Remove unused throws declarations

bzip2
Graham 5 years ago
parent ccea2f0f8e
commit 3242356c80
  1. 7
      bundler/src/main/java/dev/openrs2/bundler/transform/HostCheckTransformer.java
  2. 7
      bundler/src/main/java/dev/openrs2/bundler/transform/RightClickTransformer.java
  3. 2
      deob/src/main/java/dev/openrs2/deob/analysis/IntInterpreter.java
  4. 3
      deob/src/main/java/dev/openrs2/deob/remap/ClassNamePrefixer.java
  5. 7
      deob/src/main/java/dev/openrs2/deob/transform/DummyLocalTransformer.java

@ -9,7 +9,6 @@ import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -21,12 +20,12 @@ public final class HostCheckTransformer extends Transformer {
private int hostChecks; private int hostChecks;
@Override @Override
protected void preTransform(ClassPath classPath) throws AnalyzerException { protected void preTransform(ClassPath classPath) {
hostChecks = 0; hostChecks = 0;
} }
@Override @Override
protected boolean transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException { protected boolean transformCode(ClassNode clazz, MethodNode method) {
if (Type.getReturnType(method.desc).getSort() != Type.BOOLEAN) { if (Type.getReturnType(method.desc).getSort() != Type.BOOLEAN) {
return false; return false;
} }
@ -84,7 +83,7 @@ public final class HostCheckTransformer extends Transformer {
} }
@Override @Override
protected void postTransform(ClassPath classPath) throws AnalyzerException { protected void postTransform(ClassPath classPath) {
logger.info("Removed {} host checks", hostChecks); logger.info("Removed {} host checks", hostChecks);
} }
} }

@ -9,7 +9,6 @@ import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -19,12 +18,12 @@ public final class RightClickTransformer extends Transformer {
private int metaDownCalls; private int metaDownCalls;
@Override @Override
protected void preTransform(ClassPath classPath) throws AnalyzerException { protected void preTransform(ClassPath classPath) {
metaDownCalls = 0; metaDownCalls = 0;
} }
@Override @Override
protected boolean transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException { protected boolean transformCode(ClassNode clazz, MethodNode method) {
for (var it = method.instructions.iterator(); it.hasNext(); ) { for (var it = method.instructions.iterator(); it.hasNext(); ) {
var insn = it.next(); var insn = it.next();
if (insn.getOpcode() != Opcodes.INVOKEVIRTUAL) { if (insn.getOpcode() != Opcodes.INVOKEVIRTUAL) {
@ -59,7 +58,7 @@ public final class RightClickTransformer extends Transformer {
} }
@Override @Override
protected void postTransform(ClassPath classPath) throws AnalyzerException { protected void postTransform(ClassPath classPath) {
logger.info("Replaced {} isMetaDown calls with getModifiersEx", metaDownCalls); logger.info("Replaced {} isMetaDown calls with getModifiersEx", metaDownCalls);
} }
} }

@ -79,7 +79,7 @@ public final class IntInterpreter extends Interpreter<IntValue> {
} }
@Override @Override
public IntValue copyOperation(AbstractInsnNode insn, IntValue value) throws AnalyzerException { public IntValue copyOperation(AbstractInsnNode insn, IntValue value) {
return value; return value;
} }

@ -8,10 +8,9 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.commons.ClassRemapper; import org.objectweb.asm.commons.ClassRemapper;
import org.objectweb.asm.commons.SimpleRemapper; import org.objectweb.asm.commons.SimpleRemapper;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.analysis.AnalyzerException;
public final class ClassNamePrefixer { public final class ClassNamePrefixer {
public static void addPrefix(Library library, String prefix) throws AnalyzerException { public static void addPrefix(Library library, String prefix) {
var mapping = new HashMap<String, String>(); var mapping = new HashMap<String, String>();
for (var clazz : library) { for (var clazz : library) {
if (TypedRemapper.EXCLUDED_CLASSES.contains(clazz.name)) { if (TypedRemapper.EXCLUDED_CLASSES.contains(clazz.name)) {

@ -8,7 +8,6 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode; import org.objectweb.asm.tree.VarInsnNode;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -34,12 +33,12 @@ public final class DummyLocalTransformer extends Transformer {
private int localsRemoved; private int localsRemoved;
@Override @Override
protected void preTransform(ClassPath classPath) throws AnalyzerException { protected void preTransform(ClassPath classPath) {
localsRemoved = 0; localsRemoved = 0;
} }
@Override @Override
protected boolean transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException { protected boolean transformCode(ClassNode clazz, MethodNode method) {
/* /*
* XXX(gpe): this is primitive (ideally we'd do a proper data flow * XXX(gpe): this is primitive (ideally we'd do a proper data flow
* analysis, but we'd need to do it in reverse and ASM only supports * analysis, but we'd need to do it in reverse and ASM only supports
@ -77,7 +76,7 @@ public final class DummyLocalTransformer extends Transformer {
} }
@Override @Override
protected void postTransform(ClassPath classPath) throws AnalyzerException { protected void postTransform(ClassPath classPath) {
logger.info("Removed {} dummy local variables", localsRemoved); logger.info("Removed {} dummy local variables", localsRemoved);
} }
} }

Loading…
Cancel
Save