diff --git a/.gitignore b/.gitignore
index 2c4d871e..a857fa1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,8 @@ javacore.*
local.properties
src-gen/
tmp/
+.project
+.classpath
# Maven
.mvn/timing.properties
diff --git a/.gitmodules b/.gitmodules
index 49f5a6a5..574c7af2 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,24 +1,24 @@
[submodule "tests/org.emftext.language.java.test/JaMoPP-BulkTest"]
- path = tests/org.emftext.language.java.test/JaMoPP-BulkTest
+ path = tests/org.emftext.language.java.test/target/src-bulk/JaMoPP-BulkTest
url = https://github.com/DevBoost/JaMoPP-BulkTest
[submodule "tests/org.emftext.language.java.test/TeaStore"]
- path = tests/org.emftext.language.java.test/TeaStore
+ path = tests/org.emftext.language.java.test/target/src-bulk/TeaStore
url = https://github.com/DescartesResearch/TeaStore
[submodule "tests/org.emftext.language.java.test/teammates"]
- path = tests/org.emftext.language.java.test/teammates
+ path = tests/org.emftext.language.java.test/target/src-bulk/teammates
url = https://github.com/TEAMMATES/teammates
[submodule "tests/org.emftext.language.java.test/microservice"]
- path = tests/org.emftext.language.java.test/microservice
+ path = tests/org.emftext.language.java.test/target/src-bulk/microservice
url = https://github.com/ewolff/microservice
[submodule "tests/org.emftext.language.java.test/esda"]
- path = tests/org.emftext.language.java.test/esda
+ path = tests/org.emftext.language.java.test/target/src-bulk/esda
url = https://github.com/kit-sdq/esda
[submodule "tests/org.emftext.language.java.test/acmeair"]
- path = tests/org.emftext.language.java.test/acmeair
+ path = tests/org.emftext.language.java.test/target/src-bulk/acmeair
url = https://github.com/acmeair/acmeair.git
[submodule "tests/org.emftext.language.java.test/piggymetrics"]
- path = tests/org.emftext.language.java.test/piggymetrics
+ path = tests/org.emftext.language.java.test/target/src-bulk/piggymetrics
url = https://github.com/sqshq/piggymetrics.git
[submodule "tests/org.emftext.language.java.test/petclinic"]
- path = tests/org.emftext.language.java.test/petclinic
+ path = tests/org.emftext.language.java.test/target/src-bulk/petclinic
url = https://github.com/spring-petclinic/spring-petclinic-microservices.git
diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml
deleted file mode 100644
index 1feaecb9..00000000
--- a/.mvn/extensions.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- org.eclipse.tycho
- tycho-build
- 2.7.5
-
-
- org.palladiosimulator
- tycho-tp-refresh-maven-plugin
- 0.2.6
-
-
diff --git a/.project b/.project
deleted file mode 100644
index d3a4cc05..00000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- Palladio-Supporting-EclipseJavaDevelopmentTools
-
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
-
- org.eclipse.m2e.core.maven2Nature
-
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 34a53a86..d10203fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- Minimum required Java version: Java 17
- Supported Eclipse version: 2022-12
- Third variant: bindings of parameters and local variables are also resolved
+- Migration to MDSD Tools organization
+ - Converted Maven Tycho-based build to pure Maven build
+- Upgraded dependency versions to:
+ - Apache Commons Bytecode Engineering Library 6.7.0
+ - Apache Log4j 2 2.20.0 including the Log4j 1.x bridge
### Deprecated
@@ -27,7 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [5.1.0] - 2022-01-21
-From here, independent development by the Institute of Information Security and Dependability (KASTEL) at the Karlsruher Institute of Technology (KIT) resulting in the following changes.
+From here, independent development by the Modelling for Continuous Software Engineering (MCSE) group at the Institute of Information Security and Dependability (KASTEL) at the Karlsruher Institute of Technology (KIT) resulting in the following changes.
### Added
@@ -88,7 +93,7 @@ Originally, developed by DevBoost GmbH and Software Technology Group, Dresden Un
- Tests for the parsing (checks if generated model contains the expected elements)
- Tests for the parsing and printing (checks if printed code is equal to parsed code by parsing both source codes with Eclipse JDT and comparing the resulting ASTs)
-[Unreleased]: https://github.com/PalladioSimulator/Palladio-Supporting-EclipseJavaDevelopmentTools/compare/releases/5.1.0...HEAD
-[5.1.0]: https://github.com/PalladioSimulator/Palladio-Supporting-EclipseJavaDevelopmentTools/compare/8bc07...releases/5.1.0
-[development after 1.4.0]: https://github.com/PalladioSimulator/Palladio-Supporting-EclipseJavaDevelopmentTools/compare/e46b0...8bc07
-[1.4.0]: https://github.com/PalladioSimulator/Palladio-Supporting-EclipseJavaDevelopmentTools/commit/e46b0003803a8ccda7c3aa380ff2c759937d1ccb
\ No newline at end of file
+[Unreleased]: https://github.com/MDSD-Tools/TheExtendedJavaModelParserAndPrinter/compare/releases/5.1.0...HEAD
+[5.1.0]: https://github.com/MDSD-Tools/TheExtendedJavaModelParserAndPrinter/compare/8bc07...releases/5.1.0
+[development after 1.4.0]: https://github.com/MDSD-Tools/TheExtendedJavaModelParserAndPrinter/compare/e46b0...8bc07
+[1.4.0]: https://github.com/MDSD-Tools/TheExtendedJavaModelParserAndPrinter/commit/e46b0003803a8ccda7c3aa380ff2c759937d1ccb
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index b18fffa0..00000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,4 +0,0 @@
-PalladioPipeline {
- constraintBuildTimeLimitMinutes = 45
- deployUpdatesite 'releng/org.palladiosimulator.jdt.updatesite/target/repository'
-}
diff --git a/bundles/jamopp.parser.bcel/.classpath b/bundles/jamopp.parser.bcel/.classpath
deleted file mode 100644
index 4199cd3a..00000000
--- a/bundles/jamopp.parser.bcel/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bundles/jamopp.parser.bcel/.project b/bundles/jamopp.parser.bcel/.project
deleted file mode 100644
index 9de32fb1..00000000
--- a/bundles/jamopp.parser.bcel/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
- jamopp.parser.bcel
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
- net.sf.eclipsecs.core.CheckstyleBuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.pde.PluginNature
- net.sf.eclipsecs.core.CheckstyleNature
-
-
diff --git a/bundles/jamopp.parser.bcel/META-INF/MANIFEST.MF b/bundles/jamopp.parser.bcel/META-INF/MANIFEST.MF
deleted file mode 100644
index 55267352..00000000
--- a/bundles/jamopp.parser.bcel/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache BCEL-based JaMoPP Parser for Class Files
-Bundle-SymbolicName: jamopp.parser.bcel
-Bundle-Version: 5.1.0.qualifier
-Bundle-Vendor: Martin Armbruster
-Automatic-Module-Name: jamopp.parser.bcel
-Bundle-RequiredExecutionEnvironment: JavaSE-17
-Export-Package: jamopp.parser.bcel
-Require-Bundle: org.emftext.language.java,
- org.eclipse.emf.common
diff --git a/bundles/jamopp.parser.bcel/NOTICE.txt b/bundles/jamopp.parser.bcel/NOTICE.txt
deleted file mode 100644
index 711accf8..00000000
--- a/bundles/jamopp.parser.bcel/NOTICE.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Commons BCEL
-Copyright 2004-2020 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (https://www.apache.org/).
diff --git a/bundles/jamopp.parser.bcel/build.properties b/bundles/jamopp.parser.bcel/build.properties
deleted file mode 100644
index 34d2e4d2..00000000
--- a/bundles/jamopp.parser.bcel/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/bundles/jamopp.parser.bcel/pom.xml b/bundles/jamopp.parser.bcel/pom.xml
new file mode 100644
index 00000000..787db646
--- /dev/null
+++ b/bundles/jamopp.parser.bcel/pom.xml
@@ -0,0 +1,48 @@
+
+
+
+ 4.0.0
+ jamopp.parser.bcel
+ jar
+ Apache BCEL-based JaMoPP Parser for Class Files
+
+
+ tools.mdsd
+ jamopp.bundles
+ 6.0.0-SNAPSHOT
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+
+ bundle
+
+
+
+
+
+
+
+
+
+ org.eclipse.emf
+ org.eclipse.emf.ecore
+
+
+ tools.mdsd
+ org.emftext.language.java
+ 6.0.0-SNAPSHOT
+
+
+ org.apache.bcel
+ bcel
+
+
+
diff --git a/bundles/jamopp.parser.bcel/src/jamopp/parser/bcel/ClassFileModelLoader.java b/bundles/jamopp.parser.bcel/src/main/java/jamopp/parser/bcel/ClassFileModelLoader.java
similarity index 100%
rename from bundles/jamopp.parser.bcel/src/jamopp/parser/bcel/ClassFileModelLoader.java
rename to bundles/jamopp.parser.bcel/src/main/java/jamopp/parser/bcel/ClassFileModelLoader.java
diff --git a/bundles/jamopp.parser.bcel/src/jamopp/parser/bcel/package-info.java b/bundles/jamopp.parser.bcel/src/main/java/jamopp/parser/bcel/package-info.java
similarity index 100%
rename from bundles/jamopp.parser.bcel/src/jamopp/parser/bcel/package-info.java
rename to bundles/jamopp.parser.bcel/src/main/java/jamopp/parser/bcel/package-info.java
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/Const.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/Const.java
deleted file mode 100644
index b79b0461..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/Const.java
+++ /dev/null
@@ -1,2438 +0,0 @@
-/*
- * 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;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-/**
- * Constants for the project, mostly defined in the JVM specification.
- *
- * @since 6.0 (intended to replace the Constants interface)
- */
-public final class Const {
-
- /**
- * Java class file format Magic number (0xCAFEBABE)
- *
- * @see
- * The ClassFile Structure in The Java Virtual Machine Specification
- */
- public static final int JVM_CLASSFILE_MAGIC = 0xCAFEBABE;
-
- /** Major version number of class files for Java 1.1.
- * @see #MINOR_1_1
- * */
- public static final short MAJOR_1_1 = 45;
-
- /** Minor version number of class files for Java 1.1.
- * @see #MAJOR_1_1
- * */
- public static final short MINOR_1_1 = 3;
-
- /** Major version number of class files for Java 1.2.
- * @see #MINOR_1_2
- * */
- public static final short MAJOR_1_2 = 46;
-
- /** Minor version number of class files for Java 1.2.
- * @see #MAJOR_1_2
- * */
- public static final short MINOR_1_2 = 0;
-
- /** Major version number of class files for Java 1.2.
- * @see #MINOR_1_2
- * */
- public static final short MAJOR_1_3 = 47;
-
- /** Minor version number of class files for Java 1.3.
- * @see #MAJOR_1_3
- * */
- public static final short MINOR_1_3 = 0;
-
- /** Major version number of class files for Java 1.3.
- * @see #MINOR_1_3
- * */
- public static final short MAJOR_1_4 = 48;
-
- /** Minor version number of class files for Java 1.4.
- * @see #MAJOR_1_4
- * */
- public static final short MINOR_1_4 = 0;
-
- /** Major version number of class files for Java 1.4.
- * @see #MINOR_1_4
- * */
- public static final short MAJOR_1_5 = 49;
-
- /** Minor version number of class files for Java 1.5.
- * @see #MAJOR_1_5
- * */
- public static final short MINOR_1_5 = 0;
-
- /** Major version number of class files for Java 1.6.
- * @see #MINOR_1_6
- * */
- public static final short MAJOR_1_6 = 50;
-
- /** Minor version number of class files for Java 1.6.
- * @see #MAJOR_1_6
- * */
- public static final short MINOR_1_6 = 0;
-
- /** Major version number of class files for Java 1.7.
- * @see #MINOR_1_7
- * */
- public static final short MAJOR_1_7 = 51;
-
- /** Minor version number of class files for Java 1.7.
- * @see #MAJOR_1_7
- * */
- public static final short MINOR_1_7 = 0;
-
- /** Major version number of class files for Java 1.8.
- * @see #MINOR_1_8
- * */
- public static final short MAJOR_1_8 = 52;
-
- /** Minor version number of class files for Java 1.8.
- * @see #MAJOR_1_8
- * */
- public static final short MINOR_1_8 = 0;
-
- /** Major version number of class files for Java 9.
- * @see #MINOR_9
- * */
- public static final short MAJOR_9 = 53;
-
- /** Minor version number of class files for Java 9.
- * @see #MAJOR_9
- * */
- public static final short MINOR_9 = 0;
-
- /**
- * @deprecated Use {@link #MAJOR_9} instead
- */
- @Deprecated
- public static final short MAJOR_1_9 = MAJOR_9;
-
- /**
- * @deprecated Use {@link #MINOR_9} instead
- */
- @Deprecated
- public static final short MINOR_1_9 = MINOR_9;
-
- /** Major version number of class files for Java 10.
- * @see #MINOR_10
- * */
- public static final short MAJOR_10 = 54;
-
- /** Minor version number of class files for Java 10.
- * @see #MAJOR_10
- * */
- public static final short MINOR_10 = 0;
-
- /** Major version number of class files for Java 11.
- * @see #MINOR_11
- * */
- public static final short MAJOR_11 = 55;
-
- /** Minor version number of class files for Java 11.
- * @see #MAJOR_11
- * */
- public static final short MINOR_11 = 0;
-
- /** Major version number of class files for Java 12.
- * @see #MINOR_12
- * */
- public static final short MAJOR_12 = 56;
-
- /** Minor version number of class files for Java 12.
- * @see #MAJOR_12
- * */
- public static final short MINOR_12 = 0;
-
- /** Major version number of class files for Java 13.
- * @see #MINOR_13
- * */
- public static final short MAJOR_13 = 57;
-
- /** Minor version number of class files for Java 13.
- * @see #MAJOR_13
- * */
- public static final short MINOR_13 = 0;
-
- /** Major version number of class files for Java 14.
- * @see #MINOR_14
- * @since 6.4.0
- * */
- public static final short MAJOR_14 = 58;
-
- /** Minor version number of class files for Java 14.
- * @see #MAJOR_14
- * @since 6.4.0
- * */
- public static final short MINOR_14 = 0;
-
- /** Default major version number. Class file is for Java 1.1.
- * @see #MAJOR_1_1
- * */
- public static final short MAJOR = MAJOR_1_1;
-
- /** Default major version number. Class file is for Java 1.1.
- * @see #MAJOR_1_1
- * */
- public static final short MINOR = MINOR_1_1;
-
- /** Maximum value for an unsigned short.
- */
- public static final int MAX_SHORT = 65535; // 2^16 - 1
-
- /** Maximum value for an unsigned byte.
- */
- public static final int MAX_BYTE = 255; // 2^8 - 1
-
- /** One of the access flags for fields, methods, or classes.
- *
- * @see
- * Flag definitions for Classes in the Java Virtual Machine Specification (Java SE 9 Edition).
- * @see
- * Flag definitions for Fields in the Java Virtual Machine Specification (Java SE 9 Edition).
- * @see
- * Flag definitions for Methods in the Java Virtual Machine Specification (Java SE 9 Edition).
- * @see
- * Flag definitions for Inner Classes in the Java Virtual Machine Specification (Java SE 9 Edition).
- */
- public static final short ACC_PUBLIC = 0x0001;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_PRIVATE = 0x0002;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_PROTECTED = 0x0004;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_STATIC = 0x0008;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_FINAL = 0x0010;
-
- /** One of the access flags for the Module attribute.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_OPEN = 0x0020;
-
- /** One of the access flags for classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_SUPER = 0x0020;
-
- /** One of the access flags for methods.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_SYNCHRONIZED = 0x0020;
-
- /** One of the access flags for the Module attribute.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_TRANSITIVE = 0x0020;
-
- /** One of the access flags for methods.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_BRIDGE = 0x0040;
-
- /** One of the access flags for the Module attribute.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_STATIC_PHASE = 0x0040;
-
- /** One of the access flags for fields.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_VOLATILE = 0x0040;
-
- /** One of the access flags for fields.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_TRANSIENT = 0x0080;
-
- /** One of the access flags for methods.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_VARARGS = 0x0080;
-
- /** One of the access flags for methods.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_NATIVE = 0x0100;
-
- /** One of the access flags for classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_INTERFACE = 0x0200;
-
- /** One of the access flags for methods or classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_ABSTRACT = 0x0400;
-
- /** One of the access flags for methods.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_STRICT = 0x0800;
-
- /** One of the access flags for fields, methods, classes, MethodParameter attribute, or Module attribute.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_SYNTHETIC = 0x1000;
-
- /** One of the access flags for classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_ANNOTATION = 0x2000;
-
- /** One of the access flags for fields or classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_ENUM = 0x4000;
-
- // Applies to classes compiled by new compilers only
- /** One of the access flags for MethodParameter or Module attributes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_MANDATED = (short) 0x8000;
-
- /** One of the access flags for classes.
- * @see #ACC_PUBLIC
- */
- public static final short ACC_MODULE = (short) 0x8000;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- * @deprecated Use {@link #MAX_ACC_FLAG_I}
- */
- @Deprecated
- public static final short MAX_ACC_FLAG = ACC_ENUM;
-
- /** One of the access flags for fields, methods, or classes.
- * ACC_MODULE is negative as a short.
- * @see #ACC_PUBLIC
- * @since 6.4.0
- */
- public static final int MAX_ACC_FLAG_I = 0x8000; // ACC_MODULE is negative as a short
-
- // Note that do to overloading:
- // 'synchronized' is for methods, might be 'open' (if Module), 'super' (if class), or 'transitive' (if Module).
- // 'volatile' is for fields, might be 'bridge' (if method) or 'static_phase' (if Module)
- // 'transient' is for fields, might be 'varargs' (if method)
- // 'module' is for classes, might be 'mandated' (if Module or MethodParameters)
- /**
- * The names of the access flags.
- */
- private static final String[] ACCESS_NAMES = {
- "public", "private", "protected", "static", "final", "synchronized",
- "volatile", "transient", "native", "interface", "abstract", "strictfp",
- "synthetic", "annotation", "enum", "module"
- };
-
- /** @since 6.0 */
- public static final int ACCESS_NAMES_LENGTH = ACCESS_NAMES.length;
-
- /**
- * @param index
- * @return the ACCESS_NAMES entry at the given index
- * @since 6.0
- */
- public static String getAccessName(final int index) {
- return ACCESS_NAMES[index];
- }
-
- /*
- * The description of the constant pool is at:
- * http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4
- * References below are to the individual sections
- */
-
- /**
- * Marks a constant pool entry as type UTF-8.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Utf8 = 1;
-
- /**
- * Marks a constant pool entry as type Integer.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Integer = 3;
-
- /**
- * Marks a constant pool entry as type Float.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Float = 4;
-
- /**
- * Marks a constant pool entry as type Long.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Long = 5;
-
- /**
- * Marks a constant pool entry as type Double.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Double = 6;
-
- /**
- * Marks a constant pool entry as a Class
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Class = 7;
-
- /**
- * Marks a constant pool entry as a Field Reference.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_Fieldref = 9;
-
- /**
- * Marks a constant pool entry as type String
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_String = 8;
-
- /** Marks a constant pool entry as a Method Reference.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification */
- public static final byte CONSTANT_Methodref = 10;
-
- /**
- * Marks a constant pool entry as an Interface Method Reference.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_InterfaceMethodref = 11;
-
- /** Marks a constant pool entry as a name and type.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification */
- public static final byte CONSTANT_NameAndType = 12;
-
- /**
- * Marks a constant pool entry as a Method Handle.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_MethodHandle = 15;
-
- /**
- * Marks a constant pool entry as a Method Type.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_MethodType = 16;
-
- /**
- * Marks a constant pool entry as dynamically computed.
- * @see
- * Change request for JEP 309
- * @since 6.3
- */
- public static final byte CONSTANT_Dynamic = 17;
-
- /**
- * Marks a constant pool entry as an Invoke Dynamic
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- */
- public static final byte CONSTANT_InvokeDynamic = 18;
-
- /**
- * Marks a constant pool entry as a Module Reference.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- * @since 6.1
- */
- public static final byte CONSTANT_Module = 19;
-
- /**
- * Marks a constant pool entry as a Package Reference.
- * @see
- * The Constant Pool in The Java Virtual Machine Specification
- * @since 6.1
- */
- public static final byte CONSTANT_Package = 20;
-
- /**
- * The names of the types of entries in a constant pool.
- * Use getConstantName instead
- */
- private static final String[] CONSTANT_NAMES = {
- "", "CONSTANT_Utf8", "", "CONSTANT_Integer",
- "CONSTANT_Float", "CONSTANT_Long", "CONSTANT_Double",
- "CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref",
- "CONSTANT_Methodref", "CONSTANT_InterfaceMethodref",
- "CONSTANT_NameAndType", "", "", "CONSTANT_MethodHandle",
- "CONSTANT_MethodType", "CONSTANT_Dynamic", "CONSTANT_InvokeDynamic",
- "CONSTANT_Module", "CONSTANT_Package"};
-
- /**
- *
- * @param index
- * @return the CONSTANT_NAMES entry at the given index
- * @since 6.0
- */
- public static String getConstantName(final int index) {
- return CONSTANT_NAMES[index];
- }
-
- /** The name of the static initializer, also called "class
- * initialization method" or "interface initialization
- * method". This is "<clinit>".
- */
- public static final String STATIC_INITIALIZER_NAME = "";
-
- /** The name of every constructor method in a class, also called
- * "instance initialization method". This is "<init>".
- */
- public static final String CONSTRUCTOR_NAME = "";
-
- /**
- * The names of the interfaces implemented by arrays
- */
- private static final String[] INTERFACES_IMPLEMENTED_BY_ARRAYS = {"java.lang.Cloneable", "java.io.Serializable"};
-
- /**
- * @since 6.0
- */
- public static Iterable getInterfacesImplementedByArrays() {
- return Collections.unmodifiableList(Arrays.asList(INTERFACES_IMPLEMENTED_BY_ARRAYS));
- }
-
- /**
- * Maximum Constant Pool entries.
- * One of the limitations of the Java Virtual Machine.
- * @see
- * The Java Virtual Machine Specification, Java SE 8 Edition, page 330, chapter 4.11.
- */
- public static final int MAX_CP_ENTRIES = 65535;
-
- /**
- * Maximum code size (plus one; the code size must be LESS than this)
- * One of the limitations of the Java Virtual Machine.
- * Note vmspec2 page 152 ("Limitations") says:
- * "The amount of code per non-native, non-abstract method is limited to 65536 bytes by
- * the sizes of the indices in the exception_table of the Code attribute (§4.7.3),
- * in the LineNumberTable attribute (§4.7.8), and in the LocalVariableTable attribute (§4.7.9)."
- * However this should be taken as an upper limit rather than the defined maximum.
- * On page 134 (4.8.1 Static Constants) of the same spec, it says:
- * "The value of the code_length item must be less than 65536."
- * The entry in the Limitations section has been removed from later versions of the spec;
- * it is not present in the Java SE 8 edition.
- *
- * @see
- * The Java Virtual Machine Specification, Java SE 8 Edition, page 104, chapter 4.7.
- */
- public static final int MAX_CODE_SIZE = 65536; //bytes
-
- /**
- * The maximum number of dimensions in an array ({@value}).
- * One of the limitations of the Java Virtual Machine.
- *
- * @see
- * Field Descriptors in The Java Virtual Machine Specification
- */
- public static final int MAX_ARRAY_DIMENSIONS = 255;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short NOP = 0;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ACONST_NULL = 1;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_M1 = 2;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_0 = 3;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_1 = 4;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_2 = 5;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_3 = 6;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_4 = 7;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ICONST_5 = 8;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LCONST_0 = 9;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LCONST_1 = 10;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FCONST_0 = 11;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FCONST_1 = 12;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FCONST_2 = 13;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DCONST_0 = 14;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DCONST_1 = 15;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short BIPUSH = 16;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short SIPUSH = 17;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LDC = 18;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LDC_W = 19;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LDC2_W = 20;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ILOAD = 21;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LLOAD = 22;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FLOAD = 23;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DLOAD = 24;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ALOAD = 25;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ILOAD_0 = 26;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ILOAD_1 = 27;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ILOAD_2 = 28;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ILOAD_3 = 29;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LLOAD_0 = 30;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LLOAD_1 = 31;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LLOAD_2 = 32;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LLOAD_3 = 33;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FLOAD_0 = 34;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FLOAD_1 = 35;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FLOAD_2 = 36;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FLOAD_3 = 37;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DLOAD_0 = 38;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DLOAD_1 = 39;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DLOAD_2 = 40;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DLOAD_3 = 41;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ALOAD_0 = 42;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ALOAD_1 = 43;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ALOAD_2 = 44;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ALOAD_3 = 45;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IALOAD = 46;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LALOAD = 47;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FALOAD = 48;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DALOAD = 49;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short AALOAD = 50;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short BALOAD = 51;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short CALOAD = 52;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short SALOAD = 53;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISTORE = 54;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSTORE = 55;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FSTORE = 56;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DSTORE = 57;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ASTORE = 58;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISTORE_0 = 59;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISTORE_1 = 60;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISTORE_2 = 61;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISTORE_3 = 62;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSTORE_0 = 63;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSTORE_1 = 64;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSTORE_2 = 65;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSTORE_3 = 66;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FSTORE_0 = 67;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FSTORE_1 = 68;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FSTORE_2 = 69;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FSTORE_3 = 70;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DSTORE_0 = 71;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DSTORE_1 = 72;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DSTORE_2 = 73;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DSTORE_3 = 74;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ASTORE_0 = 75;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ASTORE_1 = 76;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ASTORE_2 = 77;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ASTORE_3 = 78;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IASTORE = 79;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LASTORE = 80;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FASTORE = 81;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DASTORE = 82;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short AASTORE = 83;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short BASTORE = 84;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short CASTORE = 85;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short SASTORE = 86;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short POP = 87;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short POP2 = 88;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DUP = 89;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DUP_X1 = 90;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DUP_X2 = 91;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DUP2 = 92;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DUP2_X1 = 93;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DUP2_X2 = 94;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short SWAP = 95;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IADD = 96;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LADD = 97;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FADD = 98;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DADD = 99;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISUB = 100;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSUB = 101;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FSUB = 102;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DSUB = 103;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IMUL = 104;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LMUL = 105;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FMUL = 106;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DMUL = 107;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IDIV = 108;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LDIV = 109;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FDIV = 110;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DDIV = 111;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IREM = 112;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LREM = 113;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FREM = 114;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DREM = 115;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INEG = 116;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LNEG = 117;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FNEG = 118;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DNEG = 119;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISHL = 120;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSHL = 121;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ISHR = 122;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LSHR = 123;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IUSHR = 124;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LUSHR = 125;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IAND = 126;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LAND = 127;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IOR = 128;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LOR = 129;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IXOR = 130;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LXOR = 131;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IINC = 132;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short I2L = 133;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short I2F = 134;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short I2D = 135;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short L2I = 136;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short L2F = 137;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short L2D = 138;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short F2I = 139;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short F2L = 140;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short F2D = 141;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short D2I = 142;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short D2L = 143;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short D2F = 144;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short I2B = 145;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INT2BYTE = 145; // Old notation
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short I2C = 146;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INT2CHAR = 146; // Old notation
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short I2S = 147;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INT2SHORT = 147; // Old notation
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LCMP = 148;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FCMPL = 149;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FCMPG = 150;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DCMPL = 151;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DCMPG = 152;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFEQ = 153;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFNE = 154;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFLT = 155;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFGE = 156;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFGT = 157;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFLE = 158;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ICMPEQ = 159;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ICMPNE = 160;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ICMPLT = 161;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ICMPGE = 162;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ICMPGT = 163;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ICMPLE = 164;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ACMPEQ = 165;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IF_ACMPNE = 166;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short GOTO = 167;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short JSR = 168;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short RET = 169;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short TABLESWITCH = 170;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LOOKUPSWITCH = 171;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IRETURN = 172;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short LRETURN = 173;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short FRETURN = 174;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short DRETURN = 175;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ARETURN = 176;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short RETURN = 177;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short GETSTATIC = 178;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short PUTSTATIC = 179;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short GETFIELD = 180;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short PUTFIELD = 181;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INVOKEVIRTUAL = 182;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INVOKESPECIAL = 183;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INVOKENONVIRTUAL = 183; // Old name in JDK 1.0
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INVOKESTATIC = 184;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INVOKEINTERFACE = 185;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INVOKEDYNAMIC = 186;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short NEW = 187;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short NEWARRAY = 188;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ANEWARRAY = 189;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ARRAYLENGTH = 190;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short ATHROW = 191;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short CHECKCAST = 192;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short INSTANCEOF = 193;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short MONITORENTER = 194;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short MONITOREXIT = 195;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short WIDE = 196;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short MULTIANEWARRAY = 197;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFNULL = 198;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short IFNONNULL = 199;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short GOTO_W = 200;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- public static final short JSR_W = 201;
-
- /** JVM internal opcode.
- * @see
- * Reserved opcodes in the Java Virtual Machine Specification */
- public static final short BREAKPOINT = 202;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short LDC_QUICK = 203;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short LDC_W_QUICK = 204;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short LDC2_W_QUICK = 205;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short GETFIELD_QUICK = 206;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short PUTFIELD_QUICK = 207;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short GETFIELD2_QUICK = 208;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short PUTFIELD2_QUICK = 209;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short GETSTATIC_QUICK = 210;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short PUTSTATIC_QUICK = 211;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short GETSTATIC2_QUICK = 212;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short PUTSTATIC2_QUICK = 213;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKEVIRTUAL_QUICK = 214;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKENONVIRTUAL_QUICK = 215;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKESUPER_QUICK = 216;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKESTATIC_QUICK = 217;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKEINTERFACE_QUICK = 218;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKEVIRTUALOBJECT_QUICK = 219;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short NEW_QUICK = 221;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short ANEWARRAY_QUICK = 222;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short MULTIANEWARRAY_QUICK = 223;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short CHECKCAST_QUICK = 224;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INSTANCEOF_QUICK = 225;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short INVOKEVIRTUAL_QUICK_W = 226;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short GETFIELD_QUICK_W = 227;
-
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- public static final short PUTFIELD_QUICK_W = 228;
-
- /** JVM internal opcode.
- * @see
- * Reserved opcodes in the Java Virtual Machine Specification */
- public static final short IMPDEP1 = 254;
-
- /** JVM internal opcode.
- * @see
- * Reserved opcodes in the Java Virtual Machine Specification */
- public static final short IMPDEP2 = 255;
-
- /**
- * BCEL virtual instruction for pushing an arbitrary data type onto the stack. Will be converted to the appropriate JVM
- * opcode when the class is dumped.
- */
- public static final short PUSH = 4711;
-
- /**
- * BCEL virtual instruction for either LOOKUPSWITCH or TABLESWITCH. Will be converted to the appropriate JVM
- * opcode when the class is dumped.
- */
- public static final short SWITCH = 4712;
-
- /** Illegal opcode. */
- public static final short UNDEFINED = -1;
-
- /** Illegal opcode. */
- public static final short UNPREDICTABLE = -2;
-
- /** Illegal opcode. */
- public static final short RESERVED = -3;
-
- /** Mnemonic for an illegal opcode. */
- public static final String ILLEGAL_OPCODE = "";
-
- /** Mnemonic for an illegal type. */
- public static final String ILLEGAL_TYPE = "";
-
- /** Boolean data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_BOOLEAN = 4;
-
- /** Char data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_CHAR = 5;
-
- /** Float data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_FLOAT = 6;
-
- /** Double data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_DOUBLE = 7;
-
- /** Byte data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_BYTE = 8;
-
- /** Short data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_SHORT = 9;
-
- /** Int data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_INT = 10;
-
- /** Long data type.
- * @see
- * Static Constraints in the Java Virtual Machine Specification */
- public static final byte T_LONG = 11;
-
- /** Void data type (non-standard). */
- public static final byte T_VOID = 12; // Non-standard
-
- /** Array data type. */
- public static final byte T_ARRAY = 13;
-
- /** Object data type. */
- public static final byte T_OBJECT = 14;
-
- /** Reference data type (deprecated). */
- public static final byte T_REFERENCE = 14; // Deprecated
-
- /** Unknown data type. */
- public static final byte T_UNKNOWN = 15;
-
- /** Address data type. */
- public static final byte T_ADDRESS = 16;
-
- /** The primitive type names corresponding to the T_XX constants,
- * e.g., TYPE_NAMES[T_INT] = "int"
- */
- private static final String[] TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "boolean", "char", "float", "double", "byte", "short", "int", "long",
- "void", "array", "object", "unknown", "address"
- };
-
- /**
- * The primitive type names corresponding to the T_XX constants,
- * e.g., TYPE_NAMES[T_INT] = "int"
- * @param index
- * @return the type name
- * @since 6.0
- */
- public static String getTypeName(final int index) {
- return TYPE_NAMES[index];
- }
-
- /** The primitive class names corresponding to the T_XX constants,
- * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
- */
- private static final String[] CLASS_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "java.lang.Boolean", "java.lang.Character", "java.lang.Float",
- "java.lang.Double", "java.lang.Byte", "java.lang.Short",
- "java.lang.Integer", "java.lang.Long", "java.lang.Void",
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
-
- /**
- * The primitive class names corresponding to the T_XX constants,
- * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
- * @param index
- * @return the class name
- * @since 6.0
- */
- public static String getClassTypeName(final int index) {
- return CLASS_TYPE_NAMES[index];
- }
-
- /** The signature characters corresponding to primitive types,
- * e.g., SHORT_TYPE_NAMES[T_INT] = "I"
- */
- private static final String[] SHORT_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "Z", "C", "F", "D", "B", "S", "I", "J",
- "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
-
- /**
- *
- * @param index
- * @return the short type name
- * @since 6.0
- */
- public static String getShortTypeName(final int index) {
- return SHORT_TYPE_NAMES[index];
- }
-
-
- /**
- * Number of byte code operands for each opcode, i.e., number of bytes after the tag byte
- * itself. Indexed by opcode, so NO_OF_OPERANDS[BIPUSH] = the number of operands for a bipush
- * instruction.
- */
- private static final short[] NO_OF_OPERANDS = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/,
- 0/*iconst_1*/, 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/,
- 0/*iconst_5*/, 0/*lconst_0*/, 0/*lconst_1*/, 0/*fconst_0*/,
- 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/, 0/*dconst_1*/,
- 1/*bipush*/, 2/*sipush*/, 1/*ldc*/, 2/*ldc_w*/, 2/*ldc2_w*/,
- 1/*iload*/, 1/*lload*/, 1/*fload*/, 1/*dload*/, 1/*aload*/,
- 0/*iload_0*/, 0/*iload_1*/, 0/*iload_2*/, 0/*iload_3*/,
- 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/,
- 0/*fload_0*/, 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/,
- 0/*dload_0*/, 0/*dload_1*/, 0/*dload_2*/, 0/*dload_3*/,
- 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/,
- 0/*iaload*/, 0/*laload*/, 0/*faload*/, 0/*daload*/,
- 0/*aaload*/, 0/*baload*/, 0/*caload*/, 0/*saload*/,
- 1/*istore*/, 1/*lstore*/, 1/*fstore*/, 1/*dstore*/,
- 1/*astore*/, 0/*istore_0*/, 0/*istore_1*/, 0/*istore_2*/,
- 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/, 0/*lstore_2*/,
- 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/,
- 0/*dstore_3*/, 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/,
- 0/*astore_3*/, 0/*iastore*/, 0/*lastore*/, 0/*fastore*/,
- 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/,
- 0/*sastore*/, 0/*pop*/, 0/*pop2*/, 0/*dup*/, 0/*dup_x1*/,
- 0/*dup_x2*/, 0/*dup2*/, 0/*dup2_x1*/, 0/*dup2_x2*/, 0/*swap*/,
- 0/*iadd*/, 0/*ladd*/, 0/*fadd*/, 0/*dadd*/, 0/*isub*/,
- 0/*lsub*/, 0/*fsub*/, 0/*dsub*/, 0/*imul*/, 0/*lmul*/,
- 0/*fmul*/, 0/*dmul*/, 0/*idiv*/, 0/*ldiv*/, 0/*fdiv*/,
- 0/*ddiv*/, 0/*irem*/, 0/*lrem*/, 0/*frem*/, 0/*drem*/,
- 0/*ineg*/, 0/*lneg*/, 0/*fneg*/, 0/*dneg*/, 0/*ishl*/,
- 0/*lshl*/, 0/*ishr*/, 0/*lshr*/, 0/*iushr*/, 0/*lushr*/,
- 0/*iand*/, 0/*land*/, 0/*ior*/, 0/*lor*/, 0/*ixor*/, 0/*lxor*/,
- 2/*iinc*/, 0/*i2l*/, 0/*i2f*/, 0/*i2d*/, 0/*l2i*/, 0/*l2f*/,
- 0/*l2d*/, 0/*f2i*/, 0/*f2l*/, 0/*f2d*/, 0/*d2i*/, 0/*d2l*/,
- 0/*d2f*/, 0/*i2b*/, 0/*i2c*/, 0/*i2s*/, 0/*lcmp*/, 0/*fcmpl*/,
- 0/*fcmpg*/, 0/*dcmpl*/, 0/*dcmpg*/, 2/*ifeq*/, 2/*ifne*/,
- 2/*iflt*/, 2/*ifge*/, 2/*ifgt*/, 2/*ifle*/, 2/*if_icmpeq*/,
- 2/*if_icmpne*/, 2/*if_icmplt*/, 2/*if_icmpge*/, 2/*if_icmpgt*/,
- 2/*if_icmple*/, 2/*if_acmpeq*/, 2/*if_acmpne*/, 2/*goto*/,
- 2/*jsr*/, 1/*ret*/, UNPREDICTABLE/*tableswitch*/, UNPREDICTABLE/*lookupswitch*/,
- 0/*ireturn*/, 0/*lreturn*/, 0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/,
- 2/*getstatic*/, 2/*putstatic*/, 2/*getfield*/,
- 2/*putfield*/, 2/*invokevirtual*/, 2/*invokespecial*/, 2/*invokestatic*/,
- 4/*invokeinterface*/, 4/*invokedynamic*/, 2/*new*/,
- 1/*newarray*/, 2/*anewarray*/,
- 0/*arraylength*/, 0/*athrow*/, 2/*checkcast*/,
- 2/*instanceof*/, 0/*monitorenter*/,
- 0/*monitorexit*/, UNPREDICTABLE/*wide*/, 3/*multianewarray*/,
- 2/*ifnull*/, 2/*ifnonnull*/, 4/*goto_w*/,
- 4/*jsr_w*/, 0/*breakpoint*/, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, RESERVED/*impdep1*/, RESERVED/*impdep2*/
- };
-
- /**
- *
- * @param index
- * @return Number of byte code operands
- * @since 6.0
- */
- public static short getNoOfOperands(final int index) {
- return NO_OF_OPERANDS[index];
- }
-
- /**
- * How the byte code operands are to be interpreted for each opcode.
- * Indexed by opcode. TYPE_OF_OPERANDS[ILOAD] = an array of shorts
- * describing the data types for the instruction.
- */
- private static final short[][] TYPE_OF_OPERANDS = {
- {}/*nop*/, {}/*aconst_null*/, {}/*iconst_m1*/, {}/*iconst_0*/,
- {}/*iconst_1*/, {}/*iconst_2*/, {}/*iconst_3*/, {}/*iconst_4*/,
- {}/*iconst_5*/, {}/*lconst_0*/, {}/*lconst_1*/, {}/*fconst_0*/,
- {}/*fconst_1*/, {}/*fconst_2*/, {}/*dconst_0*/, {}/*dconst_1*/,
- {T_BYTE}/*bipush*/, {T_SHORT}/*sipush*/, {T_BYTE}/*ldc*/,
- {T_SHORT}/*ldc_w*/, {T_SHORT}/*ldc2_w*/,
- {T_BYTE}/*iload*/, {T_BYTE}/*lload*/, {T_BYTE}/*fload*/,
- {T_BYTE}/*dload*/, {T_BYTE}/*aload*/, {}/*iload_0*/,
- {}/*iload_1*/, {}/*iload_2*/, {}/*iload_3*/, {}/*lload_0*/,
- {}/*lload_1*/, {}/*lload_2*/, {}/*lload_3*/, {}/*fload_0*/,
- {}/*fload_1*/, {}/*fload_2*/, {}/*fload_3*/, {}/*dload_0*/,
- {}/*dload_1*/, {}/*dload_2*/, {}/*dload_3*/, {}/*aload_0*/,
- {}/*aload_1*/, {}/*aload_2*/, {}/*aload_3*/, {}/*iaload*/,
- {}/*laload*/, {}/*faload*/, {}/*daload*/, {}/*aaload*/,
- {}/*baload*/, {}/*caload*/, {}/*saload*/, {T_BYTE}/*istore*/,
- {T_BYTE}/*lstore*/, {T_BYTE}/*fstore*/, {T_BYTE}/*dstore*/,
- {T_BYTE}/*astore*/, {}/*istore_0*/, {}/*istore_1*/,
- {}/*istore_2*/, {}/*istore_3*/, {}/*lstore_0*/, {}/*lstore_1*/,
- {}/*lstore_2*/, {}/*lstore_3*/, {}/*fstore_0*/, {}/*fstore_1*/,
- {}/*fstore_2*/, {}/*fstore_3*/, {}/*dstore_0*/, {}/*dstore_1*/,
- {}/*dstore_2*/, {}/*dstore_3*/, {}/*astore_0*/, {}/*astore_1*/,
- {}/*astore_2*/, {}/*astore_3*/, {}/*iastore*/, {}/*lastore*/,
- {}/*fastore*/, {}/*dastore*/, {}/*aastore*/, {}/*bastore*/,
- {}/*castore*/, {}/*sastore*/, {}/*pop*/, {}/*pop2*/, {}/*dup*/,
- {}/*dup_x1*/, {}/*dup_x2*/, {}/*dup2*/, {}/*dup2_x1*/,
- {}/*dup2_x2*/, {}/*swap*/, {}/*iadd*/, {}/*ladd*/, {}/*fadd*/,
- {}/*dadd*/, {}/*isub*/, {}/*lsub*/, {}/*fsub*/, {}/*dsub*/,
- {}/*imul*/, {}/*lmul*/, {}/*fmul*/, {}/*dmul*/, {}/*idiv*/,
- {}/*ldiv*/, {}/*fdiv*/, {}/*ddiv*/, {}/*irem*/, {}/*lrem*/,
- {}/*frem*/, {}/*drem*/, {}/*ineg*/, {}/*lneg*/, {}/*fneg*/,
- {}/*dneg*/, {}/*ishl*/, {}/*lshl*/, {}/*ishr*/, {}/*lshr*/,
- {}/*iushr*/, {}/*lushr*/, {}/*iand*/, {}/*land*/, {}/*ior*/,
- {}/*lor*/, {}/*ixor*/, {}/*lxor*/, {T_BYTE, T_BYTE}/*iinc*/,
- {}/*i2l*/, {}/*i2f*/, {}/*i2d*/, {}/*l2i*/, {}/*l2f*/, {}/*l2d*/,
- {}/*f2i*/, {}/*f2l*/, {}/*f2d*/, {}/*d2i*/, {}/*d2l*/, {}/*d2f*/,
- {}/*i2b*/, {}/*i2c*/, {}/*i2s*/, {}/*lcmp*/, {}/*fcmpl*/,
- {}/*fcmpg*/, {}/*dcmpl*/, {}/*dcmpg*/, {T_SHORT}/*ifeq*/,
- {T_SHORT}/*ifne*/, {T_SHORT}/*iflt*/, {T_SHORT}/*ifge*/,
- {T_SHORT}/*ifgt*/, {T_SHORT}/*ifle*/, {T_SHORT}/*if_icmpeq*/,
- {T_SHORT}/*if_icmpne*/, {T_SHORT}/*if_icmplt*/,
- {T_SHORT}/*if_icmpge*/, {T_SHORT}/*if_icmpgt*/,
- {T_SHORT}/*if_icmple*/, {T_SHORT}/*if_acmpeq*/,
- {T_SHORT}/*if_acmpne*/, {T_SHORT}/*goto*/, {T_SHORT}/*jsr*/,
- {T_BYTE}/*ret*/, {}/*tableswitch*/, {}/*lookupswitch*/,
- {}/*ireturn*/, {}/*lreturn*/, {}/*freturn*/, {}/*dreturn*/,
- {}/*areturn*/, {}/*return*/, {T_SHORT}/*getstatic*/,
- {T_SHORT}/*putstatic*/, {T_SHORT}/*getfield*/,
- {T_SHORT}/*putfield*/, {T_SHORT}/*invokevirtual*/,
- {T_SHORT}/*invokespecial*/, {T_SHORT}/*invokestatic*/,
- {T_SHORT, T_BYTE, T_BYTE}/*invokeinterface*/, {T_SHORT, T_BYTE, T_BYTE}/*invokedynamic*/,
- {T_SHORT}/*new*/, {T_BYTE}/*newarray*/,
- {T_SHORT}/*anewarray*/, {}/*arraylength*/, {}/*athrow*/,
- {T_SHORT}/*checkcast*/, {T_SHORT}/*instanceof*/,
- {}/*monitorenter*/, {}/*monitorexit*/, {T_BYTE}/*wide*/,
- {T_SHORT, T_BYTE}/*multianewarray*/, {T_SHORT}/*ifnull*/,
- {T_SHORT}/*ifnonnull*/, {T_INT}/*goto_w*/, {T_INT}/*jsr_w*/,
- {}/*breakpoint*/, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}/*impdep1*/, {}/*impdep2*/
- };
-
- /**
- * @since 6.0
- */
- public static short getOperandType(final int opcode, final int index) {
- return TYPE_OF_OPERANDS[opcode][index];
- }
-
- /**
- * @since 6.0
- */
- public static long getOperandTypeCount(final int opcode) {
- return TYPE_OF_OPERANDS[opcode].length;
- }
-
- /**
- * Names of opcodes. Indexed by opcode. OPCODE_NAMES[ALOAD] = "aload".
- */
- private static final String[] OPCODE_NAMES = {
- "nop", "aconst_null", "iconst_m1", "iconst_0", "iconst_1",
- "iconst_2", "iconst_3", "iconst_4", "iconst_5", "lconst_0",
- "lconst_1", "fconst_0", "fconst_1", "fconst_2", "dconst_0",
- "dconst_1", "bipush", "sipush", "ldc", "ldc_w", "ldc2_w", "iload",
- "lload", "fload", "dload", "aload", "iload_0", "iload_1", "iload_2",
- "iload_3", "lload_0", "lload_1", "lload_2", "lload_3", "fload_0",
- "fload_1", "fload_2", "fload_3", "dload_0", "dload_1", "dload_2",
- "dload_3", "aload_0", "aload_1", "aload_2", "aload_3", "iaload",
- "laload", "faload", "daload", "aaload", "baload", "caload", "saload",
- "istore", "lstore", "fstore", "dstore", "astore", "istore_0",
- "istore_1", "istore_2", "istore_3", "lstore_0", "lstore_1",
- "lstore_2", "lstore_3", "fstore_0", "fstore_1", "fstore_2",
- "fstore_3", "dstore_0", "dstore_1", "dstore_2", "dstore_3",
- "astore_0", "astore_1", "astore_2", "astore_3", "iastore", "lastore",
- "fastore", "dastore", "aastore", "bastore", "castore", "sastore",
- "pop", "pop2", "dup", "dup_x1", "dup_x2", "dup2", "dup2_x1",
- "dup2_x2", "swap", "iadd", "ladd", "fadd", "dadd", "isub", "lsub",
- "fsub", "dsub", "imul", "lmul", "fmul", "dmul", "idiv", "ldiv",
- "fdiv", "ddiv", "irem", "lrem", "frem", "drem", "ineg", "lneg",
- "fneg", "dneg", "ishl", "lshl", "ishr", "lshr", "iushr", "lushr",
- "iand", "land", "ior", "lor", "ixor", "lxor", "iinc", "i2l", "i2f",
- "i2d", "l2i", "l2f", "l2d", "f2i", "f2l", "f2d", "d2i", "d2l", "d2f",
- "i2b", "i2c", "i2s", "lcmp", "fcmpl", "fcmpg",
- "dcmpl", "dcmpg", "ifeq", "ifne", "iflt", "ifge", "ifgt", "ifle",
- "if_icmpeq", "if_icmpne", "if_icmplt", "if_icmpge", "if_icmpgt",
- "if_icmple", "if_acmpeq", "if_acmpne", "goto", "jsr", "ret",
- "tableswitch", "lookupswitch", "ireturn", "lreturn", "freturn",
- "dreturn", "areturn", "return", "getstatic", "putstatic", "getfield",
- "putfield", "invokevirtual", "invokespecial", "invokestatic",
- "invokeinterface", "invokedynamic", "new", "newarray", "anewarray",
- "arraylength", "athrow", "checkcast", "instanceof", "monitorenter",
- "monitorexit", "wide", "multianewarray", "ifnull", "ifnonnull",
- "goto_w", "jsr_w", "breakpoint", ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, "impdep1", "impdep2"
- };
-
- /**
- * @since 6.0
- */
- public static final int OPCODE_NAMES_LENGTH = OPCODE_NAMES.length;
-
-
- /**
- * @since 6.0
- */
- public static String getOpcodeName(final int index) {
- return OPCODE_NAMES[index];
- }
-
- /**
- * Number of words consumed on operand stack by instructions.
- * Indexed by opcode. CONSUME_STACK[FALOAD] = number of words
- * consumed from the stack by a faload instruction.
- */
- private static final int[] CONSUME_STACK = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/, 0/*iconst_1*/,
- 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/, 0/*iconst_5*/, 0/*lconst_0*/,
- 0/*lconst_1*/, 0/*fconst_0*/, 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/,
- 0/*dconst_1*/, 0/*bipush*/, 0/*sipush*/, 0/*ldc*/, 0/*ldc_w*/, 0/*ldc2_w*/, 0/*iload*/,
- 0/*lload*/, 0/*fload*/, 0/*dload*/, 0/*aload*/, 0/*iload_0*/, 0/*iload_1*/, 0/*iload_2*/,
- 0/*iload_3*/, 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/, 0/*fload_0*/,
- 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/, 0/*dload_0*/, 0/*dload_1*/, 0/*dload_2*/,
- 0/*dload_3*/, 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/, 2/*iaload*/,
- 2/*laload*/, 2/*faload*/, 2/*daload*/, 2/*aaload*/, 2/*baload*/, 2/*caload*/, 2/*saload*/,
- 1/*istore*/, 2/*lstore*/, 1/*fstore*/, 2/*dstore*/, 1/*astore*/, 1/*istore_0*/,
- 1/*istore_1*/, 1/*istore_2*/, 1/*istore_3*/, 2/*lstore_0*/, 2/*lstore_1*/,
- 2/*lstore_2*/, 2/*lstore_3*/, 1/*fstore_0*/, 1/*fstore_1*/, 1/*fstore_2*/,
- 1/*fstore_3*/, 2/*dstore_0*/, 2/*dstore_1*/, 2/*dstore_2*/, 2/*dstore_3*/,
- 1/*astore_0*/, 1/*astore_1*/, 1/*astore_2*/, 1/*astore_3*/, 3/*iastore*/, 4/*lastore*/,
- 3/*fastore*/, 4/*dastore*/, 3/*aastore*/, 3/*bastore*/, 3/*castore*/, 3/*sastore*/,
- 1/*pop*/, 2/*pop2*/, 1/*dup*/, 2/*dup_x1*/, 3/*dup_x2*/, 2/*dup2*/, 3/*dup2_x1*/,
- 4/*dup2_x2*/, 2/*swap*/, 2/*iadd*/, 4/*ladd*/, 2/*fadd*/, 4/*dadd*/, 2/*isub*/, 4/*lsub*/,
- 2/*fsub*/, 4/*dsub*/, 2/*imul*/, 4/*lmul*/, 2/*fmul*/, 4/*dmul*/, 2/*idiv*/, 4/*ldiv*/,
- 2/*fdiv*/, 4/*ddiv*/, 2/*irem*/, 4/*lrem*/, 2/*frem*/, 4/*drem*/, 1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 2/*ishl*/, 3/*lshl*/, 2/*ishr*/, 3/*lshr*/, 2/*iushr*/, 3/*lushr*/,
- 2/*iand*/, 4/*land*/, 2/*ior*/, 4/*lor*/, 2/*ixor*/, 4/*lxor*/, 0/*iinc*/,
- 1/*i2l*/, 1/*i2f*/, 1/*i2d*/, 2/*l2i*/, 2/*l2f*/, 2/*l2d*/, 1/*f2i*/, 1/*f2l*/,
- 1/*f2d*/, 2/*d2i*/, 2/*d2l*/, 2/*d2f*/, 1/*i2b*/, 1/*i2c*/, 1/*i2s*/,
- 4/*lcmp*/, 2/*fcmpl*/, 2/*fcmpg*/, 4/*dcmpl*/, 4/*dcmpg*/, 1/*ifeq*/, 1/*ifne*/,
- 1/*iflt*/, 1/*ifge*/, 1/*ifgt*/, 1/*ifle*/, 2/*if_icmpeq*/, 2/*if_icmpne*/, 2/*if_icmplt*/,
- 2 /*if_icmpge*/, 2/*if_icmpgt*/, 2/*if_icmple*/, 2/*if_acmpeq*/, 2/*if_acmpne*/,
- 0/*goto*/, 0/*jsr*/, 0/*ret*/, 1/*tableswitch*/, 1/*lookupswitch*/, 1/*ireturn*/,
- 2/*lreturn*/, 1/*freturn*/, 2/*dreturn*/, 1/*areturn*/, 0/*return*/, 0/*getstatic*/,
- UNPREDICTABLE/*putstatic*/, 1/*getfield*/, UNPREDICTABLE/*putfield*/,
- UNPREDICTABLE/*invokevirtual*/, UNPREDICTABLE/*invokespecial*/,
- UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNPREDICTABLE/*invokedynamic*/, 0/*new*/, 1/*newarray*/, 1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/, 1/*monitorenter*/,
- 1/*monitorexit*/, 0/*wide*/, UNPREDICTABLE/*multianewarray*/, 1/*ifnull*/, 1/*ifnonnull*/,
- 0/*goto_w*/, 0/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
-
- /**
- *
- * @param index
- * @return Number of words consumed on operand stack
- * @since 6.0
- */
- public static int getConsumeStack(final int index) {
- return CONSUME_STACK[index];
- }
-
-
- /**
- * Number of words produced onto operand stack by instructions.
- * Indexed by opcode. CONSUME_STACK[DALOAD] = number of words
- * consumed from the stack by a daload instruction.
- */
- private static final int[] PRODUCE_STACK = {
- 0/*nop*/, 1/*aconst_null*/, 1/*iconst_m1*/, 1/*iconst_0*/, 1/*iconst_1*/,
- 1/*iconst_2*/, 1/*iconst_3*/, 1/*iconst_4*/, 1/*iconst_5*/, 2/*lconst_0*/,
- 2/*lconst_1*/, 1/*fconst_0*/, 1/*fconst_1*/, 1/*fconst_2*/, 2/*dconst_0*/,
- 2/*dconst_1*/, 1/*bipush*/, 1/*sipush*/, 1/*ldc*/, 1/*ldc_w*/, 2/*ldc2_w*/, 1/*iload*/,
- 2/*lload*/, 1/*fload*/, 2/*dload*/, 1/*aload*/, 1/*iload_0*/, 1/*iload_1*/, 1/*iload_2*/,
- 1/*iload_3*/, 2/*lload_0*/, 2/*lload_1*/, 2/*lload_2*/, 2/*lload_3*/, 1/*fload_0*/,
- 1/*fload_1*/, 1/*fload_2*/, 1/*fload_3*/, 2/*dload_0*/, 2/*dload_1*/, 2/*dload_2*/,
- 2/*dload_3*/, 1/*aload_0*/, 1/*aload_1*/, 1/*aload_2*/, 1/*aload_3*/, 1/*iaload*/,
- 2/*laload*/, 1/*faload*/, 2/*daload*/, 1/*aaload*/, 1/*baload*/, 1/*caload*/, 1/*saload*/,
- 0/*istore*/, 0/*lstore*/, 0/*fstore*/, 0/*dstore*/, 0/*astore*/, 0/*istore_0*/,
- 0/*istore_1*/, 0/*istore_2*/, 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/,
- 0/*lstore_2*/, 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/, 0/*dstore_3*/,
- 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/, 0/*astore_3*/, 0/*iastore*/, 0/*lastore*/,
- 0/*fastore*/, 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/, 0/*sastore*/,
- 0/*pop*/, 0/*pop2*/, 2/*dup*/, 3/*dup_x1*/, 4/*dup_x2*/, 4/*dup2*/, 5/*dup2_x1*/,
- 6/*dup2_x2*/, 2/*swap*/, 1/*iadd*/, 2/*ladd*/, 1/*fadd*/, 2/*dadd*/, 1/*isub*/, 2/*lsub*/,
- 1/*fsub*/, 2/*dsub*/, 1/*imul*/, 2/*lmul*/, 1/*fmul*/, 2/*dmul*/, 1/*idiv*/, 2/*ldiv*/,
- 1/*fdiv*/, 2/*ddiv*/, 1/*irem*/, 2/*lrem*/, 1/*frem*/, 2/*drem*/, 1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 1/*ishl*/, 2/*lshl*/, 1/*ishr*/, 2/*lshr*/, 1/*iushr*/, 2/*lushr*/,
- 1/*iand*/, 2/*land*/, 1/*ior*/, 2/*lor*/, 1/*ixor*/, 2/*lxor*/,
- 0/*iinc*/, 2/*i2l*/, 1/*i2f*/, 2/*i2d*/, 1/*l2i*/, 1/*l2f*/, 2/*l2d*/, 1/*f2i*/,
- 2/*f2l*/, 2/*f2d*/, 1/*d2i*/, 2/*d2l*/, 1/*d2f*/,
- 1/*i2b*/, 1/*i2c*/, 1/*i2s*/, 1/*lcmp*/, 1/*fcmpl*/, 1/*fcmpg*/,
- 1/*dcmpl*/, 1/*dcmpg*/, 0/*ifeq*/, 0/*ifne*/, 0/*iflt*/, 0/*ifge*/, 0/*ifgt*/, 0/*ifle*/,
- 0/*if_icmpeq*/, 0/*if_icmpne*/, 0/*if_icmplt*/, 0/*if_icmpge*/, 0/*if_icmpgt*/,
- 0/*if_icmple*/, 0/*if_acmpeq*/, 0/*if_acmpne*/, 0/*goto*/, 1/*jsr*/, 0/*ret*/,
- 0/*tableswitch*/, 0/*lookupswitch*/, 0/*ireturn*/, 0/*lreturn*/, 0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/, UNPREDICTABLE/*getstatic*/, 0/*putstatic*/,
- UNPREDICTABLE/*getfield*/, 0/*putfield*/, UNPREDICTABLE/*invokevirtual*/,
- UNPREDICTABLE/*invokespecial*/, UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNPREDICTABLE/*invokedynamic*/, 1/*new*/, 1/*newarray*/, 1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/, 0/*monitorenter*/,
- 0/*monitorexit*/, 0/*wide*/, 1/*multianewarray*/, 0/*ifnull*/, 0/*ifnonnull*/,
- 0/*goto_w*/, 1/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
-
- /**
- *
- * @param index
- * @return Number of words produced onto operand stack
- * @since 6.0
- */
- public static int getProduceStack(final int index) {
- return PRODUCE_STACK[index];
- }
-
- /** Attributes and their corresponding names.
- */
- public static final byte ATTR_UNKNOWN = -1;
- public static final byte ATTR_SOURCE_FILE = 0;
- public static final byte ATTR_CONSTANT_VALUE = 1;
- public static final byte ATTR_CODE = 2;
- public static final byte ATTR_EXCEPTIONS = 3;
- public static final byte ATTR_LINE_NUMBER_TABLE = 4;
- public static final byte ATTR_LOCAL_VARIABLE_TABLE = 5;
- public static final byte ATTR_INNER_CLASSES = 6;
- public static final byte ATTR_SYNTHETIC = 7;
- public static final byte ATTR_DEPRECATED = 8;
- public static final byte ATTR_PMG = 9;
- public static final byte ATTR_SIGNATURE = 10;
- public static final byte ATTR_STACK_MAP = 11;
- public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS = 12;
- public static final byte ATTR_RUNTIME_INVISIBLE_ANNOTATIONS = 13;
- public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS = 14;
- public static final byte ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS = 15;
- public static final byte ATTR_ANNOTATION_DEFAULT = 16;
- public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE = 17;
- public static final byte ATTR_ENCLOSING_METHOD = 18;
- public static final byte ATTR_STACK_MAP_TABLE = 19;
- public static final byte ATTR_BOOTSTRAP_METHODS = 20;
- public static final byte ATTR_METHOD_PARAMETERS = 21;
- public static final byte ATTR_MODULE = 22;
- public static final byte ATTR_MODULE_PACKAGES = 23;
- public static final byte ATTR_MODULE_MAIN_CLASS = 24;
- public static final byte ATTR_NEST_HOST = 25;
- public static final byte ATTR_NEST_MEMBERS = 26;
-
- public static final short KNOWN_ATTRIBUTES = 27; // count of attributes
-
- private static final String[] ATTRIBUTE_NAMES = {
- "SourceFile", "ConstantValue", "Code", "Exceptions",
- "LineNumberTable", "LocalVariableTable",
- "InnerClasses", "Synthetic", "Deprecated",
- "PMGClass", "Signature", "StackMap",
- "RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations",
- "RuntimeVisibleParameterAnnotations", "RuntimeInvisibleParameterAnnotations",
- "AnnotationDefault", "LocalVariableTypeTable", "EnclosingMethod", "StackMapTable",
- "BootstrapMethods", "MethodParameters", "Module", "ModulePackages",
- "ModuleMainClass", "NestHost", "NestMembers"
- };
-
- /**
- *
- * @param index
- * @return the attribute name
- * @since 6.0
- */
- public static String getAttributeName(final int index) {
- return ATTRIBUTE_NAMES[index];
- }
-
- /** Constants used in the StackMap attribute.
- */
- public static final byte ITEM_Bogus = 0;
- public static final byte ITEM_Integer = 1;
- public static final byte ITEM_Float = 2;
- public static final byte ITEM_Double = 3;
- public static final byte ITEM_Long = 4;
- public static final byte ITEM_Null = 5;
- public static final byte ITEM_InitObject = 6;
- public static final byte ITEM_Object = 7;
- public static final byte ITEM_NewObject = 8;
-
- private static final String[] ITEM_NAMES = {
- "Bogus", "Integer", "Float", "Double", "Long",
- "Null", "InitObject", "Object", "NewObject"
- };
-
- /**
- *
- * @param index
- * @return the item name
- * @since 6.0
- */
- public static String getItemName(final int index) {
- return ITEM_NAMES[index];
- }
-
- /** Constants used to identify StackMapEntry types.
- *
- * For those types which can specify a range, the
- * constant names the lowest value.
- */
- public static final int SAME_FRAME = 0;
- public static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64;
- public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247;
- public static final int CHOP_FRAME = 248;
- public static final int SAME_FRAME_EXTENDED = 251;
- public static final int APPEND_FRAME = 252;
- public static final int FULL_FRAME = 255;
-
- /** Constants that define the maximum value of
- * those constants which store ranges. */
-
- public static final int SAME_FRAME_MAX = 63;
- public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_MAX = 127;
- public static final int CHOP_FRAME_MAX = 250;
- public static final int APPEND_FRAME_MAX = 254;
-
-
- // Constants defining the behavior of the Method Handles (JVMS �5.4.3.5)
-
- public static final byte REF_getField = 1;
- public static final byte REF_getStatic = 2;
- public static final byte REF_putField = 3;
- public static final byte REF_putStatic = 4;
- public static final byte REF_invokeVirtual = 5;
- public static final byte REF_invokeStatic = 6;
- public static final byte REF_invokeSpecial = 7;
- public static final byte REF_newInvokeSpecial = 8;
- public static final byte REF_invokeInterface = 9;
-
- /**
- * The names of the reference_kinds of a CONSTANT_MethodHandle_info.
- */
- private static final String[] METHODHANDLE_NAMES = {
- "", "getField", "getStatic", "putField", "putStatic", "invokeVirtual",
- "invokeStatic", "invokeSpecial", "newInvokeSpecial", "invokeInterface" };
-
- /**
- *
- * @param index
- * @return the method handle name
- * @since 6.0
- */
- public static String getMethodHandleName(final int index) {
- return METHODHANDLE_NAMES[index];
- }
-
- private Const() { } // not instantiable
-
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/Constants.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/Constants.java
deleted file mode 100644
index 07ec9228..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/Constants.java
+++ /dev/null
@@ -1,1697 +0,0 @@
-/*
- * 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;
-
-/**
- * Constants for the project, mostly defined in the JVM specification.
- *
- * @deprecated (since 6.0) DO NOT USE - use Const instead
- */
-@Deprecated
-public interface Constants {
-
- /** Major version number of class files for Java 1.1.
- * @see #MINOR_1_1
- * */
- short MAJOR_1_1 = 45;
-
- /** Minor version number of class files for Java 1.1.
- * @see #MAJOR_1_1
- * */
- short MINOR_1_1 = 3;
-
- /** Major version number of class files for Java 1.2.
- * @see #MINOR_1_2
- * */
- short MAJOR_1_2 = 46;
-
- /** Minor version number of class files for Java 1.2.
- * @see #MAJOR_1_2
- * */
- short MINOR_1_2 = 0;
-
- /** Major version number of class files for Java 1.2.
- * @see #MINOR_1_2
- * */
- short MAJOR_1_3 = 47;
-
- /** Minor version number of class files for Java 1.3.
- * @see #MAJOR_1_3
- * */
- short MINOR_1_3 = 0;
-
- /** Major version number of class files for Java 1.3.
- * @see #MINOR_1_3
- * */
- short MAJOR_1_4 = 48;
-
- /** Minor version number of class files for Java 1.4.
- * @see #MAJOR_1_4
- * */
- short MINOR_1_4 = 0;
-
- /** Major version number of class files for Java 1.4.
- * @see #MINOR_1_4
- * */
- short MAJOR_1_5 = 49;
-
- /** Minor version number of class files for Java 1.5.
- * @see #MAJOR_1_5
- * */
- short MINOR_1_5 = 0;
-
-
- /** Default major version number. Class file is for Java 1.1.
- * @see #MAJOR_1_1
- * */
- short MAJOR = MAJOR_1_1;
-
- /** Default major version number. Class file is for Java 1.1.
- * @see #MAJOR_1_1
- * */
- short MINOR = MINOR_1_1;
-
- /** Maximum value for an unsigned short.
- */
- int MAX_SHORT = 65535; // 2^16 - 1
-
- /** Maximum value for an unsigned byte.
- */
- int MAX_BYTE = 255; // 2^8 - 1
-
- /** One of the access flags for fields, methods, or classes.
- *
- * @see
- * Flag definitions for Fields in the Java Virtual Machine Specification (Java SE 8 Edition).
- * @see
- * Flag definitions for Methods in the Java Virtual Machine Specification (Java SE 8 Edition).
- * @see
- * Flag definitions for Classes in the Java Virtual Machine Specification (Java SE 8 Edition).
- */
- short ACC_PUBLIC = 0x0001;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_PRIVATE = 0x0002;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_PROTECTED = 0x0004;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_STATIC = 0x0008;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_FINAL = 0x0010;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_SYNCHRONIZED = 0x0020;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_VOLATILE = 0x0040;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_BRIDGE = 0x0040;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_TRANSIENT = 0x0080;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_VARARGS = 0x0080;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_NATIVE = 0x0100;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_INTERFACE = 0x0200;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_ABSTRACT = 0x0400;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_STRICT = 0x0800;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_SYNTHETIC = 0x1000;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_ANNOTATION = 0x2000;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_ENUM = 0x4000;
-
- // Applies to classes compiled by new compilers only
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short ACC_SUPER = 0x0020;
-
- /** One of the access flags for fields, methods, or classes.
- * @see #ACC_PUBLIC
- */
- short MAX_ACC_FLAG = ACC_ENUM;
-
- /** The names of the access flags. */
- String[] ACCESS_NAMES = {
- "public", "private", "protected", "static", "final", "synchronized",
- "volatile", "transient", "native", "interface", "abstract", "strictfp",
- "synthetic", "annotation", "enum"
- };
-
- /** Marks a constant pool entry as type UTF-8. */
- byte CONSTANT_Utf8 = 1;
-
- /** Marks a constant pool entry as type Integer. */
- byte CONSTANT_Integer = 3;
-
- /** Marks a constant pool entry as type Float. */
- byte CONSTANT_Float = 4;
-
- /** Marks a constant pool entry as type Long. */
- byte CONSTANT_Long = 5;
-
- /** Marks a constant pool entry as type Double. */
- byte CONSTANT_Double = 6;
-
- /** Marks a constant pool entry as a Class. */
- byte CONSTANT_Class = 7;
-
- /** Marks a constant pool entry as a Field Reference. */
- byte CONSTANT_Fieldref = 9;
-
- /** Marks a constant pool entry as type String. */
- byte CONSTANT_String = 8;
-
- /** Marks a constant pool entry as a Method Reference. */
- byte CONSTANT_Methodref = 10;
-
- /** Marks a constant pool entry as an Interface Method Reference. */
- byte CONSTANT_InterfaceMethodref = 11;
-
- /** Marks a constant pool entry as a name and type. */
- byte CONSTANT_NameAndType = 12;
-
- /** The names of the types of entries in a constant pool. */
- String[] CONSTANT_NAMES = {
- "", "CONSTANT_Utf8", "", "CONSTANT_Integer",
- "CONSTANT_Float", "CONSTANT_Long", "CONSTANT_Double",
- "CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref",
- "CONSTANT_Methodref", "CONSTANT_InterfaceMethodref",
- "CONSTANT_NameAndType" };
-
- /** The name of the static initializer, also called "class
- * initialization method" or "interface initialization
- * method". This is "<clinit>".
- */
- String STATIC_INITIALIZER_NAME = "";
-
- /** The name of every constructor method in a class, also called
- * "instance initialization method". This is "<init>".
- */
- String CONSTRUCTOR_NAME = "";
-
- /** The names of the interfaces implemented by arrays */
- String[] INTERFACES_IMPLEMENTED_BY_ARRAYS = {"java.lang.Cloneable", "java.io.Serializable"};
-
- /**
- * One of the limitations of the Java Virtual Machine.
- * @see
- * The Java Virtual Machine Specification, Second Edition, page 152, chapter 4.10.
- */
- int MAX_CP_ENTRIES = 65535;
-
- /**
- * One of the limitations of the Java Virtual Machine.
- * @see
- * The Java Virtual Machine Specification, Second Edition, page 152, chapter 4.10.
- */
- int MAX_CODE_SIZE = 65536; //bytes
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short NOP = 0;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ACONST_NULL = 1;
-
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_M1 = 2;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_0 = 3;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_1 = 4;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_2 = 5;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_3 = 6;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_4 = 7;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ICONST_5 = 8;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LCONST_0 = 9;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LCONST_1 = 10;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FCONST_0 = 11;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FCONST_1 = 12;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FCONST_2 = 13;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DCONST_0 = 14;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DCONST_1 = 15;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short BIPUSH = 16;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short SIPUSH = 17;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LDC = 18;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LDC_W = 19;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LDC2_W = 20;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ILOAD = 21;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LLOAD = 22;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FLOAD = 23;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DLOAD = 24;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ALOAD = 25;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ILOAD_0 = 26;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ILOAD_1 = 27;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ILOAD_2 = 28;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ILOAD_3 = 29;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LLOAD_0 = 30;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LLOAD_1 = 31;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LLOAD_2 = 32;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LLOAD_3 = 33;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FLOAD_0 = 34;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FLOAD_1 = 35;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FLOAD_2 = 36;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FLOAD_3 = 37;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DLOAD_0 = 38;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DLOAD_1 = 39;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DLOAD_2 = 40;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DLOAD_3 = 41;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ALOAD_0 = 42;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ALOAD_1 = 43;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ALOAD_2 = 44;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ALOAD_3 = 45;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IALOAD = 46;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LALOAD = 47;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FALOAD = 48;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DALOAD = 49;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short AALOAD = 50;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short BALOAD = 51;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short CALOAD = 52;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short SALOAD = 53;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISTORE = 54;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSTORE = 55;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FSTORE = 56;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DSTORE = 57;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ASTORE = 58;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISTORE_0 = 59;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISTORE_1 = 60;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISTORE_2 = 61;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISTORE_3 = 62;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSTORE_0 = 63;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSTORE_1 = 64;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSTORE_2 = 65;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSTORE_3 = 66;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FSTORE_0 = 67;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FSTORE_1 = 68;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FSTORE_2 = 69;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FSTORE_3 = 70;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DSTORE_0 = 71;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DSTORE_1 = 72;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DSTORE_2 = 73;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DSTORE_3 = 74;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ASTORE_0 = 75;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ASTORE_1 = 76;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ASTORE_2 = 77;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ASTORE_3 = 78;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IASTORE = 79;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LASTORE = 80;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FASTORE = 81;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DASTORE = 82;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short AASTORE = 83;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short BASTORE = 84;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short CASTORE = 85;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short SASTORE = 86;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short POP = 87;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short POP2 = 88;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DUP = 89;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DUP_X1 = 90;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DUP_X2 = 91;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DUP2 = 92;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DUP2_X1 = 93;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DUP2_X2 = 94;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short SWAP = 95;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IADD = 96;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LADD = 97;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FADD = 98;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DADD = 99;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISUB = 100;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSUB = 101;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FSUB = 102;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DSUB = 103;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IMUL = 104;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LMUL = 105;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FMUL = 106;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DMUL = 107;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IDIV = 108;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LDIV = 109;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FDIV = 110;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DDIV = 111;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IREM = 112;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LREM = 113;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FREM = 114;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DREM = 115;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INEG = 116;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LNEG = 117;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FNEG = 118;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DNEG = 119;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISHL = 120;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSHL = 121;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ISHR = 122;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LSHR = 123;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IUSHR = 124;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LUSHR = 125;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IAND = 126;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LAND = 127;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IOR = 128;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LOR = 129;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IXOR = 130;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LXOR = 131;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IINC = 132;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short I2L = 133;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short I2F = 134;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short I2D = 135;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short L2I = 136;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short L2F = 137;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short L2D = 138;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short F2I = 139;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short F2L = 140;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short F2D = 141;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short D2I = 142;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short D2L = 143;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short D2F = 144;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short I2B = 145;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INT2BYTE = 145; // Old notion
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short I2C = 146;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INT2CHAR = 146; // Old notion
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short I2S = 147;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INT2SHORT = 147; // Old notion
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LCMP = 148;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FCMPL = 149;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FCMPG = 150;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DCMPL = 151;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DCMPG = 152;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFEQ = 153;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFNE = 154;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFLT = 155;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFGE = 156;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFGT = 157;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFLE = 158;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ICMPEQ = 159;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ICMPNE = 160;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ICMPLT = 161;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ICMPGE = 162;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ICMPGT = 163;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ICMPLE = 164;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ACMPEQ = 165;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IF_ACMPNE = 166;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short GOTO = 167;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short JSR = 168;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short RET = 169;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short TABLESWITCH = 170;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LOOKUPSWITCH = 171;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IRETURN = 172;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short LRETURN = 173;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short FRETURN = 174;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short DRETURN = 175;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ARETURN = 176;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short RETURN = 177;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short GETSTATIC = 178;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short PUTSTATIC = 179;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short GETFIELD = 180;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short PUTFIELD = 181;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INVOKEVIRTUAL = 182;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INVOKESPECIAL = 183;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INVOKENONVIRTUAL = 183; // Old name in JDK 1.0
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INVOKESTATIC = 184;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INVOKEINTERFACE = 185;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INVOKEDYNAMIC = 186;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short NEW = 187;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short NEWARRAY = 188;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ANEWARRAY = 189;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ARRAYLENGTH = 190;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short ATHROW = 191;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short CHECKCAST = 192;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short INSTANCEOF = 193;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short MONITORENTER = 194;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short MONITOREXIT = 195;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short WIDE = 196;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short MULTIANEWARRAY = 197;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFNULL = 198;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short IFNONNULL = 199;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short GOTO_W = 200;
- /** Java VM opcode.
- * @see
- * Opcode definitions in The Java Virtual Machine Specification */
- short JSR_W = 201;
-
- /** JVM internal opcode.
- * @see
- * Reserved opcodes in the Java Virtual Machine Specification */
- short BREAKPOINT = 202;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short LDC_QUICK = 203;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short LDC_W_QUICK = 204;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short LDC2_W_QUICK = 205;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short GETFIELD_QUICK = 206;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short PUTFIELD_QUICK = 207;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short GETFIELD2_QUICK = 208;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short PUTFIELD2_QUICK = 209;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short GETSTATIC_QUICK = 210;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short PUTSTATIC_QUICK = 211;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short GETSTATIC2_QUICK = 212;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short PUTSTATIC2_QUICK = 213;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKEVIRTUAL_QUICK = 214;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKENONVIRTUAL_QUICK = 215;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKESUPER_QUICK = 216;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKESTATIC_QUICK = 217;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKEINTERFACE_QUICK = 218;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKEVIRTUALOBJECT_QUICK = 219;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short NEW_QUICK = 221;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short ANEWARRAY_QUICK = 222;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short MULTIANEWARRAY_QUICK = 223;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short CHECKCAST_QUICK = 224;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INSTANCEOF_QUICK = 225;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short INVOKEVIRTUAL_QUICK_W = 226;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short GETFIELD_QUICK_W = 227;
- /** JVM internal opcode.
- * @see
- * Specification of _quick opcodes in the Java Virtual Machine Specification (version 1)
- * @see
- * Why the _quick opcodes were removed from the second version of the Java Virtual Machine Specification. */
- short PUTFIELD_QUICK_W = 228;
- /** JVM internal opcode.
- * @see
- * Reserved opcodes in the Java Virtual Machine Specification */
- short IMPDEP1 = 254;
- /** JVM internal opcode.
- * @see
- * Reserved opcodes in the Java Virtual Machine Specification */
- short IMPDEP2 = 255;
-
- /**
- * BCEL virtual instruction for pushing an arbitrary data type onto the stack. Will be converted to the appropriate JVM
- * opcode when the class is dumped.
- */
- short PUSH = 4711;
- /**
- * BCEL virtual instruction for either LOOKUPSWITCH or TABLESWITCH. Will be converted to the appropriate JVM
- * opcode when the class is dumped.
- */
- short SWITCH = 4712;
-
- /** Illegal opcode. */
- short UNDEFINED = -1;
- /** Illegal opcode. */
- short UNPREDICTABLE = -2;
- /** Illegal opcode. */
- short RESERVED = -3;
- /** Mnemonic for an illegal opcode. */
- String ILLEGAL_OPCODE = "";
- /** Mnemonic for an illegal type. */
- String ILLEGAL_TYPE = "";
-
- /** Boolean data type. */
- byte T_BOOLEAN = 4;
- /** Char data type. */
- byte T_CHAR = 5;
- /** Float data type. */
- byte T_FLOAT = 6;
- /** Double data type. */
- byte T_DOUBLE = 7;
- /** Byte data type. */
- byte T_BYTE = 8;
- /** Short data type. */
- byte T_SHORT = 9;
- /** Int data type. */
- byte T_INT = 10;
- /** Long data type. */
- byte T_LONG = 11;
-
- /** Void data type (non-standard). */
- byte T_VOID = 12; // Non-standard
- /** Array data type. */
- byte T_ARRAY = 13;
- /** Object data type. */
- byte T_OBJECT = 14;
- /** Reference data type (deprecated). */
- byte T_REFERENCE = 14; // Deprecated
- /** Unknown data type. */
- byte T_UNKNOWN = 15;
- /** Address data type. */
- byte T_ADDRESS = 16;
-
- /** The primitive type names corresponding to the T_XX constants,
- * e.g., TYPE_NAMES[T_INT] = "int"
- */
- String[] TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "boolean", "char", "float", "double", "byte", "short", "int", "long",
- "void", "array", "object", "unknown", "address"
- };
-
- /** The primitive class names corresponding to the T_XX constants,
- * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
- */
- String[] CLASS_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "java.lang.Boolean", "java.lang.Character", "java.lang.Float",
- "java.lang.Double", "java.lang.Byte", "java.lang.Short",
- "java.lang.Integer", "java.lang.Long", "java.lang.Void",
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
-
- /** The signature characters corresponding to primitive types,
- * e.g., SHORT_TYPE_NAMES[T_INT] = "I"
- */
- String[] SHORT_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "Z", "C", "F", "D", "B", "S", "I", "J",
- "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
-
- /**
- * Number of byte code operands for each opcode, i.e., number of bytes after the tag byte
- * itself. Indexed by opcode, so NO_OF_OPERANDS[BIPUSH] = the number of operands for a bipush
- * instruction.
- */
- short[] NO_OF_OPERANDS = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/,
- 0/*iconst_1*/, 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/,
- 0/*iconst_5*/, 0/*lconst_0*/, 0/*lconst_1*/, 0/*fconst_0*/,
- 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/, 0/*dconst_1*/,
- 1/*bipush*/, 2/*sipush*/, 1/*ldc*/, 2/*ldc_w*/, 2/*ldc2_w*/,
- 1/*iload*/, 1/*lload*/, 1/*fload*/, 1/*dload*/, 1/*aload*/,
- 0/*iload_0*/, 0/*iload_1*/, 0/*iload_2*/, 0/*iload_3*/,
- 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/,
- 0/*fload_0*/, 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/,
- 0/*dload_0*/, 0/*dload_1*/, 0/*dload_2*/, 0/*dload_3*/,
- 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/,
- 0/*iaload*/, 0/*laload*/, 0/*faload*/, 0/*daload*/,
- 0/*aaload*/, 0/*baload*/, 0/*caload*/, 0/*saload*/,
- 1/*istore*/, 1/*lstore*/, 1/*fstore*/, 1/*dstore*/,
- 1/*astore*/, 0/*istore_0*/, 0/*istore_1*/, 0/*istore_2*/,
- 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/, 0/*lstore_2*/,
- 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/,
- 0/*dstore_3*/, 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/,
- 0/*astore_3*/, 0/*iastore*/, 0/*lastore*/, 0/*fastore*/,
- 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/,
- 0/*sastore*/, 0/*pop*/, 0/*pop2*/, 0/*dup*/, 0/*dup_x1*/,
- 0/*dup_x2*/, 0/*dup2*/, 0/*dup2_x1*/, 0/*dup2_x2*/, 0/*swap*/,
- 0/*iadd*/, 0/*ladd*/, 0/*fadd*/, 0/*dadd*/, 0/*isub*/,
- 0/*lsub*/, 0/*fsub*/, 0/*dsub*/, 0/*imul*/, 0/*lmul*/,
- 0/*fmul*/, 0/*dmul*/, 0/*idiv*/, 0/*ldiv*/, 0/*fdiv*/,
- 0/*ddiv*/, 0/*irem*/, 0/*lrem*/, 0/*frem*/, 0/*drem*/,
- 0/*ineg*/, 0/*lneg*/, 0/*fneg*/, 0/*dneg*/, 0/*ishl*/,
- 0/*lshl*/, 0/*ishr*/, 0/*lshr*/, 0/*iushr*/, 0/*lushr*/,
- 0/*iand*/, 0/*land*/, 0/*ior*/, 0/*lor*/, 0/*ixor*/, 0/*lxor*/,
- 2/*iinc*/, 0/*i2l*/, 0/*i2f*/, 0/*i2d*/, 0/*l2i*/, 0/*l2f*/,
- 0/*l2d*/, 0/*f2i*/, 0/*f2l*/, 0/*f2d*/, 0/*d2i*/, 0/*d2l*/,
- 0/*d2f*/, 0/*i2b*/, 0/*i2c*/, 0/*i2s*/, 0/*lcmp*/, 0/*fcmpl*/,
- 0/*fcmpg*/, 0/*dcmpl*/, 0/*dcmpg*/, 2/*ifeq*/, 2/*ifne*/,
- 2/*iflt*/, 2/*ifge*/, 2/*ifgt*/, 2/*ifle*/, 2/*if_icmpeq*/,
- 2/*if_icmpne*/, 2/*if_icmplt*/, 2/*if_icmpge*/, 2/*if_icmpgt*/,
- 2/*if_icmple*/, 2/*if_acmpeq*/, 2/*if_acmpne*/, 2/*goto*/,
- 2/*jsr*/, 1/*ret*/, UNPREDICTABLE/*tableswitch*/, UNPREDICTABLE/*lookupswitch*/,
- 0/*ireturn*/, 0/*lreturn*/, 0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/,
- 2/*getstatic*/, 2/*putstatic*/, 2/*getfield*/,
- 2/*putfield*/, 2/*invokevirtual*/, 2/*invokespecial*/, 2/*invokestatic*/,
- 4/*invokeinterface*/, 4/*invokedynamic*/, 2/*new*/,
- 1/*newarray*/, 2/*anewarray*/,
- 0/*arraylength*/, 0/*athrow*/, 2/*checkcast*/,
- 2/*instanceof*/, 0/*monitorenter*/,
- 0/*monitorexit*/, UNPREDICTABLE/*wide*/, 3/*multianewarray*/,
- 2/*ifnull*/, 2/*ifnonnull*/, 4/*goto_w*/,
- 4/*jsr_w*/, 0/*breakpoint*/, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, RESERVED/*impdep1*/, RESERVED/*impdep2*/
- };
-
- /**
- * How the byte code operands are to be interpreted for each opcode.
- * Indexed by opcode. TYPE_OF_OPERANDS[ILOAD] = an array of shorts
- * describing the data types for the instruction.
- */
- short[][] TYPE_OF_OPERANDS = {
- {}/*nop*/, {}/*aconst_null*/, {}/*iconst_m1*/, {}/*iconst_0*/,
- {}/*iconst_1*/, {}/*iconst_2*/, {}/*iconst_3*/, {}/*iconst_4*/,
- {}/*iconst_5*/, {}/*lconst_0*/, {}/*lconst_1*/, {}/*fconst_0*/,
- {}/*fconst_1*/, {}/*fconst_2*/, {}/*dconst_0*/, {}/*dconst_1*/,
- {T_BYTE}/*bipush*/, {T_SHORT}/*sipush*/, {T_BYTE}/*ldc*/,
- {T_SHORT}/*ldc_w*/, {T_SHORT}/*ldc2_w*/,
- {T_BYTE}/*iload*/, {T_BYTE}/*lload*/, {T_BYTE}/*fload*/,
- {T_BYTE}/*dload*/, {T_BYTE}/*aload*/, {}/*iload_0*/,
- {}/*iload_1*/, {}/*iload_2*/, {}/*iload_3*/, {}/*lload_0*/,
- {}/*lload_1*/, {}/*lload_2*/, {}/*lload_3*/, {}/*fload_0*/,
- {}/*fload_1*/, {}/*fload_2*/, {}/*fload_3*/, {}/*dload_0*/,
- {}/*dload_1*/, {}/*dload_2*/, {}/*dload_3*/, {}/*aload_0*/,
- {}/*aload_1*/, {}/*aload_2*/, {}/*aload_3*/, {}/*iaload*/,
- {}/*laload*/, {}/*faload*/, {}/*daload*/, {}/*aaload*/,
- {}/*baload*/, {}/*caload*/, {}/*saload*/, {T_BYTE}/*istore*/,
- {T_BYTE}/*lstore*/, {T_BYTE}/*fstore*/, {T_BYTE}/*dstore*/,
- {T_BYTE}/*astore*/, {}/*istore_0*/, {}/*istore_1*/,
- {}/*istore_2*/, {}/*istore_3*/, {}/*lstore_0*/, {}/*lstore_1*/,
- {}/*lstore_2*/, {}/*lstore_3*/, {}/*fstore_0*/, {}/*fstore_1*/,
- {}/*fstore_2*/, {}/*fstore_3*/, {}/*dstore_0*/, {}/*dstore_1*/,
- {}/*dstore_2*/, {}/*dstore_3*/, {}/*astore_0*/, {}/*astore_1*/,
- {}/*astore_2*/, {}/*astore_3*/, {}/*iastore*/, {}/*lastore*/,
- {}/*fastore*/, {}/*dastore*/, {}/*aastore*/, {}/*bastore*/,
- {}/*castore*/, {}/*sastore*/, {}/*pop*/, {}/*pop2*/, {}/*dup*/,
- {}/*dup_x1*/, {}/*dup_x2*/, {}/*dup2*/, {}/*dup2_x1*/,
- {}/*dup2_x2*/, {}/*swap*/, {}/*iadd*/, {}/*ladd*/, {}/*fadd*/,
- {}/*dadd*/, {}/*isub*/, {}/*lsub*/, {}/*fsub*/, {}/*dsub*/,
- {}/*imul*/, {}/*lmul*/, {}/*fmul*/, {}/*dmul*/, {}/*idiv*/,
- {}/*ldiv*/, {}/*fdiv*/, {}/*ddiv*/, {}/*irem*/, {}/*lrem*/,
- {}/*frem*/, {}/*drem*/, {}/*ineg*/, {}/*lneg*/, {}/*fneg*/,
- {}/*dneg*/, {}/*ishl*/, {}/*lshl*/, {}/*ishr*/, {}/*lshr*/,
- {}/*iushr*/, {}/*lushr*/, {}/*iand*/, {}/*land*/, {}/*ior*/,
- {}/*lor*/, {}/*ixor*/, {}/*lxor*/, {T_BYTE, T_BYTE}/*iinc*/,
- {}/*i2l*/, {}/*i2f*/, {}/*i2d*/, {}/*l2i*/, {}/*l2f*/, {}/*l2d*/,
- {}/*f2i*/, {}/*f2l*/, {}/*f2d*/, {}/*d2i*/, {}/*d2l*/, {}/*d2f*/,
- {}/*i2b*/, {}/*i2c*/,{}/*i2s*/, {}/*lcmp*/, {}/*fcmpl*/,
- {}/*fcmpg*/, {}/*dcmpl*/, {}/*dcmpg*/, {T_SHORT}/*ifeq*/,
- {T_SHORT}/*ifne*/, {T_SHORT}/*iflt*/, {T_SHORT}/*ifge*/,
- {T_SHORT}/*ifgt*/, {T_SHORT}/*ifle*/, {T_SHORT}/*if_icmpeq*/,
- {T_SHORT}/*if_icmpne*/, {T_SHORT}/*if_icmplt*/,
- {T_SHORT}/*if_icmpge*/, {T_SHORT}/*if_icmpgt*/,
- {T_SHORT}/*if_icmple*/, {T_SHORT}/*if_acmpeq*/,
- {T_SHORT}/*if_acmpne*/, {T_SHORT}/*goto*/, {T_SHORT}/*jsr*/,
- {T_BYTE}/*ret*/, {}/*tableswitch*/, {}/*lookupswitch*/,
- {}/*ireturn*/, {}/*lreturn*/, {}/*freturn*/, {}/*dreturn*/,
- {}/*areturn*/, {}/*return*/, {T_SHORT}/*getstatic*/,
- {T_SHORT}/*putstatic*/, {T_SHORT}/*getfield*/,
- {T_SHORT}/*putfield*/, {T_SHORT}/*invokevirtual*/,
- {T_SHORT}/*invokespecial*/, {T_SHORT}/*invokestatic*/,
- {T_SHORT, T_BYTE, T_BYTE}/*invokeinterface*/, {T_SHORT, T_BYTE, T_BYTE}/*invokedynamic*/,
- {T_SHORT}/*new*/, {T_BYTE}/*newarray*/,
- {T_SHORT}/*anewarray*/, {}/*arraylength*/, {}/*athrow*/,
- {T_SHORT}/*checkcast*/, {T_SHORT}/*instanceof*/,
- {}/*monitorenter*/, {}/*monitorexit*/, {T_BYTE}/*wide*/,
- {T_SHORT, T_BYTE}/*multianewarray*/, {T_SHORT}/*ifnull*/,
- {T_SHORT}/*ifnonnull*/, {T_INT}/*goto_w*/, {T_INT}/*jsr_w*/,
- {}/*breakpoint*/, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}/*impdep1*/, {}/*impdep2*/
- };
-
- /**
- * Names of opcodes. Indexed by opcode. OPCODE_NAMES[ALOAD] = "aload".
- */
- String[] OPCODE_NAMES = {
- "nop", "aconst_null", "iconst_m1", "iconst_0", "iconst_1",
- "iconst_2", "iconst_3", "iconst_4", "iconst_5", "lconst_0",
- "lconst_1", "fconst_0", "fconst_1", "fconst_2", "dconst_0",
- "dconst_1", "bipush", "sipush", "ldc", "ldc_w", "ldc2_w", "iload",
- "lload", "fload", "dload", "aload", "iload_0", "iload_1", "iload_2",
- "iload_3", "lload_0", "lload_1", "lload_2", "lload_3", "fload_0",
- "fload_1", "fload_2", "fload_3", "dload_0", "dload_1", "dload_2",
- "dload_3", "aload_0", "aload_1", "aload_2", "aload_3", "iaload",
- "laload", "faload", "daload", "aaload", "baload", "caload", "saload",
- "istore", "lstore", "fstore", "dstore", "astore", "istore_0",
- "istore_1", "istore_2", "istore_3", "lstore_0", "lstore_1",
- "lstore_2", "lstore_3", "fstore_0", "fstore_1", "fstore_2",
- "fstore_3", "dstore_0", "dstore_1", "dstore_2", "dstore_3",
- "astore_0", "astore_1", "astore_2", "astore_3", "iastore", "lastore",
- "fastore", "dastore", "aastore", "bastore", "castore", "sastore",
- "pop", "pop2", "dup", "dup_x1", "dup_x2", "dup2", "dup2_x1",
- "dup2_x2", "swap", "iadd", "ladd", "fadd", "dadd", "isub", "lsub",
- "fsub", "dsub", "imul", "lmul", "fmul", "dmul", "idiv", "ldiv",
- "fdiv", "ddiv", "irem", "lrem", "frem", "drem", "ineg", "lneg",
- "fneg", "dneg", "ishl", "lshl", "ishr", "lshr", "iushr", "lushr",
- "iand", "land", "ior", "lor", "ixor", "lxor", "iinc", "i2l", "i2f",
- "i2d", "l2i", "l2f", "l2d", "f2i", "f2l", "f2d", "d2i", "d2l", "d2f",
- "i2b", "i2c", "i2s", "lcmp", "fcmpl", "fcmpg",
- "dcmpl", "dcmpg", "ifeq", "ifne", "iflt", "ifge", "ifgt", "ifle",
- "if_icmpeq", "if_icmpne", "if_icmplt", "if_icmpge", "if_icmpgt",
- "if_icmple", "if_acmpeq", "if_acmpne", "goto", "jsr", "ret",
- "tableswitch", "lookupswitch", "ireturn", "lreturn", "freturn",
- "dreturn", "areturn", "return", "getstatic", "putstatic", "getfield",
- "putfield", "invokevirtual", "invokespecial", "invokestatic",
- "invokeinterface", "invokedynamic", "new", "newarray", "anewarray",
- "arraylength", "athrow", "checkcast", "instanceof", "monitorenter",
- "monitorexit", "wide", "multianewarray", "ifnull", "ifnonnull",
- "goto_w", "jsr_w", "breakpoint", ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, "impdep1", "impdep2"
- };
-
- /**
- * Number of words consumed on operand stack by instructions.
- * Indexed by opcode. CONSUME_STACK[FALOAD] = number of words
- * consumed from the stack by a faload instruction.
- */
- int[] CONSUME_STACK = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/, 0/*iconst_1*/,
- 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/, 0/*iconst_5*/, 0/*lconst_0*/,
- 0/*lconst_1*/, 0/*fconst_0*/, 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/,
- 0/*dconst_1*/, 0/*bipush*/, 0/*sipush*/, 0/*ldc*/, 0/*ldc_w*/, 0/*ldc2_w*/, 0/*iload*/,
- 0/*lload*/, 0/*fload*/, 0/*dload*/, 0/*aload*/, 0/*iload_0*/, 0/*iload_1*/, 0/*iload_2*/,
- 0/*iload_3*/, 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/, 0/*fload_0*/,
- 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/, 0/*dload_0*/, 0/*dload_1*/, 0/*dload_2*/,
- 0/*dload_3*/, 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/, 2/*iaload*/,
- 2/*laload*/, 2/*faload*/, 2/*daload*/, 2/*aaload*/, 2/*baload*/, 2/*caload*/, 2/*saload*/,
- 1/*istore*/, 2/*lstore*/, 1/*fstore*/, 2/*dstore*/, 1/*astore*/, 1/*istore_0*/,
- 1/*istore_1*/, 1/*istore_2*/, 1/*istore_3*/, 2/*lstore_0*/, 2/*lstore_1*/,
- 2/*lstore_2*/, 2/*lstore_3*/, 1/*fstore_0*/, 1/*fstore_1*/, 1/*fstore_2*/,
- 1/*fstore_3*/, 2/*dstore_0*/, 2/*dstore_1*/, 2/*dstore_2*/, 2/*dstore_3*/,
- 1/*astore_0*/, 1/*astore_1*/, 1/*astore_2*/, 1/*astore_3*/, 3/*iastore*/, 4/*lastore*/,
- 3/*fastore*/, 4/*dastore*/, 3/*aastore*/, 3/*bastore*/, 3/*castore*/, 3/*sastore*/,
- 1/*pop*/, 2/*pop2*/, 1/*dup*/, 2/*dup_x1*/, 3/*dup_x2*/, 2/*dup2*/, 3/*dup2_x1*/,
- 4/*dup2_x2*/, 2/*swap*/, 2/*iadd*/, 4/*ladd*/, 2/*fadd*/, 4/*dadd*/, 2/*isub*/, 4/*lsub*/,
- 2/*fsub*/, 4/*dsub*/, 2/*imul*/, 4/*lmul*/, 2/*fmul*/, 4/*dmul*/, 2/*idiv*/, 4/*ldiv*/,
- 2/*fdiv*/, 4/*ddiv*/, 2/*irem*/, 4/*lrem*/, 2/*frem*/, 4/*drem*/, 1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 2/*ishl*/, 3/*lshl*/, 2/*ishr*/, 3/*lshr*/, 2/*iushr*/, 3/*lushr*/,
- 2/*iand*/, 4/*land*/, 2/*ior*/, 4/*lor*/, 2/*ixor*/, 4/*lxor*/, 0/*iinc*/,
- 1/*i2l*/, 1/*i2f*/, 1/*i2d*/, 2/*l2i*/, 2/*l2f*/, 2/*l2d*/, 1/*f2i*/, 1/*f2l*/,
- 1/*f2d*/, 2/*d2i*/, 2/*d2l*/, 2/*d2f*/, 1/*i2b*/, 1/*i2c*/, 1/*i2s*/,
- 4/*lcmp*/, 2/*fcmpl*/, 2/*fcmpg*/, 4/*dcmpl*/, 4/*dcmpg*/, 1/*ifeq*/, 1/*ifne*/,
- 1/*iflt*/, 1/*ifge*/, 1/*ifgt*/, 1/*ifle*/, 2/*if_icmpeq*/, 2/*if_icmpne*/, 2/*if_icmplt*/,
- 2 /*if_icmpge*/, 2/*if_icmpgt*/, 2/*if_icmple*/, 2/*if_acmpeq*/, 2/*if_acmpne*/,
- 0/*goto*/, 0/*jsr*/, 0/*ret*/, 1/*tableswitch*/, 1/*lookupswitch*/, 1/*ireturn*/,
- 2/*lreturn*/, 1/*freturn*/, 2/*dreturn*/, 1/*areturn*/, 0/*return*/, 0/*getstatic*/,
- UNPREDICTABLE/*putstatic*/, 1/*getfield*/, UNPREDICTABLE/*putfield*/,
- UNPREDICTABLE/*invokevirtual*/, UNPREDICTABLE/*invokespecial*/,
- UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNPREDICTABLE/*invokedynamic*/, 0/*new*/, 1/*newarray*/, 1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/, 1/*monitorenter*/,
- 1/*monitorexit*/, 0/*wide*/, UNPREDICTABLE/*multianewarray*/, 1/*ifnull*/, 1/*ifnonnull*/,
- 0/*goto_w*/, 0/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
-
- /**
- * Number of words produced onto operand stack by instructions.
- * Indexed by opcode. CONSUME_STACK[DALOAD] = number of words
- * consumed from the stack by a daload instruction.
- */
- int[] PRODUCE_STACK = {
- 0/*nop*/, 1/*aconst_null*/, 1/*iconst_m1*/, 1/*iconst_0*/, 1/*iconst_1*/,
- 1/*iconst_2*/, 1/*iconst_3*/, 1/*iconst_4*/, 1/*iconst_5*/, 2/*lconst_0*/,
- 2/*lconst_1*/, 1/*fconst_0*/, 1/*fconst_1*/, 1/*fconst_2*/, 2/*dconst_0*/,
- 2/*dconst_1*/, 1/*bipush*/, 1/*sipush*/, 1/*ldc*/, 1/*ldc_w*/, 2/*ldc2_w*/, 1/*iload*/,
- 2/*lload*/, 1/*fload*/, 2/*dload*/, 1/*aload*/, 1/*iload_0*/, 1/*iload_1*/, 1/*iload_2*/,
- 1/*iload_3*/, 2/*lload_0*/, 2/*lload_1*/, 2/*lload_2*/, 2/*lload_3*/, 1/*fload_0*/,
- 1/*fload_1*/, 1/*fload_2*/, 1/*fload_3*/, 2/*dload_0*/, 2/*dload_1*/, 2/*dload_2*/,
- 2/*dload_3*/, 1/*aload_0*/, 1/*aload_1*/, 1/*aload_2*/, 1/*aload_3*/, 1/*iaload*/,
- 2/*laload*/, 1/*faload*/, 2/*daload*/, 1/*aaload*/, 1/*baload*/, 1/*caload*/, 1/*saload*/,
- 0/*istore*/, 0/*lstore*/, 0/*fstore*/, 0/*dstore*/, 0/*astore*/, 0/*istore_0*/,
- 0/*istore_1*/, 0/*istore_2*/, 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/,
- 0/*lstore_2*/, 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/, 0/*dstore_3*/,
- 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/, 0/*astore_3*/, 0/*iastore*/, 0/*lastore*/,
- 0/*fastore*/, 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/, 0/*sastore*/,
- 0/*pop*/, 0/*pop2*/, 2/*dup*/, 3/*dup_x1*/, 4/*dup_x2*/, 4/*dup2*/, 5/*dup2_x1*/,
- 6/*dup2_x2*/, 2/*swap*/, 1/*iadd*/, 2/*ladd*/, 1/*fadd*/, 2/*dadd*/, 1/*isub*/, 2/*lsub*/,
- 1/*fsub*/, 2/*dsub*/, 1/*imul*/, 2/*lmul*/, 1/*fmul*/, 2/*dmul*/, 1/*idiv*/, 2/*ldiv*/,
- 1/*fdiv*/, 2/*ddiv*/, 1/*irem*/, 2/*lrem*/, 1/*frem*/, 2/*drem*/, 1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 1/*ishl*/, 2/*lshl*/, 1/*ishr*/, 2/*lshr*/, 1/*iushr*/, 2/*lushr*/,
- 1/*iand*/, 2/*land*/, 1/*ior*/, 2/*lor*/, 1/*ixor*/, 2/*lxor*/,
- 0/*iinc*/, 2/*i2l*/, 1/*i2f*/, 2/*i2d*/, 1/*l2i*/, 1/*l2f*/, 2/*l2d*/, 1/*f2i*/,
- 2/*f2l*/, 2/*f2d*/, 1/*d2i*/, 2/*d2l*/, 1/*d2f*/,
- 1/*i2b*/, 1/*i2c*/, 1/*i2s*/, 1/*lcmp*/, 1/*fcmpl*/, 1/*fcmpg*/,
- 1/*dcmpl*/, 1/*dcmpg*/, 0/*ifeq*/, 0/*ifne*/, 0/*iflt*/, 0/*ifge*/, 0/*ifgt*/, 0/*ifle*/,
- 0/*if_icmpeq*/, 0/*if_icmpne*/, 0/*if_icmplt*/, 0/*if_icmpge*/, 0/*if_icmpgt*/,
- 0/*if_icmple*/, 0/*if_acmpeq*/, 0/*if_acmpne*/, 0/*goto*/, 1/*jsr*/, 0/*ret*/,
- 0/*tableswitch*/, 0/*lookupswitch*/, 0/*ireturn*/, 0/*lreturn*/, 0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/, UNPREDICTABLE/*getstatic*/, 0/*putstatic*/,
- UNPREDICTABLE/*getfield*/, 0/*putfield*/, UNPREDICTABLE/*invokevirtual*/,
- UNPREDICTABLE/*invokespecial*/, UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNPREDICTABLE/*invokedynamic*/, 1/*new*/, 1/*newarray*/, 1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/, 0/*monitorenter*/,
- 0/*monitorexit*/, 0/*wide*/, 1/*multianewarray*/, 0/*ifnull*/, 0/*ifnonnull*/,
- 0/*goto_w*/, 1/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
-
- /** Attributes and their corresponding names.
- */
- byte ATTR_UNKNOWN = -1;
- byte ATTR_SOURCE_FILE = 0;
- byte ATTR_CONSTANT_VALUE = 1;
- byte ATTR_CODE = 2;
- byte ATTR_EXCEPTIONS = 3;
- byte ATTR_LINE_NUMBER_TABLE = 4;
- byte ATTR_LOCAL_VARIABLE_TABLE = 5;
- byte ATTR_INNER_CLASSES = 6;
- byte ATTR_SYNTHETIC = 7;
- byte ATTR_DEPRECATED = 8;
- byte ATTR_PMG = 9;
- byte ATTR_SIGNATURE = 10;
- byte ATTR_STACK_MAP = 11;
- byte ATTR_RUNTIMEVISIBLE_ANNOTATIONS = 12;
- byte ATTR_RUNTIMEINVISIBLE_ANNOTATIONS = 13;
- byte ATTR_RUNTIMEVISIBLE_PARAMETER_ANNOTATIONS = 14;
- byte ATTR_RUNTIMEINVISIBLE_PARAMETER_ANNOTATIONS = 15;
- byte ATTR_ANNOTATION_DEFAULT = 16;
-
- short KNOWN_ATTRIBUTES = 12;//should be 17
-
-
- // TODO: mutable public array!!
- String[] ATTRIBUTE_NAMES = {
- "SourceFile", "ConstantValue", "Code", "Exceptions",
- "LineNumberTable", "LocalVariableTable",
- "InnerClasses", "Synthetic", "Deprecated",
- "PMGClass", "Signature", "StackMap",
- "RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations",
- "RuntimeVisibleParameterAnnotations", "RuntimeInvisibleParameterAnnotations",
- "AnnotationDefault"
- };
-
- /** Constants used in the StackMap attribute.
- */
- byte ITEM_Bogus = 0;
- byte ITEM_Integer = 1;
- byte ITEM_Float = 2;
- byte ITEM_Double = 3;
- byte ITEM_Long = 4;
- byte ITEM_Null = 5;
- byte ITEM_InitObject = 6;
- byte ITEM_Object = 7;
- byte ITEM_NewObject = 8;
-
- String[] ITEM_NAMES = {
- "Bogus", "Integer", "Float", "Double", "Long",
- "Null", "InitObject", "Object", "NewObject"
- };
-
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/ExceptionConst.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/ExceptionConst.java
deleted file mode 100644
index ed2c4268..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/ExceptionConst.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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;
-
-/**
- * Exception constants.
- * @since 6.0 (intended to replace the InstructionConstant interface)
- */
-public final class ExceptionConst {
-
- /**
- * The mother of all exceptions
- */
- public static final Class THROWABLE = Throwable.class;
-
- /**
- * Super class of any run-time exception
- */
- public static final Class RUNTIME_EXCEPTION = RuntimeException.class;
-
- /**
- * Super class of any linking exception (aka Linkage Error)
- */
- public static final Class LINKING_EXCEPTION = LinkageError.class;
-
- /**
- * Linking Exceptions
- */
- public static final Class CLASS_CIRCULARITY_ERROR = ClassCircularityError.class;
- public static final Class CLASS_FORMAT_ERROR = ClassFormatError.class;
- public static final Class EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
- public static final Class INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
- public static final Class ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
- public static final Class ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
- public static final Class INSTANTIATION_ERROR = InstantiationError.class;
- public static final Class NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
- public static final Class NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
- public static final Class NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
- public static final Class UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
- public static final Class VERIFY_ERROR = VerifyError.class;
- /* UnsupportedClassVersionError is new in JDK 1.2 */
-// public static final Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
-
- /**
- * Run-Time Exceptions
- */
- public static final Class NULL_POINTER_EXCEPTION = NullPointerException.class;
- public static final Class ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
- = ArrayIndexOutOfBoundsException.class;
- public static final Class ARITHMETIC_EXCEPTION = ArithmeticException.class;
- public static final Class NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
- public static final Class CLASS_CAST_EXCEPTION = ClassCastException.class;
- public static final Class ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
-
- /**
- * Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual
- * Machine Specification
- */
- private static final Class>[] EXCS_CLASS_AND_INTERFACE_RESOLUTION = {
- NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
- EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR
- }; // Chapter 5.1
- private static final Class>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {
- NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR
- }; // Chapter 5.2
- private static final Class>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
- private static final Class>[] EXCS_STRING_RESOLUTION = new Class[0];
- // Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
- private static final Class>[] EXCS_ARRAY_EXCEPTION = {
- NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
- };
-
- /**
- * Enum corresponding to the various Exception Class arrays,
- * used by {@link ExceptionConst#createExceptions(EXCS, Class...)}
- */
- public enum EXCS {
- EXCS_CLASS_AND_INTERFACE_RESOLUTION,
- EXCS_FIELD_AND_METHOD_RESOLUTION,
- EXCS_INTERFACE_METHOD_RESOLUTION,
- EXCS_STRING_RESOLUTION,
- EXCS_ARRAY_EXCEPTION,
- }
-
- // helper method to merge exception class arrays
- private static Class>[] mergeExceptions(final Class>[] input, final Class> ... extraClasses) {
- final int extraLen = extraClasses == null ? 0 : extraClasses.length;
- final Class>[] excs = new Class>[input.length + extraLen];
- System.arraycopy(input, 0, excs, 0, input.length);
- if (extraLen > 0) {
- System.arraycopy(extraClasses, 0, excs, input.length, extraLen);
- }
- return excs;
- }
-
- /**
- * Creates a copy of the specified Exception Class array combined with any additional Exception classes.
- * @param type the basic array type
- * @param extraClasses additional classes, if any
- * @return the merged array
- */
- public static Class>[] createExceptions(final EXCS type, final Class> ... extraClasses) {
- switch (type) {
- case EXCS_CLASS_AND_INTERFACE_RESOLUTION:
- return mergeExceptions(EXCS_CLASS_AND_INTERFACE_RESOLUTION, extraClasses);
- case EXCS_ARRAY_EXCEPTION:
- return mergeExceptions(EXCS_ARRAY_EXCEPTION, extraClasses);
- case EXCS_FIELD_AND_METHOD_RESOLUTION:
- return mergeExceptions(EXCS_FIELD_AND_METHOD_RESOLUTION, extraClasses);
- case EXCS_INTERFACE_METHOD_RESOLUTION:
- return mergeExceptions(EXCS_INTERFACE_METHOD_RESOLUTION, extraClasses);
- case EXCS_STRING_RESOLUTION:
- return mergeExceptions(EXCS_STRING_RESOLUTION, extraClasses);
- default:
- throw new AssertionError("Cannot happen; unexpected enum value: " + type);
- }
- }
-
-
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/ExceptionConstants.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/ExceptionConstants.java
deleted file mode 100644
index ea0e1ce6..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/ExceptionConstants.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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;
-
-/**
- * Exception constants.
- *
- * @deprecated (since 6.0) DO NOT USE - use ExceptionConst instead
- */
-@Deprecated
-public interface ExceptionConstants {
-
- /** The mother of all exceptions
- */
- Class THROWABLE = Throwable.class;
- /** Super class of any run-time exception
- */
- Class RUNTIME_EXCEPTION = RuntimeException.class;
- /** Super class of any linking exception (aka Linkage Error)
- */
- Class LINKING_EXCEPTION = LinkageError.class;
- /** Linking Exceptions
- */
- Class CLASS_CIRCULARITY_ERROR = ClassCircularityError.class;
- Class CLASS_FORMAT_ERROR = ClassFormatError.class;
- Class EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
- Class INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
- Class ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
- Class ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
- Class INSTANTIATION_ERROR = InstantiationError.class;
- Class NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
- Class NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
- Class NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
- Class UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
- Class VERIFY_ERROR = VerifyError.class;
- /* UnsupportedClassVersionError is new in JDK 1.2 */
-// Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
- /** Run-Time Exceptions
- */
- Class NULL_POINTER_EXCEPTION = NullPointerException.class;
- Class ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
- = ArrayIndexOutOfBoundsException.class;
- Class ARITHMETIC_EXCEPTION = ArithmeticException.class;
- Class NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
- Class CLASS_CAST_EXCEPTION = ClassCastException.class;
- Class ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
-
- /**
- * Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual
- * Machine Specification
- * @deprecated Do not use these arrays, use the static methods in the ExceptionConst implementation class instead
- */
- @Deprecated
- Class>[] EXCS_CLASS_AND_INTERFACE_RESOLUTION = {
- NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
- EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR
- }; // Chapter 5.1
- @Deprecated
- Class>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {
- NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR
- }; // Chapter 5.2
- @Deprecated
- Class>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
- @Deprecated
- Class>[] EXCS_STRING_RESOLUTION = new Class[0];
- // Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
- @Deprecated
- Class>[] EXCS_ARRAY_EXCEPTION = {
- NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
- };
-
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/Repository.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/Repository.java
deleted file mode 100644
index edcccb4a..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/Repository.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * 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;
-
-import java.io.IOException;
-
-import org.apache.bcel.classfile.JavaClass;
-import org.apache.bcel.util.ClassPath;
-import org.apache.bcel.util.SyntheticRepository;
-
-/**
- * The repository maintains informations about class interdependencies, e.g.,
- * whether a class is a sub-class of another. Delegates actual class loading
- * to SyntheticRepository with current class path by default.
- *
- * @see org.apache.bcel.util.Repository
- * @see SyntheticRepository
- *
- */
-public abstract class Repository {
-
- private static org.apache.bcel.util.Repository repository = SyntheticRepository.getInstance();
-
-
- /**
- * @return currently used repository instance
- */
- public static org.apache.bcel.util.Repository getRepository() {
- return repository;
- }
-
-
- /**
- * Sets repository instance to be used for class loading
- */
- public static void setRepository( final org.apache.bcel.util.Repository rep ) {
- repository = rep;
- }
-
-
- /**
- * Lookups class somewhere found on your CLASSPATH, or whereever the
- * repository instance looks for it.
- *
- * @return class object for given fully qualified class name
- * @throws ClassNotFoundException if the class could not be found or
- * parsed correctly
- */
- public static JavaClass lookupClass( final String class_name ) throws ClassNotFoundException {
- return repository.loadClass(class_name);
- }
-
-
- /**
- * Tries to find class source using the internal repository instance.
- *
- * @see Class
- * @return JavaClass object for given runtime class
- * @throws ClassNotFoundException if the class could not be found or
- * parsed correctly
- */
- public static JavaClass lookupClass( final Class> clazz ) throws ClassNotFoundException {
- return repository.loadClass(clazz);
- }
-
-
- /**
- * @return class file object for given Java class by looking on the
- * system class path; returns null if the class file can't be
- * found
- */
- public static ClassPath.ClassFile lookupClassFile( final String class_name ) {
- try {
- final ClassPath path = repository.getClassPath();
- if (path == null) {
- return null;
- }
- return path.getClassFile(class_name);
- } catch (final IOException e) {
- return null;
- }
- }
-
-
- /**
- * Clears the repository.
- */
- public static void clearCache() {
- repository.clear();
- }
-
-
- /**
- * Adds clazz to repository if there isn't an equally named class already in there.
- *
- * @return old entry in repository
- */
- public static JavaClass addClass( final JavaClass clazz ) {
- final JavaClass old = repository.findClass(clazz.getClassName());
- repository.storeClass(clazz);
- return old;
- }
-
-
- /**
- * Removes class with given (fully qualified) name from repository.
- */
- public static void removeClass( final String clazz ) {
- repository.removeClass(repository.findClass(clazz));
- }
-
-
- /**
- * Removes given class from repository.
- */
- public static void removeClass( final JavaClass clazz ) {
- repository.removeClass(clazz);
- }
-
-
- /**
- * @return list of super classes of clazz in ascending order, i.e.,
- * Object is always the last element
- * @throws ClassNotFoundException if any of the superclasses can't be found
- */
- public static JavaClass[] getSuperClasses( final JavaClass clazz ) throws ClassNotFoundException {
- return clazz.getSuperClasses();
- }
-
-
- /**
- * @return list of super classes of clazz in ascending order, i.e.,
- * Object is always the last element.
- * @throws ClassNotFoundException if the named class or any of its
- * superclasses can't be found
- */
- public static JavaClass[] getSuperClasses( final String class_name ) throws ClassNotFoundException {
- final JavaClass jc = lookupClass(class_name);
- return getSuperClasses(jc);
- }
-
-
- /**
- * @return all interfaces implemented by class and its super
- * classes and the interfaces that those interfaces extend, and so on.
- * (Some people call this a transitive hull).
- * @throws ClassNotFoundException if any of the class's
- * superclasses or superinterfaces can't be found
- */
- public static JavaClass[] getInterfaces( final JavaClass clazz ) throws ClassNotFoundException {
- return clazz.getAllInterfaces();
- }
-
-
- /**
- * @return all interfaces implemented by class and its super
- * classes and the interfaces that extend those interfaces, and so on
- * @throws ClassNotFoundException if the named class can't be found,
- * or if any of its superclasses or superinterfaces can't be found
- */
- public static JavaClass[] getInterfaces( final String class_name ) throws ClassNotFoundException {
- return getInterfaces(lookupClass(class_name));
- }
-
-
- /**
- * Equivalent to runtime "instanceof" operator.
- * @return true, if clazz is an instance of super_class
- * @throws ClassNotFoundException if any superclasses or superinterfaces
- * of clazz can't be found
- */
- public static boolean instanceOf( final JavaClass clazz, final JavaClass super_class )
- throws ClassNotFoundException {
- return clazz.instanceOf(super_class);
- }
-
-
- /**
- * @return true, if clazz is an instance of super_class
- * @throws ClassNotFoundException if either clazz or super_class
- * can't be found
- */
- public static boolean instanceOf( final String clazz, final String super_class )
- throws ClassNotFoundException {
- return instanceOf(lookupClass(clazz), lookupClass(super_class));
- }
-
-
- /**
- * @return true, if clazz is an instance of super_class
- * @throws ClassNotFoundException if super_class can't be found
- */
- public static boolean instanceOf( final JavaClass clazz, final String super_class )
- throws ClassNotFoundException {
- return instanceOf(clazz, lookupClass(super_class));
- }
-
-
- /**
- * @return true, if clazz is an instance of super_class
- * @throws ClassNotFoundException if clazz can't be found
- */
- public static boolean instanceOf( final String clazz, final JavaClass super_class )
- throws ClassNotFoundException {
- return instanceOf(lookupClass(clazz), super_class);
- }
-
-
- /**
- * @return true, if clazz is an implementation of interface inter
- * @throws ClassNotFoundException if any superclasses or superinterfaces
- * of clazz can't be found
- */
- public static boolean implementationOf( final JavaClass clazz, final JavaClass inter )
- throws ClassNotFoundException {
- return clazz.implementationOf(inter);
- }
-
-
- /**
- * @return true, if clazz is an implementation of interface inter
- * @throws ClassNotFoundException if clazz, inter, or any superclasses
- * or superinterfaces of clazz can't be found
- */
- public static boolean implementationOf( final String clazz, final String inter )
- throws ClassNotFoundException {
- return implementationOf(lookupClass(clazz), lookupClass(inter));
- }
-
-
- /**
- * @return true, if clazz is an implementation of interface inter
- * @throws ClassNotFoundException if inter or any superclasses
- * or superinterfaces of clazz can't be found
- */
- public static boolean implementationOf( final JavaClass clazz, final String inter )
- throws ClassNotFoundException {
- return implementationOf(clazz, lookupClass(inter));
- }
-
-
- /**
- * @return true, if clazz is an implementation of interface inter
- * @throws ClassNotFoundException if clazz or any superclasses or
- * superinterfaces of clazz can't be found
- */
- public static boolean implementationOf( final String clazz, final JavaClass inter )
- throws ClassNotFoundException {
- return implementationOf(lookupClass(clazz), inter);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AccessFlags.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AccessFlags.java
deleted file mode 100644
index 2d03a763..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AccessFlags.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * 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.apache.bcel.Const;
-
-/**
- * Super class for all objects that have modifiers like private, final, ... I.e. classes, fields, and methods.
- *
- */
-public abstract class AccessFlags {
-
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected int access_flags; // TODO not used externally at present
-
- public AccessFlags() {
- }
-
- /**
- * @param a
- * inital access flags
- */
- public AccessFlags(final int a) {
- access_flags = a;
- }
-
- /**
- * @return Access flags of the object aka. "modifiers".
- */
- public final int getAccessFlags() {
- return access_flags;
- }
-
- /**
- * @return Access flags of the object aka. "modifiers".
- */
- public final int getModifiers() {
- return access_flags;
- }
-
- /**
- * Set access flags aka "modifiers".
- *
- * @param access_flags
- * Access flags of the object.
- */
- public final void setAccessFlags(final int access_flags) {
- this.access_flags = access_flags;
- }
-
- /**
- * Set access flags aka "modifiers".
- *
- * @param access_flags
- * Access flags of the object.
- */
- public final void setModifiers(final int access_flags) {
- setAccessFlags(access_flags);
- }
-
- private void setFlag(final int flag, final boolean set) {
- if ((access_flags & flag) != 0) { // Flag is set already
- if (!set) {
- access_flags ^= flag;
- }
- } else { // Flag not set
- if (set) {
- access_flags |= flag;
- }
- }
- }
-
- public final void isPublic(final boolean flag) {
- setFlag(Const.ACC_PUBLIC, flag);
- }
-
- public final boolean isPublic() {
- return (access_flags & Const.ACC_PUBLIC) != 0;
- }
-
- public final void isPrivate(final boolean flag) {
- setFlag(Const.ACC_PRIVATE, flag);
- }
-
- public final boolean isPrivate() {
- return (access_flags & Const.ACC_PRIVATE) != 0;
- }
-
- public final void isProtected(final boolean flag) {
- setFlag(Const.ACC_PROTECTED, flag);
- }
-
- public final boolean isProtected() {
- return (access_flags & Const.ACC_PROTECTED) != 0;
- }
-
- public final void isStatic(final boolean flag) {
- setFlag(Const.ACC_STATIC, flag);
- }
-
- public final boolean isStatic() {
- return (access_flags & Const.ACC_STATIC) != 0;
- }
-
- public final void isFinal(final boolean flag) {
- setFlag(Const.ACC_FINAL, flag);
- }
-
- public final boolean isFinal() {
- return (access_flags & Const.ACC_FINAL) != 0;
- }
-
- public final void isSynchronized(final boolean flag) {
- setFlag(Const.ACC_SYNCHRONIZED, flag);
- }
-
- public final boolean isSynchronized() {
- return (access_flags & Const.ACC_SYNCHRONIZED) != 0;
- }
-
- public final void isVolatile(final boolean flag) {
- setFlag(Const.ACC_VOLATILE, flag);
- }
-
- public final boolean isVolatile() {
- return (access_flags & Const.ACC_VOLATILE) != 0;
- }
-
- public final void isTransient(final boolean flag) {
- setFlag(Const.ACC_TRANSIENT, flag);
- }
-
- public final boolean isTransient() {
- return (access_flags & Const.ACC_TRANSIENT) != 0;
- }
-
- public final void isNative(final boolean flag) {
- setFlag(Const.ACC_NATIVE, flag);
- }
-
- public final boolean isNative() {
- return (access_flags & Const.ACC_NATIVE) != 0;
- }
-
- public final void isInterface(final boolean flag) {
- setFlag(Const.ACC_INTERFACE, flag);
- }
-
- public final boolean isInterface() {
- return (access_flags & Const.ACC_INTERFACE) != 0;
- }
-
- public final void isAbstract(final boolean flag) {
- setFlag(Const.ACC_ABSTRACT, flag);
- }
-
- public final boolean isAbstract() {
- return (access_flags & Const.ACC_ABSTRACT) != 0;
- }
-
- public final void isStrictfp(final boolean flag) {
- setFlag(Const.ACC_STRICT, flag);
- }
-
- public final boolean isStrictfp() {
- return (access_flags & Const.ACC_STRICT) != 0;
- }
-
- public final void isSynthetic(final boolean flag) {
- setFlag(Const.ACC_SYNTHETIC, flag);
- }
-
- public final boolean isSynthetic() {
- return (access_flags & Const.ACC_SYNTHETIC) != 0;
- }
-
- public final void isAnnotation(final boolean flag) {
- setFlag(Const.ACC_ANNOTATION, flag);
- }
-
- public final boolean isAnnotation() {
- return (access_flags & Const.ACC_ANNOTATION) != 0;
- }
-
- public final void isEnum(final boolean flag) {
- setFlag(Const.ACC_ENUM, flag);
- }
-
- public final boolean isEnum() {
- return (access_flags & Const.ACC_ENUM) != 0;
- }
-
- public final void isVarArgs(final boolean flag) {
- setFlag(Const.ACC_VARARGS, flag);
- }
-
- public final boolean isVarArgs() {
- return (access_flags & Const.ACC_VARARGS) != 0;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationDefault.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationDefault.java
deleted file mode 100644
index c0efe4c2..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationDefault.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * Represents the default value of a annotation for a method info
- *
- * @since 6.0
- */
-public class AnnotationDefault extends Attribute {
-
- private ElementValue defaultValue;
-
- /**
- * @param name_index Index pointing to the name Code
- * @param length Content length in bytes
- * @param input Input stream
- * @param constant_pool Array of constants
- */
- AnnotationDefault(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
- this(name_index, length, (ElementValue) null, constant_pool);
- defaultValue = ElementValue.readElementValue(input, constant_pool);
- }
-
- /**
- * @param name_index Index pointing to the name Code
- * @param length Content length in bytes
- * @param defaultValue the annotation's default value
- * @param constant_pool Array of constants
- */
- public AnnotationDefault(final int name_index, final int length, final ElementValue defaultValue, final ConstantPool constant_pool) {
- super(Const.ATTR_ANNOTATION_DEFAULT, name_index, length, constant_pool);
- this.defaultValue = defaultValue;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept(final Visitor v) {
- v.visitAnnotationDefault(this);
- }
-
- /**
- * @param defaultValue the default value of this methodinfo's annotation
- */
- public final void setDefaultValue(final ElementValue defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- /**
- * @return the default value
- */
- public final ElementValue getDefaultValue() {
- return defaultValue;
- }
-
- @Override
- public Attribute copy(final ConstantPool _constant_pool) {
- return (Attribute) clone();
- }
-
- @Override
- public final void dump(final DataOutputStream dos) throws IOException {
- super.dump(dos);
- defaultValue.dump(dos);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationElementValue.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationElementValue.java
deleted file mode 100644
index 86e68ea1..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationElementValue.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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 java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * @since 6.0
- */
-public class AnnotationElementValue extends ElementValue
-{
- // For annotation element values, this is the annotation
- private final AnnotationEntry annotationEntry;
-
- public AnnotationElementValue(final int type, final AnnotationEntry annotationEntry,
- final ConstantPool cpool)
- {
- super(type, cpool);
- if (type != ANNOTATION) {
- throw new IllegalArgumentException(
- "Only element values of type annotation can be built with this ctor - type specified: " + type);
- }
- this.annotationEntry = annotationEntry;
- }
-
- @Override
- public void dump(final DataOutputStream dos) throws IOException
- {
- dos.writeByte(super.getType()); // u1 type of value (ANNOTATION == '@')
- annotationEntry.dump(dos);
- }
-
- @Override
- public String stringifyValue()
- {
- return annotationEntry.toString();
- }
-
- @Override
- public String toString()
- {
- return stringifyValue();
- }
-
- public AnnotationEntry getAnnotationEntry()
- {
- return annotationEntry;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationEntry.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationEntry.java
deleted file mode 100644
index 6540e2d0..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AnnotationEntry.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.bcel.Const;
-
-/**
- * represents one annotation in the annotation table
- *
- * @since 6.0
- */
-public class AnnotationEntry implements Node {
-
- private final int typeIndex;
- private final ConstantPool constantPool;
- private final boolean isRuntimeVisible;
-
- private List elementValuePairs;
-
- /*
- * Factory method to create an AnnotionEntry from a DataInput
- *
- * @param input
- * @param constantPool
- * @param isRuntimeVisible
- * @return the entry
- * @throws IOException
- */
- public static AnnotationEntry read(final DataInput input, final ConstantPool constant_pool, final boolean isRuntimeVisible) throws IOException {
-
- final AnnotationEntry annotationEntry = new AnnotationEntry(input.readUnsignedShort(), constant_pool, isRuntimeVisible);
- final int num_element_value_pairs = input.readUnsignedShort();
- annotationEntry.elementValuePairs = new ArrayList<>();
- for (int i = 0; i < num_element_value_pairs; i++) {
- annotationEntry.elementValuePairs.add(
- new ElementValuePair(input.readUnsignedShort(), ElementValue.readElementValue(input, constant_pool),
- constant_pool));
- }
- return annotationEntry;
- }
-
- public AnnotationEntry(final int type_index, final ConstantPool constant_pool, final boolean isRuntimeVisible) {
- this.typeIndex = type_index;
- this.constantPool = constant_pool;
- this.isRuntimeVisible = isRuntimeVisible;
- }
-
- public int getTypeIndex() {
- return typeIndex;
- }
-
- public ConstantPool getConstantPool() {
- return constantPool;
- }
-
- public boolean isRuntimeVisible() {
- return isRuntimeVisible;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
- * I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept(final Visitor v) {
- v.visitAnnotationEntry(this);
- }
-
- /**
- * @return the annotation type name
- */
- public String getAnnotationType() {
- final ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(typeIndex, Const.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return the annotation type index
- */
- public int getAnnotationTypeIndex() {
- return typeIndex;
- }
-
- /**
- * @return the number of element value pairs in this annotation entry
- */
- public final int getNumElementValuePairs() {
- return elementValuePairs.size();
- }
-
- /**
- * @return the element value pairs in this annotation entry
- */
- public ElementValuePair[] getElementValuePairs() {
- // TODO return List
- return elementValuePairs.toArray(new ElementValuePair[elementValuePairs.size()]);
- }
-
- public void dump(final DataOutputStream dos) throws IOException {
- dos.writeShort(typeIndex); // u2 index of type name in cpool
- dos.writeShort(elementValuePairs.size()); // u2 element_value pair
- // count
- for (final ElementValuePair envp : elementValuePairs) {
- envp.dump(dos);
- }
- }
-
- public void addElementNameValuePair(final ElementValuePair elementNameValuePair) {
- elementValuePairs.add(elementNameValuePair);
- }
-
- public String toShortString() {
- final StringBuilder result = new StringBuilder();
- result.append("@");
- result.append(getAnnotationType());
- final ElementValuePair[] evPairs = getElementValuePairs();
- if (evPairs.length > 0) {
- result.append("(");
- for (final ElementValuePair element : evPairs) {
- result.append(element.toShortString());
- }
- result.append(")");
- }
- return result.toString();
- }
-
- @Override
- public String toString() {
- return toShortString();
- }
-
- public static AnnotationEntry[] createAnnotationEntries(final Attribute[] attrs) {
- // Find attributes that contain annotation data
- final List accumulatedAnnotations = new ArrayList<>(attrs.length);
- for (final Attribute attribute : attrs) {
- if (attribute instanceof Annotations) {
- final Annotations runtimeAnnotations = (Annotations) attribute;
- Collections.addAll(accumulatedAnnotations, runtimeAnnotations.getAnnotationEntries());
- }
- }
- return accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Annotations.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Annotations.java
deleted file mode 100644
index 584cc5fa..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Annotations.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * base class for annotations
- *
- * @since 6.0
- */
-public abstract class Annotations extends Attribute {
-
- private AnnotationEntry[] annotationTable;
- private final boolean isRuntimeVisible;
-
- /**
- * @param annotation_type the subclass type of the annotation
- * @param name_index Index pointing to the name Code
- * @param length Content length in bytes
- * @param input Input stream
- * @param constant_pool Array of constants
- */
- Annotations(final byte annotation_type, final int name_index, final int length, final DataInput input,
- final ConstantPool constant_pool, final boolean isRuntimeVisible) throws IOException {
- this(annotation_type, name_index, length, (AnnotationEntry[]) null, constant_pool, isRuntimeVisible);
- final int annotation_table_length = input.readUnsignedShort();
- annotationTable = new AnnotationEntry[annotation_table_length];
- for (int i = 0; i < annotation_table_length; i++) {
- annotationTable[i] = AnnotationEntry.read(input, constant_pool, isRuntimeVisible);
- }
- }
-
- /**
- * @param annotationType the subclass type of the annotation
- * @param nameIndex Index pointing to the name Code
- * @param length Content length in bytes
- * @param annotationTable the actual annotations
- * @param constantPool Array of constants
- */
- public Annotations(final byte annotationType, final int nameIndex, final int length, final AnnotationEntry[] annotationTable,
- final ConstantPool constantPool, final boolean isRuntimeVisible) {
- super(annotationType, nameIndex, length, constantPool);
- this.annotationTable = annotationTable;
- this.isRuntimeVisible = isRuntimeVisible;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
- * I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept(final Visitor v) {
- v.visitAnnotation(this);
- }
-
- /**
- * @param annotationTable the entries to set in this annotation
- */
- public final void setAnnotationTable(final AnnotationEntry[] annotationTable) {
- this.annotationTable = annotationTable;
- }
-
- /**
- * returns the array of annotation entries in this annotation
- */
- public AnnotationEntry[] getAnnotationEntries() {
- return annotationTable;
- }
-
- /**
- * @return the number of annotation entries in this annotation
- */
- public final int getNumAnnotations() {
- if (annotationTable == null) {
- return 0;
- }
- return annotationTable.length;
- }
-
- public boolean isRuntimeVisible() {
- return isRuntimeVisible;
- }
-
- protected void writeAnnotations(final DataOutputStream dos) throws IOException {
- if (annotationTable == null) {
- return;
- }
- dos.writeShort(annotationTable.length);
- for (final AnnotationEntry element : annotationTable) {
- element.dump(dos);
- }
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ArrayElementValue.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ArrayElementValue.java
deleted file mode 100644
index 734a904d..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ArrayElementValue.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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 java.io.DataOutputStream;
-import java.io.IOException;
-
-/**
- * @since 6.0
- */
-public class ArrayElementValue extends ElementValue
-{
- // For array types, this is the array
- private final ElementValue[] elementValues;
-
- @Override
- public String toString()
- {
- final StringBuilder sb = new StringBuilder();
- sb.append("{");
- for (int i = 0; i < elementValues.length; i++)
- {
- sb.append(elementValues[i]);
- if ((i + 1) < elementValues.length) {
- sb.append(",");
- }
- }
- sb.append("}");
- return sb.toString();
- }
-
- public ArrayElementValue(final int type, final ElementValue[] datums, final ConstantPool cpool)
- {
- super(type, cpool);
- if (type != ARRAY) {
- throw new IllegalArgumentException(
- "Only element values of type array can be built with this ctor - type specified: " + type);
- }
- this.elementValues = datums;
- }
-
- @Override
- public void dump(final DataOutputStream dos) throws IOException
- {
- dos.writeByte(super.getType()); // u1 type of value (ARRAY == '[')
- dos.writeShort(elementValues.length);
- for (final ElementValue evalue : elementValues) {
- evalue.dump(dos);
- }
- }
-
- @Override
- public String stringifyValue()
- {
- final StringBuilder sb = new StringBuilder();
- sb.append("[");
- for (int i = 0; i < elementValues.length; i++)
- {
- sb.append(elementValues[i].stringifyValue());
- if ((i + 1) < elementValues.length) {
- sb.append(",");
- }
- }
- sb.append("]");
- return sb.toString();
- }
-
- public ElementValue[] getElementValuesArray()
- {
- return elementValues;
- }
-
- public int getElementValuesArraySize()
- {
- return elementValues.length;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Attribute.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Attribute.java
deleted file mode 100644
index 72e5c4e8..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Attribute.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.bcel.Const;
-
-/**
- * Abstract super class for Attribute objects. Currently the
- * ConstantValue, SourceFile, Code,
- * Exceptiontable, LineNumberTable,
- * LocalVariableTable, InnerClasses and
- * Synthetic attributes are supported. The Unknown
- * attribute stands for non-standard-attributes.
- *
- * @see ConstantValue
- * @see SourceFile
- * @see Code
- * @see Unknown
- * @see ExceptionTable
- * @see LineNumberTable
- * @see LocalVariableTable
- * @see InnerClasses
- * @see Synthetic
- * @see Deprecated
- * @see Signature
- */
-public abstract class Attribute implements Cloneable, Node {
-
- private static final boolean debug = Boolean.getBoolean(Attribute.class.getCanonicalName() + ".debug"); // Debugging on/off
-
- private static final Map readers = new HashMap<>();
-
- /**
- * Add an Attribute reader capable of parsing (user-defined) attributes
- * named "name". You should not add readers for the standard attributes such
- * as "LineNumberTable", because those are handled internally.
- *
- * @param name the name of the attribute as stored in the class file
- * @param r the reader object
- * @deprecated (6.0) Use {@link #addAttributeReader(String, UnknownAttributeReader)} instead
- */
- @java.lang.Deprecated
- public static void addAttributeReader(final String name, final AttributeReader r)
- {
- readers.put(name, r);
- }
-
- /**
- * Add an Attribute reader capable of parsing (user-defined) attributes
- * named "name". You should not add readers for the standard attributes such
- * as "LineNumberTable", because those are handled internally.
- *
- * @param name the name of the attribute as stored in the class file
- * @param r the reader object
- */
- public static void addAttributeReader(final String name, final UnknownAttributeReader r)
- {
- readers.put(name, r);
- }
-
- protected static void println(final String msg) {
- if (debug) {
- System.err.println(msg);
- }
- }
-
- /**
- * Class method reads one attribute from the input data stream. This method
- * must not be accessible from the outside. It is called by the Field and
- * Method constructor methods.
- *
- * @see Field
- * @see Method
- *
- * @param file Input stream
- * @param constant_pool Array of constants
- * @return Attribute
- * @throws IOException
- * @throws ClassFormatException
- * @since 6.0
- */
- public static Attribute readAttribute(final DataInput file, final ConstantPool constant_pool)
- throws IOException, ClassFormatException
- {
- byte tag = Const.ATTR_UNKNOWN; // Unknown attribute
- // Get class name from constant pool via `name_index' indirection
- final int name_index = file.readUnsignedShort();
- final ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index, Const.CONSTANT_Utf8);
- final String name = c.getBytes();
-
- // Length of data in bytes
- final int length = file.readInt();
-
- // Compare strings to find known attribute
- for (byte i = 0; i < Const.KNOWN_ATTRIBUTES; i++)
- {
- if (name.equals(Const.getAttributeName(i)))
- {
- tag = i; // found!
- break;
- }
- }
-
- // Call proper constructor, depending on `tag'
- switch (tag)
- {
- case Const.ATTR_UNKNOWN:
- final Object r = readers.get(name);
- if (r instanceof UnknownAttributeReader)
- {
- return ((UnknownAttributeReader) r).createAttribute(name_index, length, file, constant_pool);
- }
- return new Unknown(name_index, length, file, constant_pool);
- case Const.ATTR_CONSTANT_VALUE:
- return new ConstantValue(name_index, length, file, constant_pool);
- case Const.ATTR_SOURCE_FILE:
- return new SourceFile(name_index, length, file, constant_pool);
- case Const.ATTR_CODE:
- return new Code(name_index, length, file, constant_pool);
- case Const.ATTR_EXCEPTIONS:
- return new ExceptionTable(name_index, length, file, constant_pool);
- case Const.ATTR_LINE_NUMBER_TABLE:
- return new LineNumberTable(name_index, length, file, constant_pool);
- case Const.ATTR_LOCAL_VARIABLE_TABLE:
- return new LocalVariableTable(name_index, length, file, constant_pool);
- case Const.ATTR_INNER_CLASSES:
- return new InnerClasses(name_index, length, file, constant_pool);
- case Const.ATTR_SYNTHETIC:
- return new Synthetic(name_index, length, file, constant_pool);
- case Const.ATTR_DEPRECATED:
- return new Deprecated(name_index, length, file, constant_pool);
- case Const.ATTR_PMG:
- return new PMGClass(name_index, length, file, constant_pool);
- case Const.ATTR_SIGNATURE:
- return new Signature(name_index, length, file, constant_pool);
- case Const.ATTR_STACK_MAP:
- // old style stack map: unneeded for JDK5 and below;
- // illegal(?) for JDK6 and above. So just delete with a warning.
- println("Warning: Obsolete StackMap attribute ignored.");
- return new Unknown(name_index, length, file, constant_pool);
- case Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
- return new RuntimeVisibleAnnotations(name_index, length, file, constant_pool);
- case Const.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS:
- return new RuntimeInvisibleAnnotations(name_index, length, file, constant_pool);
- case Const.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
- return new RuntimeVisibleParameterAnnotations(name_index, length, file, constant_pool);
- case Const.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS:
- return new RuntimeInvisibleParameterAnnotations(name_index, length, file, constant_pool);
- case Const.ATTR_ANNOTATION_DEFAULT:
- return new AnnotationDefault(name_index, length, file, constant_pool);
- case Const.ATTR_LOCAL_VARIABLE_TYPE_TABLE:
- return new LocalVariableTypeTable(name_index, length, file, constant_pool);
- case Const.ATTR_ENCLOSING_METHOD:
- return new EnclosingMethod(name_index, length, file, constant_pool);
- case Const.ATTR_STACK_MAP_TABLE:
- // read new style stack map: StackMapTable. The rest of the code
- // calls this a StackMap for historical reasons.
- return new StackMap(name_index, length, file, constant_pool);
- case Const.ATTR_BOOTSTRAP_METHODS:
- return new BootstrapMethods(name_index, length, file, constant_pool);
- case Const.ATTR_METHOD_PARAMETERS:
- return new MethodParameters(name_index, length, file, constant_pool);
- case Const.ATTR_MODULE:
- return new Module(name_index, length, file, constant_pool);
- case Const.ATTR_MODULE_PACKAGES:
- return new ModulePackages(name_index, length, file, constant_pool);
- case Const.ATTR_MODULE_MAIN_CLASS:
- return new ModuleMainClass(name_index, length, file, constant_pool);
- case Const.ATTR_NEST_HOST:
- return new NestHost(name_index, length, file, constant_pool);
- case Const.ATTR_NEST_MEMBERS:
- return new NestMembers(name_index, length, file, constant_pool);
- default:
- // Never reached
- throw new IllegalStateException("Unrecognized attribute type tag parsed: " + tag);
- }
- }
-
- /**
- * Class method reads one attribute from the input data stream. This method
- * must not be accessible from the outside. It is called by the Field and
- * Method constructor methods.
- *
- * @see Field
- * @see Method
- *
- * @param file Input stream
- * @param constant_pool Array of constants
- * @return Attribute
- * @throws IOException
- * @throws ClassFormatException
- */
- public static Attribute readAttribute(final DataInputStream file, final ConstantPool constant_pool)
- throws IOException, ClassFormatException
- {
- return readAttribute((DataInput) file, constant_pool);
- }
-
- /**
- * Remove attribute reader
- *
- * @param name the name of the attribute as stored in the class file
- */
- public static void removeAttributeReader(final String name)
- {
- readers.remove(name);
- }
-
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected int name_index; // Points to attribute name in constant pool TODO make private (has getter & setter)
-
- /**
- * @deprecated (since 6.0) (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected int length; // Content length of attribute field TODO make private (has getter & setter)
-
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected byte tag; // Tag to distinguish subclasses TODO make private & final; supposed to be immutable
-
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected ConstantPool constant_pool; // TODO make private (has getter & setter)
-
- protected Attribute(final byte tag, final int name_index, final int length, final ConstantPool constant_pool)
- {
- this.tag = tag;
- this.name_index = name_index;
- this.length = length;
- this.constant_pool = constant_pool;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v
- * Visitor object
- */
- @Override
- public abstract void accept(Visitor v);
-
- /**
- * Use copy() if you want to have a deep copy(), i.e., with all references
- * copied correctly.
- *
- * @return shallow copy of this attribute
- */
- @Override
- public Object clone()
- {
- Attribute attr = null;
- try
- {
- attr = (Attribute) super.clone();
- }
- catch (final CloneNotSupportedException e)
- {
- throw new Error("Clone Not Supported"); // never happens
- }
- return attr;
- }
-
- /**
- * @return deep copy of this attribute
- */
- public abstract Attribute copy(ConstantPool _constant_pool);
-
- /**
- * Dump attribute to file stream in binary format.
- *
- * @param file
- * Output file stream
- * @throws IOException
- */
- public void dump(final DataOutputStream file) throws IOException
- {
- file.writeShort(name_index);
- file.writeInt(length);
- }
-
- /**
- * @return Constant pool used by this object.
- * @see ConstantPool
- */
- public final ConstantPool getConstantPool()
- {
- return constant_pool;
- }
-
- /**
- * @return Length of attribute field in bytes.
- */
- public final int getLength()
- {
- return length;
- }
-
- /**
- * @return Name of attribute
- * @since 6.0
- */
- public String getName()
- {
- final ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index, Const.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return Name index in constant pool of attribute name.
- */
- public final int getNameIndex()
- {
- return name_index;
- }
-
- /**
- * @return Tag of attribute, i.e., its type. Value may not be altered, thus there is no setTag() method.
- */
- public final byte getTag()
- {
- return tag;
- }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- * @see ConstantPool
- */
- public final void setConstantPool(final ConstantPool constant_pool)
- {
- this.constant_pool = constant_pool;
- }
-
- /**
- * @param length length in bytes.
- */
- public final void setLength(final int length)
- {
- this.length = length;
- }
-
- /**
- * @param name_index of attribute.
- */
- public final void setNameIndex(final int name_index)
- {
- this.name_index = name_index;
- }
-
- /**
- * @return attribute name.
- */
- @Override
- public String toString()
- {
- return Const.getAttributeName(tag);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AttributeReader.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AttributeReader.java
deleted file mode 100644
index 4993aaa6..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/AttributeReader.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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;
-
-/**
- * Unknown (non-standard) attributes may be read via user-defined factory
- * objects that can be registered with the Attribute.addAttributeReader
- * method. These factory objects should implement this interface.
-
- * @see Attribute
- *
- * @deprecated Use UnknownAttributeReader instead
- */
-@java.lang.Deprecated
-public interface AttributeReader {
-
- /**
- When this attribute reader is added via the static method
- Attribute.addAttributeReader, an attribute name is associated with it.
- As the class file parser parses attributes, it will call various
- AttributeReaders based on the name of the attributes it is
- constructing.
-
- @param name_index An index into the constant pool, indexing a
- ConstantUtf8 that represents the name of the attribute.
-
- @param length The length of the data contained in the attribute. This
- is written into the constant pool and should agree with what the
- factory expects the length to be.
-
- @param file This is the data input stream that the factory needs to read
- its data from.
-
- @param constant_pool This is the constant pool associated with the
- Attribute that we are constructing.
-
- @return The user-defined AttributeReader should take this data and use
- it to construct an attribute. In the case of errors, a null can be
- returned which will cause the parsing of the class file to fail.
-
- @see Attribute#addAttributeReader( String, AttributeReader )
- */
- Attribute createAttribute( int name_index, int length, java.io.DataInputStream file, ConstantPool constant_pool );
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/BootstrapMethod.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/BootstrapMethod.java
deleted file mode 100644
index 0835a659..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/BootstrapMethod.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.Arrays;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents a bootstrap method attribute, i.e., the bootstrap
- * method ref, the number of bootstrap arguments and an array of the
- * bootstrap arguments.
- *
- * @see
- * The class File Format : The BootstrapMethods Attribute
- * @since 6.0
- */
-public class BootstrapMethod implements Cloneable {
-
- /** Index of the CONSTANT_MethodHandle_info structure in the constant_pool table */
- private int bootstrapMethodRef;
-
- /** Array of references to the constant_pool table */
- private int[] bootstrapArguments;
-
-
- /**
- * Initialize from another object.
- */
- public BootstrapMethod(final BootstrapMethod c) {
- this(c.getBootstrapMethodRef(), c.getBootstrapArguments());
- }
-
- /**
- * Construct object from input stream.
- *
- * @param input Input stream
- * @throws IOException
- */
- BootstrapMethod(final DataInput input) throws IOException {
- this(input.readUnsignedShort(), input.readUnsignedShort());
-
- for (int i = 0; i < bootstrapArguments.length; i++) {
- bootstrapArguments[i] = input.readUnsignedShort();
- }
- }
-
- // helper method
- private BootstrapMethod(final int bootstrap_method_ref, final int num_bootstrap_arguments) {
- this(bootstrap_method_ref, new int[num_bootstrap_arguments]);
- }
-
- /**
- * @param bootstrapMethodRef int index into constant_pool of CONSTANT_MethodHandle
- * @param bootstrapArguments int[] indices into constant_pool of CONSTANT_[type]_info
- */
- public BootstrapMethod(final int bootstrapMethodRef, final int[] bootstrapArguments) {
- this.bootstrapMethodRef = bootstrapMethodRef;
- this.bootstrapArguments = bootstrapArguments;
- }
-
- /**
- * @return index into constant_pool of bootstrap_method
- */
- public int getBootstrapMethodRef() {
- return bootstrapMethodRef;
- }
-
- /**
- * @param bootstrapMethodRef int index into constant_pool of CONSTANT_MethodHandle
- */
- public void setBootstrapMethodRef(final int bootstrapMethodRef) {
- this.bootstrapMethodRef = bootstrapMethodRef;
- }
-
- /**
- * @return int[] of bootstrap_method indices into constant_pool of CONSTANT_[type]_info
- */
- public int[] getBootstrapArguments() {
- return bootstrapArguments;
- }
-
- /**
- * @return count of number of boostrap arguments
- */
- public int getNumBootstrapArguments() {
- return bootstrapArguments.length;
- }
-
- /**
- * @param bootstrapArguments int[] indices into constant_pool of CONSTANT_[type]_info
- */
- public void setBootstrapArguments(final int[] bootstrapArguments) {
- this.bootstrapArguments = bootstrapArguments;
- }
-
- /**
- * @return String representation.
- */
- @Override
- public final String toString() {
- return "BootstrapMethod(" + bootstrapMethodRef + ", " + bootstrapArguments.length + ", "
- + Arrays.toString(bootstrapArguments) + ")";
- }
-
- /**
- * @return Resolved string representation
- */
- public final String toString( final ConstantPool constantPool ) {
- final StringBuilder buf = new StringBuilder();
- String bootstrap_method_name;
- bootstrap_method_name = constantPool.constantToString(bootstrapMethodRef,
- Const.CONSTANT_MethodHandle);
- buf.append(Utility.compactClassName(bootstrap_method_name, false));
- final int num_bootstrap_arguments = bootstrapArguments.length;
- if (num_bootstrap_arguments > 0) {
- buf.append("\nMethod Arguments:");
- for (int i = 0; i < num_bootstrap_arguments; i++) {
- buf.append("\n ").append(i).append(": ");
- buf.append(constantPool.constantToString(constantPool.getConstant(bootstrapArguments[i])));
- }
- }
- return buf.toString();
- }
-
- /**
- * Dump object to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(final DataOutputStream file) throws IOException {
- file.writeShort(bootstrapMethodRef);
- file.writeShort(bootstrapArguments.length);
- for (final int bootstrap_argument : bootstrapArguments) {
- file.writeShort(bootstrap_argument);
- }
- }
-
- /**
- * @return deep copy of this object
- */
- public BootstrapMethod copy() {
- try {
- return (BootstrapMethod) clone();
- } catch (final CloneNotSupportedException e) {
- // TODO should this throw?
- }
- return null;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/BootstrapMethods.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/BootstrapMethods.java
deleted file mode 100644
index 3abe716b..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/BootstrapMethods.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents a BootstrapMethods attribute.
- *
- * @see
- * The class File Format : The BootstrapMethods Attribute
- * @since 6.0
- */
-public class BootstrapMethods extends Attribute {
-
- private BootstrapMethod[] bootstrapMethods; // TODO this could be made final (setter is not used)
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public BootstrapMethods(final BootstrapMethods c) {
- this(c.getNameIndex(), c.getLength(), c.getBootstrapMethods(), c.getConstantPool());
- }
-
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param bootstrapMethods array of bootstrap methods
- * @param constant_pool Array of constants
- */
- public BootstrapMethods(final int name_index, final int length, final BootstrapMethod[] bootstrapMethods, final ConstantPool constant_pool) {
- super(Const.ATTR_BOOTSTRAP_METHODS, name_index, length, constant_pool);
- this.bootstrapMethods = bootstrapMethods;
- }
-
- /**
- * Construct object from Input stream.
- *
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param input Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- BootstrapMethods(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
- this(name_index, length, (BootstrapMethod[]) null, constant_pool);
-
- final int num_bootstrap_methods = input.readUnsignedShort();
- bootstrapMethods = new BootstrapMethod[num_bootstrap_methods];
- for (int i = 0; i < num_bootstrap_methods; i++) {
- bootstrapMethods[i] = new BootstrapMethod(input);
- }
- }
-
- /**
- * @return array of bootstrap method "records"
- */
- public final BootstrapMethod[] getBootstrapMethods() {
- return bootstrapMethods;
- }
-
- /**
- * @param bootstrapMethods the array of bootstrap methods
- */
- public final void setBootstrapMethods(final BootstrapMethod[] bootstrapMethods) {
- this.bootstrapMethods = bootstrapMethods;
- }
-
- /**
- * @param v Visitor object
- */
- @Override
- public void accept(final Visitor v) {
- v.visitBootstrapMethods(this);
- }
-
- /**
- * @return deep copy of this attribute
- */
- @Override
- public BootstrapMethods copy(final ConstantPool _constant_pool) {
- final BootstrapMethods c = (BootstrapMethods) clone();
- c.bootstrapMethods = new BootstrapMethod[bootstrapMethods.length];
-
- for (int i = 0; i < bootstrapMethods.length; i++) {
- c.bootstrapMethods[i] = bootstrapMethods[i].copy();
- }
- c.setConstantPool(_constant_pool);
- return c;
- }
-
- /**
- * Dump bootstrap methods attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public final void dump(final DataOutputStream file) throws IOException {
- super.dump(file);
-
- file.writeShort(bootstrapMethods.length);
- for (final BootstrapMethod bootstrap_method : bootstrapMethods) {
- bootstrap_method.dump(file);
- }
- }
-
- /**
- * @return String representation.
- */
- @Override
- public final String toString() {
- final StringBuilder buf = new StringBuilder();
- buf.append("BootstrapMethods(");
- buf.append(bootstrapMethods.length);
- buf.append("):");
- for (int i = 0; i < bootstrapMethods.length; i++) {
- buf.append("\n");
- final int start = buf.length();
- buf.append(" ").append(i).append(": ");
- final int indent_count = buf.length() - start;
- final String[] lines = (bootstrapMethods[i].toString(super.getConstantPool())).split("\\r?\\n");
- buf.append(lines[0]);
- for (int j = 1; j < lines.length; j++) {
- buf.append("\n").append(" ".substring(0,indent_count)).append(lines[j]);
- }
- }
- return buf.toString();
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassElementValue.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassElementValue.java
deleted file mode 100644
index 2a62a872..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassElementValue.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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 java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * @since 6.0
- */
-public class ClassElementValue extends ElementValue
-{
- // For primitive types and string type, this points to the value entry in
- // the cpool
- // For 'class' this points to the class entry in the cpool
- private final int idx;
-
- public ClassElementValue(final int type, final int idx, final ConstantPool cpool)
- {
- super(type, cpool);
- this.idx = idx;
- }
-
- public int getIndex()
- {
- return idx;
- }
-
- public String getClassString()
- {
- final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(idx,
- Const.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- @Override
- public String stringifyValue()
- {
- final ConstantUtf8 cu8 = (ConstantUtf8) super.getConstantPool().getConstant(idx,
- Const.CONSTANT_Utf8);
- return cu8.getBytes();
- }
-
- @Override
- public void dump(final DataOutputStream dos) throws IOException
- {
- dos.writeByte(super.getType()); // u1 kind of value
- dos.writeShort(idx);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassFormatException.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassFormatException.java
deleted file mode 100644
index 963cc266..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassFormatException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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;
-
-/**
- * Thrown when the BCEL attempts to read a class file and determines
- * that the file is malformed or otherwise cannot be interpreted as a
- * class file.
- *
- */
-public class ClassFormatException extends RuntimeException {
-
- private static final long serialVersionUID = -3569097343160139969L;
-
- public ClassFormatException() {
- super();
- }
-
-
- public ClassFormatException(final String s) {
- super(s);
- }
-
- /**
- * @since 6.0
- */
- public ClassFormatException(final String message, final Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassParser.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassParser.java
deleted file mode 100644
index a592bfed..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ClassParser.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * 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 java.io.BufferedInputStream;
-import java.io.DataInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.apache.bcel.Const;
-
-/**
- * Wrapper class that parses a given Java .class file. The method parse returns a
- * JavaClass object on success. When an I/O error or an
- * inconsistency occurs an appropiate exception is propagated back to
- * the caller.
- *
- * The structure and the names comply, except for a few conveniences,
- * exactly with the
- * JVM specification 1.0. See this paper for
- * further details about the structure of a bytecode file.
- *
- */
-public final class ClassParser {
-
- private DataInputStream dataInputStream;
- private final boolean fileOwned;
- private final String fileName;
- private String zipFile;
- private int classNameIndex;
- private int superclassNameIndex;
- private int major; // Compiler version
- private int minor; // Compiler version
- private int accessFlags; // Access rights of parsed class
- private int[] interfaces; // Names of implemented interfaces
- private ConstantPool constantPool; // collection of constants
- private Field[] fields; // class fields, i.e., its variables
- private Method[] methods; // methods defined in the class
- private Attribute[] attributes; // attributes defined in the class
- private final boolean isZip; // Loaded from zip file
- private static final int BUFSIZE = 8192;
-
-
- /**
- * Parses class from the given stream.
- *
- * @param inputStream Input stream
- * @param fileName File name
- */
- public ClassParser(final InputStream inputStream, final String fileName) {
- this.fileName = fileName;
- fileOwned = false;
- final String clazz = inputStream.getClass().getName(); // Not a very clean solution ...
- isZip = clazz.startsWith("java.util.zip.") || clazz.startsWith("java.util.jar.");
- if (inputStream instanceof DataInputStream) {
- this.dataInputStream = (DataInputStream) inputStream;
- } else {
- this.dataInputStream = new DataInputStream(new BufferedInputStream(inputStream, BUFSIZE));
- }
- }
-
-
- /** Parses class from given .class file.
- *
- * @param fileName file name
- */
- public ClassParser(final String fileName) {
- isZip = false;
- this.fileName = fileName;
- fileOwned = true;
- }
-
-
- /** Parses class from given .class file in a ZIP-archive
- *
- * @param zipFile zip file name
- * @param fileName file name
- */
- public ClassParser(final String zipFile, final String fileName) {
- isZip = true;
- fileOwned = true;
- this.zipFile = zipFile;
- this.fileName = fileName;
- }
-
-
- /**
- * Parses the given Java class file and return an object that represents
- * the contained data, i.e., constants, methods, fields and commands.
- * A ClassFormatException is raised, if the file is not a valid
- * .class file. (This does not include verification of the byte code as it
- * is performed by the java interpreter).
- *
- * @return Class object representing the parsed class file
- * @throws IOException
- * @throws ClassFormatException
- */
- public JavaClass parse() throws IOException, ClassFormatException {
- ZipFile zip = null;
- try {
- if (fileOwned) {
- if (isZip) {
- zip = new ZipFile(zipFile);
- final ZipEntry entry = zip.getEntry(fileName);
-
- if (entry == null) {
- throw new IOException("File " + fileName + " not found");
- }
-
- dataInputStream = new DataInputStream(new BufferedInputStream(zip.getInputStream(entry),
- BUFSIZE));
- } else {
- dataInputStream = new DataInputStream(new BufferedInputStream(new FileInputStream(
- fileName), BUFSIZE));
- }
- }
- /****************** Read headers ********************************/
- // Check magic tag of class file
- readID();
- // Get compiler version
- readVersion();
- /****************** Read constant pool and related **************/
- // Read constant pool entries
- readConstantPool();
- // Get class information
- readClassInfo();
- // Get interface information, i.e., implemented interfaces
- readInterfaces();
- /****************** Read class fields and methods ***************/
- // Read class fields, i.e., the variables of the class
- readFields();
- // Read class methods, i.e., the functions in the class
- readMethods();
- // Read class attributes
- readAttributes();
- // Check for unknown variables
- //Unknown[] u = Unknown.getUnknownAttributes();
- //for (int i=0; i < u.length; i++)
- // System.err.println("WARNING: " + u[i]);
- // Everything should have been read now
- // if(file.available() > 0) {
- // int bytes = file.available();
- // byte[] buf = new byte[bytes];
- // file.read(buf);
- // if(!(isZip && (buf.length == 1))) {
- // System.err.println("WARNING: Trailing garbage at end of " + fileName);
- // System.err.println(bytes + " extra bytes: " + Utility.toHexString(buf));
- // }
- // }
- } finally {
- // Read everything of interest, so close the file
- if (fileOwned) {
- try {
- if (dataInputStream != null) {
- dataInputStream.close();
- }
- } catch (final IOException ioe) {
- //ignore close exceptions
- }
- }
- try {
- if (zip != null) {
- zip.close();
- }
- } catch (final IOException ioe) {
- //ignore close exceptions
- }
- }
- // Return the information we have gathered in a new object
- return new JavaClass(classNameIndex, superclassNameIndex, fileName, major, minor,
- accessFlags, constantPool, interfaces, fields, methods, attributes, isZip
- ? JavaClass.ZIP
- : JavaClass.FILE);
- }
-
-
- /**
- * Reads information about the attributes of the class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readAttributes() throws IOException, ClassFormatException {
- final int attributes_count = dataInputStream.readUnsignedShort();
- attributes = new Attribute[attributes_count];
- for (int i = 0; i < attributes_count; i++) {
- attributes[i] = Attribute.readAttribute(dataInputStream, constantPool);
- }
- }
-
-
- /**
- * Reads information about the class and its super class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readClassInfo() throws IOException, ClassFormatException {
- accessFlags = dataInputStream.readUnsignedShort();
- /* Interfaces are implicitely abstract, the flag should be set
- * according to the JVM specification.
- */
- if ((accessFlags & Const.ACC_INTERFACE) != 0) {
- accessFlags |= Const.ACC_ABSTRACT;
- }
- if (((accessFlags & Const.ACC_ABSTRACT) != 0)
- && ((accessFlags & Const.ACC_FINAL) != 0)) {
- throw new ClassFormatException("Class " + fileName + " can't be both final and abstract");
- }
- classNameIndex = dataInputStream.readUnsignedShort();
- superclassNameIndex = dataInputStream.readUnsignedShort();
- }
-
-
- /**
- * Reads constant pool entries.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readConstantPool() throws IOException, ClassFormatException {
- constantPool = new ConstantPool(dataInputStream);
- }
-
-
- /**
- * Reads information about the fields of the class, i.e., its variables.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readFields() throws IOException, ClassFormatException {
- final int fields_count = dataInputStream.readUnsignedShort();
- fields = new Field[fields_count];
- for (int i = 0; i < fields_count; i++) {
- fields[i] = new Field(dataInputStream, constantPool);
- }
- }
-
-
- /******************** Private utility methods **********************/
- /**
- * Checks whether the header of the file is ok.
- * Of course, this has to be the first action on successive file reads.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readID() throws IOException, ClassFormatException {
- if (dataInputStream.readInt() != Const.JVM_CLASSFILE_MAGIC) {
- throw new ClassFormatException(fileName + " is not a Java .class file");
- }
- }
-
-
- /**
- * Reads information about the interfaces implemented by this class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readInterfaces() throws IOException, ClassFormatException {
- final int interfaces_count = dataInputStream.readUnsignedShort();
- interfaces = new int[interfaces_count];
- for (int i = 0; i < interfaces_count; i++) {
- interfaces[i] = dataInputStream.readUnsignedShort();
- }
- }
-
-
- /**
- * Reads information about the methods of the class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readMethods() throws IOException, ClassFormatException {
- final int methods_count = dataInputStream.readUnsignedShort();
- methods = new Method[methods_count];
- for (int i = 0; i < methods_count; i++) {
- methods[i] = new Method(dataInputStream, constantPool);
- }
- }
-
-
- /**
- * Reads major and minor version of compiler which created the file.
- * @throws IOException
- * @throws ClassFormatException
- */
- private void readVersion() throws IOException, ClassFormatException {
- minor = dataInputStream.readUnsignedShort();
- major = dataInputStream.readUnsignedShort();
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Code.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Code.java
deleted file mode 100644
index 5e81d21f..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Code.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents a chunk of Java byte code contained in a
- * method. It is instantiated by the
- * Attribute.readAttribute() method. A Code
- * attribute contains informations about operand stack, local
- * variables, byte code and the exceptions handled within this
- * method.
- *
- * This attribute has attributes itself, namely LineNumberTable which
- * is used for debugging purposes and LocalVariableTable which
- * contains information about the local variables.
- *
- * @see Attribute
- * @see CodeException
- * @see LineNumberTable
- * @see LocalVariableTable
- */
-public final class Code extends Attribute {
-
- private int maxStack; // Maximum size of stack used by this method // TODO this could be made final (setter is not used)
- private int maxLocals; // Number of local variables // TODO this could be made final (setter is not used)
- private byte[] code; // Actual byte code
- private CodeException[] exceptionTable; // Table of handled exceptions
- private Attribute[] attributes; // or LocalVariable
-
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public Code(final Code c) {
- this(c.getNameIndex(), c.getLength(), c.getMaxStack(), c.getMaxLocals(), c.getCode(), c
- .getExceptionTable(), c.getAttributes(), c.getConstantPool());
- }
-
-
- /**
- * @param name_index Index pointing to the name Code
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- */
- Code(final int name_index, final int length, final DataInput file, final ConstantPool constant_pool)
- throws IOException {
- // Initialize with some default values which will be overwritten later
- this(name_index, length, file.readUnsignedShort(), file.readUnsignedShort(), (byte[]) null,
- (CodeException[]) null, (Attribute[]) null, constant_pool);
- final int code_length = file.readInt();
- code = new byte[code_length]; // Read byte code
- file.readFully(code);
- /* Read exception table that contains all regions where an exception
- * handler is active, i.e., a try { ... } catch() block.
- */
- final int exception_table_length = file.readUnsignedShort();
- exceptionTable = new CodeException[exception_table_length];
- for (int i = 0; i < exception_table_length; i++) {
- exceptionTable[i] = new CodeException(file);
- }
- /* Read all attributes, currently `LineNumberTable' and
- * `LocalVariableTable'
- */
- final int attributes_count = file.readUnsignedShort();
- attributes = new Attribute[attributes_count];
- for (int i = 0; i < attributes_count; i++) {
- attributes[i] = Attribute.readAttribute(file, constant_pool);
- }
- /* Adjust length, because of setAttributes in this(), s.b. length
- * is incorrect, because it didn't take the internal attributes
- * into account yet! Very subtle bug, fixed in 3.1.1.
- */
- super.setLength(length);
- }
-
-
- /**
- * @param name_index Index pointing to the name Code
- * @param length Content length in bytes
- * @param maxStack Maximum size of stack
- * @param maxLocals Number of local variables
- * @param code Actual byte code
- * @param exceptionTable of handled exceptions
- * @param attributes Attributes of code: LineNumber or LocalVariable
- * @param constant_pool Array of constants
- */
- public Code(final int name_index, final int length, final int maxStack, final int maxLocals, final byte[] code,
- final CodeException[] exceptionTable, final Attribute[] attributes, final ConstantPool constant_pool) {
- super(Const.ATTR_CODE, name_index, length, constant_pool);
- this.maxStack = maxStack;
- this.maxLocals = maxLocals;
- this.code = code != null ? code : new byte[0];
- this.exceptionTable = exceptionTable != null ? exceptionTable : new CodeException[0];
- this.attributes = attributes != null ? attributes : new Attribute[0];
- super.setLength(calculateLength()); // Adjust length
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitCode(this);
- }
-
-
- /**
- * Dump code attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- super.dump(file);
- file.writeShort(maxStack);
- file.writeShort(maxLocals);
- file.writeInt(code.length);
- file.write(code, 0, code.length);
- file.writeShort(exceptionTable.length);
- for (final CodeException exception : exceptionTable) {
- exception.dump(file);
- }
- file.writeShort(attributes.length);
- for (final Attribute attribute : attributes) {
- attribute.dump(file);
- }
- }
-
-
- /**
- * @return Collection of code attributes.
- * @see Attribute
- */
- public Attribute[] getAttributes() {
- return attributes;
- }
-
-
- /**
- * @return LineNumberTable of Code, if it has one
- */
- public LineNumberTable getLineNumberTable() {
- for (final Attribute attribute : attributes) {
- if (attribute instanceof LineNumberTable) {
- return (LineNumberTable) attribute;
- }
- }
- return null;
- }
-
-
- /**
- * @return LocalVariableTable of Code, if it has one
- */
- public LocalVariableTable getLocalVariableTable() {
- for (final Attribute attribute : attributes) {
- if (attribute instanceof LocalVariableTable) {
- return (LocalVariableTable) attribute;
- }
- }
- return null;
- }
-
-
- /**
- * @return Actual byte code of the method.
- */
- public byte[] getCode() {
- return code;
- }
-
-
- /**
- * @return Table of handled exceptions.
- * @see CodeException
- */
- public CodeException[] getExceptionTable() {
- return exceptionTable;
- }
-
-
- /**
- * @return Number of local variables.
- */
- public int getMaxLocals() {
- return maxLocals;
- }
-
-
- /**
- * @return Maximum size of stack used by this method.
- */
- public int getMaxStack() {
- return maxStack;
- }
-
-
- /**
- * @return the internal length of this code attribute (minus the first 6 bytes)
- * and excluding all its attributes
- */
- private int getInternalLength() {
- return 2 /*maxStack*/+ 2 /*maxLocals*/+ 4 /*code length*/
- + code.length /*byte-code*/
- + 2 /*exception-table length*/
- + 8 * (exceptionTable == null ? 0 : exceptionTable.length) /* exception table */
- + 2 /* attributes count */;
- }
-
-
- /**
- * @return the full size of this code attribute, minus its first 6 bytes,
- * including the size of all its contained attributes
- */
- private int calculateLength() {
- int len = 0;
- if (attributes != null) {
- for (final Attribute attribute : attributes) {
- len += attribute.getLength() + 6 /*attribute header size*/;
- }
- }
- return len + getInternalLength();
- }
-
-
- /**
- * @param attributes the attributes to set for this Code
- */
- public void setAttributes( final Attribute[] attributes ) {
- this.attributes = attributes != null ? attributes : new Attribute[0];
- super.setLength(calculateLength()); // Adjust length
- }
-
-
- /**
- * @param code byte code
- */
- public void setCode( final byte[] code ) {
- this.code = code != null ? code : new byte[0];
- super.setLength(calculateLength()); // Adjust length
- }
-
-
- /**
- * @param exceptionTable exception table
- */
- public void setExceptionTable( final CodeException[] exceptionTable ) {
- this.exceptionTable = exceptionTable != null ? exceptionTable : new CodeException[0];
- super.setLength(calculateLength()); // Adjust length
- }
-
-
- /**
- * @param maxLocals maximum number of local variables
- */
- public void setMaxLocals( final int maxLocals ) {
- this.maxLocals = maxLocals;
- }
-
-
- /**
- * @param maxStack maximum stack size
- */
- public void setMaxStack( final int maxStack ) {
- this.maxStack = maxStack;
- }
-
-
- /**
- * @return String representation of code chunk.
- */
- public String toString( final boolean verbose ) {
- final StringBuilder buf = new StringBuilder(100); // CHECKSTYLE IGNORE MagicNumber
- buf.append("Code(maxStack = ").append(maxStack).append(", maxLocals = ").append(
- maxLocals).append(", code_length = ").append(code.length).append(")\n").append(
- Utility.codeToString(code, super.getConstantPool(), 0, -1, verbose));
- if (exceptionTable.length > 0) {
- buf.append("\nException handler(s) = \n").append("From\tTo\tHandler\tType\n");
- for (final CodeException exception : exceptionTable) {
- buf.append(exception.toString(super.getConstantPool(), verbose)).append("\n");
- }
- }
- if (attributes.length > 0) {
- buf.append("\nAttribute(s) = ");
- for (final Attribute attribute : attributes) {
- buf.append("\n").append(attribute.getName()).append(":");
- buf.append("\n").append(attribute);
- }
- }
- return buf.toString();
- }
-
-
- /**
- * @return String representation of code chunk.
- */
- @Override
- public String toString() {
- return toString(true);
- }
-
-
- /**
- * @return deep copy of this attribute
- *
- * @param _constant_pool the constant pool to duplicate
- */
- @Override
- public Attribute copy( final ConstantPool _constant_pool ) {
- final Code c = (Code) clone();
- if (code != null) {
- c.code = new byte[code.length];
- System.arraycopy(code, 0, c.code, 0, code.length);
- }
- c.setConstantPool(_constant_pool);
- c.exceptionTable = new CodeException[exceptionTable.length];
- for (int i = 0; i < exceptionTable.length; i++) {
- c.exceptionTable[i] = exceptionTable[i].copy();
- }
- c.attributes = new Attribute[attributes.length];
- for (int i = 0; i < attributes.length; i++) {
- c.attributes[i] = attributes[i].copy(_constant_pool);
- }
- return c;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/CodeException.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/CodeException.java
deleted file mode 100644
index d223f08e..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/CodeException.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-import org.apache.bcel.Constants;
-
-/**
- * This class represents an entry in the exception table of the Code
- * attribute and is used only there. It contains a range in which a
- * particular exception handler is active.
- *
- * @see Code
- */
-public final class CodeException implements Cloneable, Node, Constants {
-
- private int startPc; // Range in the code the exception handler is
- private int endPc; // active. startPc is inclusive, endPc exclusive
- private int handlerPc; /* Starting address of exception handler, i.e.,
- * an offset from start of code.
- */
- private int catchType; /* If this is zero the handler catches any
- * exception, otherwise it points to the
- * exception class which is to be caught.
- */
-
-
- /**
- * Initialize from another object.
- */
- public CodeException(final CodeException c) {
- this(c.getStartPC(), c.getEndPC(), c.getHandlerPC(), c.getCatchType());
- }
-
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- CodeException(final DataInput file) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), file
- .readUnsignedShort());
- }
-
-
- /**
- * @param startPc Range in the code the exception handler is active,
- * startPc is inclusive while
- * @param endPc is exclusive
- * @param handlerPc Starting address of exception handler, i.e.,
- * an offset from start of code.
- * @param catchType If zero the handler catches any
- * exception, otherwise it points to the exception class which is
- * to be caught.
- */
- public CodeException(final int startPc, final int endPc, final int handlerPc, final int catchType) {
- this.startPc = startPc;
- this.endPc = endPc;
- this.handlerPc = handlerPc;
- this.catchType = catchType;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitCodeException(this);
- }
-
-
- /**
- * Dump code exception to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeShort(startPc);
- file.writeShort(endPc);
- file.writeShort(handlerPc);
- file.writeShort(catchType);
- }
-
-
- /**
- * @return 0, if the handler catches any exception, otherwise it points to
- * the exception class which is to be caught.
- */
- public int getCatchType() {
- return catchType;
- }
-
-
- /**
- * @return Exclusive end index of the region where the handler is active.
- */
- public int getEndPC() {
- return endPc;
- }
-
-
- /**
- * @return Starting address of exception handler, relative to the code.
- */
- public int getHandlerPC() {
- return handlerPc;
- }
-
-
- /**
- * @return Inclusive start index of the region where the handler is active.
- */
- public int getStartPC() {
- return startPc;
- }
-
-
- /**
- * @param catchType the type of exception that is caught
- */
- public void setCatchType( final int catchType ) {
- this.catchType = catchType;
- }
-
-
- /**
- * @param endPc end of handled block
- */
- public void setEndPC( final int endPc ) {
- this.endPc = endPc;
- }
-
-
- /**
- * @param handlerPc where the actual code is
- */
- public void setHandlerPC( final int handlerPc ) { // TODO unused
- this.handlerPc = handlerPc;
- }
-
-
- /**
- * @param startPc start of handled block
- */
- public void setStartPC( final int startPc ) { // TODO unused
- this.startPc = startPc;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return "CodeException(startPc = " + startPc + ", endPc = " + endPc + ", handlerPc = "
- + handlerPc + ", catchType = " + catchType + ")";
- }
-
-
- /**
- * @return String representation.
- */
- public String toString( final ConstantPool cp, final boolean verbose ) {
- String str;
- if (catchType == 0) {
- str = "(0)";
- } else {
- str = Utility.compactClassName(cp.getConstantString(catchType, Const.CONSTANT_Class), false)
- + (verbose ? "(" + catchType + ")" : "");
- }
- return startPc + "\t" + endPc + "\t" + handlerPc + "\t" + str;
- }
-
-
- public String toString( final ConstantPool cp ) {
- return toString(cp, true);
- }
-
-
- /**
- * @return deep copy of this object
- */
- public CodeException copy() {
- try {
- return (CodeException) clone();
- } catch (final CloneNotSupportedException e) {
- // TODO should this throw?
- }
- return null;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Constant.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Constant.java
deleted file mode 100644
index 36061ed2..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Constant.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.Objects;
-
-import org.apache.bcel.Const;
-import org.apache.bcel.util.BCELComparator;
-
-/**
- * Abstract superclass for classes to represent the different constant types
- * in the constant pool of a class file. The classes keep closely to
- * the JVM specification.
- */
-public abstract class Constant implements Cloneable, Node {
-
- private static BCELComparator bcelComparator = new BCELComparator() {
-
- @Override
- public boolean equals( final Object o1, final Object o2 ) {
- final Constant THIS = (Constant) o1;
- final Constant THAT = (Constant) o2;
- return Objects.equals(THIS.toString(), THAT.toString());
- }
-
-
- @Override
- public int hashCode( final Object o ) {
- final Constant THIS = (Constant) o;
- return THIS.toString().hashCode();
- }
- };
-
- /* In fact this tag is redundant since we can distinguish different
- * `Constant' objects by their type, i.e., via `instanceof'. In some
- * places we will use the tag for switch()es anyway.
- *
- * First, we want match the specification as closely as possible. Second we
- * need the tag as an index to select the corresponding class name from the
- * `CONSTANT_NAMES' array.
- */
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected byte tag; // TODO should be private & final
-
- Constant(final byte tag) {
- this.tag = tag;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public abstract void accept( Visitor v );
-
- public abstract void dump( DataOutputStream file ) throws IOException;
-
- /**
- * @return Tag of constant, i.e., its type. No setTag() method to avoid
- * confusion.
- */
- public final byte getTag() {
- return tag;
- }
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return Const.getConstantName(tag) + "[" + tag + "]";
- }
-
- /**
- * @return deep copy of this constant
- */
- public Constant copy() {
- try {
- return (Constant) super.clone();
- } catch (final CloneNotSupportedException e) {
- // TODO should this throw?
- }
- return null;
- }
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (final CloneNotSupportedException e) {
- throw new Error("Clone Not Supported"); // never happens
- }
- }
-
- /**
- * Reads one constant from the given input, the type depends on a tag byte.
- *
- * @param dataInput Input stream
- * @return Constant object
- * @throws IOException if an I/O error occurs reading from the given {@code dataInput}.
- * @throws ClassFormatException if the next byte is not recognized
- * @since 6.0 made public
- */
- public static Constant readConstant(final DataInput dataInput) throws IOException, ClassFormatException {
- final byte b = dataInput.readByte(); // Read tag byte
- switch (b) {
- case Const.CONSTANT_Class:
- return new ConstantClass(dataInput);
- case Const.CONSTANT_Fieldref:
- return new ConstantFieldref(dataInput);
- case Const.CONSTANT_Methodref:
- return new ConstantMethodref(dataInput);
- case Const.CONSTANT_InterfaceMethodref:
- return new ConstantInterfaceMethodref(dataInput);
- case Const.CONSTANT_String:
- return new ConstantString(dataInput);
- case Const.CONSTANT_Integer:
- return new ConstantInteger(dataInput);
- case Const.CONSTANT_Float:
- return new ConstantFloat(dataInput);
- case Const.CONSTANT_Long:
- return new ConstantLong(dataInput);
- case Const.CONSTANT_Double:
- return new ConstantDouble(dataInput);
- case Const.CONSTANT_NameAndType:
- return new ConstantNameAndType(dataInput);
- case Const.CONSTANT_Utf8:
- return ConstantUtf8.getInstance(dataInput);
- case Const.CONSTANT_MethodHandle:
- return new ConstantMethodHandle(dataInput);
- case Const.CONSTANT_MethodType:
- return new ConstantMethodType(dataInput);
- case Const.CONSTANT_Dynamic:
- return new ConstantDynamic(dataInput);
- case Const.CONSTANT_InvokeDynamic:
- return new ConstantInvokeDynamic(dataInput);
- case Const.CONSTANT_Module:
- return new ConstantModule(dataInput);
- case Const.CONSTANT_Package:
- return new ConstantPackage(dataInput);
- default:
- throw new ClassFormatException("Invalid byte tag in constant pool: " + b);
- }
- }
-
- /**
- * @return Comparison strategy object
- */
- public static BCELComparator getComparator() {
- return bcelComparator;
- }
-
- /**
- * @param comparator Comparison strategy object
- */
- public static void setComparator( final BCELComparator comparator ) {
- bcelComparator = comparator;
- }
-
- /**
- * Returns value as defined by given BCELComparator strategy.
- * By default two Constant objects are said to be equal when
- * the result of toString() is equal.
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( final Object obj ) {
- return bcelComparator.equals(this, obj);
- }
-
- /**
- * Returns value as defined by given BCELComparator strategy.
- * By default return the hashcode of the result of toString().
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return bcelComparator.hashCode(this);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantCP.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantCP.java
deleted file mode 100644
index 73e675c7..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantCP.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * Abstract super class for Fieldref, Methodref, InterfaceMethodref and
- * InvokeDynamic constants.
- *
- * @see ConstantFieldref
- * @see ConstantMethodref
- * @see ConstantInterfaceMethodref
- * @see ConstantInvokeDynamic
- */
-public abstract class ConstantCP extends Constant {
-
- /** References to the constants containing the class and the field signature
- */
- // Note that this field is used to store the
- // bootstrap_method_attr_index of a ConstantInvokeDynamic.
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected int class_index; // TODO make private (has getter & setter)
- // This field has the same meaning for all subclasses.
-
- /**
- * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
- */
- @java.lang.Deprecated
- protected int name_and_type_index; // TODO make private (has getter & setter)
-
-
- /**
- * Initialize from another object.
- */
- public ConstantCP(final ConstantCP c) {
- this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param tag Constant type tag
- * @param file Input stream
- * @throws IOException
- */
- ConstantCP(final byte tag, final DataInput file) throws IOException {
- this(tag, file.readUnsignedShort(), file.readUnsignedShort());
- }
-
-
- /**
- * @param class_index Reference to the class containing the field
- * @param name_and_type_index and the field signature
- */
- protected ConstantCP(final byte tag, final int class_index, final int name_and_type_index) {
- super(tag);
- this.class_index = class_index;
- this.name_and_type_index = name_and_type_index;
- }
-
-
- /**
- * Dump constant field reference to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public final void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(class_index);
- file.writeShort(name_and_type_index);
- }
-
-
- /**
- * @return Reference (index) to class this constant refers to.
- */
- public final int getClassIndex() {
- return class_index;
- }
-
-
- /**
- * @param class_index points to Constant_class
- */
- public final void setClassIndex( final int class_index ) {
- this.class_index = class_index;
- }
-
-
- /**
- * @return Reference (index) to signature of the field.
- */
- public final int getNameAndTypeIndex() {
- return name_and_type_index;
- }
-
-
- /**
- * @param name_and_type_index points to Constant_NameAndType
- */
- public final void setNameAndTypeIndex( final int name_and_type_index ) {
- this.name_and_type_index = name_and_type_index;
- }
-
-
- /**
- * @return Class this field belongs to.
- */
- public String getClass( final ConstantPool cp ) {
- return cp.constantToString(class_index, Const.CONSTANT_Class);
- }
-
-
- /**
- * @return String representation.
- *
- * not final as ConstantInvokeDynamic needs to modify
- */
- @Override
- public String toString() {
- return super.toString() + "(class_index = " + class_index + ", name_and_type_index = "
- + name_and_type_index + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantClass.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantClass.java
deleted file mode 100644
index f77ecc3d..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantClass.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a (external) class.
- *
- * @see Constant
- */
-public final class ConstantClass extends Constant implements ConstantObject {
-
- private int nameIndex; // Identical to ConstantString except for the name
-
-
- /**
- * Initialize from another object.
- */
- public ConstantClass(final ConstantClass c) {
- this(c.getNameIndex());
- }
-
-
- /**
- * Constructs an instance from file data.
- *
- * @param dataInput Input stream
- * @throws IOException if an I/O error occurs reading from the given {@code dataInput}.
- */
- ConstantClass(final DataInput dataInput) throws IOException {
- this(dataInput.readUnsignedShort());
- }
-
-
- /**
- * @param nameIndex Name index in constant pool. Should refer to a
- * ConstantUtf8.
- */
- public ConstantClass(final int nameIndex) {
- super(Const.CONSTANT_Class);
- this.nameIndex = nameIndex;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantClass(this);
- }
-
-
- /**
- * Dumps constant class to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException if an I/O error occurs writing to the DataOutputStream.
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(nameIndex);
- }
-
-
- /**
- * @return Name index in constant pool of class name.
- */
- public int getNameIndex() {
- return nameIndex;
- }
-
-
- /**
- * @param nameIndex the name index in the constant pool of this Constant Class
- */
- public void setNameIndex( final int nameIndex ) {
- this.nameIndex = nameIndex;
- }
-
-
- /** @return String object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- final Constant c = cp.getConstant(nameIndex, Const.CONSTANT_Utf8);
- return ((ConstantUtf8) c).getBytes();
- }
-
-
- /** @return dereferenced string
- */
- public String getBytes( final ConstantPool cp ) {
- return (String) getConstantValue(cp);
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(nameIndex = " + nameIndex + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantDouble.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantDouble.java
deleted file mode 100644
index 9ef7ce68..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantDouble.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a Double object.
- *
- * @see Constant
- */
-public final class ConstantDouble extends Constant implements ConstantObject {
-
- private double bytes;
-
-
- /**
- * @param bytes Data
- */
- public ConstantDouble(final double bytes) {
- super(Const.CONSTANT_Double);
- this.bytes = bytes;
- }
-
-
- /**
- * Initialize from another object.
- */
- public ConstantDouble(final ConstantDouble c) {
- this(c.getBytes());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantDouble(final DataInput file) throws IOException {
- this(file.readDouble());
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantDouble(this);
- }
-
-
- /**
- * Dump constant double to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeDouble(bytes);
- }
-
-
- /**
- * @return data, i.e., 8 bytes.
- */
- public double getBytes() {
- return bytes;
- }
-
-
- /**
- * @param bytes the raw bytes that represent the double value
- */
- public void setBytes( final double bytes ) {
- this.bytes = bytes;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
-
- /** @return Double object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- return new Double(bytes);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantDynamic.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantDynamic.java
deleted file mode 100644
index b76db6dc..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantDynamic.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a dynamically computed constant.
- *
- * @see Constant
- * @see
- * Change request for JEP 309
- * @since 6.3
- */
-public final class ConstantDynamic extends ConstantCP {
-
- /**
- * Initialize from another object.
- */
- public ConstantDynamic(final ConstantDynamic c) {
- this(c.getBootstrapMethodAttrIndex(), c.getNameAndTypeIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantDynamic(final DataInput file) throws IOException {
- this(file.readShort(), file.readShort());
- }
-
-
- public ConstantDynamic(final int bootstrap_method_attr_index, final int name_and_type_index) {
- super(Const.CONSTANT_Dynamic, bootstrap_method_attr_index, name_and_type_index);
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitly
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantDynamic(this);
- }
-
- /**
- * @return Reference (index) to bootstrap method this constant refers to.
- *
- * Note that this method is a functional duplicate of getClassIndex
- * for use by ConstantInvokeDynamic.
- * @since 6.0
- */
- public int getBootstrapMethodAttrIndex() {
- return super.getClassIndex(); // AKA bootstrap_method_attr_index
- }
-
- /**
- * @return String representation
- */
- @Override
- public String toString() {
- return super.toString().replace("class_index", "bootstrap_method_attr_index");
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantFieldref.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantFieldref.java
deleted file mode 100644
index 2c4e89d1..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantFieldref.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents a constant pool reference to a field.
- *
- */
-public final class ConstantFieldref extends ConstantCP {
-
- /**
- * Initialize from another object.
- */
- public ConstantFieldref(final ConstantFieldref c) {
- super(Const.CONSTANT_Fieldref, c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
-
- /**
- * Initialize instance from input data.
- *
- * @param input input stream
- * @throws IOException
- */
- ConstantFieldref(final DataInput input) throws IOException {
- super(Const.CONSTANT_Fieldref, input);
- }
-
-
- /**
- * @param class_index Reference to the class containing the Field
- * @param name_and_type_index and the Field signature
- */
- public ConstantFieldref(final int class_index, final int name_and_type_index) {
- super(Const.CONSTANT_Fieldref, class_index, name_and_type_index);
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of Fields,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantFieldref(this);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantFloat.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantFloat.java
deleted file mode 100644
index 569021dc..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantFloat.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a float object.
- *
- * @see Constant
- */
-public final class ConstantFloat extends Constant implements ConstantObject {
-
- private float bytes;
-
-
- /**
- * @param bytes Data
- */
- public ConstantFloat(final float bytes) {
- super(Const.CONSTANT_Float);
- this.bytes = bytes;
- }
-
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public ConstantFloat(final ConstantFloat c) {
- this(c.getBytes());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantFloat(final DataInput file) throws IOException {
- this(file.readFloat());
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantFloat(this);
- }
-
-
- /**
- * Dump constant float to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeFloat(bytes);
- }
-
-
- /**
- * @return data, i.e., 4 bytes.
- */
- public float getBytes() {
- return bytes;
- }
-
-
- /**
- * @param bytes the raw bytes that represent this float
- */
- public void setBytes( final float bytes ) {
- this.bytes = bytes;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
-
- /** @return Float object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- return new Float(bytes);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInteger.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInteger.java
deleted file mode 100644
index 68b524da..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInteger.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to an int object.
- *
- * @see Constant
- */
-public final class ConstantInteger extends Constant implements ConstantObject {
-
- private int bytes;
-
-
- /**
- * @param bytes Data
- */
- public ConstantInteger(final int bytes) {
- super(Const.CONSTANT_Integer);
- this.bytes = bytes;
- }
-
-
- /**
- * Initialize from another object.
- */
- public ConstantInteger(final ConstantInteger c) {
- this(c.getBytes());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantInteger(final DataInput file) throws IOException {
- this(file.readInt());
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantInteger(this);
- }
-
-
- /**
- * Dump constant integer to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeInt(bytes);
- }
-
-
- /**
- * @return data, i.e., 4 bytes.
- */
- public int getBytes() {
- return bytes;
- }
-
-
- /**
- * @param bytes the raw bytes that represent this integer
- */
- public void setBytes( final int bytes ) {
- this.bytes = bytes;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
-
- /** @return Integer object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- return Integer.valueOf(bytes);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInterfaceMethodref.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInterfaceMethodref.java
deleted file mode 100644
index b1c668a5..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInterfaceMethodref.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents a constant pool reference to an interface method.
- *
- */
-public final class ConstantInterfaceMethodref extends ConstantCP {
-
- /**
- * Initialize from another object.
- */
- public ConstantInterfaceMethodref(final ConstantInterfaceMethodref c) {
- super(Const.CONSTANT_InterfaceMethodref, c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
-
- /**
- * Initialize instance from input data.
- *
- * @param input input stream
- * @throws IOException
- */
- ConstantInterfaceMethodref(final DataInput input) throws IOException {
- super(Const.CONSTANT_InterfaceMethodref, input);
- }
-
-
- /**
- * @param class_index Reference to the class containing the method
- * @param name_and_type_index and the method signature
- */
- public ConstantInterfaceMethodref(final int class_index, final int name_and_type_index) {
- super(Const.CONSTANT_InterfaceMethodref, class_index, name_and_type_index);
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantInterfaceMethodref(this);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInvokeDynamic.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInvokeDynamic.java
deleted file mode 100644
index 830276ec..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantInvokeDynamic.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a invoke dynamic.
- *
- * @see Constant
- * @see
- * The CONSTANT_InvokeDynamic_info Structure in The Java Virtual Machine Specification
- * @since 6.0
- */
-public final class ConstantInvokeDynamic extends ConstantCP {
-
- /**
- * Initialize from another object.
- */
- public ConstantInvokeDynamic(final ConstantInvokeDynamic c) {
- this(c.getBootstrapMethodAttrIndex(), c.getNameAndTypeIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantInvokeDynamic(final DataInput file) throws IOException {
- this(file.readShort(), file.readShort());
- }
-
-
- public ConstantInvokeDynamic(final int bootstrap_method_attr_index, final int name_and_type_index) {
- super(Const.CONSTANT_InvokeDynamic, bootstrap_method_attr_index, name_and_type_index);
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitly
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantInvokeDynamic(this);
- }
-
- /**
- * @return Reference (index) to bootstrap method this constant refers to.
- *
- * Note that this method is a functional duplicate of getClassIndex
- * for use by ConstantInvokeDynamic.
- * @since 6.0
- */
- public int getBootstrapMethodAttrIndex() {
- return super.getClassIndex(); // AKA bootstrap_method_attr_index
- }
-
- /**
- * @return String representation
- */
- @Override
- public String toString() {
- return super.toString().replace("class_index", "bootstrap_method_attr_index");
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantLong.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantLong.java
deleted file mode 100644
index 821c3397..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantLong.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a long object.
- *
- * @see Constant
- */
-public final class ConstantLong extends Constant implements ConstantObject {
-
- private long bytes;
-
-
- /**
- * @param bytes Data
- */
- public ConstantLong(final long bytes) {
- super(Const.CONSTANT_Long);
- this.bytes = bytes;
- }
-
-
- /**
- * Initialize from another object.
- */
- public ConstantLong(final ConstantLong c) {
- this(c.getBytes());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantLong(final DataInput file) throws IOException {
- this(file.readLong());
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantLong(this);
- }
-
-
- /**
- * Dump constant long to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeLong(bytes);
- }
-
-
- /**
- * @return data, i.e., 8 bytes.
- */
- public long getBytes() {
- return bytes;
- }
-
-
- /**
- * @param bytes the raw bytes that represent this long
- */
- public void setBytes( final long bytes ) {
- this.bytes = bytes;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
-
- /** @return Long object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- return Long.valueOf(bytes);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodHandle.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodHandle.java
deleted file mode 100644
index cd68fd4b..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodHandle.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a method handle.
- *
- * @see Constant
- * @since 6.0
- */
-public final class ConstantMethodHandle extends Constant {
-
- private int referenceKind;
- private int referenceIndex;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantMethodHandle(final ConstantMethodHandle c) {
- this(c.getReferenceKind(), c.getReferenceIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantMethodHandle(final DataInput file) throws IOException {
- this(file.readUnsignedByte(), file.readUnsignedShort());
- }
-
-
- public ConstantMethodHandle(final int reference_kind, final int reference_index) {
- super(Const.CONSTANT_MethodHandle);
- this.referenceKind = reference_kind;
- this.referenceIndex = reference_index;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitly
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantMethodHandle(this);
- }
-
-
- /**
- * Dump method kind and index to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeByte(referenceKind);
- file.writeShort(referenceIndex);
- }
-
-
- public int getReferenceKind() {
- return referenceKind;
- }
-
-
- public void setReferenceKind(final int reference_kind) {
- this.referenceKind = reference_kind;
- }
-
-
- public int getReferenceIndex() {
- return referenceIndex;
- }
-
-
- public void setReferenceIndex(final int reference_index) {
- this.referenceIndex = reference_index;
- }
-
-
- /**
- * @return String representation
- */
- @Override
- public String toString() {
- return super.toString() + "(referenceKind = " + referenceKind +
- ", referenceIndex = " + referenceIndex + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodType.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodType.java
deleted file mode 100644
index d687e6ec..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodType.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a method type.
- *
- * @see Constant
- * @since 6.0
- */
-public final class ConstantMethodType extends Constant {
-
- private int descriptorIndex;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantMethodType(final ConstantMethodType c) {
- this(c.getDescriptorIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantMethodType(final DataInput file) throws IOException {
- this(file.readUnsignedShort());
- }
-
-
- public ConstantMethodType(final int descriptor_index) {
- super(Const.CONSTANT_MethodType);
- this.descriptorIndex = descriptor_index;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitly
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantMethodType(this);
- }
-
-
- /**
- * Dump name and signature index to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(descriptorIndex);
- }
-
-
- public int getDescriptorIndex() {
- return descriptorIndex;
- }
-
-
- public void setDescriptorIndex(final int descriptor_index) {
- this.descriptorIndex = descriptor_index;
- }
-
-
- /**
- * @return String representation
- */
- @Override
- public String toString() {
- return super.toString() + "(descriptorIndex = " + descriptorIndex + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodref.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodref.java
deleted file mode 100644
index 0e1e628d..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantMethodref.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents a constant pool reference to a method.
- *
- */
-public final class ConstantMethodref extends ConstantCP {
-
- /**
- * Initialize from another object.
- */
- public ConstantMethodref(final ConstantMethodref c) {
- super(Const.CONSTANT_Methodref, c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
-
- /**
- * Initialize instance from input data.
- *
- * @param input input stream
- * @throws IOException
- */
- ConstantMethodref(final DataInput input) throws IOException {
- super(Const.CONSTANT_Methodref, input);
- }
-
-
- /**
- * @param class_index Reference to the class containing the method
- * @param name_and_type_index and the method signature
- */
- public ConstantMethodref(final int class_index, final int name_and_type_index) {
- super(Const.CONSTANT_Methodref, class_index, name_and_type_index);
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantMethodref(this);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantModule.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantModule.java
deleted file mode 100644
index 66cc2035..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantModule.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a module.
- *
- *
Note: Early access Java 9 support- currently subject to change
- *
- * @see Constant
- * @since 6.1
- */
-public final class ConstantModule extends Constant implements ConstantObject {
-
- private int nameIndex;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantModule(final ConstantModule c) {
- this(c.getNameIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantModule(final DataInput file) throws IOException {
- this(file.readUnsignedShort());
- }
-
-
- /**
- * @param nameIndex Name index in constant pool. Should refer to a
- * ConstantUtf8.
- */
- public ConstantModule(final int nameIndex) {
- super(Const.CONSTANT_Module);
- this.nameIndex = nameIndex;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitly
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantModule(this);
- }
-
-
- /**
- * Dump constant module to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(nameIndex);
- }
-
-
- /**
- * @return Name index in constant pool of module name.
- */
- public int getNameIndex() {
- return nameIndex;
- }
-
-
- /**
- * @param nameIndex the name index in the constant pool of this Constant Module
- */
- public void setNameIndex( final int nameIndex ) {
- this.nameIndex = nameIndex;
- }
-
-
- /** @return String object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- final Constant c = cp.getConstant(nameIndex, Const.CONSTANT_Utf8);
- return ((ConstantUtf8) c).getBytes();
- }
-
-
- /** @return dereferenced string
- */
- public String getBytes( final ConstantPool cp ) {
- return (String) getConstantValue(cp);
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(nameIndex = " + nameIndex + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantNameAndType.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantNameAndType.java
deleted file mode 100644
index 01982ea5..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantNameAndType.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to the name and signature
- * of a field or method.
- *
- * @see Constant
- */
-public final class ConstantNameAndType extends Constant {
-
- private int nameIndex; // Name of field/method
- private int signatureIndex; // and its signature.
-
-
- /**
- * Initialize from another object.
- */
- public ConstantNameAndType(final ConstantNameAndType c) {
- this(c.getNameIndex(), c.getSignatureIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantNameAndType(final DataInput file) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort());
- }
-
-
- /**
- * @param nameIndex Name of field/method
- * @param signatureIndex and its signature
- */
- public ConstantNameAndType(final int nameIndex, final int signatureIndex) {
- super(Const.CONSTANT_NameAndType);
- this.nameIndex = nameIndex;
- this.signatureIndex = signatureIndex;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantNameAndType(this);
- }
-
-
- /**
- * Dump name and signature index to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(nameIndex);
- file.writeShort(signatureIndex);
- }
-
-
- /**
- * @return Name index in constant pool of field/method name.
- */
- public int getNameIndex() {
- return nameIndex;
- }
-
-
- /** @return name
- */
- public String getName( final ConstantPool cp ) {
- return cp.constantToString(getNameIndex(), Const.CONSTANT_Utf8);
- }
-
-
- /**
- * @return Index in constant pool of field/method signature.
- */
- public int getSignatureIndex() {
- return signatureIndex;
- }
-
-
- /** @return signature
- */
- public String getSignature( final ConstantPool cp ) {
- return cp.constantToString(getSignatureIndex(), Const.CONSTANT_Utf8);
- }
-
-
- /**
- * @param nameIndex the name index of this constant
- */
- public void setNameIndex( final int nameIndex ) {
- this.nameIndex = nameIndex;
- }
-
-
- /**
- * @param signatureIndex the signature index in the constant pool of this type
- */
- public void setSignatureIndex( final int signatureIndex ) {
- this.signatureIndex = signatureIndex;
- }
-
-
- /**
- * @return String representation
- */
- @Override
- public String toString() {
- return super.toString() + "(nameIndex = " + nameIndex + ", signatureIndex = "
- + signatureIndex + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantObject.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantObject.java
deleted file mode 100644
index feb2f52d..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantObject.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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;
-
-/**
- * This interface denotes those constants that have a "natural" value,
- * such as ConstantLong, ConstantString, etc..
- *
- * @see Constant
- */
-public interface ConstantObject {
-
- /** @return object representing the constant, e.g., Long for ConstantLong
- */
- Object getConstantValue( ConstantPool cp );
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantPackage.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantPackage.java
deleted file mode 100644
index 3f94c749..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantPackage.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a package.
- *
- *
Note: Early access Java 9 support- currently subject to change
- *
- * @see Constant
- * @since 6.1
- */
-public final class ConstantPackage extends Constant implements ConstantObject {
-
- private int nameIndex;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantPackage(final ConstantPackage c) {
- this(c.getNameIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantPackage(final DataInput file) throws IOException {
- this(file.readUnsignedShort());
- }
-
-
- /**
- * @param nameIndex Name index in constant pool. Should refer to a
- * ConstantUtf8.
- */
- public ConstantPackage(final int nameIndex) {
- super(Const.CONSTANT_Package);
- this.nameIndex = nameIndex;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitly
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantPackage(this);
- }
-
-
- /**
- * Dump constant package to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(nameIndex);
- }
-
-
- /**
- * @return Name index in constant pool of package name.
- */
- public int getNameIndex() {
- return nameIndex;
- }
-
-
- /**
- * @param nameIndex the name index in the constant pool of this Constant Package
- */
- public void setNameIndex( final int nameIndex ) {
- this.nameIndex = nameIndex;
- }
-
-
- /** @return String object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- final Constant c = cp.getConstant(nameIndex, Const.CONSTANT_Utf8);
- return ((ConstantUtf8) c).getBytes();
- }
-
-
- /** @return dereferenced string
- */
- public String getBytes( final ConstantPool cp ) {
- return (String) getConstantValue(cp);
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(nameIndex = " + nameIndex + ")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantPool.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantPool.java
deleted file mode 100644
index c2926c08..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantPool.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class represents the constant pool, i.e., a table of constants, of
- * a parsed classfile. It may contain null references, due to the JVM
- * specification that skips an entry after an 8-byte constant (double,
- * long) entry. Those interested in generating constant pools
- * programatically should see
- * ConstantPoolGen.
-
- * @see Constant
- * @see org.apache.bcel.generic.ConstantPoolGen
- */
-public class ConstantPool implements Cloneable, Node {
-
- private Constant[] constantPool;
-
- /**
- * @param constantPool Array of constants
- */
- public ConstantPool(final Constant[] constantPool) {
- this.constantPool = constantPool;
- }
-
- /**
- * Reads constants from given input stream.
- *
- * @param input Input stream
- * @throws IOException
- * @throws ClassFormatException
- */
- public ConstantPool(final DataInput input) throws IOException, ClassFormatException {
- byte tag;
- final int constant_pool_count = input.readUnsignedShort();
- constantPool = new Constant[constant_pool_count];
- /* constantPool[0] is unused by the compiler and may be used freely
- * by the implementation.
- */
- for (int i = 1; i < constant_pool_count; i++) {
- constantPool[i] = Constant.readConstant(input);
- /* Quote from the JVM specification:
- * "All eight byte constants take up two spots in the constant pool.
- * If this is the n'th byte in the constant pool, then the next item
- * will be numbered n+2"
- *
- * Thus we have to increment the index counter.
- */
- tag = constantPool[i].getTag();
- if ((tag == Const.CONSTANT_Double) || (tag == Const.CONSTANT_Long)) {
- i++;
- }
- }
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantPool(this);
- }
-
- /**
- * Resolves constant to a string representation.
- *
- * @param c Constant to be printed
- * @return String representation
- */
- public String constantToString( Constant c ) throws ClassFormatException {
- String str;
- int i;
- final byte tag = c.getTag();
- switch (tag) {
- case Const.CONSTANT_Class:
- i = ((ConstantClass) c).getNameIndex();
- c = getConstant(i, Const.CONSTANT_Utf8);
- str = Utility.compactClassName(((ConstantUtf8) c).getBytes(), false);
- break;
- case Const.CONSTANT_String:
- i = ((ConstantString) c).getStringIndex();
- c = getConstant(i, Const.CONSTANT_Utf8);
- str = "\"" + escape(((ConstantUtf8) c).getBytes()) + "\"";
- break;
- case Const.CONSTANT_Utf8:
- str = ((ConstantUtf8) c).getBytes();
- break;
- case Const.CONSTANT_Double:
- str = String.valueOf(((ConstantDouble) c).getBytes());
- break;
- case Const.CONSTANT_Float:
- str = String.valueOf(((ConstantFloat) c).getBytes());
- break;
- case Const.CONSTANT_Long:
- str = String.valueOf(((ConstantLong) c).getBytes());
- break;
- case Const.CONSTANT_Integer:
- str = String.valueOf(((ConstantInteger) c).getBytes());
- break;
- case Const.CONSTANT_NameAndType:
- str = constantToString(((ConstantNameAndType) c).getNameIndex(),
- Const.CONSTANT_Utf8)
- + " " + constantToString(((ConstantNameAndType) c).getSignatureIndex(),
- Const.CONSTANT_Utf8);
- break;
- case Const.CONSTANT_InterfaceMethodref:
- case Const.CONSTANT_Methodref:
- case Const.CONSTANT_Fieldref:
- str = constantToString(((ConstantCP) c).getClassIndex(), Const.CONSTANT_Class)
- + "." + constantToString(((ConstantCP) c).getNameAndTypeIndex(),
- Const.CONSTANT_NameAndType);
- break;
- case Const.CONSTANT_MethodHandle:
- // Note that the ReferenceIndex may point to a Fieldref, Methodref or
- // InterfaceMethodref - so we need to peek ahead to get the actual type.
- final ConstantMethodHandle cmh = (ConstantMethodHandle) c;
- str = Const.getMethodHandleName(cmh.getReferenceKind())
- + " " + constantToString(cmh.getReferenceIndex(),
- getConstant(cmh.getReferenceIndex()).getTag());
- break;
- case Const.CONSTANT_MethodType:
- final ConstantMethodType cmt = (ConstantMethodType) c;
- str = constantToString(cmt.getDescriptorIndex(), Const.CONSTANT_Utf8);
- break;
- case Const.CONSTANT_InvokeDynamic:
- final ConstantInvokeDynamic cid = (ConstantInvokeDynamic) c;
- str = cid.getBootstrapMethodAttrIndex()
- + ":" + constantToString(cid.getNameAndTypeIndex(),
- Const.CONSTANT_NameAndType);
- break;
- case Const.CONSTANT_Module:
- i = ((ConstantModule) c).getNameIndex();
- c = getConstant(i, Const.CONSTANT_Utf8);
- str = Utility.compactClassName(((ConstantUtf8) c).getBytes(), false);
- break;
- case Const.CONSTANT_Package:
- i = ((ConstantPackage) c).getNameIndex();
- c = getConstant(i, Const.CONSTANT_Utf8);
- str = Utility.compactClassName(((ConstantUtf8) c).getBytes(), false);
- break;
- default: // Never reached
- throw new IllegalArgumentException("Unknown constant type " + tag);
- }
- return str;
- }
-
- private static String escape( final String str ) {
- final int len = str.length();
- final StringBuilder buf = new StringBuilder(len + 5);
- final char[] ch = str.toCharArray();
- for (int i = 0; i < len; i++) {
- switch (ch[i]) {
- case '\n':
- buf.append("\\n");
- break;
- case '\r':
- buf.append("\\r");
- break;
- case '\t':
- buf.append("\\t");
- break;
- case '\b':
- buf.append("\\b");
- break;
- case '"':
- buf.append("\\\"");
- break;
- default:
- buf.append(ch[i]);
- }
- }
- return buf.toString();
- }
-
- /**
- * Retrieves constant at `index' from constant pool and resolve it to
- * a string representation.
- *
- * @param index of constant in constant pool
- * @param tag expected type
- * @return String representation
- */
- public String constantToString( final int index, final byte tag ) throws ClassFormatException {
- final Constant c = getConstant(index, tag);
- return constantToString(c);
- }
-
- /**
- * Dump constant pool to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeShort(constantPool.length);
- for (int i = 1; i < constantPool.length; i++) {
- if (constantPool[i] != null) {
- constantPool[i].dump(file);
- }
- }
- }
-
- /**
- * Gets constant from constant pool.
- *
- * @param index Index in constant pool
- * @return Constant value
- * @see Constant
- */
- public Constant getConstant( final int index ) {
- if (index >= constantPool.length || index < 0) {
- throw new ClassFormatException("Invalid constant pool reference: " + index
- + ". Constant pool size is: " + constantPool.length);
- }
- return constantPool[index];
- }
-
- /**
- * Gets constant from constant pool and check whether it has the
- * expected type.
- *
- * @param index Index in constant pool
- * @param tag Tag of expected constant, i.e., its type
- * @return Constant value
- * @see Constant
- * @throws ClassFormatException
- */
- public Constant getConstant( final int index, final byte tag ) throws ClassFormatException {
- Constant c;
- c = getConstant(index);
- if (c == null) {
- throw new ClassFormatException("Constant pool at index " + index + " is null.");
- }
- if (c.getTag() != tag) {
- throw new ClassFormatException("Expected class `" + Const.getConstantName(tag)
- + "' at index " + index + " and got " + c);
- }
- return c;
- }
-
- /**
- * @return Array of constants.
- * @see Constant
- */
- public Constant[] getConstantPool() {
- return constantPool;
- }
-
- /**
- * Gets string from constant pool and bypass the indirection of
- * `ConstantClass' and `ConstantString' objects. I.e. these classes have
- * an index field that points to another entry of the constant pool of
- * type `ConstantUtf8' which contains the real data.
- *
- * @param index Index in constant pool
- * @param tag Tag of expected constant, either ConstantClass or ConstantString
- * @return Contents of string reference
- * @see ConstantClass
- * @see ConstantString
- * @throws ClassFormatException
- */
- public String getConstantString( final int index, final byte tag ) throws ClassFormatException {
- Constant c;
- int i;
- c = getConstant(index, tag);
- /* This switch() is not that elegant, since the four classes have the
- * same contents, they just differ in the name of the index
- * field variable.
- * But we want to stick to the JVM naming conventions closely though
- * we could have solved these more elegantly by using the same
- * variable name or by subclassing.
- */
- switch (tag) {
- case Const.CONSTANT_Class:
- i = ((ConstantClass) c).getNameIndex();
- break;
- case Const.CONSTANT_String:
- i = ((ConstantString) c).getStringIndex();
- break;
- case Const.CONSTANT_Module:
- i = ((ConstantModule) c).getNameIndex();
- break;
- case Const.CONSTANT_Package:
- i = ((ConstantPackage) c).getNameIndex();
- break;
- default:
- throw new IllegalArgumentException("getConstantString called with illegal tag " + tag);
- }
- // Finally get the string from the constant pool
- c = getConstant(i, Const.CONSTANT_Utf8);
- return ((ConstantUtf8) c).getBytes();
- }
-
-
- /**
- * @return Length of constant pool.
- */
- public int getLength() {
- return constantPool == null ? 0 : constantPool.length;
- }
-
-
- /**
- * @param constant Constant to set
- */
- public void setConstant( final int index, final Constant constant ) {
- constantPool[index] = constant;
- }
-
-
- /**
- * @param constantPool
- */
- public void setConstantPool( final Constant[] constantPool ) {
- this.constantPool = constantPool;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder();
- for (int i = 1; i < constantPool.length; i++) {
- buf.append(i).append(")").append(constantPool[i]).append("\n");
- }
- return buf.toString();
- }
-
-
- /**
- * @return deep copy of this constant pool
- */
- public ConstantPool copy() {
- ConstantPool c = null;
- try {
- c = (ConstantPool) clone();
- c.constantPool = new Constant[constantPool.length];
- for (int i = 1; i < constantPool.length; i++) {
- if (constantPool[i] != null) {
- c.constantPool[i] = constantPool[i].copy();
- }
- }
- } catch (final CloneNotSupportedException e) {
- // TODO should this throw?
- }
- return c;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantString.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantString.java
deleted file mode 100644
index e3458d2b..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantString.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from the abstract {@link Constant}
- * and represents a reference to a String object.
- *
- * @see Constant
- */
-public final class ConstantString extends Constant implements ConstantObject {
-
- private int stringIndex; // Identical to ConstantClass except for this name
-
-
- /**
- * Initialize from another object.
- */
- public ConstantString(final ConstantString c) {
- this(c.getStringIndex());
- }
-
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantString(final DataInput file) throws IOException {
- this(file.readUnsignedShort());
- }
-
-
- /**
- * @param stringIndex Index of Constant_Utf8 in constant pool
- */
- public ConstantString(final int stringIndex) {
- super(Const.CONSTANT_String);
- this.stringIndex = stringIndex;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantString(this);
- }
-
-
- /**
- * Dump constant field reference to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- file.writeByte(super.getTag());
- file.writeShort(stringIndex);
- }
-
-
- /**
- * @return Index in constant pool of the string (ConstantUtf8).
- */
- public int getStringIndex() {
- return stringIndex;
- }
-
-
- /**
- * @param stringIndex the index into the constant of the string value
- */
- public void setStringIndex( final int stringIndex ) {
- this.stringIndex = stringIndex;
- }
-
-
- /**
- * @return String representation.
- */
- @Override
- public String toString() {
- return super.toString() + "(stringIndex = " + stringIndex + ")";
- }
-
-
- /** @return String object
- */
- @Override
- public Object getConstantValue( final ConstantPool cp ) {
- final Constant c = cp.getConstant(stringIndex, Const.CONSTANT_Utf8);
- return ((ConstantUtf8) c).getBytes();
- }
-
-
- /** @return dereferenced string
- */
- public String getBytes( final ConstantPool cp ) {
- return (String) getConstantValue(cp);
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantUtf8.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantUtf8.java
deleted file mode 100644
index f421f66a..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantUtf8.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.apache.bcel.Const;
-
-/**
- * Extends the abstract {@link Constant} to represent a reference to a UTF-8 encoded string.
- *
- * The following system properties govern caching this class performs.
- *
- *
- *
{@value #SYS_PROP_CACHE_MAX_ENTRIES} (since 6.4): The size of the cache, by default 0, meaning caching is disabled.
- *
{@value #SYS_PROP_CACHE_MAX_ENTRY_SIZE} (since 6.0): The maximum size of the values to cache, by default 200, 0 disables
- * caching. Values larger than this are not cached.
- *
{@value #SYS_PROP_STATISTICS} (since 6.0): Prints statistics on the console when the JVM exits.
- *
- *
- * Here is a sample Maven invocation with caching disabled:
- *
- *
- *
- * mvn test -Dbcel.statistics=true -Dbcel.maxcached.size=0 -Dbcel.maxcached=0
- *
- *
- * Here is a sample Maven invocation with caching enabled:
- *
- *
- *
- * mvn test -Dbcel.statistics=true -Dbcel.maxcached.size=100000 -Dbcel.maxcached=5000000
- *
- *
- * @see Constant
- */
-public final class ConstantUtf8 extends Constant {
-
- private static class Cache {
-
- private static final boolean BCEL_STATISTICS = Boolean.getBoolean(SYS_PROP_STATISTICS);
- private static final int MAX_ENTRIES = Integer.getInteger(SYS_PROP_CACHE_MAX_ENTRIES, 0).intValue();
- private static final int INITIAL_CAPACITY = (int) (MAX_ENTRIES / 0.75);
-
- private static final HashMap CACHE = new LinkedHashMap(
- INITIAL_CAPACITY, 0.75f, true) {
-
- private static final long serialVersionUID = -8506975356158971766L;
-
- @Override
- protected boolean removeEldestEntry(final Map.Entry eldest) {
- return size() > MAX_ENTRIES;
- }
- };
-
- // Set the size to 0 or below to skip caching entirely
- private static final int MAX_ENTRY_SIZE = Integer.getInteger(SYS_PROP_CACHE_MAX_ENTRY_SIZE, 200).intValue();
-
- static boolean isEnabled() {
- return Cache.MAX_ENTRIES > 0 && MAX_ENTRY_SIZE > 0;
- }
-
- }
-
- // TODO these should perhaps be AtomicInt?
- private static volatile int considered = 0;
- private static volatile int created = 0;
- private static volatile int hits = 0;
- private static volatile int skipped = 0;
-
- private static final String SYS_PROP_CACHE_MAX_ENTRIES = "bcel.maxcached";
- private static final String SYS_PROP_CACHE_MAX_ENTRY_SIZE = "bcel.maxcached.size";
- private static final String SYS_PROP_STATISTICS = "bcel.statistics";
-
- static {
- if (Cache.BCEL_STATISTICS) {
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- printStats();
- }
- });
- }
- }
-
- /**
- * Clears the cache.
- *
- * @since 6.4.0
- */
- public static synchronized void clearCache() {
- Cache.CACHE.clear();
- }
-
- // for accesss by test code
- static synchronized void clearStats() {
- hits = considered = skipped = created = 0;
- }
-
- /**
- * Gets a new or cached instance of the given value.
- *
- * See {@link ConstantUtf8} class Javadoc for details.
- *
- *
- * @param value the value.
- * @return a new or cached instance of the given value.
- * @since 6.0
- */
- public static ConstantUtf8 getCachedInstance(final String value) {
- if (value.length() > Cache.MAX_ENTRY_SIZE) {
- skipped++;
- return new ConstantUtf8(value);
- }
- considered++;
- synchronized (ConstantUtf8.class) { // might be better with a specific lock object
- ConstantUtf8 result = Cache.CACHE.get(value);
- if (result != null) {
- hits++;
- return result;
- }
- result = new ConstantUtf8(value);
- Cache.CACHE.put(value, result);
- return result;
- }
- }
-
- /**
- * Gets a new or cached instance of the given value.
- *
- * See {@link ConstantUtf8} class Javadoc for details.
- *
- *
- * @param dataInput the value.
- * @return a new or cached instance of the given value.
- * @throws IOException if an I/O error occurs.
- * @since 6.0
- */
- public static ConstantUtf8 getInstance(final DataInput dataInput) throws IOException {
- return getInstance(dataInput.readUTF());
- }
-
- /**
- * Gets a new or cached instance of the given value.
- *
- * See {@link ConstantUtf8} class Javadoc for details.
- *
- *
- * @param value the value.
- * @return a new or cached instance of the given value.
- * @since 6.0
- */
- public static ConstantUtf8 getInstance(final String value) {
- return Cache.isEnabled() ? getCachedInstance(value) : new ConstantUtf8(value);
- }
-
- // for accesss by test code
- static void printStats() {
- final String prefix = "[Apache Commons BCEL]";
- System.err.printf("%s Cache hit %,d/%,d, %d skipped.%n", prefix, hits, considered, skipped);
- System.err.printf("%s Total of %,d ConstantUtf8 objects created.%n", prefix, created);
- System.err.printf("%s Configuration: %s=%,d, %s=%,d.%n", prefix, SYS_PROP_CACHE_MAX_ENTRIES, Cache.MAX_ENTRIES,
- SYS_PROP_CACHE_MAX_ENTRY_SIZE, Cache.MAX_ENTRY_SIZE);
- }
-
- private final String value;
-
- /**
- * Initializes from another object.
- *
- * @param constantUtf8 the value.
- */
- public ConstantUtf8(final ConstantUtf8 constantUtf8) {
- this(constantUtf8.getBytes());
- }
-
- /**
- * Initializes instance from file data.
- *
- * @param dataInput Input stream
- * @throws IOException
- */
- ConstantUtf8(final DataInput dataInput) throws IOException {
- super(Const.CONSTANT_Utf8);
- value = dataInput.readUTF();
- created++;
- }
-
- /**
- * @param value Data
- */
- public ConstantUtf8(final String value) {
- super(Const.CONSTANT_Utf8);
- if (value == null) {
- throw new IllegalArgumentException("Value must not be null.");
- }
- this.value = value;
- created++;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
- * I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept(final Visitor v) {
- v.visitConstantUtf8(this);
- }
-
- /**
- * Dumps String in Utf8 format to file stream.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump(final DataOutputStream file) throws IOException {
- file.writeByte(super.getTag());
- file.writeUTF(value);
- }
-
- /**
- * @return Data converted to string.
- */
- public String getBytes() {
- return value;
- }
-
- /**
- * @param bytes the raw bytes of this UTF-8
- * @deprecated (since 6.0)
- */
- @java.lang.Deprecated
- public void setBytes(final String bytes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @return String representation
- */
- @Override
- public String toString() {
- return super.toString() + "(\"" + Utility.replace(value, "\n", "\\n") + "\")";
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantValue.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantValue.java
deleted file mode 100644
index 0ca63b8e..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/ConstantValue.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from Attribute and represents a constant
- * value, i.e., a default value for initializing a class field.
- * This class is instantiated by the Attribute.readAttribute() method.
- *
- * @see Attribute
- */
-public final class ConstantValue extends Attribute {
-
- private int constantValueIndex;
-
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public ConstantValue(final ConstantValue c) {
- this(c.getNameIndex(), c.getLength(), c.getConstantValueIndex(), c.getConstantPool());
- }
-
-
- /**
- * Construct object from input stream.
- * @param name_index Name index in constant pool
- * @param length Content length in bytes
- * @param input Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- ConstantValue(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
- throws IOException {
- this(name_index, length, input.readUnsignedShort(), constant_pool);
- }
-
-
- /**
- * @param name_index Name index in constant pool
- * @param length Content length in bytes
- * @param constantValueIndex Index in constant pool
- * @param constant_pool Array of constants
- */
- public ConstantValue(final int name_index, final int length, final int constantValueIndex,
- final ConstantPool constant_pool) {
- super(Const.ATTR_CONSTANT_VALUE, name_index, length, constant_pool);
- this.constantValueIndex = constantValueIndex;
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitConstantValue(this);
- }
-
-
- /**
- * Dump constant value attribute to file stream on binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- super.dump(file);
- file.writeShort(constantValueIndex);
- }
-
-
- /**
- * @return Index in constant pool of constant value.
- */
- public int getConstantValueIndex() {
- return constantValueIndex;
- }
-
-
- /**
- * @param constantValueIndex the index info the constant pool of this constant value
- */
- public void setConstantValueIndex( final int constantValueIndex ) {
- this.constantValueIndex = constantValueIndex;
- }
-
-
- /**
- * @return String representation of constant value.
- */
- @Override
- public String toString() {
- Constant c = super.getConstantPool().getConstant(constantValueIndex);
- String buf;
- int i;
- // Print constant to string depending on its type
- switch (c.getTag()) {
- case Const.CONSTANT_Long:
- buf = String.valueOf(((ConstantLong) c).getBytes());
- break;
- case Const.CONSTANT_Float:
- buf = String.valueOf(((ConstantFloat) c).getBytes());
- break;
- case Const.CONSTANT_Double:
- buf = String.valueOf(((ConstantDouble) c).getBytes());
- break;
- case Const.CONSTANT_Integer:
- buf = String.valueOf(((ConstantInteger) c).getBytes());
- break;
- case Const.CONSTANT_String:
- i = ((ConstantString) c).getStringIndex();
- c = super.getConstantPool().getConstant(i, Const.CONSTANT_Utf8);
- buf = "\"" + Utility.convertString(((ConstantUtf8) c).getBytes()) + "\"";
- break;
- default:
- throw new IllegalStateException("Type of ConstValue invalid: " + c);
- }
- return buf;
- }
-
-
- /**
- * @return deep copy of this attribute
- */
- @Override
- public Attribute copy( final ConstantPool _constant_pool ) {
- final ConstantValue c = (ConstantValue) clone();
- c.setConstantPool(_constant_pool);
- return c;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Deprecated.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Deprecated.java
deleted file mode 100644
index 0b67e86e..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/Deprecated.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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 java.io.DataInput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.bcel.Const;
-
-/**
- * This class is derived from Attribute and denotes that this is a
- * deprecated method.
- * It is instantiated from the Attribute.readAttribute() method.
- *
- * @see Attribute
- */
-public final class Deprecated extends Attribute {
-
- private byte[] bytes;
-
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Deprecated(final Deprecated c) {
- this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
- }
-
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param bytes Attribute contents
- * @param constant_pool Array of constants
- */
- public Deprecated(final int name_index, final int length, final byte[] bytes, final ConstantPool constant_pool) {
- super(Const.ATTR_DEPRECATED, name_index, length, constant_pool);
- this.bytes = bytes;
- }
-
-
- /**
- * Construct object from input stream.
- *
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param input Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- Deprecated(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
- throws IOException {
- this(name_index, length, (byte[]) null, constant_pool);
- if (length > 0) {
- bytes = new byte[length];
- input.readFully(bytes);
- println("Deprecated attribute with length > 0");
- }
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- @Override
- public void accept( final Visitor v ) {
- v.visitDeprecated(this);
- }
-
-
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- @Override
- public void dump( final DataOutputStream file ) throws IOException {
- super.dump(file);
- if (super.getLength() > 0) {
- file.write(bytes, 0, super.getLength());
- }
- }
-
-
- /**
- * @return data bytes.
- */
- public byte[] getBytes() {
- return bytes;
- }
-
-
- /**
- * @param bytes the raw bytes that represents this byte array
- */
- public void setBytes( final byte[] bytes ) {
- this.bytes = bytes;
- }
-
-
- /**
- * @return attribute name
- */
- @Override
- public String toString() {
- return Const.getAttributeName(Const.ATTR_DEPRECATED);
- }
-
-
- /**
- * @return deep copy of this attribute
- */
- @Override
- public Attribute copy( final ConstantPool _constant_pool ) {
- final Deprecated c = (Deprecated) clone();
- if (bytes != null) {
- c.bytes = new byte[bytes.length];
- System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
- }
- c.setConstantPool(_constant_pool);
- return c;
- }
-}
diff --git a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/DescendingVisitor.java b/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/DescendingVisitor.java
deleted file mode 100644
index a1eb096f..00000000
--- a/bundles/jamopp.parser.bcel/src/org/apache/bcel/classfile/DescendingVisitor.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * 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 java.util.Stack;
-
-/**
- * Traverses a JavaClass with another Visitor object 'piggy-backed' that is
- * applied to all components of a JavaClass object. I.e. this class supplies the
- * traversal strategy, other classes can make use of it.
- *
- */
-public class DescendingVisitor implements Visitor
-{
- private final JavaClass clazz;
-
- private final Visitor visitor;
-
- private final Stack