aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSebastian Bazley <sebb@apache.org>2015-09-11 00:01:16 +0000
committerSebastian Bazley <sebb@apache.org>2015-09-11 00:01:16 +0000
commit885b0a0a353275739c9b1658a8384fdbf6a9af2b (patch)
tree07c549e8b496afda52e58f39cf78238a8d2e63db /src/test
parentd8bf84a141b46cde9f0a31294e21053bd8d7cfec (diff)
downloadapache-commons-bcel-885b0a0a353275739c9b1658a8384fdbf6a9af2b.tar.gz
Gradually working towards restoring binary compatibility
Revert InstructionConstants back to interface git-svn-id: https://svn.apache.org/repos/asf/commons/proper/bcel/trunk@1702352 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/apache/commons/bcel6/generic/GeneratingAnnotatedClassesTestCase.java24
-rw-r--r--src/test/java/org/apache/commons/bcel6/generic/InstructionHandleTestCase.java2
-rw-r--r--src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java6
-rw-r--r--src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java6
-rw-r--r--src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java4
-rw-r--r--src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java6
-rw-r--r--src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java4
7 files changed, 26 insertions, 26 deletions
diff --git a/src/test/java/org/apache/commons/bcel6/generic/GeneratingAnnotatedClassesTestCase.java b/src/test/java/org/apache/commons/bcel6/generic/GeneratingAnnotatedClassesTestCase.java
index afcc4652..f31e3e3a 100644
--- a/src/test/java/org/apache/commons/bcel6/generic/GeneratingAnnotatedClassesTestCase.java
+++ b/src/test/java/org/apache/commons/bcel6/generic/GeneratingAnnotatedClassesTestCase.java
@@ -427,9 +427,9 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
// to the BufferedReader object stays on top of the stack and is stored
// in the newly allocated in variable.
il.append(factory.createNew("java.io.BufferedReader"));
- il.append(InstructionConstants.DUP); // Use predefined constant
+ il.append(InstructionConst.DUP); // Use predefined constant
il.append(factory.createNew("java.io.InputStreamReader"));
- il.append(InstructionConstants.DUP);
+ il.append(InstructionConst.DUP);
il.append(factory.createFieldAccess("java.lang.System", "in", i_stream,
Constants.GETSTATIC));
il.append(factory.createInvoke("java.io.InputStreamReader", "<init>",
@@ -444,7 +444,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
// Create local variable name and initialize it to null
lg = mg.addLocalVariable("name", Type.STRING, null, null);
int name = lg.getIndex();
- il.append(InstructionConstants.ACONST_NULL);
+ il.append(InstructionConst.ACONST_NULL);
lg.setStart(il.append(new ASTORE(name))); // "name" valid from here
// Create try-catch block: We remember the start of the block, read a
// line from the standard input and store it into the variable name .
@@ -469,7 +469,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
int var_ex_slot = var_ex.getIndex();
InstructionHandle handler = il.append(new ASTORE(var_ex_slot));
var_ex.setStart(handler);
- var_ex.setEnd(il.append(InstructionConstants.RETURN));
+ var_ex.setEnd(il.append(InstructionConst.RETURN));
mg.addExceptionHandler(try_start, try_end, handler, new ObjectType(
"java.io.IOException"));
// "Normal" code continues, now we can set the branch target of the GOTO
@@ -480,7 +480,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
// Printing "Hello": String concatenation compiles to StringBuffer
// operations.
il.append(factory.createNew(Type.STRINGBUFFER));
- il.append(InstructionConstants.DUP);
+ il.append(InstructionConst.DUP);
il.append(new PUSH(cp, "Hello, "));
il
.append(factory.createInvoke("java.lang.StringBuffer",
@@ -496,7 +496,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
.append(factory.createInvoke("java.io.PrintStream", "println",
Type.VOID, new Type[] { Type.STRING },
Constants.INVOKEVIRTUAL));
- il.append(InstructionConstants.RETURN);
+ il.append(InstructionConst.RETURN);
// Finalization: Finally, we have to set the stack size, which normally
// would have to be computed on the fly and add a default constructor
// method to the class, which is empty in this case.
@@ -521,9 +521,9 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
// to the BufferedReader object stays on top of the stack and is stored
// in the newly allocated in variable.
il.append(factory.createNew("java.io.BufferedReader"));
- il.append(InstructionConstants.DUP); // Use predefined constant
+ il.append(InstructionConst.DUP); // Use predefined constant
il.append(factory.createNew("java.io.InputStreamReader"));
- il.append(InstructionConstants.DUP);
+ il.append(InstructionConst.DUP);
il.append(factory.createFieldAccess("java.lang.System", "in", i_stream,
Constants.GETSTATIC));
il.append(factory.createInvoke("java.io.InputStreamReader", "<init>",
@@ -538,7 +538,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
// Create local variable name and initialize it to null
lg = mg.addLocalVariable("name", Type.STRING, null, null);
int name = lg.getIndex();
- il.append(InstructionConstants.ACONST_NULL);
+ il.append(InstructionConst.ACONST_NULL);
lg.setStart(il.append(new ASTORE(name))); // "name" valid from here
// Create try-catch block: We remember the start of the block, read a
// line from the standard input and store it into the variable name .
@@ -563,7 +563,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
int var_ex_slot = var_ex.getIndex();
InstructionHandle handler = il.append(new ASTORE(var_ex_slot));
var_ex.setStart(handler);
- var_ex.setEnd(il.append(InstructionConstants.RETURN));
+ var_ex.setEnd(il.append(InstructionConst.RETURN));
mg.addExceptionHandler(try_start, try_end, handler, new ObjectType(
"java.io.IOException"));
// "Normal" code continues, now we can set the branch target of the GOTO
@@ -574,7 +574,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
// Printing "Hello": String concatenation compiles to StringBuffer
// operations.
il.append(factory.createNew(Type.STRINGBUFFER));
- il.append(InstructionConstants.DUP);
+ il.append(InstructionConst.DUP);
il.append(new PUSH(cp, "Hello, "));
il
.append(factory.createInvoke("java.lang.StringBuffer",
@@ -590,7 +590,7 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase
.append(factory.createInvoke("java.io.PrintStream", "println",
Type.VOID, new Type[] { Type.STRING },
Constants.INVOKEVIRTUAL));
- il.append(InstructionConstants.RETURN);
+ il.append(InstructionConst.RETURN);
// Finalization: Finally, we have to set the stack size, which normally
// would have to be computed on the fly and add a default constructor
// method to the class, which is empty in this case.
diff --git a/src/test/java/org/apache/commons/bcel6/generic/InstructionHandleTestCase.java b/src/test/java/org/apache/commons/bcel6/generic/InstructionHandleTestCase.java
index 08a854da..ab9d786c 100644
--- a/src/test/java/org/apache/commons/bcel6/generic/InstructionHandleTestCase.java
+++ b/src/test/java/org/apache/commons/bcel6/generic/InstructionHandleTestCase.java
@@ -39,7 +39,7 @@ public class InstructionHandleTestCase {
@Test
public void testBCEL195() {
InstructionList il = new InstructionList();
- InstructionHandle ih = il.append(InstructionConstants.NOP);
+ InstructionHandle ih = il.append(InstructionConst.NOP);
new TABLESWITCH(new int[0], new InstructionHandle[0], ih);
new TABLESWITCH(new int[0], new InstructionHandle[0], ih);
}
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 451f0ef3..ed9797cc 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
@@ -23,7 +23,7 @@ import java.io.OutputStream;
import org.apache.commons.bcel6.Constants;
import org.apache.commons.bcel6.generic.ClassGen;
import org.apache.commons.bcel6.generic.ConstantPoolGen;
-import org.apache.commons.bcel6.generic.InstructionConstants;
+import org.apache.commons.bcel6.generic.InstructionConst;
import org.apache.commons.bcel6.generic.InstructionFactory;
import org.apache.commons.bcel6.generic.InstructionHandle;
import org.apache.commons.bcel6.generic.InstructionList;
@@ -86,9 +86,9 @@ public void create(OutputStream out) throws IOException {
Assert.assertNotNull(ih_10); // TODO why is this not used
il.append(new PUSH(_cp, 0));
il.append(_factory.createNew(TEST_PACKAGE+".TestArrayAccess02"));
- il.append(InstructionConstants.DUP);
+ il.append(InstructionConst.DUP);
il.append(_factory.createInvoke(TEST_PACKAGE+".TestArrayAccess02", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
- il.append(InstructionConstants.AASTORE);
+ il.append(InstructionConst.AASTORE);
InstructionHandle ih_20 = il.append(InstructionFactory.createReturn(Type.VOID));
Assert.assertNotNull(ih_20); // TODO why is this not used
method.setMaxStack();
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 e4856c19..0cda5bb2 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
@@ -23,7 +23,7 @@ import java.io.OutputStream;
import org.apache.commons.bcel6.Constants;
import org.apache.commons.bcel6.generic.ClassGen;
import org.apache.commons.bcel6.generic.ConstantPoolGen;
-import org.apache.commons.bcel6.generic.InstructionConstants;
+import org.apache.commons.bcel6.generic.InstructionConst;
import org.apache.commons.bcel6.generic.InstructionFactory;
import org.apache.commons.bcel6.generic.InstructionHandle;
import org.apache.commons.bcel6.generic.InstructionList;
@@ -82,9 +82,9 @@ public void create(OutputStream out) throws IOException {
Assert.assertNotNull(ih_5); // TODO why is this not used
il.append(new PUSH(_cp, 0));
il.append(_factory.createNew(TEST_PACKAGE+".TestArrayAccess03"));
- il.append(InstructionConstants.DUP);
+ il.append(InstructionConst.DUP);
il.append(_factory.createInvoke(TEST_PACKAGE+".TestArrayAccess03", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
- il.append(InstructionConstants.AASTORE);
+ il.append(InstructionConst.AASTORE);
InstructionHandle ih_15 = il.append(InstructionFactory.createReturn(Type.VOID));
Assert.assertNotNull(ih_15); // TODO why is this not used
method.setMaxStack();
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 1958a5e9..17b72726 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
@@ -24,7 +24,7 @@ import java.io.OutputStream;
import org.apache.commons.bcel6.Constants;
import org.apache.commons.bcel6.generic.ClassGen;
import org.apache.commons.bcel6.generic.ConstantPoolGen;
-import org.apache.commons.bcel6.generic.InstructionConstants;
+import org.apache.commons.bcel6.generic.InstructionConst;
import org.apache.commons.bcel6.generic.InstructionFactory;
import org.apache.commons.bcel6.generic.InstructionHandle;
import org.apache.commons.bcel6.generic.InstructionList;
@@ -85,7 +85,7 @@ public void create(OutputStream out) throws IOException {
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);
+ il.append(InstructionConst.AASTORE);
InstructionHandle ih_11 = il.append(InstructionFactory.createReturn(Type.VOID));
Assert.assertNotNull(ih_11); // TODO why is this not used
method.setMaxStack();
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 a993a113..f39d489e 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
@@ -23,7 +23,7 @@ import java.io.OutputStream;
import org.apache.commons.bcel6.Constants;
import org.apache.commons.bcel6.generic.ClassGen;
import org.apache.commons.bcel6.generic.ConstantPoolGen;
-import org.apache.commons.bcel6.generic.InstructionConstants;
+import org.apache.commons.bcel6.generic.InstructionConst;
import org.apache.commons.bcel6.generic.InstructionFactory;
import org.apache.commons.bcel6.generic.InstructionHandle;
import org.apache.commons.bcel6.generic.InstructionList;
@@ -74,9 +74,9 @@ public void create(OutputStream out) throws IOException {
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(InstructionConst.DUP);
il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
- il.append(InstructionConstants.NOP);
+ il.append(InstructionConst.NOP);
InstructionHandle ih_8 = il.append(InstructionFactory.createReturn(Type.OBJECT));
Assert.assertNotNull(ih_8); // TODO why is this not used
method.setMaxStack();
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 7c73aa4e..c7ffaf0a 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
@@ -23,7 +23,7 @@ import java.io.OutputStream;
import org.apache.commons.bcel6.Constants;
import org.apache.commons.bcel6.generic.ClassGen;
import org.apache.commons.bcel6.generic.ConstantPoolGen;
-import org.apache.commons.bcel6.generic.InstructionConstants;
+import org.apache.commons.bcel6.generic.InstructionConst;
import org.apache.commons.bcel6.generic.InstructionFactory;
import org.apache.commons.bcel6.generic.InstructionHandle;
import org.apache.commons.bcel6.generic.InstructionList;
@@ -72,7 +72,7 @@ public void create(OutputStream out) throws IOException {
MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.INT, Type.NO_ARGS,
new String[] { }, "test3", TEST_PACKAGE+".TestReturn03", il, _cp);
- InstructionHandle ih_0 = il.append(InstructionConstants.ACONST_NULL);
+ InstructionHandle ih_0 = il.append(InstructionConst.ACONST_NULL);
Assert.assertNotNull(ih_0); // TODO why is this not used
il.append(InstructionFactory.createReturn(Type.OBJECT));
method.setMaxStack();