From 7e4dee02d051282a24171c6dbdd49c0d90169aa6 Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 29 Jul 2019 16:20:06 +0100 Subject: [PATCH] Rename FieldRef to MemberRef --- .../dev/openrs2/asm/{FieldRef.java => MemberRef.java} | 6 +++--- .../deob/transform/OpaquePredicateTransformer.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename asm/src/main/java/dev/openrs2/asm/{FieldRef.java => MemberRef.java} (85%) diff --git a/asm/src/main/java/dev/openrs2/asm/FieldRef.java b/asm/src/main/java/dev/openrs2/asm/MemberRef.java similarity index 85% rename from asm/src/main/java/dev/openrs2/asm/FieldRef.java rename to asm/src/main/java/dev/openrs2/asm/MemberRef.java index e2a488c1..f4a7e549 100644 --- a/asm/src/main/java/dev/openrs2/asm/FieldRef.java +++ b/asm/src/main/java/dev/openrs2/asm/MemberRef.java @@ -2,10 +2,10 @@ package dev.openrs2.asm; import java.util.Objects; -public final class FieldRef { +public final class MemberRef { private final String owner, name, desc; - public FieldRef(String owner, String name, String desc) { + public MemberRef(String owner, String name, String desc) { this.owner = owner; this.name = name; this.desc = desc; @@ -31,7 +31,7 @@ public final class FieldRef { if (o == null || getClass() != o.getClass()) { return false; } - FieldRef fieldRef = (FieldRef) o; + MemberRef fieldRef = (MemberRef) o; return owner.equals(fieldRef.owner) && name.equals(fieldRef.name) && desc.equals(fieldRef.desc); diff --git a/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.java b/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.java index 1aa46755..378e800f 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.java +++ b/deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.java @@ -4,9 +4,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import dev.openrs2.asm.FieldRef; import dev.openrs2.asm.InsnMatcher; import dev.openrs2.asm.Library; +import dev.openrs2.asm.MemberRef; import dev.openrs2.asm.Transformer; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.AbstractInsnNode; @@ -25,7 +25,7 @@ public final class OpaquePredicateTransformer extends Transformer { private static final InsnMatcher OPAQUE_PREDICATE_MATCHER = InsnMatcher.compile("(GETSTATIC | ILOAD) (IFEQ | IFNE)"); private static final InsnMatcher STORE_MATCHER = InsnMatcher.compile("GETSTATIC ISTORE"); - private final Set flowObstructors = new HashSet<>(); + private final Set flowObstructors = new HashSet<>(); private int opaquePredicates, stores; @Override @@ -49,7 +49,7 @@ public final class OpaquePredicateTransformer extends Transformer { FLOW_OBSTRUCTOR_INITIALIZER_MATCHER.match(method).forEach(match -> { /* add flow obstructor to set */ var putstatic = (FieldInsnNode) match.get(match.size() - 1); - flowObstructors.add(new FieldRef(putstatic.owner, putstatic.name, putstatic.desc)); + flowObstructors.add(new MemberRef(putstatic.owner, putstatic.name, putstatic.desc)); /* remove initializer */ match.forEach(method.instructions::remove); @@ -61,7 +61,7 @@ public final class OpaquePredicateTransformer extends Transformer { } private boolean isFlowObstructor(FieldInsnNode insn) { - return flowObstructors.contains(new FieldRef(insn.owner, insn.name, insn.desc)); + return flowObstructors.contains(new MemberRef(insn.owner, insn.name, insn.desc)); } private boolean isOpaquePredicate(MethodNode method, List match) {