[BCEL-330] Remove unnecessary references to Constants.
Add tests to enforce binary compatibilty. If this PR was merged, we
would no longer compile to run.
diff --git a/src/test/java/org/apache/bcel/classfile/CodeExceptionTestCase.java b/src/test/java/org/apache/bcel/classfile/CodeExceptionTestCase.java
new file mode 100644
index 0000000..141cc06
--- /dev/null
+++ b/src/test/java/org/apache/bcel/classfile/CodeExceptionTestCase.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.bcel.classfile;
+
+import org.junit.Test;
+
+public class CodeExceptionTestCase {
+
+ /**
+ * Tests that we do not break binary compatibility with BCEL-330.
+ */
+ @Test
+ public void testReferenceToConstant() {
+ @SuppressWarnings("unused")
+ short referenceToConstant = CodeException.AALOAD;
+ }
+}
diff --git a/src/test/java/org/apache/bcel/classfile/LocalVariableTestCase.java b/src/test/java/org/apache/bcel/classfile/LocalVariableTestCase.java
new file mode 100644
index 0000000..ac03a44
--- /dev/null
+++ b/src/test/java/org/apache/bcel/classfile/LocalVariableTestCase.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.bcel.classfile;
+
+import org.junit.Test;
+
+public class LocalVariableTestCase {
+
+ /**
+ * Tests that we do not break binary compatibility with BCEL-330.
+ */
+ @Test
+ public void testReferenceToConstant() {
+ @SuppressWarnings("unused")
+ short referenceToConstant = LocalVariable.AALOAD;
+ }
+}
diff --git a/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java b/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
index ca455b1..02d3eb7 100644
--- a/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
+++ b/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
@@ -22,6 +22,7 @@
import org.apache.bcel.classfile.ClassParser;
import org.junit.Assert;
+import org.junit.Test;
import junit.framework.TestCase;
@@ -40,4 +41,14 @@
new Class2HTML(parser.parse(), outputDir.getAbsolutePath() + "/");
}
}
+
+ /**
+ * Tests that we do not break binary compatibility with BCEL-330.
+ */
+ @Test
+ public void testReferenceToConstant() {
+ @SuppressWarnings("unused")
+ short referenceToConstant = Class2HTML.AALOAD;
+ }
+
}
diff --git a/src/test/java/org/apache/bcel/verifier/statics/Pass2VerifierTestCase.java b/src/test/java/org/apache/bcel/verifier/statics/Pass2VerifierTestCase.java
new file mode 100644
index 0000000..e336a73
--- /dev/null
+++ b/src/test/java/org/apache/bcel/verifier/statics/Pass2VerifierTestCase.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.bcel.verifier.statics;
+
+import org.junit.Test;
+
+public class Pass2VerifierTestCase {
+
+ /**
+ * Tests that we do not break binary compatibility with BCEL-330.
+ */
+ @Test
+ public void testReferenceToConstant() {
+ @SuppressWarnings("unused")
+ short referenceToConstant = Pass2Verifier.AALOAD;
+ }
+}
diff --git a/src/test/java/org/apache/bcel/verifier/structurals/UninitializedObjectTypeTestCase.java b/src/test/java/org/apache/bcel/verifier/structurals/UninitializedObjectTypeTestCase.java
new file mode 100644
index 0000000..43028ca
--- /dev/null
+++ b/src/test/java/org/apache/bcel/verifier/structurals/UninitializedObjectTypeTestCase.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.bcel.verifier.structurals;
+
+import org.junit.Test;
+
+public class UninitializedObjectTypeTestCase {
+
+ /**
+ * Tests that we do not break binary compatibility with BCEL-330.
+ */
+ @Test
+ public void testReferenceToConstant() {
+ @SuppressWarnings("unused")
+ short referenceToConstant = UninitializedObjectType.AALOAD;
+ }
+}