You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/10 12:40:03 UTC

svn commit: r1695014 - in /commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests: TestArrayAccess02Creator.java TestArrayAccess03Creator.java TestArrayAccess04Creator.java TestReturn01Creator.java TestReturn03Creator.java

Author: sebb
Date: Mon Aug 10 10:40:03 2015
New Revision: 1695014

URL: http://svn.apache.org/r1695014
Log:
Avoide unused variable warnings

Modified:
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java?rev=1695014&r1=1695013&r2=1695014&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java Mon Aug 10 10:40:03 2015
@@ -31,6 +31,7 @@ import org.apache.commons.bcel6.generic.
 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 ex
     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 ex
     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());

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java?rev=1695014&r1=1695013&r2=1695014&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java Mon Aug 10 10:40:03 2015
@@ -31,6 +31,7 @@ import org.apache.commons.bcel6.generic.
 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 ex
     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 ex
     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());

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java?rev=1695014&r1=1695013&r2=1695014&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java Mon Aug 10 10:40:03 2015
@@ -29,6 +29,7 @@ import org.apache.commons.bcel6.generic.
 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 ex
     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 ex
     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());

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java?rev=1695014&r1=1695013&r2=1695014&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java Mon Aug 10 10:40:03 2015
@@ -29,6 +29,7 @@ import org.apache.commons.bcel6.generic.
 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
     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
     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());

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java?rev=1695014&r1=1695013&r2=1695014&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java Mon Aug 10 10:40:03 2015
@@ -29,6 +29,7 @@ import org.apache.commons.bcel6.generic.
 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
     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
     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();