project: Fix deprecations and supress unchecked warnings

This commit is contained in:
Owain van Brakel
2019-07-25 20:08:45 +02:00
parent 481831359b
commit 17b35205fd
40 changed files with 113 additions and 263 deletions

View File

@@ -66,6 +66,7 @@ public class InvokeDynamic extends Instruction implements InvokeInstruction
}
@Override
@SuppressWarnings("unchecked")
public List<net.runelite.asm.Method> getMethods()
{
return Collections.EMPTY_LIST;

View File

@@ -75,6 +75,7 @@ public class InvokeSpecial extends Instruction implements InvokeInstruction
}
@Override
@SuppressWarnings("unchecked")
public List<net.runelite.asm.Method> getMethods()
{
return myMethod != null ? Arrays.asList(myMethod) : Collections.EMPTY_LIST;

View File

@@ -83,6 +83,7 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
}
@Override
@SuppressWarnings("unchecked")
public List<net.runelite.asm.Method> getMethods()
{
return myMethod != null ? Arrays.asList(myMethod) : Collections.EMPTY_LIST;

View File

@@ -70,6 +70,7 @@ public class MethodContext
return contexts.get(i);
}
@SuppressWarnings("unchecked")
public Collection<InstructionContext> getInstructionContexts()
{
return (Collection) contexts.values();

View File

@@ -167,7 +167,7 @@ public class ModArith implements Deobfuscator
FieldInfo fieldInfo = getFieldInfo(fi.getMyField());
List<InstructionContext> l = getInsInExpr(ctx, new HashSet(), false);
@SuppressWarnings("unchecked") List<InstructionContext> l = getInsInExpr(ctx, new HashSet(), false);
boolean other = false; // check if this contains another field
boolean getter = false, setter = false;
for (InstructionContext i : l)
@@ -272,7 +272,7 @@ public class ModArith implements Deobfuscator
// parse the full multiplication expression to
// get all associated constants
List<InstructionContext> insInExpr = getInsInExpr(ctx, new HashSet(), true);
@SuppressWarnings("unchecked") List<InstructionContext> insInExpr = getInsInExpr(ctx, new HashSet(), true);
for (InstructionContext ctx2 : insInExpr)
{

View File

@@ -171,6 +171,7 @@ public class ConstantParameter implements Deobfuscator
findConstantParameter(methods, ins);
}
@SuppressWarnings("unchecked")
private List<ConstantMethodParameter> findParametersForMethod(Method m)
{
Collection<ConstantMethodParameter> c = mparams.get(m);

View File

@@ -52,7 +52,7 @@ public class CheckExports
@Before
public void before() throws MalformedURLException, ClassNotFoundException
{
ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURL()});
ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURI().toURL()});
Class c = loader.loadClass("net.runelite.rs.client.client");
classes.add(c);
@@ -70,6 +70,7 @@ public class CheckExports
}
}
@SuppressWarnings("unchecked")
private Class<?> findClassWithObfuscatedName(String name)
{
for (Class c : classes)

View File

@@ -53,7 +53,7 @@ public class CheckMappings
@Before
public void before() throws MalformedURLException, ClassNotFoundException
{
ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURL()});
ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURI().toURL()});
Class c = loader.loadClass("client");
classes.add(c);
@@ -71,6 +71,7 @@ public class CheckMappings
}
}
@SuppressWarnings("unchecked")
private Class<?> findClassWithObfuscatedName(String name)
{
for (Class c : classes)