diff options
author | Sebastian Bazley <sebb@apache.org> | 2015-08-10 10:40:03 +0000 |
---|---|---|
committer | Sebastian Bazley <sebb@apache.org> | 2015-08-10 10:40:03 +0000 |
commit | c8ef82cca5ff5043456cdb451ad0a5d4b0e9af42 (patch) | |
tree | 8c0ed389a99142c3c278e3baabf48f9182bf3d72 /src/test | |
parent | c3c9015a44b5657ffb5143cd0c27ae1ce998e78d (diff) | |
download | apache-commons-bcel-c8ef82cca5ff5043456cdb451ad0a5d4b0e9af42.tar.gz |
Avoide unused variable warnings
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/bcel/trunk@1695014 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/test')
5 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java index b1fc610a..23a16b4a 100644 --- a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java +++ b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java @@ -31,6 +31,7 @@ import org.apache.commons.bcel6.generic.MethodGen; import org.apache.commons.bcel6.generic.ObjectType; import org.apache.commons.bcel6.generic.PUSH; import org.apache.commons.bcel6.generic.Type; +import org.junit.Assert; public class TestArrayAccess02Creator extends TestCreator implements Constants { private InstructionFactory _factory; @@ -55,8 +56,10 @@ public class TestArrayAccess02Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", "org.apache.commons.bcel6.verifier.tests.TestArrayAccess02", il, _cp); InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); InstructionHandle ih_4 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_4); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); @@ -68,18 +71,22 @@ public class TestArrayAccess02Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC | ACC_STATIC, Type.VOID, Type.NO_ARGS, new String[] { }, "test", "org.apache.commons.bcel6.verifier.tests.TestArrayAccess02", il, _cp); InstructionHandle ih_0 = il.append(new PUSH(_cp, 1)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createNewArray(new ObjectType("org.apache.commons.bcel6.verifier.tests.TestArrayAccess02"), (short) 1)); il.append(InstructionFactory.createStore(Type.OBJECT, 0)); InstructionHandle ih_5 = il.append(new PUSH(_cp, 1)); + Assert.assertNotNull(ih_5); // TODO why is this not used il.append(_factory.createNewArray(Type.STRING, (short) 1)); il.append(InstructionFactory.createStore(Type.OBJECT, 1)); InstructionHandle ih_10 = il.append(InstructionFactory.createLoad(Type.OBJECT, 1)); + Assert.assertNotNull(ih_10); // TODO why is this not used il.append(new PUSH(_cp, 0)); il.append(_factory.createNew("org.apache.commons.bcel6.verifier.tests.TestArrayAccess02")); il.append(InstructionConstants.DUP); il.append(_factory.createInvoke("org.apache.commons.bcel6.verifier.tests.TestArrayAccess02", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); il.append(InstructionConstants.AASTORE); InstructionHandle ih_20 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_20); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); diff --git a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java index 5ceee54f..16cdabc4 100644 --- a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java +++ b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java @@ -31,6 +31,7 @@ import org.apache.commons.bcel6.generic.MethodGen; import org.apache.commons.bcel6.generic.ObjectType; import org.apache.commons.bcel6.generic.PUSH; import org.apache.commons.bcel6.generic.Type; +import org.junit.Assert; public class TestArrayAccess03Creator extends TestCreator implements Constants { private InstructionFactory _factory; @@ -55,8 +56,10 @@ public class TestArrayAccess03Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", "org.apache.commons.bcel6.verifier.tests.TestArrayAccess03", il, _cp); InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); InstructionHandle ih_4 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_4); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); @@ -68,15 +71,18 @@ public class TestArrayAccess03Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC | ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT }, new String[] { "arg0" }, "test", "org.apache.commons.bcel6.verifier.tests.TestArrayAccess03", il, _cp); InstructionHandle ih_0 = il.append(new PUSH(_cp, 1)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createNewArray(new ObjectType("org.apache.commons.bcel6.verifier.tests.TestArrayAccess03"), (short) 1)); il.append(InstructionFactory.createStore(Type.OBJECT, 1)); InstructionHandle ih_5 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); + Assert.assertNotNull(ih_5); // TODO why is this not used il.append(new PUSH(_cp, 0)); il.append(_factory.createNew("org.apache.commons.bcel6.verifier.tests.TestArrayAccess03")); il.append(InstructionConstants.DUP); il.append(_factory.createInvoke("org.apache.commons.bcel6.verifier.tests.TestArrayAccess03", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); il.append(InstructionConstants.AASTORE); InstructionHandle ih_15 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_15); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); diff --git a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java index 947fb165..b94f1c98 100644 --- a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java +++ b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java @@ -29,6 +29,7 @@ import org.apache.commons.bcel6.generic.InstructionList; import org.apache.commons.bcel6.generic.MethodGen; import org.apache.commons.bcel6.generic.PUSH; import org.apache.commons.bcel6.generic.Type; +import org.junit.Assert; public class TestArrayAccess04Creator extends TestCreator implements Constants { private InstructionFactory _factory; @@ -53,8 +54,10 @@ public class TestArrayAccess04Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", "org.apache.commons.bcel6.verifier.tests.TestArrayAccess04", il, _cp); InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); InstructionHandle ih_4 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_4); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); @@ -66,15 +69,19 @@ public class TestArrayAccess04Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC | ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT }, new String[] { "arg0" }, "test", "org.apache.commons.bcel6.verifier.tests.TestArrayAccess04", il, _cp); InstructionHandle ih_0 = il.append(new PUSH(_cp, 1)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createNewArray(Type.OBJECT, (short) 1)); il.append(InstructionFactory.createStore(Type.OBJECT, 1)); InstructionHandle ih_5 = il.append(new PUSH(_cp, 1)); + Assert.assertNotNull(ih_5); // TODO why is this not used il.append(InstructionFactory.createStore(Type.INT, 2)); InstructionHandle ih_7 = il.append(InstructionFactory.createLoad(Type.OBJECT, 1)); + Assert.assertNotNull(ih_7); // TODO why is this not used il.append(new PUSH(_cp, 0)); il.append(InstructionFactory.createLoad(Type.INT, 2)); il.append(InstructionConstants.AASTORE); InstructionHandle ih_11 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_11); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); diff --git a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java index 3e22879c..1cdf82a5 100644 --- a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java +++ b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java @@ -29,6 +29,7 @@ import org.apache.commons.bcel6.generic.InstructionHandle; import org.apache.commons.bcel6.generic.InstructionList; import org.apache.commons.bcel6.generic.MethodGen; import org.apache.commons.bcel6.generic.Type; +import org.junit.Assert; public class TestReturn01Creator extends TestCreator implements Constants { private InstructionFactory _factory; @@ -53,8 +54,10 @@ public class TestReturn01Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", "org.apache.commons.bcel6.verifier.tests.TestReturn01", il, _cp); InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); InstructionHandle ih_4 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_4); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); @@ -66,10 +69,12 @@ public class TestReturn01Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC | ACC_STATIC, Type.VOID, Type.NO_ARGS, new String[] { }, "foo", "org.apache.commons.bcel6.verifier.tests.TestReturn01", il, _cp); InstructionHandle ih_0 = il.append(_factory.createNew("java.lang.Object")); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(InstructionConstants.DUP); il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); il.append(InstructionConstants.NOP); InstructionHandle ih_8 = il.append(InstructionFactory.createReturn(Type.OBJECT)); + Assert.assertNotNull(ih_8); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); diff --git a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java index 23ccea73..d3d59fc8 100644 --- a/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java +++ b/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java @@ -29,6 +29,7 @@ import org.apache.commons.bcel6.generic.InstructionHandle; import org.apache.commons.bcel6.generic.InstructionList; import org.apache.commons.bcel6.generic.MethodGen; import org.apache.commons.bcel6.generic.Type; +import org.junit.Assert; public class TestReturn03Creator extends TestCreator implements Constants { private InstructionFactory _factory; @@ -53,8 +54,10 @@ public class TestReturn03Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", "org.apache.commons.bcel6.verifier.tests.TestReturn03", il, _cp); InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); InstructionHandle ih_4 = il.append(InstructionFactory.createReturn(Type.VOID)); + Assert.assertNotNull(ih_4); // TODO why is this not used method.setMaxStack(); method.setMaxLocals(); _cg.addMethod(method.getMethod()); @@ -66,6 +69,7 @@ public class TestReturn03Creator extends TestCreator implements Constants { MethodGen method = new MethodGen(ACC_PUBLIC | ACC_STATIC, Type.INT, Type.NO_ARGS, new String[] { }, "test3", "org.apache.commons.bcel6.verifier.tests.TestReturn03", il, _cp); InstructionHandle ih_0 = il.append(InstructionConstants.ACONST_NULL); + Assert.assertNotNull(ih_0); // TODO why is this not used il.append(InstructionFactory.createReturn(Type.OBJECT)); method.setMaxStack(); method.setMaxLocals(); |