With the unit tests warnings were squashed by suppressing them with SuppressWarnings annotations, instead of
reparing the issues as was done with the source. Reasons being...
* The tests might be relying on the types as they were defined.
* If the tests were written to test against the correct forms they would've/should've stipulated those.
* Even unused members might be important to tests so we attempt to change as little as possible.
import javassist.expr.ExprEditor;
import javassist.expr.MethodCall;
+@SuppressWarnings("unused")
public class Jassist150 {
public static final String BASE_PATH = "./";
public static final String JAVASSIST_JAR = BASE_PATH + "javassist.jar";
import java.util.List;
import javassist.*;
+@SuppressWarnings("unused")
class InvalidStackMapFrame {
public void bytecodeVerifyError1() {
+@SuppressWarnings("unused")
public class VisibleTop {
public int pub;
protected int pro;
+@SuppressWarnings("unused")
public class VisibleTop2 {
public int pub;
protected int pro;
cc.detach();\r
}\r
\r
+ @SuppressWarnings("rawtypes")\r
public static void accessAll(String filename) throws Exception {\r
ZipFile zip = new ZipFile(filename);\r
Enumeration files = zip.entries();\r
import javassist.expr.*;
import javassist.runtime.*;
+@SuppressWarnings({"rawtypes","unused", "resource"})
public class JvstTest extends JvstTestRoot {
public static boolean java9;
import javassist.expr.*;
+@SuppressWarnings({"rawtypes","unused"})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class JvstTest2 extends JvstTestRoot {
public JvstTest2(String name) {
import javassist.expr.*;
import test3.*;
+@SuppressWarnings({"rawtypes","unchecked","unused"})
public class JvstTest3 extends JvstTestRoot {
public JvstTest3(String name) {
super(name);
import javassist.bytecode.annotation.Annotation;
import javassist.expr.*;
+@SuppressWarnings({"rawtypes","unchecked","unused"})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class JvstTest4 extends JvstTestRoot {
public JvstTest4(String name) {
import javassist.expr.ExprEditor;
import javassist.expr.MethodCall;
+@SuppressWarnings({"rawtypes","unchecked","unused"})
public class JvstTest5 extends JvstTestRoot {
public JvstTest5(String name) {
super(name);
/**\r
* @author brandall\r
*/\r
+@SuppressWarnings({"rawtypes","unused"})\r
public class LoaderTestByRandall extends TestCase {\r
\r
ClassPool cp;\r
\r
import junit.framework.TestCase;\r
\r
+@SuppressWarnings({"rawtypes","unchecked"})\r
public class SetterTest extends TestCase {\r
\r
ClassPool pool;\r
import javassist.bytecode.annotation.*;
import javassist.bytecode.SignatureAttribute.*;
+@SuppressWarnings("unused")
public class BytecodeTest extends TestCase {
public static final String PATH = JvstTest.PATH;
private ClassPool loader, dloader;
import java.util.List;\r
import java.io.*;\r
\r
+@SuppressWarnings({"rawtypes","resource"})\r
public class CodeAnalyzerTest {\r
public static void main(String[] args) throws Exception {\r
ZipFile zfile = new ZipFile(args[0]);\r
import javassist.*;
+@SuppressWarnings("unused")
final class Gap0Example {
public static int counter = 1;
}
}
+@SuppressWarnings("unused")
final class Gap0Example2 {
public static int counter = 1;
}
}
+@SuppressWarnings({"rawtypes","unchecked","unused"})
public final class InsertGap0 extends JvstTestRoot {
public InsertGap0(String name) {
super(name);
import javassist.bytecode.stackmap.TypeData;
import junit.framework.TestCase;
+@SuppressWarnings({"rawtypes","unused"})
public class StackMapTest extends TestCase {
public static final String PATH = JvstTest.PATH;
private ClassPool loader, dloader;
public static int k;
}
+@SuppressWarnings({"rawtypes","unchecked"})
class HelloAspect{
List list;
/**
* <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
*/
+@SuppressWarnings({"rawtypes","unchecked","unused"})
public class ProxyFactoryTest extends TestCase {
public void testMethodHandlers() throws Exception {
ProxyFactory fact = new ProxyFactory();
int getHandler() { return 3; }
}
+@SuppressWarnings({"rawtypes","unchecked","resource"})
public class Tester extends TestCase {
static class MHandler implements MethodHandler, java.io.Serializable {
/** default serialVersionUID */
}
+ @SuppressWarnings("rawtypes")
public void reusedLocalMerge() {
ArrayList list = new ArrayList();
try {
}
}
+ @SuppressWarnings({"rawtypes","unchecked"})
public static class Echo {
public static Map byteMap = new HashMap();
public static Map charMap = new HashMap();
import javassist.util.proxy.Proxy;
import junit.framework.TestCase;
+@SuppressWarnings({"rawtypes","unchecked"})
public class JBPAPP9257Test extends TestCase {
public void testGetHandler() throws Exception {
ProxyFactory f = new ProxyFactory();
* test which checks that proxy classes are not retained after their classloader is released.
* this is a before and after test which validates JASSIST-104
*/
+@SuppressWarnings({"rawtypes","unchecked"})
public class ProxyCacheGCTest extends TestCase
{
/**
* automatically disabled if this legacy api is used. it also exercises the new style
* api, ensuring that caching works correctly with this model.
*/
+@SuppressWarnings({"rawtypes","unchecked","unused"})
public class ProxyFactoryCompatibilityTest extends TestCase
{
private ClassPool basePool;
* {@link javassist.util.proxy.ProxyObjectOutputStream} and @link javassist.util.proxy.ProxyObjectInputStream}
* reuses classes located in the proxy cache. This tests the fixes provided for JASSIST-42 and JASSIST-97.
*/
+@SuppressWarnings({"rawtypes","unchecked","unused","resource"})
public class ProxySerializationTest extends TestCase
{
public void testSerialization()
import javassist.util.proxy.Proxy;
import javassist.util.proxy.ProxyFactory;
+@SuppressWarnings({"rawtypes","unchecked"})
public class ProxySimpleTest extends TestCase {
String testResult;
public class DummyClass {
+ @SuppressWarnings("unused")
private String dummyString = "dummyStringValue";
public void dummyMethod(){}
package test1;\r
\r
public class FieldMod {\r
+ @SuppressWarnings("unused")
private String text;\r
public int i;\r
}\r
}\r
\r
public class Howard extends Howard2 {\r
+ @SuppressWarnings("unused")
private Object _remote;\r
\r
public int run() {\r
package test1;
+@SuppressWarnings("unused")
public class Proceed {
public int p(int i, int j) { return i + j; }
String name;
}
+@SuppressWarnings({"rawtypes","unchecked", "unused"})
public class RenameClass {
private Hashtable table;
public RenameClass() {
package test2;\r
\r
public class AddMethod {\r
+ @SuppressWarnings("unused")
private int f;\r
\r
public int f() { return 0; }\r
package test2;\r
\r
+@SuppressWarnings("unused")
public class Anon {\r
public Object make() {\r
return new Object() { int k; };\r
package test2;
+@SuppressWarnings("unused")
public class Brennan {
private Object format = null;
}
package test2;
+@SuppressWarnings("unused")
public class Inner {
public void sample() throws Exception {
java.util.Properties props = new java.util.Properties();
return k + s.length();
}
+ @SuppressWarnings("unused")
public int run3() {
int i = 0;
int j = field;
package test2;\r
\r
+@SuppressWarnings("unused")
public class Nested {\r
private int i = 3;\r
private int geti() { return i; }\r
package test2;\r
\r
+@SuppressWarnings("unused")
public class Nested2 {\r
private int i = 3;\r
private double d = 3.0;\r
package test2;\r
\r
+@SuppressWarnings("unused")
public class Nested3 {\r
private int i = 0;\r
private int geti() { return i; }\r
package test2;\r
\r
+@SuppressWarnings("unused")
public class Nested4 {\r
private static int value = 6;\r
}\r
package test2;\r
\r
+@SuppressWarnings("unused")
public class NewArray {\r
public int run() {\r
return foo(1);\r
\r
import java.util.HashMap;\r
\r
+@SuppressWarnings("rawtypes")
class HashMapWrapper extends HashMap {\r
/** default serialVersionUID */\r
private static final long serialVersionUID = 1L;\r
}\r
}\r
\r
+@SuppressWarnings({"rawtypes","unused"})
public class NewExprInTry {\r
public int run() {\r
return foo(6);\r
}\r
\r
public static void main(String[] args) {\r
+ @SuppressWarnings("unused")
NewExprTry obj = new NewExprTry(3);\r
}\r
}\r
}\r
\r
public class NewOp {\r
+ @SuppressWarnings("rawtypes")
java.util.Vector listenerList;\r
static int i = 0;\r
static String s;\r
public void foo(String s) { System.out.println(s); }
}
+@SuppressWarnings({"rawtypes","unchecked","unused"})
public class Enhancer {
private ClassPool pool;
private CtClass superClass;
public Erasure(T t) { value = t; }
public Erasure() { value = null; }
public int run() {
+ @SuppressWarnings("unchecked")
ErasureGet<String> obj = (ErasureGet<String>)new Erasure<String>("1234");
return obj.get().length();
}
private int[] k;
public void access() {
k = new int[1];
+ @SuppressWarnings("unused")
int i = 3;
i += k[0];
}
package test3;
+@SuppressWarnings("unused")
class SuperGetMethods {
public int f0;
protected double d0;
private void mpri0() {}
}
+@SuppressWarnings("unused")
public class GetMethods extends SuperGetMethods {
public GetMethods(int i) {}
protected GetMethods(String i, int j) {}
}
public class MethodRedirect implements MethodRedirectIntf {
+ @SuppressWarnings("unused")
private int foo() { return 0; }
public static int poi() { return 1; }
public int bar() { return 2; }
public Object bar() {
class Local {
+ @SuppressWarnings("unused")
int j;
}
return new Local();
// the error is somehow related to the string concatenation and local variables,
// when the code below is replaced with something else, the error does not occur.
String s1 = "a";
+ @SuppressWarnings("unused")
String s2 = s1 + "b";
}
int i = 0;
public int run() {
i = 3;
+ @SuppressWarnings("unused")
ReplaceNew s = new ReplaceNew();
new ReplaceNew();
return i;
package test3;
+@SuppressWarnings("unused")
class Visible2 {
public int pub;
protected int pro;
int pack;
}
+@SuppressWarnings("unused")
public class Visible {
public int pub;
protected int pro;
import junit.framework.TestSuite;\r
import junit.textui.TestRunner;\r
\r
+@SuppressWarnings({"rawtypes","unchecked", "unused"})\r
public class ProxyFactoryPerformanceTest extends TestCase {\r
\r
public static final int COUNT = 100; \r
}\r
}\r
\r
+@SuppressWarnings({"rawtypes","unused"})\r
class ProxyMaker extends Thread implements MethodHandler {\r
private static final MethodFilter FINALIZE_FILTER = new MethodFilter() {\r
public boolean isHandled(Method m) {\r
import junit.framework.TestCase;
import java.io.*;
+@SuppressWarnings({"unchecked", "rawtypes","unused"})
public class ProxyTester extends TestCase {
public ProxyTester(String s) {
super(s);
\r
import java.io.IOException;\r
\r
+@SuppressWarnings("unused")
public class Target2 {\r
private int value;\r
public Target2(int i) { value = 1; }\r
package testproxy.sub;
+@SuppressWarnings("unused")
public class TargetSuper {
private int poi() { return 1; }
int poi2() { return 2; }