Bug 525526: upgrade to ASM 6.0 final (CQ: 14395)
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
Reviewed-by: TomasK
diff --git a/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF b/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF
index b0a3064..77d7700 100644
--- a/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF
@@ -1,4 +1,5 @@
Manifest-Version: 1.0
+Automatic-Module-Name: eclipselink.asm
Export-Package: org.eclipse.persistence.internal.libraries.asm.signatu
re;version="6.0.0",org.eclipse.persistence.internal.libraries.asm.com
mons;version="6.0.0";uses:="org.eclipse.persistence.internal.librarie
@@ -21,10 +22,10 @@
Bundle-Name: EclipseLink ASM
Created-By: 1.8.0_121 (Sun Microsystems Inc.)
HK2-Bundle-Name: org.eclipse.persistence:org.eclipse.persistence.asm
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Implementation-Vendor: Eclipse.org - EclipseLink Project
Bundle-Vendor: Eclipse.org - EclipseLink Project
-Bundle-Version: 6.0.0.v201702131300
+Bundle-Version: 6.0.0.qualifier
Bundle-ManifestVersion: 2
Import-Package: javax.xml.transform;resolution:=optional,javax.xml.tra
nsform.sax;resolution:=optional,javax.xml.transform.stream;resolution
diff --git a/plugins/org.eclipse.persistence.asm/README b/plugins/org.eclipse.persistence.asm/README
new file mode 100644
index 0000000..4c87825
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/README
@@ -0,0 +1,22 @@
+to update ASM library:
+-obtain a CQ
+-get ASM sources and unpack them to some <tmp> folder
+-create a properties file 'asm.properties' with following content:
+org.objectweb=org.eclipse.persistence.internal.libraries
+-run:
+java -cp $eclipselink_home/utils/eclipselink.utils.rename/package-rename.jar \
+org.eclipse.persistence.utils.rename.MigrateTopLinkToEclipseLink <tmp>/org/objectweb <dst> asm.properties
+-copy <dst>/* to $eclipselink_home/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries
+-update 'release.version' property in 'antbuild.xml'
+-update release version in 'about.html' and 'readme.html'
+
+-commit changes
+-build final artifact with:
+ant -f antbuild.xml -Dbuild.type=RELEASE bld
+
+-commit & push changes
+-rebuild compdeps
+-update asm version in the source tree
+-commit and push the change
+
+done.
\ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/about.html b/plugins/org.eclipse.persistence.asm/about.html
index 6b03e88..19398f3 100644
--- a/plugins/org.eclipse.persistence.asm/about.html
+++ b/plugins/org.eclipse.persistence.asm/about.html
@@ -3,16 +3,16 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About ASM 6.0.0.ALPHA</title>
+<title>About ASM 6.0.0</title>
</head>
<body lang="EN-US">
-<h1>ASM 6.0.0.ALPHA</h1>
+<h1>ASM 6.0.0</h1>
<h2>License </h2>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content").
Unless otherwise indicated below, the Content is provided to you under the terms
and conditions of the Eclipse Public License Version 1.0 ("EPL") and
- Eclipse Distribution License Version 1.0 (EDL). A copy of the EPL is available at
+ Eclipse Distribution License Version 1.0 ("EDL"). A copy of the EPL is available at
<a href="http://www.eclipse.org/legal/epl-v10.html"> http://www.eclipse.org/legal/epl-v10.html</a>
and a copy of the EDL is available at <a href="http://www.eclipse.org/org/documents/edl-v10.php">
http://www.eclipse.org/org/documents/edl-v10.php</a>. For purposes of the EPL, "Program"
@@ -29,7 +29,7 @@
out below. If you did not receive this Content directly from the Eclipse Foundation,
the following is provided for informational purposes only, and you should look
to the Redistributor’s license for terms and conditions of use.</p>
-<h3><a name="ASM" id="ASM"></a>ASM v6.0.0.ALPHA</h3>
+<h3><a name="ASM" id="ASM"></a>ASM v6.0.0</h3>
<blockquote>
<p>The EclipseLink Project includes ASM for the purpose of
diff --git a/plugins/org.eclipse.persistence.asm/antbuild.xml b/plugins/org.eclipse.persistence.asm/antbuild.xml
index 5d84c5e..b805949 100644
--- a/plugins/org.eclipse.persistence.asm/antbuild.xml
+++ b/plugins/org.eclipse.persistence.asm/antbuild.xml
@@ -43,6 +43,8 @@
<!-- clean -->
<target name="clean" depends="init" description="Clean the build">
+ <!-- remove stored manifest for regen -->
+ <delete dir="${asm.classes.dir}/META-INF" includeEmptyDirs="true" failonerror="false" quiet="true"/>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${asm.2.common.plugins.dir}" includes="${ant.project.name}_*.jar, ${ant.project.name}.source_*.jar"/>
</delete>
@@ -62,10 +64,19 @@
<!-- Properties usually defined in build.properties, set here to avoid easy redefinition. -->
<!-- Version properties -->
- <property name="release.version" value="6.0.0"/>
- <!-- Project infrastructure properties -->
- <property name="src.dir" value="src"/>
- <property name="asm.classes.dir" value="${asm.build.location}"/> <!-- "." -->
+ <property name="release.version" value="6.0.0"/>
+
+ <condition property="javac.debug" value="false"
+ else="true">
+ <equals arg1="${build.type}" arg2="RELEASE"/>
+ </condition>
+ <property name="javac.debuglevel" value="lines,vars,source"/>
+ <property name="javac.version" value="1.7"/>
+ <property name="javac.optimize" value="false"/>
+ <property name="javac.deprecation" value="false"/>
+ <property name="src.dir" value="src"/>
+ <property name="classes.dir" value="bin"/>
+ <property name="asm.classes.dir" value="${asm.build.location}/${classes.dir}"/>
<!-- local property overrides -->
<condition property="custom.properties.message" value="Loading ${user.home}/build.properties..."
@@ -86,11 +97,6 @@
</condition>
<echo message="extensions.depend.dir = '${extensions.depend.dir}'"/>
- <!-- Set Compile Path-->
- <path id="asm.compile.path">
- <pathelement path="${asm.2.common.plugins.dir}/osgi.core.zip"/>
- <pathelement path="${asm.2.common.plugins.dir}/osgi.cmpn_4.1.0.jar"/>
- </path>
</target>
<target name="package-init" depends="init">
@@ -101,8 +107,10 @@
<format property="build.time" pattern="HHmm"/>
</tstamp>
<property name="build.type" value="SNAPSHOT"/>
- <property name="svn.revision" value="NA"/>
- <property name="version.qualifier" value="v201702131300"/>
+ <condition property="version.qualifier" value="v${build.date}${build.time}"
+ else="qualifier">
+ <equals arg1="${build.type}" arg2="RELEASE"/>
+ </condition>
<property name="version.string" value="${release.version}.${version.qualifier}"/>
<property name="release.designation" value="EclipseLink ${release.version} Build"/>
<property name="specification.vendor" value="Eclipse.org - EclipseLink Project"/>
@@ -112,11 +120,12 @@
<!-- compile -->
<target name="compile" depends="compile-init" description="Compile bundle code">
<!-- remove stored classes for recompile -->
- <delete dir="${asm.build.location}/org" includeEmptyDirs="true" failonerror="false" quiet="true"/>
- <property name="javac.version" value="1.7"/>
+ <delete dir="${asm.classes.dir}/org" includeEmptyDirs="true" failonerror="false" quiet="true"/>
+ <mkdir dir="${asm.classes.dir}"/>
<javac srcdir="${src.dir}"
destdir="${asm.classes.dir}"
includes="org/eclipse/persistence/**/*.java"
+ debug="${javac.debug}"
debuglevel="${javac.debuglevel}"
encoding="UTF-8"
optimize="${javac.optimize}"
@@ -126,13 +135,15 @@
failonerror="true"
memoryMaximumSize="512m"
fork="true"
- classpathref="asm.compile.path"
/>
</target>
<!-- package -->
<target name="package" depends="package-init" description="jar OSGI bundle">
- <jar jarfile="${asm.2.common.plugins.dir}/${ant.project.name}_${version.string}.jar" manifest="META-INF/MANIFEST.MF">
+ <mkdir dir="${asm.classes.dir}/META-INF"/>
+ <copy file="META-INF/MANIFEST.MF" todir="${asm.classes.dir}/META-INF"/>
+ <replace file="${asm.classes.dir}/META-INF/MANIFEST.MF" token="${release.version}.qualifier" value="${version.string}" />
+ <jar jarfile="${asm.2.common.plugins.dir}/${ant.project.name}_${version.string}.jar" manifest="${asm.classes.dir}/META-INF/MANIFEST.MF">
<fileset dir="${asm.2.base.dir}">
<include name="license.*"/>
</fileset>
diff --git a/plugins/org.eclipse.persistence.asm/readme.html b/plugins/org.eclipse.persistence.asm/readme.html
index 3af7104..dff45d0 100644
--- a/plugins/org.eclipse.persistence.asm/readme.html
+++ b/plugins/org.eclipse.persistence.asm/readme.html
@@ -3,11 +3,11 @@
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<TITLE>ASM 6.0.0.ALPHA Readme</TITLE>
+<TITLE>ASM 6.0.0 Readme</TITLE>
</HEAD>
<BODY>
<DIV class=Section0>
-<P style="TEXT-ALIGN: center" align=center><B>ASM 6.0.0.ALPHA Read Me</B> </P>
+<P style="TEXT-ALIGN: center" align=center><B>ASM 6.0.0 Read Me</B> </P>
<P>The <A href="http://www.eclipse.org/eclipselink">EclipseLink</A> project
includes ASM for the purpose of byte code weaving. The ASM library is
re-packaged within the source of the
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java
index 1596a01..ed4faf9 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java
@@ -89,7 +89,7 @@ public AnnotationVisitor(final int api, final AnnotationVisitor av) {
* the actual value, whose type must be {@link Byte},
* {@link Boolean}, {@link Character}, {@link Short},
* {@link Integer} , {@link Long}, {@link Float}, {@link Double},
- * {@link String} or {@link Type} or OBJECT or ARRAY sort. This
+ * {@link String} or {@link Type} of OBJECT or ARRAY sort. This
* value can also be an array of byte, boolean, short, char, int,
* long, float or double values (this is equivalent to using
* {@link #visitArray visitArray} and visiting each array element
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java
index d5b491f..c64bde8 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java
@@ -42,30 +42,6 @@
* @author Eugene Kuleshov
*/
public class ClassReader {
- /**
- * True to enable signatures support.
- */
- static final boolean SIGNATURES = true;
-
- /**
- * True to enable annotations support.
- */
- static final boolean ANNOTATIONS = true;
-
- /**
- * True to enable stack map frames support.
- */
- static final boolean FRAMES = true;
-
- /**
- * True to enable bytecode writing support.
- */
- static final boolean WRITER = true;
-
- /**
- * True to enable JSR_W and GOTO_W support.
- */
- static final boolean RESIZE = true;
/**
* Flag to skip method code. If this class is set <code>CODE</code>
@@ -104,6 +80,21 @@ public class ClassReader {
public static final int EXPAND_FRAMES = 8;
/**
+ * Flag to expand the ASM pseudo instructions into an equivalent sequence of
+ * standard bytecode instructions. When resolving a forward jump it may
+ * happen that the signed 2 bytes offset reserved for it is not sufficient
+ * to store the bytecode offset. In this case the jump instruction is
+ * replaced with a temporary ASM pseudo instruction using an unsigned 2
+ * bytes offset (see Label#resolve). This internal flag is used to re-read
+ * classes containing such instructions, in order to replace them with
+ * standard instructions. In addition, when this flag is used, GOTO_W and
+ * JSR_W are <i>not</i> converted into GOTO and JSR, to make sure that
+ * infinite loops where a GOTO_W is replaced with a GOTO in ClassReader and
+ * converted back to a GOTO_W in ClassWriter cannot occur.
+ */
+ static final int EXPAND_ASM_INSNS = 256;
+
+ /**
* The class to be parsed. <i>The content of this array must not be
* modified. This field is intended for {@link Attribute} sub classes, and
* is normally not needed by class generators or adapters.</i>
@@ -165,7 +156,7 @@ public ClassReader(final byte[] b) {
public ClassReader(final byte[] b, final int off, final int len) {
this.b = b;
// checks the class version
- if (readShort(off + 6) > Opcodes.V1_9) {
+ if (readShort(off + 6) > Opcodes.V9) {
throw new IllegalArgumentException();
}
// parses the constant pool
@@ -204,6 +195,8 @@ public ClassReader(final byte[] b, final int off, final int len) {
// case ClassWriter.CLASS:
// case ClassWriter.STR:
// case ClassWriter.MTYPE
+ // case ClassWriter.PACKAGE:
+ // case ClassWriter.MODULE:
default:
size = 3;
break;
@@ -347,7 +340,9 @@ void copyPool(final ClassWriter classWriter) {
break;
// case ClassWriter.STR:
// case ClassWriter.CLASS:
- // case ClassWriter.MTYPE
+ // case ClassWriter.MTYPE:
+ // case ClassWriter.MODULE:
+ // case ClassWriter.PACKAGE:
default:
item.set(tag, readUTF8(index, buf), null, null);
break;
@@ -554,12 +549,14 @@ public void accept(final ClassVisitor classVisitor,
String enclosingOwner = null;
String enclosingName = null;
String enclosingDesc = null;
+ String moduleMainClass = null;
int anns = 0;
int ianns = 0;
int tanns = 0;
int itanns = 0;
int innerClasses = 0;
int module = 0;
+ int packages = 0;
Attribute attributes = null;
u = getAttributes();
@@ -578,13 +575,11 @@ public void accept(final ClassVisitor classVisitor,
enclosingName = readUTF8(items[item], c);
enclosingDesc = readUTF8(items[item] + 2, c);
}
- } else if (SIGNATURES && "Signature".equals(attrName)) {
+ } else if ("Signature".equals(attrName)) {
signature = readUTF8(u + 8, c);
- } else if (ANNOTATIONS
- && "RuntimeVisibleAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleAnnotations".equals(attrName)) {
anns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleTypeAnnotations".equals(attrName)) {
tanns = u + 8;
} else if ("Deprecated".equals(attrName)) {
access |= Opcodes.ACC_DEPRECATED;
@@ -594,14 +589,16 @@ public void accept(final ClassVisitor classVisitor,
} else if ("SourceDebugExtension".equals(attrName)) {
int len = readInt(u + 4);
sourceDebug = readUTF(u + 8, len, new char[len]);
- } else if (ANNOTATIONS
- && "RuntimeInvisibleAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleAnnotations".equals(attrName)) {
ianns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleTypeAnnotations".equals(attrName)) {
itanns = u + 8;
} else if ("Module".equals(attrName)) {
module = u + 8;
+ } else if ("ModuleMainClass".equals(attrName)) {
+ moduleMainClass = readClass(u + 8, c);
+ } else if ("ModulePackages".equals(attrName)) {
+ packages = u + 10;
} else if ("BootstrapMethods".equals(attrName)) {
int[] bootstrapMethods = new int[readUnsignedShort(u + 8)];
for (int j = 0, v = u + 10; j < bootstrapMethods.length; j++) {
@@ -630,9 +627,10 @@ public void accept(final ClassVisitor classVisitor,
classVisitor.visitSource(sourceFile, sourceDebug);
}
- // visits the module info
+ // visits the module info and associated attributes
if (module != 0) {
- readModule(classVisitor, context, module);
+ readModule(classVisitor, context, module,
+ moduleMainClass, packages);
}
// visits the outer class
@@ -642,19 +640,19 @@ public void accept(final ClassVisitor classVisitor,
}
// visits the class annotations and type annotations
- if (ANNOTATIONS && anns != 0) {
+ if (anns != 0) {
for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
v = readAnnotationValues(v + 2, c, true,
classVisitor.visitAnnotation(readUTF8(v, c), true));
}
}
- if (ANNOTATIONS && ianns != 0) {
+ if (ianns != 0) {
for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
v = readAnnotationValues(v + 2, c, true,
classVisitor.visitAnnotation(readUTF8(v, c), false));
}
}
- if (ANNOTATIONS && tanns != 0) {
+ if (tanns != 0) {
for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
v = readAnnotationTarget(context, v);
v = readAnnotationValues(v + 2, c, true,
@@ -662,7 +660,7 @@ public void accept(final ClassVisitor classVisitor,
context.typePath, readUTF8(v, c), true));
}
}
- if (ANNOTATIONS && itanns != 0) {
+ if (itanns != 0) {
for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
v = readAnnotationTarget(context, v);
v = readAnnotationValues(v + 2, c, true,
@@ -711,46 +709,87 @@ public void accept(final ClassVisitor classVisitor,
* the current class visitor
* @param context
* information about the class being parsed.
- * @param moduleOffset
- * the start offset of the module attribute in the class file.
- * @return
+ * @param u
+ * start offset of the module attribute in the class file.
+ * @param mainClass
+ * name of the main class of a module or null.
+ * @param packages
+ * start offset of the concealed package attribute.
*/
private void readModule(final ClassVisitor classVisitor,
- final Context context, int u) {
- ModuleVisitor mv = classVisitor.visitModule();
+ final Context context, int u,
+ final String mainClass, int packages) {
+
+ char[] buffer = context.buffer;
+
+ // reads module name, flags and version
+ String name = readModule(u, buffer);
+ int flags = readUnsignedShort(u + 2);
+ String version = readUTF8(u + 4, buffer);
+ u += 6;
+
+ ModuleVisitor mv = classVisitor.visitModule(name, flags, version);
if (mv == null) {
return;
}
- char[] buffer = context.buffer;
+
+ // module attributes (main class, packages)
+ if (mainClass != null) {
+ mv.visitMainClass(mainClass);
+ }
+
+ if (packages != 0) {
+ for (int i = readUnsignedShort(packages - 2); i > 0; --i) {
+ String packaze = readPackage(packages, buffer);
+ mv.visitPackage(packaze);
+ packages += 2;
+ }
+ }
// reads requires
u += 2;
for (int i = readUnsignedShort(u - 2); i > 0; --i) {
- //FIXME emulate ACC_PUBLIC wrong value (0x0020)
- String module = readUTF8(u, buffer);
+ String module = readModule(u, buffer);
int access = readUnsignedShort(u + 2);
- if ((access & 0x0020) != 0) {
- access = access & ~ 0x0020 | Opcodes.ACC_PUBLIC;
- }
- mv.visitRequire(module, access);
- u += 4;
+ String requireVersion = readUTF8(u + 4, buffer);
+ mv.visitRequire(module, access, requireVersion);
+ u += 6;
}
// reads exports
u += 2;
for (int i = readUnsignedShort(u - 2); i > 0; --i) {
- String export = readUTF8(u, buffer);
- int exportToCount = readUnsignedShort(u + 2);
- u += 4;
+ String export = readPackage(u, buffer);
+ int access = readUnsignedShort(u + 2);
+ int exportToCount = readUnsignedShort(u + 4);
+ u += 6;
String[] tos = null;
if (exportToCount != 0) {
tos = new String[exportToCount];
for (int j = 0; j < tos.length; ++j) {
- tos[j] = readUTF8(u, buffer);
+ tos[j] = readModule(u, buffer);
u += 2;
}
}
- mv.visitExport(export, tos);
+ mv.visitExport(export, access, tos);
+ }
+
+ // reads opens
+ u += 2;
+ for (int i = readUnsignedShort(u - 2); i > 0; --i) {
+ String open = readPackage(u, buffer);
+ int access = readUnsignedShort(u + 2);
+ int openToCount = readUnsignedShort(u + 4);
+ u += 6;
+ String[] tos = null;
+ if (openToCount != 0) {
+ tos = new String[openToCount];
+ for (int j = 0; j < tos.length; ++j) {
+ tos[j] = readModule(u, buffer);
+ u += 2;
+ }
+ }
+ mv.visitOpen(open, access, tos);
}
// read uses
@@ -763,8 +802,15 @@ private void readModule(final ClassVisitor classVisitor,
// read provides
u += 2;
for (int i = readUnsignedShort(u - 2); i > 0; --i) {
- mv.visitProvide(readClass(u, buffer), readClass(u + 2, buffer));
+ String service = readClass(u, buffer);
+ int provideWithCount = readUnsignedShort(u + 2);
u += 4;
+ String[] withs = new String[provideWithCount];
+ for (int j = 0; j < withs.length; ++j) {
+ withs[j] = readClass(u, buffer);
+ u += 2;
+ }
+ mv.visitProvide(service, withs);
}
mv.visitEnd();
@@ -806,24 +852,20 @@ private int readField(final ClassVisitor classVisitor,
if ("ConstantValue".equals(attrName)) {
int item = readUnsignedShort(u + 8);
value = item == 0 ? null : readConst(item, c);
- } else if (SIGNATURES && "Signature".equals(attrName)) {
+ } else if ("Signature".equals(attrName)) {
signature = readUTF8(u + 8, c);
} else if ("Deprecated".equals(attrName)) {
access |= Opcodes.ACC_DEPRECATED;
} else if ("Synthetic".equals(attrName)) {
access |= Opcodes.ACC_SYNTHETIC
| ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if (ANNOTATIONS
- && "RuntimeVisibleAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleAnnotations".equals(attrName)) {
anns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleTypeAnnotations".equals(attrName)) {
tanns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleAnnotations".equals(attrName)) {
ianns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleTypeAnnotations".equals(attrName)) {
itanns = u + 8;
} else {
Attribute attr = readAttribute(context.attrs, attrName, u + 8,
@@ -845,19 +887,19 @@ private int readField(final ClassVisitor classVisitor,
}
// visits the field annotations and type annotations
- if (ANNOTATIONS && anns != 0) {
+ if (anns != 0) {
for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
v = readAnnotationValues(v + 2, c, true,
fv.visitAnnotation(readUTF8(v, c), true));
}
}
- if (ANNOTATIONS && ianns != 0) {
+ if (ianns != 0) {
for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
v = readAnnotationValues(v + 2, c, true,
fv.visitAnnotation(readUTF8(v, c), false));
}
}
- if (ANNOTATIONS && tanns != 0) {
+ if (tanns != 0) {
for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
v = readAnnotationTarget(context, v);
v = readAnnotationValues(v + 2, c, true,
@@ -865,7 +907,7 @@ private int readField(final ClassVisitor classVisitor,
context.typePath, readUTF8(v, c), true));
}
}
- if (ANNOTATIONS && itanns != 0) {
+ if (itanns != 0) {
for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
v = readAnnotationTarget(context, v);
v = readAnnotationValues(v + 2, c, true,
@@ -939,32 +981,26 @@ private int readMethod(final ClassVisitor classVisitor,
exceptions[j] = readClass(exception, c);
exception += 2;
}
- } else if (SIGNATURES && "Signature".equals(attrName)) {
+ } else if ("Signature".equals(attrName)) {
signature = readUTF8(u + 8, c);
} else if ("Deprecated".equals(attrName)) {
context.access |= Opcodes.ACC_DEPRECATED;
- } else if (ANNOTATIONS
- && "RuntimeVisibleAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleAnnotations".equals(attrName)) {
anns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleTypeAnnotations".equals(attrName)) {
tanns = u + 8;
- } else if (ANNOTATIONS && "AnnotationDefault".equals(attrName)) {
+ } else if ("AnnotationDefault".equals(attrName)) {
dann = u + 8;
} else if ("Synthetic".equals(attrName)) {
context.access |= Opcodes.ACC_SYNTHETIC
| ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleAnnotations".equals(attrName)) {
ianns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleTypeAnnotations".equals(attrName)) {
itanns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeVisibleParameterAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleParameterAnnotations".equals(attrName)) {
mpanns = u + 8;
- } else if (ANNOTATIONS
- && "RuntimeInvisibleParameterAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleParameterAnnotations".equals(attrName)) {
impanns = u + 8;
} else if ("MethodParameters".equals(attrName)) {
methodParameters = u + 8;
@@ -997,7 +1033,7 @@ private int readMethod(final ClassVisitor classVisitor,
* access, name and descriptor can have been changed, this is not
* important since they are not copied as is from the reader).
*/
- if (WRITER && mv instanceof MethodWriter) {
+ if (mv instanceof MethodWriter) {
MethodWriter mw = (MethodWriter) mv;
if (mw.cw.cr == this && signature == mw.signature) {
boolean sameExceptions = false;
@@ -1034,26 +1070,26 @@ private int readMethod(final ClassVisitor classVisitor,
}
// visits the method annotations
- if (ANNOTATIONS && dann != 0) {
+ if (dann != 0) {
AnnotationVisitor dv = mv.visitAnnotationDefault();
readAnnotationValue(dann, c, null, dv);
if (dv != null) {
dv.visitEnd();
}
}
- if (ANNOTATIONS && anns != 0) {
+ if (anns != 0) {
for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
v = readAnnotationValues(v + 2, c, true,
mv.visitAnnotation(readUTF8(v, c), true));
}
}
- if (ANNOTATIONS && ianns != 0) {
+ if (ianns != 0) {
for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
v = readAnnotationValues(v + 2, c, true,
mv.visitAnnotation(readUTF8(v, c), false));
}
}
- if (ANNOTATIONS && tanns != 0) {
+ if (tanns != 0) {
for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
v = readAnnotationTarget(context, v);
v = readAnnotationValues(v + 2, c, true,
@@ -1061,7 +1097,7 @@ private int readMethod(final ClassVisitor classVisitor,
context.typePath, readUTF8(v, c), true));
}
}
- if (ANNOTATIONS && itanns != 0) {
+ if (itanns != 0) {
for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
v = readAnnotationTarget(context, v);
v = readAnnotationValues(v + 2, c, true,
@@ -1069,10 +1105,10 @@ private int readMethod(final ClassVisitor classVisitor,
context.typePath, readUTF8(v, c), false));
}
}
- if (ANNOTATIONS && mpanns != 0) {
+ if (mpanns != 0) {
readParameterAnnotations(mv, context, mpanns, true);
}
- if (ANNOTATIONS && impanns != 0) {
+ if (impanns != 0) {
readParameterAnnotations(mv, context, impanns, false);
}
@@ -1119,7 +1155,7 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
int codeStart = u;
int codeEnd = u + codeLength;
Label[] labels = context.labels = new Label[codeLength + 2];
- readLabel(codeLength + 1, labels);
+ createLabel(codeLength + 1, labels);
while (u < codeEnd) {
int offset = u - codeStart;
int opcode = b[u] & 0xFF;
@@ -1129,11 +1165,16 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
u += 1;
break;
case ClassWriter.LABEL_INSN:
- readLabel(offset + readShort(u + 1), labels);
+ createLabel(offset + readShort(u + 1), labels);
+ u += 3;
+ break;
+ case ClassWriter.ASM_LABEL_INSN:
+ createLabel(offset + readUnsignedShort(u + 1), labels);
u += 3;
break;
case ClassWriter.LABELW_INSN:
- readLabel(offset + readInt(u + 1), labels);
+ case ClassWriter.ASM_LABELW_INSN:
+ createLabel(offset + readInt(u + 1), labels);
u += 5;
break;
case ClassWriter.WIDE_INSN:
@@ -1148,9 +1189,9 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
// skips 0 to 3 padding bytes
u = u + 4 - (offset & 3);
// reads instruction
- readLabel(offset + readInt(u), labels);
+ createLabel(offset + readInt(u), labels);
for (int i = readInt(u + 8) - readInt(u + 4) + 1; i > 0; --i) {
- readLabel(offset + readInt(u + 12), labels);
+ createLabel(offset + readInt(u + 12), labels);
u += 4;
}
u += 12;
@@ -1159,9 +1200,9 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
// skips 0 to 3 padding bytes
u = u + 4 - (offset & 3);
// reads instruction
- readLabel(offset + readInt(u), labels);
+ createLabel(offset + readInt(u), labels);
for (int i = readInt(u + 4); i > 0; --i) {
- readLabel(offset + readInt(u + 12), labels);
+ createLabel(offset + readInt(u + 12), labels);
u += 8;
}
u += 8;
@@ -1191,9 +1232,9 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
// reads the try catch entries to find the labels, and also visits them
for (int i = readUnsignedShort(u); i > 0; --i) {
- Label start = readLabel(readUnsignedShort(u + 2), labels);
- Label end = readLabel(readUnsignedShort(u + 4), labels);
- Label handler = readLabel(readUnsignedShort(u + 6), labels);
+ Label start = createLabel(readUnsignedShort(u + 2), labels);
+ Label end = createLabel(readUnsignedShort(u + 4), labels);
+ Label handler = createLabel(readUnsignedShort(u + 6), labels);
String type = readUTF8(items[readUnsignedShort(u + 8)], c);
mv.visitTryCatchBlock(start, end, handler, type);
u += 8;
@@ -1224,13 +1265,9 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
varTable = u + 8;
for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
int label = readUnsignedShort(v + 10);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
+ createDebugLabel(label, labels);
label += readUnsignedShort(v + 12);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
+ createDebugLabel(label, labels);
v += 10;
}
}
@@ -1240,9 +1277,7 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
if ((context.flags & SKIP_DEBUG) == 0) {
for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
int label = readUnsignedShort(v + 10);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
+ createDebugLabel(label, labels);
Label l = labels[label];
while (l.line > 0) {
if (l.next == null) {
@@ -1254,17 +1289,15 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
v += 4;
}
}
- } else if (ANNOTATIONS
- && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeVisibleTypeAnnotations".equals(attrName)) {
tanns = readTypeAnnotations(mv, context, u + 8, true);
ntoff = tanns.length == 0 || readByte(tanns[0]) < 0x43 ? -1
: readUnsignedShort(tanns[0] + 1);
- } else if (ANNOTATIONS
- && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ } else if ("RuntimeInvisibleTypeAnnotations".equals(attrName)) {
itanns = readTypeAnnotations(mv, context, u + 8, false);
nitoff = itanns.length == 0 || readByte(itanns[0]) < 0x43 ? -1
: readUnsignedShort(itanns[0] + 1);
- } else if (FRAMES && "StackMapTable".equals(attrName)) {
+ } else if ("StackMapTable".equals(attrName)) {
if ((context.flags & SKIP_FRAMES) == 0) {
stackMap = u + 10;
stackMapSize = readInt(u + 4);
@@ -1288,7 +1321,7 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
* this by parsing the stack map table without a full decoding
* (see below).
*/
- } else if (FRAMES && "StackMap".equals(attrName)) {
+ } else if ("StackMap".equals(attrName)) {
if ((context.flags & SKIP_FRAMES) == 0) {
zip = false;
stackMap = u + 10;
@@ -1317,7 +1350,7 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
u += 2;
// generates the first (implicit) stack map frame
- if (FRAMES && stackMap != 0) {
+ if (stackMap != 0) {
/*
* for the first explicit frame the offset is not offset_delta + 1
* but only offset_delta; setting the implicit frame offset to -1
@@ -1350,14 +1383,31 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
int v = readUnsignedShort(i + 1);
if (v >= 0 && v < codeLength) {
if ((b[codeStart + v] & 0xFF) == Opcodes.NEW) {
- readLabel(v, labels);
+ createLabel(v, labels);
}
}
}
}
}
+ if ((context.flags & EXPAND_ASM_INSNS) != 0
+ && (context.flags & EXPAND_FRAMES) != 0) {
+ // Expanding the ASM pseudo instructions can introduce F_INSERT
+ // frames, even if the method does not currently have any frame.
+ // Also these inserted frames must be computed by simulating the
+ // effect of the bytecode instructions one by one, starting from the
+ // first one and the last existing frame (or the implicit first
+ // one). Finally, due to the way MethodWriter computes this (with
+ // the compute = INSERTED_FRAMES option), MethodWriter needs to know
+ // maxLocals before the first instruction is visited. For all these
+ // reasons we always visit the implicit first frame in this case
+ // (passing only maxLocals - the rest can be and is computed in
+ // MethodWriter).
+ mv.visitFrame(Opcodes.F_NEW, maxLocals, null, 0, null);
+ }
// visits the instructions
+ int opcodeDelta = (context.flags & EXPAND_ASM_INSNS) == 0 ? -33 : 0;
+ boolean insertFrame = false;
u = codeStart;
while (u < codeEnd) {
int offset = u - codeStart;
@@ -1378,7 +1428,7 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
}
// visits the frame for this offset, if any
- while (FRAMES && frame != null
+ while (frame != null
&& (frame.offset == offset || frame.offset == -1)) {
// if there is a frame for this offset, makes the visitor visit
// it, and reads the next frame if there is one.
@@ -1390,6 +1440,9 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
mv.visitFrame(frame.mode, frame.localDiff, frame.local,
frame.stackCount, frame.stack);
}
+ // if there is already a frame for this offset, there is no
+ // need to insert a new one.
+ insertFrame = false;
}
if (frameCount > 0) {
stackMap = readFrame(stackMap, zip, unzip, frame);
@@ -1398,6 +1451,13 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
frame = null;
}
}
+ // inserts a frame for this offset, if requested by setting
+ // insertFrame to true during the previous iteration. The actual
+ // frame content will be computed in MethodWriter.
+ if (insertFrame) {
+ mv.visitFrame(ClassWriter.F_INSERT, 0, null, 0, null);
+ insertFrame = false;
+ }
// visits the instruction at this offset
int opcode = b[u] & 0xFF;
@@ -1422,9 +1482,47 @@ private void readCode(final MethodVisitor mv, final Context context, int u) {
u += 3;
break;
case ClassWriter.LABELW_INSN:
- mv.visitJumpInsn(opcode - 33, labels[offset + readInt(u + 1)]);
+ mv.visitJumpInsn(opcode + opcodeDelta, labels[offset
+ + readInt(u + 1)]);
u += 5;
break;
+ case ClassWriter.ASM_LABEL_INSN: {
+ // changes temporary opcodes 202 to 217 (inclusive), 218
+ // and 219 to IFEQ ... JSR (inclusive), IFNULL and
+ // IFNONNULL
+ opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+ Label target = labels[offset + readUnsignedShort(u + 1)];
+ // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
+ // <l> with IFNOTxxx <L> GOTO_W <l> L:..., where IFNOTxxx is
+ // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
+ // and where <L> designates the instruction just after
+ // the GOTO_W.
+ if (opcode == Opcodes.GOTO || opcode == Opcodes.JSR) {
+ mv.visitJumpInsn(opcode + 33, target);
+ } else {
+ opcode = opcode <= 166 ? ((opcode + 1) ^ 1) - 1
+ : opcode ^ 1;
+ Label endif = createLabel(offset + 3, labels);
+ mv.visitJumpInsn(opcode, endif);
+ mv.visitJumpInsn(200, target); // GOTO_W
+ // endif designates the instruction just after GOTO_W,
+ // and is visited as part of the next instruction. Since
+ // it is a jump target, we need to insert a frame here.
+ insertFrame = true;
+ }
+ u += 3;
+ break;
+ }
+ case ClassWriter.ASM_LABELW_INSN: {
+ // replaces the pseudo GOTO_W instruction with a real one.
+ mv.visitJumpInsn(200, labels[offset + readInt(u + 1)]);
+ // The instruction just after is a jump target (because pseudo
+ // GOTO_W are used in patterns IFNOTxxx <L> GOTO_W <l> L:...,
+ // see MethodWriter), so we need to insert a frame here.
+ insertFrame = true;
+ u += 5;
+ break;
+ }
case ClassWriter.WIDE_INSN:
opcode = b[u + 1] & 0xFF;
if (opcode == Opcodes.IINC) {
@@ -1680,8 +1778,8 @@ context.end, context.index, readUTF8(v, c),
for (int j = readUnsignedShort(u + 1); j > 0; --j) {
int start = readUnsignedShort(u + 3);
int length = readUnsignedShort(u + 5);
- readLabel(start, context.labels);
- readLabel(start + length, context.labels);
+ createLabel(start, context.labels);
+ createLabel(start + length, context.labels);
u += 6;
}
u += 3;
@@ -1760,8 +1858,8 @@ private int readAnnotationTarget(final Context context, int u) {
for (int i = 0; i < n; ++i) {
int start = readUnsignedShort(u);
int length = readUnsignedShort(u + 2);
- context.start[i] = readLabel(start, context.labels);
- context.end[i] = readLabel(start + length, context.labels);
+ context.start[i] = createLabel(start, context.labels);
+ context.end[i] = createLabel(start + length, context.labels);
context.index[i] = readUnsignedShort(u + 4);
u += 6;
}
@@ -2181,7 +2279,7 @@ private int readFrame(int stackMap, boolean zip, boolean unzip,
}
}
frame.offset += delta + 1;
- readLabel(frame.offset, labels);
+ createLabel(frame.offset, labels);
return stackMap;
}
@@ -2234,7 +2332,7 @@ private int readFrameType(final Object[] frame, final int index, int v,
v += 2;
break;
default: // Uninitialized
- frame[index] = readLabel(readUnsignedShort(v), labels);
+ frame[index] = createLabel(readUnsignedShort(v), labels);
v += 2;
}
return v;
@@ -2261,6 +2359,39 @@ protected Label readLabel(int offset, Label[] labels) {
}
/**
+ * Creates a label without the Label.DEBUG flag set, for the given offset.
+ * The label is created with a call to {@link #readLabel} and its
+ * Label.DEBUG flag is cleared.
+ *
+ * @param offset
+ * a bytecode offset in a method.
+ * @param labels
+ * the already created labels, indexed by their offset.
+ * @return a Label without the Label.DEBUG flag set.
+ */
+ private Label createLabel(int offset, Label[] labels) {
+ Label label = readLabel(offset, labels);
+ label.status &= ~Label.DEBUG;
+ return label;
+ }
+
+ /**
+ * Creates a label with the Label.DEBUG flag set, if there is no already
+ * existing label for the given offset (otherwise does nothing). The label
+ * is created with a call to {@link #readLabel}.
+ *
+ * @param offset
+ * a bytecode offset in a method.
+ * @param labels
+ * the already created labels, indexed by their offset.
+ */
+ private void createDebugLabel(int offset, Label[] labels) {
+ if (labels[offset] == null) {
+ readLabel(offset, labels).status |= Label.DEBUG;
+ }
+ }
+
+ /**
* Returns the start index of the attribute_info structure of this class.
*
* @return the start index of the attribute_info structure of this class.
@@ -2515,6 +2646,20 @@ private String readUTF(int index, final int utfLen, final char[] buf) {
}
/**
+ * Read a stringish constant item (CONSTANT_Class, CONSTANT_String,
+ * CONSTANT_MethodType, CONSTANT_Module or CONSTANT_Package
+ * @param index
+ * @param buf
+ * @return
+ */
+ private String readStringish(final int index, final char[] buf) {
+ // computes the start index of the item in b
+ // and reads the CONSTANT_Utf8 item designated by
+ // the first two bytes of this item
+ return readUTF8(items[readUnsignedShort(index)], buf);
+ }
+
+ /**
* Reads a class constant pool item in {@link #b b}. <i>This method is
* intended for {@link Attribute} sub classes, and is normally not needed by
* class generators or adapters.</i>
@@ -2528,10 +2673,41 @@ private String readUTF(int index, final int utfLen, final char[] buf) {
* @return the String corresponding to the specified class item.
*/
public String readClass(final int index, final char[] buf) {
- // computes the start index of the CONSTANT_Class item in b
- // and reads the CONSTANT_Utf8 item designated by
- // the first two bytes of this CONSTANT_Class item
- return readUTF8(items[readUnsignedShort(index)], buf);
+ return readStringish(index, buf);
+ }
+
+ /**
+ * Reads a module constant pool item in {@link #b b}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by
+ * class generators or adapters.</i>
+ *
+ * @param index
+ * the start index of an unsigned short value in {@link #b b},
+ * whose value is the index of a module constant pool item.
+ * @param buf
+ * buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the String corresponding to the specified module item.
+ */
+ public String readModule(final int index, final char[] buf) {
+ return readStringish(index, buf);
+ }
+
+ /**
+ * Reads a module constant pool item in {@link #b b}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by
+ * class generators or adapters.</i>
+ *
+ * @param index
+ * the start index of an unsigned short value in {@link #b b},
+ * whose value is the index of a module constant pool item.
+ * @param buf
+ * buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the String corresponding to the specified module item.
+ */
+ public String readPackage(final int index, final char[] buf) {
+ return readStringish(index, buf);
}
/**
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java
index ebb0dfe..3aad0b0 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java
@@ -32,7 +32,7 @@
/**
* A visitor to visit a Java class. The methods of this class must be called in
* the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
- * <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
+ * <tt>visitModule</tt> ][ <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
* <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* (
* <tt>visitInnerClass</tt> | <tt>visitField</tt> | <tt>visitMethod</tt> )*
* <tt>visitEnd</tt>.
@@ -133,15 +133,22 @@ public void visitSource(String source, String debug) {
/**
* Visit the module corresponding to the class.
+ * @param name
+ * module name
+ * @param access
+ * module flags, among {@code ACC_OPEN}, {@code ACC_SYNTHETIC}
+ * and {@code ACC_MANDATED}.
+ * @param version
+ * module version or null.
* @return a visitor to visit the module values, or <tt>null</tt> if
* this visitor is not interested in visiting this module.
*/
- public ModuleVisitor visitModule() {
+ public ModuleVisitor visitModule(String name, int access, String version) {
if (api < Opcodes.ASM6) {
throw new RuntimeException();
}
if (cv != null) {
- return cv.visitModule();
+ return cv.visitModule(name, access, version);
}
return null;
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java
index 5c55a58..742c6d4 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java
@@ -58,8 +58,8 @@ public class ClassWriter extends ClassVisitor {
* {@link MethodVisitor#visitFrame} method are ignored, and the stack map
* frames are recomputed from the methods bytecode. The arguments of the
* {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and
- * recomputed from the bytecode. In other words, computeFrames implies
- * computeMaxs.
+ * recomputed from the bytecode. In other words, COMPUTE_FRAMES implies
+ * COMPUTE_MAXS.
*
* @see #ClassWriter(int)
*/
@@ -168,6 +168,27 @@ public class ClassWriter extends ClassVisitor {
static final int WIDE_INSN = 17;
/**
+ * The type of the ASM pseudo instructions with an unsigned 2 bytes offset
+ * label (see Label#resolve).
+ */
+ static final int ASM_LABEL_INSN = 18;
+
+ /**
+ * The type of the ASM pseudo instructions with a 4 bytes offset label.
+ */
+ static final int ASM_LABELW_INSN = 19;
+
+ /**
+ * Represents a frame inserted between already existing frames. This kind of
+ * frame can only be used if the frame content can be computed from the
+ * previous existing frame and from the instructions between this existing
+ * frame and the inserted one, without any knowledge of the type hierarchy.
+ * This kind of frame is only used when an unconditional jump is inserted in
+ * a method while expanding an ASM pseudo instruction (see ClassReader).
+ */
+ static final int F_INSERT = 256;
+
+ /**
* The instruction types of all JVM opcodes.
*/
static final byte[] TYPE;
@@ -243,9 +264,19 @@ public class ClassWriter extends ClassVisitor {
static final int INDY = 18;
/**
+ * The type of CONSTANT_Module constant pool items.
+ */
+ static final int MODULE = 19;
+
+ /**
+ * The type of CONSTANT_Package constant pool items.
+ */
+ static final int PACKAGE = 20;
+
+ /**
* The base value for all CONSTANT_MethodHandle constant pool items.
* Internally, ASM store the 9 variations of CONSTANT_MethodHandle into 9
- * different items.
+ * different items (from 21 to 29).
*/
static final int HANDLE_BASE = 20;
@@ -489,25 +520,19 @@ public class ClassWriter extends ClassVisitor {
MethodWriter lastMethod;
/**
- * <tt>true</tt> if the maximum stack size and number of local variables
- * must be automatically computed.
+ * Indicates what must be automatically computed.
+ *
+ * @see MethodWriter#compute
*/
- private boolean computeMaxs;
+ private int compute;
/**
- * <tt>true</tt> if the stack map frames must be recomputed from scratch.
+ * <tt>true</tt> if some methods have wide forward jumps using ASM pseudo
+ * instructions, which need to be expanded into sequences of standard
+ * bytecode instructions. In this case the class is re-read and re-written
+ * with a ClassReader -> ClassWriter chain to perform this transformation.
*/
- private boolean computeFrames;
-
- /**
- * <tt>true</tt> if the stack map tables of this class are invalid. The
- * {@link MethodWriter#resizeInstructions} method cannot transform existing
- * stack map tables, and so produces potentially invalid classes when it is
- * executed. In this case the class is reread and rewritten with the
- * {@link #COMPUTE_FRAMES} option (the resizeInstructions method can resize
- * stack map tables when this option is used).
- */
- boolean invalidFrames;
+ boolean hasAsmInsns;
// ------------------------------------------------------------------------
// Static initializer
@@ -518,11 +543,11 @@ public class ClassWriter extends ClassVisitor {
*/
static {
int i;
- byte[] b = new byte[220];
+ byte[] b = new byte[221];
String s = "AAAAAAAAAAAAAAAABCLMMDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
+ "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAJJJJJJJJJJJJJJJJDOPAA"
- + "AAAAGGGGGGGHIFBFAAFFAARQJJKKJJJJJJJJJJJJJJJJJJ";
+ + "AAAAGGGGGGGHIFBFAAFFAARQJJKKSSSSSSSSSSSSSSSSSST";
for (i = 0; i < b.length; ++i) {
b[i] = (byte) (s.charAt(i) - 'A');
}
@@ -576,8 +601,9 @@ public class ClassWriter extends ClassVisitor {
// // temporary opcodes used internally by ASM - see Label and
// MethodWriter
// for (i = 202; i < 220; ++i) {
- // b[i] = LABEL_INSN;
+ // b[i] = ASM_LABEL_INSN;
// }
+ // b[220] = ASM_LABELW_INSN;
//
// // LDC(_W) instructions
// b[Constants.LDC] = LDC_INSN;
@@ -619,8 +645,9 @@ public ClassWriter(final int flags) {
key2 = new Item();
key3 = new Item();
key4 = new Item();
- this.computeMaxs = (flags & COMPUTE_MAXS) != 0;
- this.computeFrames = (flags & COMPUTE_FRAMES) != 0;
+ this.compute = (flags & COMPUTE_FRAMES) != 0 ? MethodWriter.FRAMES
+ : ((flags & COMPUTE_MAXS) != 0 ? MethodWriter.MAXS
+ : MethodWriter.NOTHING);
}
/**
@@ -673,7 +700,7 @@ public final void visit(final int version, final int access,
this.access = access;
this.name = newClass(name);
thisName = name;
- if (ClassReader.SIGNATURES && signature != null) {
+ if (signature != null) {
this.signature = newUTF8(signature);
}
this.superName = superName == null ? 0 : newClass(superName);
@@ -698,8 +725,11 @@ public final void visitSource(final String file, final String debug) {
}
@Override
- public final ModuleVisitor visitModule() {
- return moduleWriter = new ModuleWriter(this);
+ public final ModuleVisitor visitModule(final String name,
+ final int access, final String version) {
+ return moduleWriter = new ModuleWriter(this,
+ newModule(name), access,
+ version == null ? 0 : newUTF8(version));
}
@Override
@@ -714,9 +744,6 @@ public final void visitOuterClass(final String owner, final String name,
@Override
public final AnnotationVisitor visitAnnotation(final String desc,
final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write type, and reserve space for values count
bv.putShort(newUTF8(desc)).putShort(0);
@@ -734,9 +761,6 @@ public final AnnotationVisitor visitAnnotation(final String desc,
@Override
public final AnnotationVisitor visitTypeAnnotation(int typeRef,
TypePath typePath, final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write target_type and target_info
AnnotationWriter.putTarget(typeRef, typePath, bv);
@@ -776,7 +800,7 @@ public final void visitInnerClass(final String name,
// and equality tests). If so we store the index of this inner class
// entry (plus one) in intVal. This hack allows duplicate detection in
// O(1) time.
- Item nameItem = newClassItem(name);
+ Item nameItem = newStringishItem(CLASS, name);
if (nameItem.intVal == 0) {
++innerClassesCount;
innerClasses.putShort(nameItem.index);
@@ -801,7 +825,7 @@ public final FieldVisitor visitField(final int access, final String name,
public final MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
return new MethodWriter(this, access, name, desc, signature,
- exceptions, computeMaxs, computeFrames);
+ exceptions, compute);
}
@Override
@@ -845,7 +869,7 @@ public final void visitEnd() {
size += 8 + bootstrapMethods.length;
newUTF8("BootstrapMethods");
}
- if (ClassReader.SIGNATURES && signature != 0) {
+ if (signature != 0) {
++attributeCount;
size += 8;
newUTF8("Signature");
@@ -883,29 +907,29 @@ public final void visitEnd() {
size += 8 + innerClasses.length;
newUTF8("InnerClasses");
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
++attributeCount;
size += 8 + anns.getSize();
newUTF8("RuntimeVisibleAnnotations");
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
++attributeCount;
size += 8 + ianns.getSize();
newUTF8("RuntimeInvisibleAnnotations");
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
++attributeCount;
size += 8 + tanns.getSize();
newUTF8("RuntimeVisibleTypeAnnotations");
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
++attributeCount;
size += 8 + itanns.getSize();
newUTF8("RuntimeInvisibleTypeAnnotations");
}
if (moduleWriter != null) {
- ++attributeCount;
- size += 6 + moduleWriter.getSize();
+ attributeCount += 1 + moduleWriter.attributeCount;
+ size += 6 + moduleWriter.size + moduleWriter.attributesSize;
newUTF8("Module");
}
if (attrs != null) {
@@ -944,7 +968,7 @@ public final void visitEnd() {
bootstrapMethodsCount);
out.putByteArray(bootstrapMethods.data, 0, bootstrapMethods.length);
}
- if (ClassReader.SIGNATURES && signature != 0) {
+ if (signature != 0) {
out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
}
if (sourceFile != 0) {
@@ -958,6 +982,7 @@ public final void visitEnd() {
if (moduleWriter != null) {
out.putShort(newUTF8("Module"));
moduleWriter.put(out);
+ moduleWriter.putAttributes(out);
}
if (enclosingMethodOwner != 0) {
out.putShort(newUTF8("EnclosingMethod")).putInt(4);
@@ -977,42 +1002,46 @@ public final void visitEnd() {
out.putInt(innerClasses.length + 2).putShort(innerClassesCount);
out.putByteArray(innerClasses.data, 0, innerClasses.length);
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
out.putShort(newUTF8("RuntimeVisibleAnnotations"));
anns.put(out);
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
ianns.put(out);
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
out.putShort(newUTF8("RuntimeVisibleTypeAnnotations"));
tanns.put(out);
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
out.putShort(newUTF8("RuntimeInvisibleTypeAnnotations"));
itanns.put(out);
}
if (attrs != null) {
attrs.put(this, null, 0, -1, -1, out);
}
- if (invalidFrames) {
+ if (hasAsmInsns) {
+ boolean hasFrames = false;
+ mb = firstMethod;
+ while (mb != null) {
+ hasFrames |= mb.frameCount > 0;
+ mb = (MethodWriter) mb.mv;
+ }
anns = null;
ianns = null;
attrs = null;
moduleWriter = null;
- innerClassesCount = 0;
- innerClasses = null;
- bootstrapMethodsCount = 0;
- bootstrapMethods = null;
firstField = null;
lastField = null;
firstMethod = null;
lastMethod = null;
- computeMaxs = false;
- computeFrames = true;
- invalidFrames = false;
- new ClassReader(out.data).accept(this, ClassReader.SKIP_FRAMES);
+ compute =
+ hasFrames ? MethodWriter.INSERTED_FRAMES : MethodWriter.NOTHING;
+ hasAsmInsns = false;
+ new ClassReader(out.data).accept(this,
+ (hasFrames ? ClassReader.EXPAND_FRAMES : 0)
+ | ClassReader.EXPAND_ASM_INSNS);
return toByteArray();
}
return out.data;
@@ -1059,16 +1088,16 @@ Item newConstItem(final Object cst) {
double val = ((Double) cst).doubleValue();
return newDouble(val);
} else if (cst instanceof String) {
- return newString((String) cst);
+ return newStringishItem(STR, (String) cst);
} else if (cst instanceof Type) {
Type t = (Type) cst;
int s = t.getSort();
if (s == Type.OBJECT) {
- return newClassItem(t.getInternalName());
+ return newStringishItem(CLASS, t.getInternalName());
} else if (s == Type.METHOD) {
- return newMethodTypeItem(t.getDescriptor());
+ return newStringishItem(MTYPE, t.getDescriptor());
} else { // s == primitive type or array
- return newClassItem(t.getDescriptor());
+ return newStringishItem(CLASS, t.getDescriptor());
}
} else if (cst instanceof Handle) {
Handle h = (Handle) cst;
@@ -1117,20 +1146,21 @@ public int newUTF8(final String value) {
}
/**
- * Adds a class reference to the constant pool of the class being build.
+ * Adds a string reference, a class reference, a method type, a module
+ * or a package to the constant pool of the class being build.
* Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
*
+ * @param type
+ * a type among STR, CLASS, MTYPE, MODULE or PACKAGE
* @param value
- * the internal name of the class.
- * @return a new or already existing class reference item.
+ * string value of the reference.
+ * @return a new or already existing reference item.
*/
- Item newClassItem(final String value) {
- key2.set(CLASS, value, null, null);
+ Item newStringishItem(final int type, final String value) {
+ key2.set(type, value, null, null);
Item result = get(key2);
if (result == null) {
- pool.put12(CLASS, newUTF8(value));
+ pool.put12(type, newUTF8(value));
result = new Item(index++, key2);
put(result);
}
@@ -1148,28 +1178,7 @@ Item newClassItem(final String value) {
* @return the index of a new or already existing class reference item.
*/
public int newClass(final String value) {
- return newClassItem(value).index;
- }
-
- /**
- * Adds a method type reference to the constant pool of the class being
- * build. Does nothing if the constant pool already contains a similar item.
- * <i>This method is intended for {@link Attribute} sub classes, and is
- * normally not needed by class generators or adapters.</i>
- *
- * @param methodDesc
- * method descriptor of the method type.
- * @return a new or already existing method type reference item.
- */
- Item newMethodTypeItem(final String methodDesc) {
- key2.set(MTYPE, methodDesc, null, null);
- Item result = get(key2);
- if (result == null) {
- pool.put12(MTYPE, newUTF8(methodDesc));
- result = new Item(index++, key2);
- put(result);
- }
- return result;
+ return newStringishItem(CLASS, value).index;
}
/**
@@ -1184,7 +1193,37 @@ Item newMethodTypeItem(final String methodDesc) {
* item.
*/
public int newMethodType(final String methodDesc) {
- return newMethodTypeItem(methodDesc).index;
+ return newStringishItem(MTYPE, methodDesc).index;
+ }
+
+ /**
+ * Adds a module reference to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param moduleName
+ * name of the module.
+ * @return the index of a new or already existing module reference
+ * item.
+ */
+ public int newModule(final String moduleName) {
+ return newStringishItem(MODULE, moduleName).index;
+ }
+
+ /**
+ * Adds a package reference to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param packageName
+ * name of the package in its internal form.
+ * @return the index of a new or already existing module reference
+ * item.
+ */
+ public int newPackage(final String packageName) {
+ return newStringishItem(PACKAGE, packageName).index;
}
/**
@@ -1566,25 +1605,6 @@ Item newDouble(final double value) {
}
/**
- * Adds a string to the constant pool of the class being build. Does nothing
- * if the constant pool already contains a similar item.
- *
- * @param value
- * the String value.
- * @return a new or already existing string item.
- */
- private Item newString(final String value) {
- key2.set(STR, value, null, null);
- Item result = get(key2);
- if (result == null) {
- pool.put12(STR, newUTF8(value));
- result = new Item(index++, key2);
- put(result);
- }
- return result;
- }
-
- /**
* Adds a name and type to the constant pool of the class being build. Does
* nothing if the constant pool already contains a similar item. <i>This
* method is intended for {@link Attribute} sub classes, and is normally not
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/CurrentFrame.java
similarity index 63%
rename from plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/package.html
rename to plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/CurrentFrame.java
index 91d7420..67410ce 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/package.html
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/CurrentFrame.java
@@ -1,5 +1,4 @@
-<html>
-<!--
+/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
@@ -27,14 +26,31 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides ASM visitors that can be useful for programming and
-debugging purposes. These class visitors are normally not used by applications
-at runtime. This is why they are bundled in an optional <tt>asm-util.jar</tt>
-library that is separated from (but requires) the <tt>asm.jar</tt> library,
-which contains the core ASM framework.
+ */
-@since ASM 1.3.2
-</body>
-</html>
+package org.eclipse.persistence.internal.libraries.asm;
+
+/**
+ * Information about the input stack map frame at the "current" instruction of a
+ * method. This is implemented as a Frame subclass for a "basic block"
+ * containing only one instruction.
+ *
+ * @author Eric Bruneton
+ */
+class CurrentFrame extends Frame {
+
+ /**
+ * Sets this CurrentFrame to the input stack map frame of the next "current"
+ * instruction, i.e. the instruction just after the given one. It is assumed
+ * that the value of this object when this method is called is the stack map
+ * frame status just before the given instruction is executed.
+ */
+ @Override
+ void execute(int opcode, int arg, ClassWriter cw, Item item) {
+ super.execute(opcode, arg, cw, item);
+ Frame successor = new Frame();
+ merge(cw, successor, 0);
+ set(successor);
+ owner.inputStackTop = 0;
+ }
+}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java
index 45befeb..6d0747c 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java
@@ -129,7 +129,7 @@ final class FieldWriter extends FieldVisitor {
this.access = access;
this.name = cw.newUTF8(name);
this.desc = cw.newUTF8(desc);
- if (ClassReader.SIGNATURES && signature != null) {
+ if (signature != null) {
this.signature = cw.newUTF8(signature);
}
if (value != null) {
@@ -144,9 +144,6 @@ final class FieldWriter extends FieldVisitor {
@Override
public AnnotationVisitor visitAnnotation(final String desc,
final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write type, and reserve space for values count
bv.putShort(cw.newUTF8(desc)).putShort(0);
@@ -164,9 +161,6 @@ public AnnotationVisitor visitAnnotation(final String desc,
@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write target_type and target_info
AnnotationWriter.putTarget(typeRef, typePath, bv);
@@ -220,23 +214,23 @@ int getSize() {
cw.newUTF8("Deprecated");
size += 6;
}
- if (ClassReader.SIGNATURES && signature != 0) {
+ if (signature != 0) {
cw.newUTF8("Signature");
size += 8;
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
cw.newUTF8("RuntimeVisibleAnnotations");
size += 8 + anns.getSize();
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
cw.newUTF8("RuntimeInvisibleAnnotations");
size += 8 + ianns.getSize();
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
cw.newUTF8("RuntimeVisibleTypeAnnotations");
size += 8 + tanns.getSize();
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
cw.newUTF8("RuntimeInvisibleTypeAnnotations");
size += 8 + itanns.getSize();
}
@@ -270,19 +264,19 @@ void put(final ByteVector out) {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++attributeCount;
}
- if (ClassReader.SIGNATURES && signature != 0) {
+ if (signature != 0) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
++attributeCount;
}
if (attrs != null) {
@@ -302,23 +296,23 @@ void put(final ByteVector out) {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
out.putShort(cw.newUTF8("Deprecated")).putInt(0);
}
- if (ClassReader.SIGNATURES && signature != 0) {
+ if (signature != 0) {
out.putShort(cw.newUTF8("Signature"));
out.putInt(2).putShort(signature);
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
anns.put(out);
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
ianns.put(out);
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
tanns.put(out);
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
itanns.put(out);
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java
index e0a7a61..78ad8c4 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java
@@ -34,7 +34,7 @@
*
* @author Eric Bruneton
*/
-final class Frame {
+class Frame {
/*
* Frames are computed in a two steps process: during the visit of each
@@ -496,7 +496,7 @@ final class Frame {
* When the stack map frames are completely computed, this field is the
* actual number of types in {@link #outputStack}.
*/
- private int outputStackTop;
+ int outputStackTop;
/**
* Number of types that are initialized in the basic block.
@@ -521,6 +521,110 @@ final class Frame {
private int[] initializations;
/**
+ * Sets this frame to the given value.
+ *
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param nLocal
+ * the number of local variables.
+ * @param local
+ * the local variable types. Primitive types are represented by
+ * {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
+ * {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
+ * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
+ * {@link Opcodes#UNINITIALIZED_THIS} (long and double are
+ * represented by a single element). Reference types are
+ * represented by String objects (representing internal names),
+ * and uninitialized types by Label objects (this label
+ * designates the NEW instruction that created this uninitialized
+ * value).
+ * @param nStack
+ * the number of operand stack elements.
+ * @param stack
+ * the operand stack types (same format as the "local" array).
+ */
+ final void set(ClassWriter cw, final int nLocal, final Object[] local,
+ final int nStack, final Object[] stack) {
+ int i = convert(cw, nLocal, local, inputLocals);
+ while (i < local.length) {
+ inputLocals[i++] = TOP;
+ }
+ int nStackTop = 0;
+ for (int j = 0; j < nStack; ++j) {
+ if (stack[j] == Opcodes.LONG || stack[j] == Opcodes.DOUBLE) {
+ ++nStackTop;
+ }
+ }
+ inputStack = new int[nStack + nStackTop];
+ convert(cw, nStack, stack, inputStack);
+ outputStackTop = 0;
+ initializationCount = 0;
+ }
+
+ /**
+ * Converts types from the MethodWriter.visitFrame() format to the Frame
+ * format.
+ *
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param nInput
+ * the number of types to convert.
+ * @param input
+ * the types to convert. Primitive types are represented by
+ * {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
+ * {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
+ * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
+ * {@link Opcodes#UNINITIALIZED_THIS} (long and double are
+ * represented by a single element). Reference types are
+ * represented by String objects (representing internal names),
+ * and uninitialized types by Label objects (this label
+ * designates the NEW instruction that created this uninitialized
+ * value).
+ * @param output
+ * where to store the converted types.
+ * @return the number of output elements.
+ */
+ private static int convert(ClassWriter cw, int nInput, Object[] input,
+ int[] output) {
+ int i = 0;
+ for (int j = 0; j < nInput; ++j) {
+ if (input[j] instanceof Integer) {
+ output[i++] = BASE | ((Integer) input[j]).intValue();
+ if (input[j] == Opcodes.LONG || input[j] == Opcodes.DOUBLE) {
+ output[i++] = TOP;
+ }
+ } else if (input[j] instanceof String) {
+ output[i++] = type(cw, Type.getObjectType((String) input[j])
+ .getDescriptor());
+ } else {
+ output[i++] = UNINITIALIZED
+ | cw.addUninitializedType("",
+ ((Label) input[j]).position);
+ }
+ }
+ return i;
+ }
+
+ /**
+ * Sets this frame to the value of the given frame. WARNING: after this
+ * method is called the two frames share the same data structures. It is
+ * recommended to discard the given frame f to avoid unexpected side
+ * effects.
+ *
+ * @param f
+ * The new frame value.
+ */
+ final void set(final Frame f) {
+ inputLocals = f.inputLocals;
+ inputStack = f.inputStack;
+ outputLocals = f.outputLocals;
+ outputStack = f.outputStack;
+ outputStackTop = f.outputStackTop;
+ initializationCount = f.initializationCount;
+ initializations = f.initializations;
+ }
+
+ /**
* Returns the output frame local variable type at the given index.
*
* @param local
@@ -585,7 +689,7 @@ private void push(final int type) {
}
// pushes the type on the output stack
outputStack[outputStackTop++] = type;
- // updates the maximun height reached by the output stack, if needed
+ // updates the maximum height reached by the output stack, if needed
int top = owner.inputStackTop + outputStackTop;
if (top > owner.outputStackMax) {
owner.outputStackMax = top;
@@ -621,7 +725,7 @@ private void push(final ClassWriter cw, final String desc) {
* a type descriptor.
* @return the int encoding of the given type.
*/
- private static int type(final ClassWriter cw, final String desc) {
+ static int type(final ClassWriter cw, final String desc) {
String t;
int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
switch (desc.charAt(index)) {
@@ -809,7 +913,7 @@ private int init(final ClassWriter cw, final int t) {
* @param maxLocals
* the maximum number of local variables of this method.
*/
- void initInputFrame(final ClassWriter cw, final int access,
+ final void initInputFrame(final ClassWriter cw, final int access,
final Type[] args, final int maxLocals) {
inputLocals = new int[maxLocals];
inputStack = new int[0];
@@ -952,7 +1056,7 @@ void execute(final int opcode, final int arg, final ClassWriter cw,
case Opcodes.AALOAD:
pop(1);
t1 = pop();
- push(ELEMENT_OF + t1);
+ push(t1 == NULL ? t1 : ELEMENT_OF + t1);
break;
case Opcodes.ISTORE:
case Opcodes.FSTORE:
@@ -1283,7 +1387,7 @@ void execute(final int opcode, final int arg, final ClassWriter cw,
* @return <tt>true</tt> if the input frame of the given label has been
* changed by this operation.
*/
- boolean merge(final ClassWriter cw, final Frame frame, final int edge) {
+ final boolean merge(final ClassWriter cw, final Frame frame, final int edge) {
boolean changed = false;
int i, s, dim, kind, t;
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java
index b429020..caf0d72 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java
@@ -51,6 +51,7 @@ final class Item {
* {@link ClassWriter#STR}, {@link ClassWriter#CLASS},
* {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD},
* {@link ClassWriter#METH}, {@link ClassWriter#IMETH},
+ * {@link ClassWriter#MODULE}, {@link ClassWriter#PACKAGE},
* {@link ClassWriter#MTYPE}, {@link ClassWriter#INDY}.
*
* MethodHandle constant 9 variations are stored using a range of 9 values
@@ -214,6 +215,8 @@ void set(final int type, final String strVal1, final String strVal2,
case ClassWriter.UTF8:
case ClassWriter.STR:
case ClassWriter.MTYPE:
+ case ClassWriter.MODULE:
+ case ClassWriter.PACKAGE:
case ClassWriter.TYPE_NORMAL:
hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
return;
@@ -282,6 +285,8 @@ boolean isEqualTo(final Item i) {
case ClassWriter.UTF8:
case ClassWriter.STR:
case ClassWriter.CLASS:
+ case ClassWriter.MODULE:
+ case ClassWriter.PACKAGE:
case ClassWriter.MTYPE:
case ClassWriter.TYPE_NORMAL:
return i.strVal1.equals(strVal1);
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java
index 44eddc8..ddb1ca7 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java
@@ -243,8 +243,8 @@ public class Label {
* The next basic block in the basic block stack. This stack is used in the
* main loop of the fix point algorithm used in the second step of the
* control flow analysis algorithms. It is also used in
- * {@link #visitSubroutine} to avoid using a recursive method, and in
- * ClassReader to temporarily store multiple source lines for a label.
+ * {@link #visitSubroutine} to avoid using a recursive method, and in
+ * ClassReader to temporarily store multiple source lines for a label.
*
* @see MethodWriter#visitMaxs
*/
@@ -360,13 +360,12 @@ private void addReference(final int sourcePosition,
* the position of this label in the bytecode.
* @param data
* the bytecode of the method.
- * @return <tt>true</tt> if a blank that was left for this label was to
+ * @return <tt>true</tt> if a blank that was left for this label was too
* small to store the offset. In such a case the corresponding jump
* instruction is replaced with a pseudo instruction (using unused
* opcodes) using an unsigned two bytes offset. These pseudo
- * instructions will need to be replaced with true instructions with
- * wider offsets (4 bytes instead of 2). This is done in
- * {@link MethodWriter#resizeInstructions}.
+ * instructions will be replaced with standard bytecode instructions
+ * with wider offsets (4 bytes instead of 2), in ClassReader.
* @throws IllegalArgumentException
* if this label has already been resolved, or if it has not
* been created by the given code writer.
@@ -425,7 +424,7 @@ boolean resolve(final MethodWriter owner, final int position,
* @return the first label of the series to which this label belongs.
*/
Label getFirst() {
- return !ClassReader.FRAMES || frame == null ? this : frame.owner;
+ return frame == null ? this : frame.owner;
}
// ------------------------------------------------------------------------
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java
index 93d9543..81764cd 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java
@@ -99,7 +99,19 @@ class MethodWriter extends MethodVisitor {
*
* @see #compute
*/
- private static final int FRAMES = 0;
+ static final int FRAMES = 0;
+
+ /**
+ * Indicates that the stack map frames of type F_INSERT must be computed.
+ * The other frames are not (re)computed. They should all be of type F_NEW
+ * and should be sufficient to compute the content of the F_INSERT frames,
+ * together with the bytecode instructions between a F_NEW and a F_INSERT
+ * frame - and without any knowledge of the type hierarchy (by definition of
+ * F_INSERT).
+ *
+ * @see #compute
+ */
+ static final int INSERTED_FRAMES = 1;
/**
* Indicates that the maximum stack size and number of local variables must
@@ -107,14 +119,14 @@ class MethodWriter extends MethodVisitor {
*
* @see #compute
*/
- private static final int MAXS = 1;
+ static final int MAXS = 2;
/**
* Indicates that nothing must be automatically computed.
*
* @see #compute
*/
- private static final int NOTHING = 2;
+ static final int NOTHING = 3;
/**
* The class writer to which this method must be added.
@@ -248,7 +260,7 @@ class MethodWriter extends MethodVisitor {
/**
* Number of stack map frames in the StackMapTable attribute.
*/
- private int frameCount;
+ int frameCount;
/**
* The StackMapTable attribute.
@@ -355,11 +367,6 @@ class MethodWriter extends MethodVisitor {
private Attribute cattrs;
/**
- * Indicates if some jump instructions are too small and need to be resized.
- */
- private boolean resize;
-
- /**
* The number of subroutines in this method.
*/
private int subroutines;
@@ -380,6 +387,7 @@ class MethodWriter extends MethodVisitor {
* Indicates what must be automatically computed.
*
* @see #FRAMES
+ * @see #INSERTED_FRAMES
* @see #MAXS
* @see #NOTHING
*/
@@ -442,17 +450,12 @@ class MethodWriter extends MethodVisitor {
* @param exceptions
* the internal names of the method's exceptions. May be
* <tt>null</tt>.
- * @param computeMaxs
- * <tt>true</tt> if the maximum stack size and number of local
- * variables must be automatically computed.
- * @param computeFrames
- * <tt>true</tt> if the stack map tables must be recomputed from
- * scratch.
+ * @param compute
+ * Indicates what must be automatically computed (see #compute).
*/
MethodWriter(final ClassWriter cw, final int access, final String name,
final String desc, final String signature,
- final String[] exceptions, final boolean computeMaxs,
- final boolean computeFrames) {
+ final String[] exceptions, final int compute) {
super(Opcodes.ASM6);
if (cw.firstMethod == null) {
cw.firstMethod = this;
@@ -468,9 +471,7 @@ class MethodWriter extends MethodVisitor {
this.name = cw.newUTF8(name);
this.desc = cw.newUTF8(desc);
this.descriptor = desc;
- if (ClassReader.SIGNATURES) {
- this.signature = signature;
- }
+ this.signature = signature;
if (exceptions != null && exceptions.length > 0) {
exceptionCount = exceptions.length;
this.exceptions = new int[exceptionCount];
@@ -478,8 +479,8 @@ class MethodWriter extends MethodVisitor {
this.exceptions[i] = cw.newClass(exceptions[i]);
}
}
- this.compute = computeFrames ? FRAMES : (computeMaxs ? MAXS : NOTHING);
- if (computeMaxs || computeFrames) {
+ this.compute = compute;
+ if (compute != NOTHING) {
// updates maxLocals
int size = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
if ((access & Opcodes.ACC_STATIC) != 0) {
@@ -510,9 +511,6 @@ public void visitParameter(String name, int access) {
@Override
public AnnotationVisitor visitAnnotationDefault() {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
annd = new ByteVector();
return new AnnotationWriter(cw, false, annd, null, 0);
}
@@ -520,9 +518,6 @@ public AnnotationVisitor visitAnnotationDefault() {
@Override
public AnnotationVisitor visitAnnotation(final String desc,
final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write type, and reserve space for values count
bv.putShort(cw.newUTF8(desc)).putShort(0);
@@ -540,9 +535,6 @@ public AnnotationVisitor visitAnnotation(final String desc,
@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write target_type and target_info
AnnotationWriter.putTarget(typeRef, typePath, bv);
@@ -563,9 +555,6 @@ public AnnotationVisitor visitTypeAnnotation(final int typeRef,
@Override
public AnnotationVisitor visitParameterAnnotation(final int parameter,
final String desc, final boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
if ("Ljava/lang/Synthetic;".equals(desc)) {
// workaround for a bug in javac with synthetic parameters
@@ -610,11 +599,33 @@ public void visitCode() {
@Override
public void visitFrame(final int type, final int nLocal,
final Object[] local, final int nStack, final Object[] stack) {
- if (!ClassReader.FRAMES || compute == FRAMES) {
+ if (compute == FRAMES) {
return;
}
- if (type == Opcodes.F_NEW) {
+ if (compute == INSERTED_FRAMES) {
+ if (currentBlock.frame == null) {
+ // This should happen only once, for the implicit first frame
+ // (which is explicitly visited in ClassReader if the
+ // EXPAND_ASM_INSNS option is used).
+ currentBlock.frame = new CurrentFrame();
+ currentBlock.frame.owner = currentBlock;
+ currentBlock.frame.initInputFrame(cw, access,
+ Type.getArgumentTypes(descriptor), nLocal);
+ visitImplicitFirstFrame();
+ } else {
+ if (type == Opcodes.F_NEW) {
+ currentBlock.frame.set(cw, nLocal, local, nStack, stack);
+ } else {
+ // In this case type is equal to F_INSERT by hypothesis, and
+ // currentBlock.frame contains the stack map frame at the
+ // current instruction, computed from the last F_NEW frame
+ // and the bytecode instructions in between (via calls to
+ // CurrentFrame#execute).
+ }
+ visitFrame(currentBlock.frame);
+ }
+ } else if (type == Opcodes.F_NEW) {
if (previousFrame == null) {
visitImplicitFirstFrame();
}
@@ -622,10 +633,10 @@ public void visitFrame(final int type, final int nLocal,
int frameIndex = startFrame(code.length, nLocal, nStack);
for (int i = 0; i < nLocal; ++i) {
if (local[i] instanceof String) {
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType((String) local[i]);
+ String desc = Type.getObjectType((String) local[i]).getDescriptor();
+ frame[frameIndex++] = Frame.type(cw, desc);
} else if (local[i] instanceof Integer) {
- frame[frameIndex++] = ((Integer) local[i]).intValue();
+ frame[frameIndex++] = Frame.BASE | ((Integer) local[i]).intValue();
} else {
frame[frameIndex++] = Frame.UNINITIALIZED
| cw.addUninitializedType("",
@@ -634,10 +645,10 @@ public void visitFrame(final int type, final int nLocal,
}
for (int i = 0; i < nStack; ++i) {
if (stack[i] instanceof String) {
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType((String) stack[i]);
+ String desc = Type.getObjectType((String) stack[i]).getDescriptor();
+ frame[frameIndex++] = Frame.type(cw, desc);
} else if (stack[i] instanceof Integer) {
- frame[frameIndex++] = ((Integer) stack[i]).intValue();
+ frame[frameIndex++] = Frame.BASE | ((Integer) stack[i]).intValue();
} else {
frame[frameIndex++] = Frame.UNINITIALIZED
| cw.addUninitializedType("",
@@ -718,7 +729,7 @@ public void visitInsn(final int opcode) {
// update currentBlock
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(opcode, 0, null, null);
} else {
// updates current and max stack sizes
@@ -741,7 +752,7 @@ public void visitIntInsn(final int opcode, final int operand) {
lastCodeOffset = code.length;
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(opcode, operand, null, null);
} else if (opcode != Opcodes.NEWARRAY) {
// updates current and max stack sizes only for NEWARRAY
@@ -766,7 +777,7 @@ public void visitVarInsn(final int opcode, final int var) {
lastCodeOffset = code.length;
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(opcode, var, null, null);
} else {
// updates current and max stack sizes
@@ -823,10 +834,10 @@ public void visitVarInsn(final int opcode, final int var) {
@Override
public void visitTypeInsn(final int opcode, final String type) {
lastCodeOffset = code.length;
- Item i = cw.newClassItem(type);
+ Item i = cw.newStringishItem(ClassWriter.CLASS, type);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(opcode, code.length, cw, i);
} else if (opcode == Opcodes.NEW) {
// updates current and max stack sizes only if opcode == NEW
@@ -849,7 +860,7 @@ public void visitFieldInsn(final int opcode, final String owner,
Item i = cw.newFieldItem(owner, name, desc);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(opcode, 0, cw, i);
} else {
int size;
@@ -889,7 +900,7 @@ public void visitMethodInsn(final int opcode, final String owner,
int argSize = i.intVal;
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(opcode, 0, cw, i);
} else {
/*
@@ -941,7 +952,7 @@ public void visitInvokeDynamicInsn(final String name, final String desc,
int argSize = i.intVal;
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(Opcodes.INVOKEDYNAMIC, 0, cw, i);
} else {
/*
@@ -975,7 +986,9 @@ public void visitInvokeDynamicInsn(final String name, final String desc,
}
@Override
- public void visitJumpInsn(final int opcode, final Label label) {
+ public void visitJumpInsn(int opcode, final Label label) {
+ boolean isWide = opcode >= 200; // GOTO_W
+ opcode = isWide ? opcode - 33 : opcode;
lastCodeOffset = code.length;
Label nextInsn = null;
// Label currentBlock = this.currentBlock;
@@ -990,6 +1003,8 @@ public void visitJumpInsn(final int opcode, final Label label) {
// creates a Label for the next basic block
nextInsn = new Label();
}
+ } else if (compute == INSERTED_FRAMES) {
+ currentBlock.frame.execute(opcode, 0, null, null);
} else {
if (opcode == Opcodes.JSR) {
if ((label.status & Label.SUBROUTINE) == 0) {
@@ -1021,8 +1036,8 @@ public void visitJumpInsn(final int opcode, final Label label) {
/*
* case of a backward jump with an offset < -32768. In this case we
* automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx
- * <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the
- * "opposite" opcode of IFxxx (i.e., IFNE for IFEQ) and where <l'>
+ * <l> with IFNOTxxx <L> GOTO_W <l> L:..., where IFNOTxxx is the
+ * "opposite" opcode of IFxxx (i.e., IFNE for IFEQ) and where <L>
* designates the instruction just after the GOTO_W.
*/
if (opcode == Opcodes.GOTO) {
@@ -1038,9 +1053,21 @@ public void visitJumpInsn(final int opcode, final Label label) {
code.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1
: opcode ^ 1);
code.putShort(8); // jump offset
- code.putByte(200); // GOTO_W
+ // ASM pseudo GOTO_W insn, see ClassReader. We don't use a real
+ // GOTO_W because we might need to insert a frame just after (as
+ // the target of the IFNOTxxx jump instruction).
+ code.putByte(220);
+ cw.hasAsmInsns = true;
}
label.put(this, code, code.length - 1, true);
+ } else if (isWide) {
+ /*
+ * case of a GOTO_W or JSR_W specified by the user (normally
+ * ClassReader when used to resize instructions). In this case we
+ * keep the original instruction.
+ */
+ code.putByte(opcode + 33);
+ label.put(this, code, code.length - 1, true);
} else {
/*
* case of a backward jump with an offset >= -32768, or of a forward
@@ -1068,7 +1095,7 @@ public void visitJumpInsn(final int opcode, final Label label) {
@Override
public void visitLabel(final Label label) {
// resolves previous forward references to label, if any
- resize |= label.resolve(this, code.length, code.data);
+ cw.hasAsmInsns |= label.resolve(this, code.length, code.data);
// updates currentBlock
if ((label.status & Label.DEBUG) != 0) {
return;
@@ -1101,6 +1128,18 @@ public void visitLabel(final Label label) {
previousBlock.successor = label;
}
previousBlock = label;
+ } else if (compute == INSERTED_FRAMES) {
+ if (currentBlock == null) {
+ // This case should happen only once, for the visitLabel call in
+ // the constructor. Indeed, if compute is equal to
+ // INSERTED_FRAMES currentBlock can not be set back to null (see
+ // #noSuccessor).
+ currentBlock = label;
+ } else {
+ // Updates the frame owner so that a correct frame offset is
+ // computed in visitFrame(Frame).
+ currentBlock.frame.owner = label;
+ }
} else if (compute == MAXS) {
if (currentBlock != null) {
// ends current block (with one new successor)
@@ -1126,7 +1165,7 @@ public void visitLdcInsn(final Object cst) {
Item i = cw.newConstItem(cst);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(Opcodes.LDC, 0, cw, i);
} else {
int size;
@@ -1158,7 +1197,7 @@ public void visitLdcInsn(final Object cst) {
public void visitIincInsn(final int var, final int increment) {
lastCodeOffset = code.length;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(Opcodes.IINC, var, null, null);
}
}
@@ -1242,10 +1281,10 @@ private void visitSwitchInsn(final Label dflt, final Label[] labels) {
@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
lastCodeOffset = code.length;
- Item i = cw.newClassItem(desc);
+ Item i = cw.newStringishItem(ClassWriter.CLASS, desc);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
- if (compute == FRAMES) {
+ if (compute == FRAMES || compute == INSERTED_FRAMES) {
currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
} else {
// updates current stack size (max stack size unchanged because
@@ -1260,9 +1299,6 @@ public void visitMultiANewArrayInsn(final String desc, final int dims) {
@Override
public AnnotationVisitor visitInsnAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write target_type and target_info
typeRef = (typeRef & 0xFF0000FF) | (lastCodeOffset << 8);
@@ -1302,9 +1338,6 @@ public void visitTryCatchBlock(final Label start, final Label end,
@Override
public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write target_type and target_info
AnnotationWriter.putTarget(typeRef, typePath, bv);
@@ -1358,9 +1391,6 @@ public void visitLocalVariable(final String name, final String desc,
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
- if (!ClassReader.ANNOTATIONS) {
- return null;
- }
ByteVector bv = new ByteVector();
// write target_type and target_info
bv.putByte(typeRef >>> 24).putShort(start.length);
@@ -1401,15 +1431,7 @@ public void visitLineNumber(final int line, final Label start) {
@Override
public void visitMaxs(final int maxStack, final int maxLocals) {
- if (resize) {
- // replaces the temporary jump opcodes introduced by Label.resolve.
- if (ClassReader.RESIZE) {
- resizeInstructions();
- } else {
- throw new RuntimeException("Method code too large!");
- }
- }
- if (ClassReader.FRAMES && compute == FRAMES) {
+ if (compute == FRAMES) {
// completes the control flow graph with exception handler blocks
Handler handler = firstHandler;
while (handler != null) {
@@ -1439,8 +1461,8 @@ public void visitMaxs(final int maxStack, final int maxLocals) {
// creates and visits the first (implicit) frame
Frame f = labels.frame;
- Type[] args = Type.getArgumentTypes(descriptor);
- f.initInputFrame(cw, access, args, this.maxLocals);
+ f.initInputFrame(cw, access, Type.getArgumentTypes(descriptor),
+ this.maxLocals);
visitFrame(f);
/*
@@ -1688,7 +1710,9 @@ private void noSuccessor() {
} else {
currentBlock.outputStackMax = maxStackSize;
}
- currentBlock = null;
+ if (compute != INSERTED_FRAMES) {
+ currentBlock = null;
+ }
}
// ------------------------------------------------------------------------
@@ -1760,7 +1784,7 @@ private void visitImplicitFirstFrame() {
if ((access & ACC_CONSTRUCTOR) == 0) {
frame[frameIndex++] = Frame.OBJECT | cw.addType(cw.thisName);
} else {
- frame[frameIndex++] = 6; // Opcodes.UNINITIALIZED_THIS;
+ frame[frameIndex++] = Frame.UNINITIALIZED_THIS;
}
}
int i = 1;
@@ -1772,16 +1796,16 @@ private void visitImplicitFirstFrame() {
case 'B':
case 'S':
case 'I':
- frame[frameIndex++] = 1; // Opcodes.INTEGER;
+ frame[frameIndex++] = Frame.INTEGER;
break;
case 'F':
- frame[frameIndex++] = 2; // Opcodes.FLOAT;
+ frame[frameIndex++] = Frame.FLOAT;
break;
case 'J':
- frame[frameIndex++] = 4; // Opcodes.LONG;
+ frame[frameIndex++] = Frame.LONG;
break;
case 'D':
- frame[frameIndex++] = 3; // Opcodes.DOUBLE;
+ frame[frameIndex++] = Frame.DOUBLE;
break;
case '[':
while (descriptor.charAt(i) == '[') {
@@ -1793,8 +1817,7 @@ private void visitImplicitFirstFrame() {
++i;
}
}
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType(descriptor.substring(j, ++i));
+ frame[frameIndex++] = Frame.type(cw, descriptor.substring(j, ++i));
break;
case 'L':
while (descriptor.charAt(i) != ';') {
@@ -2054,11 +2077,11 @@ final int getSize() {
cw.newUTF8(zip ? "StackMapTable" : "StackMap");
size += 8 + stackMap.length;
}
- if (ClassReader.ANNOTATIONS && ctanns != null) {
+ if (ctanns != null) {
cw.newUTF8("RuntimeVisibleTypeAnnotations");
size += 8 + ctanns.getSize();
}
- if (ClassReader.ANNOTATIONS && ictanns != null) {
+ if (ictanns != null) {
cw.newUTF8("RuntimeInvisibleTypeAnnotations");
size += 8 + ictanns.getSize();
}
@@ -2082,7 +2105,7 @@ final int getSize() {
cw.newUTF8("Deprecated");
size += 6;
}
- if (ClassReader.SIGNATURES && signature != null) {
+ if (signature != null) {
cw.newUTF8("Signature");
cw.newUTF8(signature);
size += 8;
@@ -2091,34 +2114,34 @@ final int getSize() {
cw.newUTF8("MethodParameters");
size += 7 + methodParameters.length;
}
- if (ClassReader.ANNOTATIONS && annd != null) {
+ if (annd != null) {
cw.newUTF8("AnnotationDefault");
size += 6 + annd.length;
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
cw.newUTF8("RuntimeVisibleAnnotations");
size += 8 + anns.getSize();
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
cw.newUTF8("RuntimeInvisibleAnnotations");
size += 8 + ianns.getSize();
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
cw.newUTF8("RuntimeVisibleTypeAnnotations");
size += 8 + tanns.getSize();
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
cw.newUTF8("RuntimeInvisibleTypeAnnotations");
size += 8 + itanns.getSize();
}
- if (ClassReader.ANNOTATIONS && panns != null) {
+ if (panns != null) {
cw.newUTF8("RuntimeVisibleParameterAnnotations");
size += 7 + 2 * (panns.length - synthetics);
for (int i = panns.length - 1; i >= synthetics; --i) {
size += panns[i] == null ? 0 : panns[i].getSize();
}
}
- if (ClassReader.ANNOTATIONS && ipanns != null) {
+ if (ipanns != null) {
cw.newUTF8("RuntimeInvisibleParameterAnnotations");
size += 7 + 2 * (ipanns.length - synthetics);
for (int i = ipanns.length - 1; i >= synthetics; --i) {
@@ -2164,31 +2187,31 @@ final void put(final ByteVector out) {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++attributeCount;
}
- if (ClassReader.SIGNATURES && signature != null) {
+ if (signature != null) {
++attributeCount;
}
if (methodParameters != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && annd != null) {
+ if (annd != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && panns != null) {
+ if (panns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && ipanns != null) {
+ if (ipanns != null) {
++attributeCount;
}
if (attrs != null) {
@@ -2209,10 +2232,10 @@ final void put(final ByteVector out) {
if (stackMap != null) {
size += 8 + stackMap.length;
}
- if (ClassReader.ANNOTATIONS && ctanns != null) {
+ if (ctanns != null) {
size += 8 + ctanns.getSize();
}
- if (ClassReader.ANNOTATIONS && ictanns != null) {
+ if (ictanns != null) {
size += 8 + ictanns.getSize();
}
if (cattrs != null) {
@@ -2244,10 +2267,10 @@ final void put(final ByteVector out) {
if (stackMap != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && ctanns != null) {
+ if (ctanns != null) {
++attributeCount;
}
- if (ClassReader.ANNOTATIONS && ictanns != null) {
+ if (ictanns != null) {
++attributeCount;
}
if (cattrs != null) {
@@ -2275,11 +2298,11 @@ final void put(final ByteVector out) {
out.putInt(stackMap.length + 2).putShort(frameCount);
out.putByteArray(stackMap.data, 0, stackMap.length);
}
- if (ClassReader.ANNOTATIONS && ctanns != null) {
+ if (ctanns != null) {
out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
ctanns.put(out);
}
- if (ClassReader.ANNOTATIONS && ictanns != null) {
+ if (ictanns != null) {
out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
ictanns.put(out);
}
@@ -2304,7 +2327,7 @@ final void put(final ByteVector out) {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
out.putShort(cw.newUTF8("Deprecated")).putInt(0);
}
- if (ClassReader.SIGNATURES && signature != null) {
+ if (signature != null) {
out.putShort(cw.newUTF8("Signature")).putInt(2)
.putShort(cw.newUTF8(signature));
}
@@ -2314,32 +2337,32 @@ final void put(final ByteVector out) {
methodParametersCount);
out.putByteArray(methodParameters.data, 0, methodParameters.length);
}
- if (ClassReader.ANNOTATIONS && annd != null) {
+ if (annd != null) {
out.putShort(cw.newUTF8("AnnotationDefault"));
out.putInt(annd.length);
out.putByteArray(annd.data, 0, annd.length);
}
- if (ClassReader.ANNOTATIONS && anns != null) {
+ if (anns != null) {
out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
anns.put(out);
}
- if (ClassReader.ANNOTATIONS && ianns != null) {
+ if (ianns != null) {
out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
ianns.put(out);
}
- if (ClassReader.ANNOTATIONS && tanns != null) {
+ if (tanns != null) {
out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
tanns.put(out);
}
- if (ClassReader.ANNOTATIONS && itanns != null) {
+ if (itanns != null) {
out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
itanns.put(out);
}
- if (ClassReader.ANNOTATIONS && panns != null) {
+ if (panns != null) {
out.putShort(cw.newUTF8("RuntimeVisibleParameterAnnotations"));
AnnotationWriter.put(panns, synthetics, out);
}
- if (ClassReader.ANNOTATIONS && ipanns != null) {
+ if (ipanns != null) {
out.putShort(cw.newUTF8("RuntimeInvisibleParameterAnnotations"));
AnnotationWriter.put(ipanns, synthetics, out);
}
@@ -2347,569 +2370,4 @@ final void put(final ByteVector out) {
attrs.put(cw, null, 0, -1, -1, out);
}
}
-
- // ------------------------------------------------------------------------
- // Utility methods: instruction resizing (used to handle GOTO_W and JSR_W)
- // ------------------------------------------------------------------------
-
- /**
- * Resizes and replaces the temporary instructions inserted by
- * {@link Label#resolve} for wide forward jumps, while keeping jump offsets
- * and instruction addresses consistent. This may require to resize other
- * existing instructions, or even to introduce new instructions: for
- * example, increasing the size of an instruction by 2 at the middle of a
- * method can increases the offset of an IFEQ instruction from 32766 to
- * 32768, in which case IFEQ 32766 must be replaced with IFNEQ 8 GOTO_W
- * 32765. This, in turn, may require to increase the size of another jump
- * instruction, and so on... All these operations are handled automatically
- * by this method.
- * <p>
- * <i>This method must be called after all the method that is being built
- * has been visited</i>. In particular, the {@link Label Label} objects used
- * to construct the method are no longer valid after this method has been
- * called.
- */
- private void resizeInstructions() {
- byte[] b = code.data; // bytecode of the method
- int u, v, label; // indexes in b
- int i, j; // loop indexes
- /*
- * 1st step: As explained above, resizing an instruction may require to
- * resize another one, which may require to resize yet another one, and
- * so on. The first step of the algorithm consists in finding all the
- * instructions that need to be resized, without modifying the code.
- * This is done by the following "fix point" algorithm:
- *
- * Parse the code to find the jump instructions whose offset will need
- * more than 2 bytes to be stored (the future offset is computed from
- * the current offset and from the number of bytes that will be inserted
- * or removed between the source and target instructions). For each such
- * instruction, adds an entry in (a copy of) the indexes and sizes
- * arrays (if this has not already been done in a previous iteration!).
- *
- * If at least one entry has been added during the previous step, go
- * back to the beginning, otherwise stop.
- *
- * In fact the real algorithm is complicated by the fact that the size
- * of TABLESWITCH and LOOKUPSWITCH instructions depends on their
- * position in the bytecode (because of padding). In order to ensure the
- * convergence of the algorithm, the number of bytes to be added or
- * removed from these instructions is over estimated during the previous
- * loop, and computed exactly only after the loop is finished (this
- * requires another pass to parse the bytecode of the method).
- */
- int[] allIndexes = new int[0]; // copy of indexes
- int[] allSizes = new int[0]; // copy of sizes
- boolean[] resize; // instructions to be resized
- int newOffset; // future offset of a jump instruction
-
- resize = new boolean[code.length];
-
- // 3 = loop again, 2 = loop ended, 1 = last pass, 0 = done
- int state = 3;
- do {
- if (state == 3) {
- state = 2;
- }
- u = 0;
- while (u < b.length) {
- int opcode = b[u] & 0xFF; // opcode of current instruction
- int insert = 0; // bytes to be added after this instruction
-
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- if (opcode > 201) {
- // converts temporary opcodes 202 to 217, 218 and
- // 219 to IFEQ ... JSR (inclusive), IFNULL and
- // IFNONNULL
- opcode = opcode < 218 ? opcode - 49 : opcode - 20;
- label = u + readUnsignedShort(b, u + 1);
- } else {
- label = u + readShort(b, u + 1);
- }
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- if (newOffset < Short.MIN_VALUE
- || newOffset > Short.MAX_VALUE) {
- if (!resize[u]) {
- if (opcode == Opcodes.GOTO || opcode == Opcodes.JSR) {
- // two additional bytes will be required to
- // replace this GOTO or JSR instruction with
- // a GOTO_W or a JSR_W
- insert = 2;
- } else {
- // five additional bytes will be required to
- // replace this IFxxx <l> instruction with
- // IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx
- // is the "opposite" opcode of IFxxx (i.e.,
- // IFNE for IFEQ) and where <l'> designates
- // the instruction just after the GOTO_W.
- insert = 5;
- }
- resize[u] = true;
- }
- }
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- u += 5;
- break;
- case ClassWriter.TABL_INSN:
- if (state == 1) {
- // true number of bytes to be added (or removed)
- // from this instruction = (future number of padding
- // bytes - current number of padding byte) -
- // previously over estimated variation =
- // = ((3 - newOffset%4) - (3 - u%4)) - u%4
- // = (-newOffset%4 + u%4) - u%4
- // = -(newOffset & 3)
- newOffset = getNewOffset(allIndexes, allSizes, 0, u);
- insert = -(newOffset & 3);
- } else if (!resize[u]) {
- // over estimation of the number of bytes to be
- // added to this instruction = 3 - current number
- // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
- insert = u & 3;
- resize[u] = true;
- }
- // skips instruction
- u = u + 4 - (u & 3);
- u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
- break;
- case ClassWriter.LOOK_INSN:
- if (state == 1) {
- // like TABL_INSN
- newOffset = getNewOffset(allIndexes, allSizes, 0, u);
- insert = -(newOffset & 3);
- } else if (!resize[u]) {
- // like TABL_INSN
- insert = u & 3;
- resize[u] = true;
- }
- // skips instruction
- u = u + 4 - (u & 3);
- u += 8 * readInt(b, u + 4) + 8;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- u += 6;
- } else {
- u += 4;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- u += 5;
- break;
- // case ClassWriter.MANA_INSN:
- default:
- u += 4;
- break;
- }
- if (insert != 0) {
- // adds a new (u, insert) entry in the allIndexes and
- // allSizes arrays
- int[] newIndexes = new int[allIndexes.length + 1];
- int[] newSizes = new int[allSizes.length + 1];
- System.arraycopy(allIndexes, 0, newIndexes, 0,
- allIndexes.length);
- System.arraycopy(allSizes, 0, newSizes, 0, allSizes.length);
- newIndexes[allIndexes.length] = u;
- newSizes[allSizes.length] = insert;
- allIndexes = newIndexes;
- allSizes = newSizes;
- if (insert > 0) {
- state = 3;
- }
- }
- }
- if (state < 3) {
- --state;
- }
- } while (state != 0);
-
- // 2nd step:
- // copies the bytecode of the method into a new bytevector, updates the
- // offsets, and inserts (or removes) bytes as requested.
-
- ByteVector newCode = new ByteVector(code.length);
-
- u = 0;
- while (u < code.length) {
- int opcode = b[u] & 0xFF;
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- newCode.putByte(opcode);
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- if (opcode > 201) {
- // changes temporary opcodes 202 to 217 (inclusive), 218
- // and 219 to IFEQ ... JSR (inclusive), IFNULL and
- // IFNONNULL
- opcode = opcode < 218 ? opcode - 49 : opcode - 20;
- label = u + readUnsignedShort(b, u + 1);
- } else {
- label = u + readShort(b, u + 1);
- }
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- if (resize[u]) {
- // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
- // <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is
- // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
- // and where <l'> designates the instruction just after
- // the GOTO_W.
- if (opcode == Opcodes.GOTO) {
- newCode.putByte(200); // GOTO_W
- } else if (opcode == Opcodes.JSR) {
- newCode.putByte(201); // JSR_W
- } else {
- newCode.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1
- : opcode ^ 1);
- newCode.putShort(8); // jump offset
- newCode.putByte(200); // GOTO_W
- // newOffset now computed from start of GOTO_W
- newOffset -= 3;
- }
- newCode.putInt(newOffset);
- } else {
- newCode.putByte(opcode);
- newCode.putShort(newOffset);
- }
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- label = u + readInt(b, u + 1);
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- newCode.putByte(opcode);
- newCode.putInt(newOffset);
- u += 5;
- break;
- case ClassWriter.TABL_INSN:
- // skips 0 to 3 padding bytes
- v = u;
- u = u + 4 - (v & 3);
- // reads and copies instruction
- newCode.putByte(Opcodes.TABLESWITCH);
- newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- j = readInt(b, u);
- u += 4;
- newCode.putInt(j);
- j = readInt(b, u) - j + 1;
- u += 4;
- newCode.putInt(readInt(b, u - 4));
- for (; j > 0; --j) {
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- }
- break;
- case ClassWriter.LOOK_INSN:
- // skips 0 to 3 padding bytes
- v = u;
- u = u + 4 - (v & 3);
- // reads and copies instruction
- newCode.putByte(Opcodes.LOOKUPSWITCH);
- newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- j = readInt(b, u);
- u += 4;
- newCode.putInt(j);
- for (; j > 0; --j) {
- newCode.putInt(readInt(b, u));
- u += 4;
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- }
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- newCode.putByteArray(b, u, 6);
- u += 6;
- } else {
- newCode.putByteArray(b, u, 4);
- u += 4;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- newCode.putByteArray(b, u, 2);
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- newCode.putByteArray(b, u, 3);
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- newCode.putByteArray(b, u, 5);
- u += 5;
- break;
- // case MANA_INSN:
- default:
- newCode.putByteArray(b, u, 4);
- u += 4;
- break;
- }
- }
-
- // updates the stack map frame labels
- if (compute == FRAMES) {
- Label l = labels;
- while (l != null) {
- /*
- * Detects the labels that are just after an IF instruction that
- * has been resized with the IFNOT GOTO_W pattern. These labels
- * are now the target of a jump instruction (the IFNOT
- * instruction). Note that we need the original label position
- * here. getNewOffset must therefore never have been called for
- * this label.
- */
- u = l.position - 3;
- if (u >= 0 && resize[u]) {
- l.status |= Label.TARGET;
- }
- getNewOffset(allIndexes, allSizes, l);
- l = l.successor;
- }
- // Update the offsets in the uninitialized types
- if (cw.typeTable != null) {
- for (i = 0; i < cw.typeTable.length; ++i) {
- Item item = cw.typeTable[i];
- if (item != null && item.type == ClassWriter.TYPE_UNINIT) {
- item.intVal = getNewOffset(allIndexes, allSizes, 0,
- item.intVal);
- }
- }
- }
- // The stack map frames are not serialized yet, so we don't need
- // to update them. They will be serialized in visitMaxs.
- } else if (frameCount > 0) {
- /*
- * Resizing an existing stack map frame table is really hard. Not
- * only the table must be parsed to update the offets, but new
- * frames may be needed for jump instructions that were inserted by
- * this method. And updating the offsets or inserting frames can
- * change the format of the following frames, in case of packed
- * frames. In practice the whole table must be recomputed. For this
- * the frames are marked as potentially invalid. This will cause the
- * whole class to be reread and rewritten with the COMPUTE_FRAMES
- * option (see the ClassWriter.toByteArray method). This is not very
- * efficient but is much easier and requires much less code than any
- * other method I can think of.
- */
- cw.invalidFrames = true;
- }
- // updates the exception handler block labels
- Handler h = firstHandler;
- while (h != null) {
- getNewOffset(allIndexes, allSizes, h.start);
- getNewOffset(allIndexes, allSizes, h.end);
- getNewOffset(allIndexes, allSizes, h.handler);
- h = h.next;
- }
- // updates the instructions addresses in the
- // local var and line number tables
- for (i = 0; i < 2; ++i) {
- ByteVector bv = i == 0 ? localVar : localVarType;
- if (bv != null) {
- b = bv.data;
- u = 0;
- while (u < bv.length) {
- label = readUnsignedShort(b, u);
- newOffset = getNewOffset(allIndexes, allSizes, 0, label);
- writeShort(b, u, newOffset);
- label += readUnsignedShort(b, u + 2);
- newOffset = getNewOffset(allIndexes, allSizes, 0, label)
- - newOffset;
- writeShort(b, u + 2, newOffset);
- u += 10;
- }
- }
- }
- if (lineNumber != null) {
- b = lineNumber.data;
- u = 0;
- while (u < lineNumber.length) {
- writeShort(
- b,
- u,
- getNewOffset(allIndexes, allSizes, 0,
- readUnsignedShort(b, u)));
- u += 4;
- }
- }
- // updates the labels of the other attributes
- Attribute attr = cattrs;
- while (attr != null) {
- Label[] labels = attr.getLabels();
- if (labels != null) {
- for (i = labels.length - 1; i >= 0; --i) {
- getNewOffset(allIndexes, allSizes, labels[i]);
- }
- }
- attr = attr.next;
- }
-
- // replaces old bytecodes with new ones
- code = newCode;
- }
-
- /**
- * Reads an unsigned short value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
- * @return the read value.
- */
- static int readUnsignedShort(final byte[] b, final int index) {
- return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
- }
-
- /**
- * Reads a signed short value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
- * @return the read value.
- */
- static short readShort(final byte[] b, final int index) {
- return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
- }
-
- /**
- * Reads a signed int value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
- * @return the read value.
- */
- static int readInt(final byte[] b, final int index) {
- return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
- | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
- }
-
- /**
- * Writes a short value in the given byte array.
- *
- * @param b
- * a byte array.
- * @param index
- * where the first byte of the short value must be written.
- * @param s
- * the value to be written in the given byte array.
- */
- static void writeShort(final byte[] b, final int index, final int s) {
- b[index] = (byte) (s >>> 8);
- b[index + 1] = (byte) s;
- }
-
- /**
- * Computes the future value of a bytecode offset.
- * <p>
- * Note: it is possible to have several entries for the same instruction in
- * the <tt>indexes</tt> and <tt>sizes</tt>: two entries (index=a,size=b) and
- * (index=a,size=b') are equivalent to a single entry (index=a,size=b+b').
- *
- * @param indexes
- * current positions of the instructions to be resized. Each
- * instruction must be designated by the index of its <i>last</i>
- * byte, plus one (or, in other words, by the index of the
- * <i>first</i> byte of the <i>next</i> instruction).
- * @param sizes
- * the number of bytes to be <i>added</i> to the above
- * instructions. More precisely, for each i < <tt>len</tt>,
- * <tt>sizes</tt>[i] bytes will be added at the end of the
- * instruction designated by <tt>indexes</tt>[i] or, if
- * <tt>sizes</tt>[i] is negative, the <i>last</i> |
- * <tt>sizes[i]</tt>| bytes of the instruction will be removed
- * (the instruction size <i>must not</i> become negative or
- * null).
- * @param begin
- * index of the first byte of the source instruction.
- * @param end
- * index of the first byte of the target instruction.
- * @return the future value of the given bytecode offset.
- */
- static int getNewOffset(final int[] indexes, final int[] sizes,
- final int begin, final int end) {
- int offset = end - begin;
- for (int i = 0; i < indexes.length; ++i) {
- if (begin < indexes[i] && indexes[i] <= end) {
- // forward jump
- offset += sizes[i];
- } else if (end < indexes[i] && indexes[i] <= begin) {
- // backward jump
- offset -= sizes[i];
- }
- }
- return offset;
- }
-
- /**
- * Updates the offset of the given label.
- *
- * @param indexes
- * current positions of the instructions to be resized. Each
- * instruction must be designated by the index of its <i>last</i>
- * byte, plus one (or, in other words, by the index of the
- * <i>first</i> byte of the <i>next</i> instruction).
- * @param sizes
- * the number of bytes to be <i>added</i> to the above
- * instructions. More precisely, for each i < <tt>len</tt>,
- * <tt>sizes</tt>[i] bytes will be added at the end of the
- * instruction designated by <tt>indexes</tt>[i] or, if
- * <tt>sizes</tt>[i] is negative, the <i>last</i> |
- * <tt>sizes[i]</tt>| bytes of the instruction will be removed
- * (the instruction size <i>must not</i> become negative or
- * null).
- * @param label
- * the label whose offset must be updated.
- */
- static void getNewOffset(final int[] indexes, final int[] sizes,
- final Label label) {
- if ((label.status & Label.RESIZED) == 0) {
- label.position = getNewOffset(indexes, sizes, 0, label.position);
- label.status |= Label.RESIZED;
- }
- }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleVisitor.java
index 60aa89c..d1a158d 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleVisitor.java
@@ -27,14 +27,19 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-
package org.eclipse.persistence.internal.libraries.asm;
/**
* A visitor to visit a Java module. The methods of this class must be called in
- * the following order: ( <tt>visitRequire</tt> | <tt>visitExport</tt> |
+ * the following order: <tt>visitMainClass</tt> | ( <tt>visitPackage</tt> |
+ * <tt>visitRequire</tt> | <tt>visitExport</tt> | <tt>visitOpen</tt> |
* <tt>visitUse</tt> | <tt>visitProvide</tt> )* <tt>visitEnd</tt>.
*
+ * The methods {@link #visitRequire(String, int, String)}, {@link #visitExport(String, int, String...)},
+ * {@link #visitOpen(String, int, String...)} and {@link #visitPackage(String)}
+ * take as parameter a package name or a module name. Unlike the other names which are internal names
+ * (names separated by slash), module and package names are qualified names (names separated by dot).
+ *
* @author Remi Forax
*/
public abstract class ModuleVisitor {
@@ -50,18 +55,23 @@ public abstract class ModuleVisitor {
*/
protected ModuleVisitor mv;
-
+ /**
+ * Constructs a new {@link ModuleVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be {@link Opcodes#ASM6}.
+ */
public ModuleVisitor(final int api) {
this(api, null);
}
/**
- * Constructs a new {@link MethodVisitor}.
+ * Constructs a new {@link ModuleVisitor}.
*
* @param api
* the ASM API version implemented by this visitor. Must be {@link Opcodes#ASM6}.
* @param mv
- * the method visitor to which this visitor must delegate method
+ * the module visitor to which this visitor must delegate method
* calls. May be null.
*/
public ModuleVisitor(final int api, final ModuleVisitor mv) {
@@ -73,36 +83,79 @@ public ModuleVisitor(final int api, final ModuleVisitor mv) {
}
/**
+ * Visit the main class of the current module.
+ *
+ * @param mainClass the internal name of the main class of the current module.
+ */
+ public void visitMainClass(String mainClass) {
+ if (mv != null) {
+ mv.visitMainClass(mainClass);
+ }
+ }
+
+ /**
+ * Visit a package of the current module.
+ *
+ * @param packaze the qualified name of a package.
+ */
+ public void visitPackage(String packaze) {
+ if (mv != null) {
+ mv.visitPackage(packaze);
+ }
+ }
+
+ /**
* Visits a dependence of the current module.
*
- * @param module the module name of the dependence
+ * @param module the qualified name of the dependence.
* @param access the access flag of the dependence among
- * ACC_PUBLIC, ACC_SYNTHETIC and ACC_MANDATED.
+ * ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC
+ * and ACC_MANDATED.
+ * @param version the module version at compile time or null.
*/
- public void visitRequire(String module, int access) {
+ public void visitRequire(String module, int access, String version) {
if (mv != null) {
- mv.visitRequire(module, access);
+ mv.visitRequire(module, access, version);
}
}
/**
* Visit an exported package of the current module.
*
- * @param packaze the name of the exported package.
- * @param modules names of the modules that can access to
+ * @param packaze the qualified name of the exported package.
+ * @param access the access flag of the exported package,
+ * valid values are among {@code ACC_SYNTHETIC} and
+ * {@code ACC_MANDATED}.
+ * @param modules the qualified names of the modules that can access to
* the public classes of the exported package or
* <tt>null</tt>.
*/
- public void visitExport(String packaze, String... modules) {
+ public void visitExport(String packaze, int access, String... modules) {
if (mv != null) {
- mv.visitExport(packaze, modules);
+ mv.visitExport(packaze, access, modules);
+ }
+ }
+
+ /**
+ * Visit an open package of the current module.
+ *
+ * @param packaze the qualified name of the opened package.
+ * @param access the access flag of the opened package,
+ * valid values are among {@code ACC_SYNTHETIC} and
+ * {@code ACC_MANDATED}.
+ * @param modules the qualified names of the modules that can use deep
+ * reflection to the classes of the open package or
+ * <tt>null</tt>.
+ */
+ public void visitOpen(String packaze, int access, String... modules) {
+ if (mv != null) {
+ mv.visitOpen(packaze, access, modules);
}
}
/**
* Visit a service used by the current module.
- * The name must be the name of an interface or an
- * abstract class.
+ * The name must be the internal name of an interface or a class.
*
* @param service the internal name of the service.
*/
@@ -116,15 +169,19 @@ public void visitUse(String service) {
* Visit an implementation of a service.
*
* @param service the internal name of the service
- * @param impl the internal name of the implementation
- * of the service
+ * @param providers the internal names of the implementations
+ * of the service (there is at least one provider).
*/
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
if (mv != null) {
- mv.visitProvide(service, impl);
+ mv.visitProvide(service, providers);
}
}
+ /**
+ * Visits the end of the module. This method, which is the last one to be
+ * called, is used to inform the visitor that everything have been visited.
+ */
public void visitEnd() {
if (mv != null) {
mv.visitEnd();
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleWriter.java
index e7f9dab..b07247d 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ModuleWriter.java
@@ -40,9 +40,51 @@ final class ModuleWriter extends ModuleVisitor {
private final ClassWriter cw;
/**
- * size in byte of the corresponding Module attribute.
+ * size in byte of the Module attribute.
*/
- private int size;
+ int size;
+
+ /**
+ * Number of attributes associated with the current module
+ * (Version, ConcealPackages, etc)
+ */
+ int attributeCount;
+
+ /**
+ * Size in bytes of the attributes associated with the current module
+ */
+ int attributesSize;
+
+ /**
+ * module name index in the constant pool
+ */
+ private final int name;
+
+ /**
+ * module access flags
+ */
+ private final int access;
+
+ /**
+ * module version index in the constant pool or 0
+ */
+ private final int version;
+
+ /**
+ * module main class index in the constant pool or 0
+ */
+ private int mainClass;
+
+ /**
+ * number of packages
+ */
+ private int packageCount;
+
+ /**
+ * The packages in bytecode form. This byte vector only contains
+ * the items themselves, the number of items is store in packageCount
+ */
+ private ByteVector packages;
/**
* number of requires items
@@ -67,6 +109,17 @@ final class ModuleWriter extends ModuleVisitor {
private ByteVector exports;
/**
+ * number of opens items
+ */
+ private int openCount;
+
+ /**
+ * The opens items in bytecode form. This byte vector only contains
+ * the items themselves, the number of items is store in openCount
+ */
+ private ByteVector opens;
+
+ /**
* number of uses items
*/
private int useCount;
@@ -88,46 +141,91 @@ final class ModuleWriter extends ModuleVisitor {
*/
private ByteVector provides;
- ModuleWriter(final ClassWriter cw) {
+ ModuleWriter(final ClassWriter cw, final int name,
+ final int access, final int version) {
super(Opcodes.ASM6);
this.cw = cw;
- this.size = 8;
+ this.size = 16; // name + access + version + 5 counts
+ this.name = name;
+ this.access = access;
+ this.version = version;
}
@Override
- public void visitRequire(String module, int access) {
+ public void visitMainClass(String mainClass) {
+ if (this.mainClass == 0) { // protect against several calls to visitMainClass
+ cw.newUTF8("ModuleMainClass");
+ attributeCount++;
+ attributesSize += 8;
+ }
+ this.mainClass = cw.newClass(mainClass);
+ }
+
+ @Override
+ public void visitPackage(String packaze) {
+ if (packages == null) {
+ // protect against several calls to visitPackage
+ cw.newUTF8("ModulePackages");
+ packages = new ByteVector();
+ attributeCount++;
+ attributesSize += 8;
+ }
+ packages.putShort(cw.newPackage(packaze));
+ packageCount++;
+ attributesSize += 2;
+ }
+
+ @Override
+ public void visitRequire(String module, int access, String version) {
if (requires == null) {
requires = new ByteVector();
}
- //FIXME fix bad ACC_PUBLIC value (0x0020)
- if ((access & Opcodes.ACC_PUBLIC) != 0) {
- access = access & ~ Opcodes.ACC_PUBLIC | 0x0020;
- }
- requires.putShort(cw.newUTF8(module)).putShort(access);
+ requires.putShort(cw.newModule(module))
+ .putShort(access)
+ .putShort(version == null? 0: cw.newUTF8(version));
requireCount++;
- size += 4;
+ size += 6;
}
@Override
- public void visitExport(String packaze, String... modules) {
+ public void visitExport(String packaze, int access, String... modules) {
if (exports == null) {
exports = new ByteVector();
}
- exports.putShort(cw.newUTF8(packaze));
+ exports.putShort(cw.newPackage(packaze)).putShort(access);
if (modules == null) {
exports.putShort(0);
- size += 4;
+ size += 6;
} else {
exports.putShort(modules.length);
- for(String to: modules) {
- exports.putShort(cw.newUTF8(to));
+ for(String module: modules) {
+ exports.putShort(cw.newModule(module));
}
- size += 4 + 2 * modules.length;
+ size += 6 + 2 * modules.length;
}
exportCount++;
}
@Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ if (opens == null) {
+ opens = new ByteVector();
+ }
+ opens.putShort(cw.newPackage(packaze)).putShort(access);
+ if (modules == null) {
+ opens.putShort(0);
+ size += 6;
+ } else {
+ opens.putShort(modules.length);
+ for(String module: modules) {
+ opens.putShort(cw.newModule(module));
+ }
+ size += 6 + 2 * modules.length;
+ }
+ openCount++;
+ }
+
+ @Override
public void visitUse(String service) {
if (uses == null) {
uses = new ByteVector();
@@ -138,13 +236,17 @@ public void visitUse(String service) {
}
@Override
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
if (provides == null) {
provides = new ByteVector();
}
- provides.putShort(cw.newClass(service)).putShort(cw.newClass(impl));
+ provides.putShort(cw.newClass(service));
+ provides.putShort(providers.length);
+ for(String provider: providers) {
+ provides.putShort(cw.newClass(provider));
+ }
provideCount++;
- size += 4;
+ size += 4 + 2 * providers.length;
}
@Override
@@ -152,12 +254,21 @@ public void visitEnd() {
// empty
}
- int getSize() {
- return size;
+ void putAttributes(ByteVector out) {
+ if (mainClass != 0) {
+ out.putShort(cw.newUTF8("ModuleMainClass")).putInt(2).putShort(mainClass);
+ }
+ if (packages != null) {
+ out.putShort(cw.newUTF8("ModulePackages"))
+ .putInt(2 + 2 * packageCount)
+ .putShort(packageCount)
+ .putByteArray(packages.data, 0, packages.length);
+ }
}
void put(ByteVector out) {
out.putInt(size);
+ out.putShort(name).putShort(access).putShort(version);
out.putShort(requireCount);
if (requires != null) {
out.putByteArray(requires.data, 0, requires.length);
@@ -166,6 +277,10 @@ void put(ByteVector out) {
if (exports != null) {
out.putByteArray(exports.data, 0, exports.length);
}
+ out.putShort(openCount);
+ if (opens != null) {
+ out.putByteArray(opens.data, 0, opens.length);
+ }
out.putShort(useCount);
if (uses != null) {
out.putByteArray(uses.data, 0, uses.length);
@@ -174,5 +289,5 @@ void put(ByteVector out) {
if (provides != null) {
out.putByteArray(provides.data, 0, provides.length);
}
- }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Opcodes.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Opcodes.java
index e61eade..a23cddf 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Opcodes.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Opcodes.java
@@ -59,7 +59,7 @@ public interface Opcodes {
int V1_6 = 0 << 16 | 50;
int V1_7 = 0 << 16 | 51;
int V1_8 = 0 << 16 | 52;
- int V1_9 = 0 << 16 | 53;
+ int V9 = 0 << 16 | 53;
// access flags
@@ -70,19 +70,23 @@ public interface Opcodes {
int ACC_FINAL = 0x0010; // class, field, method, parameter
int ACC_SUPER = 0x0020; // class
int ACC_SYNCHRONIZED = 0x0020; // method
+ int ACC_OPEN = 0x0020; // module
+ int ACC_TRANSITIVE = 0x0020; // module requires
int ACC_VOLATILE = 0x0040; // field
int ACC_BRIDGE = 0x0040; // method
+ int ACC_STATIC_PHASE = 0x0040; // module requires
int ACC_VARARGS = 0x0080; // method
int ACC_TRANSIENT = 0x0080; // field
int ACC_NATIVE = 0x0100; // method
int ACC_INTERFACE = 0x0200; // class
int ACC_ABSTRACT = 0x0400; // class, method
int ACC_STRICT = 0x0800; // method
- int ACC_SYNTHETIC = 0x1000; // class, field, method, parameter
+ int ACC_SYNTHETIC = 0x1000; // class, field, method, parameter, module *
int ACC_ANNOTATION = 0x2000; // class
int ACC_ENUM = 0x4000; // class(?) field inner
- int ACC_MANDATED = 0x8000; // parameter
+ int ACC_MANDATED = 0x8000; // parameter, module, module *
int ACC_MODULE = 0x8000; // class
+
// ASM specific pseudo access flags
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.java
index f7b2139..3c9af4c 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.java
@@ -661,6 +661,8 @@ private void execute(final int opcode, final int iarg, final String sarg) {
t1 = pop();
if (t1 instanceof String) {
pushDesc(((String) t1).substring(1));
+ } else if (t1 == Opcodes.NULL) {
+ push(t1);
} else {
push("java/lang/Object");
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ClassRemapper.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ClassRemapper.java
index d175a7d..ddf309e 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ClassRemapper.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ClassRemapper.java
@@ -30,7 +30,10 @@
package org.eclipse.persistence.internal.libraries.asm.commons;
+import java.util.List;
+
import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
+import org.eclipse.persistence.internal.libraries.asm.Attribute;
import org.eclipse.persistence.internal.libraries.asm.ClassVisitor;
import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
import org.eclipse.persistence.internal.libraries.asm.MethodVisitor;
@@ -69,9 +72,9 @@ public void visit(int version, int access, String name, String signature,
}
@Override
- public ModuleVisitor visitModule() {
- ModuleVisitor mv = super.visitModule();
- return mv == null ? null: createModuleRemapper(mv);
+ public ModuleVisitor visitModule(String name, int flags, String version) {
+ ModuleVisitor mv = super.visitModule(remapper.mapModuleName(name), flags, version);
+ return mv == null ? null : createModuleRemapper(mv);
}
@Override
@@ -90,6 +93,18 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef,
}
@Override
+ public void visitAttribute(Attribute attr) {
+ if (attr instanceof ModuleHashesAttribute) {
+ ModuleHashesAttribute hashesAttr = new ModuleHashesAttribute();
+ List<String> modules = hashesAttr.modules;
+ for(int i = 0; i < modules.size(); i++) {
+ modules.set(i, remapper.mapModuleName(modules.get(i)));
+ }
+ }
+ super.visitAttribute(attr);
+ }
+
+ @Override
public FieldVisitor visitField(int access, String name, String desc,
String signature, Object value) {
FieldVisitor fv = super.visitField(access,
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/MethodRemapper.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/MethodRemapper.java
index 3747499..89f43f8 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/MethodRemapper.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/MethodRemapper.java
@@ -93,18 +93,20 @@ public void visitFrame(int type, int nLocal, Object[] local, int nStack,
}
private Object[] remapEntries(int n, Object[] entries) {
- for (int i = 0; i < n; i++) {
- if (entries[i] instanceof String) {
- Object[] newEntries = new Object[n];
- if (i > 0) {
- System.arraycopy(entries, 0, newEntries, 0, i);
+ if (entries != null) {
+ for (int i = 0; i < n; i++) {
+ if (entries[i] instanceof String) {
+ Object[] newEntries = new Object[n];
+ if (i > 0) {
+ System.arraycopy(entries, 0, newEntries, 0, i);
+ }
+ do {
+ Object t = entries[i];
+ newEntries[i++] = t instanceof String ? remapper
+ .mapType((String) t) : t;
+ } while (i < n);
+ return newEntries;
}
- do {
- Object t = entries[i];
- newEntries[i++] = t instanceof String ? remapper
- .mapType((String) t) : t;
- } while (i < n);
- return newEntries;
}
}
return entries;
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleHashesAttribute.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleHashesAttribute.java
new file mode 100644
index 0000000..69b4336
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleHashesAttribute.java
@@ -0,0 +1,126 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.persistence.internal.libraries.asm.commons;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.persistence.internal.libraries.asm.Attribute;
+import org.eclipse.persistence.internal.libraries.asm.ByteVector;
+import org.eclipse.persistence.internal.libraries.asm.ClassReader;
+import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
+import org.eclipse.persistence.internal.libraries.asm.Label;
+
+/**
+ * ModuleHashes attribute.
+ * This attribute is specific to the OpenJDK and may change in the future.
+ *
+ * @author Remi Forax
+ */
+public final class ModuleHashesAttribute extends Attribute {
+ public String algorithm;
+ public List<String> modules;
+ public List<byte[]> hashes;
+
+ /**
+ * Creates an attribute with a hashing algorithm, a list of module names,
+ * and a list of the same length of hashes.
+ * @param algorithm the hashing algorithm name.
+ * @param modules a list of module name
+ * @param hashes a list of hash, one for each module name.
+ */
+ public ModuleHashesAttribute(final String algorithm,
+ final List<String> modules, final List<byte[]> hashes) {
+ super("ModuleHashes");
+ this.algorithm = algorithm;
+ this.modules = modules;
+ this.hashes = hashes;
+ }
+
+ /**
+ * Creates an empty attribute that can be used as prototype
+ * to be passed as argument of the method
+ * {@link ClassReader#accept(org.eclipse.persistence.internal.libraries.asm.ClassVisitor, Attribute[], int)}.
+ */
+ public ModuleHashesAttribute() {
+ this(null, null, null);
+ }
+
+ @Override
+ protected Attribute read(ClassReader cr, int off, int len, char[] buf,
+ int codeOff, Label[] labels) {
+ String hashAlgorithm = cr.readUTF8(off, buf);
+
+ int count = cr.readUnsignedShort(off + 2);
+ ArrayList<String> modules = new ArrayList<String>(count);
+ ArrayList<byte[]> hashes = new ArrayList<byte[]>(count);
+ off += 4;
+
+ for (int i = 0; i < count; i++) {
+ String module = cr.readModule(off, buf);
+ int hashLength = cr.readUnsignedShort(off + 2);
+ off += 4;
+
+ byte[] hash = new byte[hashLength];
+ for (int j = 0; j < hashLength; j++) {
+ hash[j] = (byte) (cr.readByte(off + j) & 0xff);
+ }
+ off += hashLength;
+
+ modules.add(module);
+ hashes.add(hash);
+ }
+ return new ModuleHashesAttribute(hashAlgorithm, modules, hashes);
+ }
+
+ @Override
+ protected ByteVector write(ClassWriter cw, byte[] code, int len,
+ int maxStack, int maxLocals) {
+ ByteVector v = new ByteVector();
+ int index = cw.newUTF8(algorithm);
+ v.putShort(index);
+
+ int count = (modules == null)? 0: modules.size();
+ v.putShort(count);
+
+ for(int i = 0; i < count; i++) {
+ String module = modules.get(i);
+ v.putShort(cw.newModule(module));
+
+ byte[] hash = hashes.get(i);
+ v.putShort(hash.length);
+ for(byte b: hash) {
+ v.putByte(b);
+ }
+ }
+ return v;
+ }
+}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleRemapper.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleRemapper.java
index b0d68c3..1dd42eb 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleRemapper.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleRemapper.java
@@ -52,20 +52,42 @@ protected ModuleRemapper(final int api, final ModuleVisitor mv,
}
@Override
- public void visitRequire(String module, int access) {
- super.visitRequire(remapper.mapModuleName(module), access);
+ public void visitMainClass(String mainClass) {
+ super.visitMainClass(remapper.mapType(mainClass));
}
@Override
- public void visitExport(String packaze, String... modules) {
- String[] newTos = null;
+ public void visitPackage(String packaze) {
+ super.visitPackage(remapper.mapPackageName(packaze));
+ }
+
+ @Override
+ public void visitRequire(String module, int access, String version) {
+ super.visitRequire(remapper.mapModuleName(module), access, version);
+ }
+
+ @Override
+ public void visitExport(String packaze, int access, String... modules) {
+ String[] newModules = null;
if (modules != null) {
- newTos = new String[modules.length];
- for(int i = 0 ; i < modules.length; i++) {
- newTos[i] = remapper.mapModuleName(modules[i]);
+ newModules = new String[modules.length];
+ for (int i = 0 ; i < modules.length; i++) {
+ newModules[i] = remapper.mapModuleName(modules[i]);
}
}
- super.visitExport(remapper.mapPackageName(packaze), newTos);
+ super.visitExport(remapper.mapPackageName(packaze), access, newModules);
+ }
+
+ @Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ String[] newModules = null;
+ if (modules != null) {
+ newModules = new String[modules.length];
+ for (int i = 0 ; i < modules.length; i++) {
+ newModules[i] = remapper.mapModuleName(modules[i]);
+ }
+ }
+ super.visitOpen(remapper.mapPackageName(packaze), access, newModules);
}
@Override
@@ -74,7 +96,11 @@ public void visitUse(String service) {
}
@Override
- public void visitProvide(String service, String impl) {
- super.visitProvide(remapper.mapType(service), remapper.mapType(impl));
+ public void visitProvide(String service, String... providers) {
+ String[] newProviders = new String[providers.length];
+ for (int i = 0 ; i < providers.length; i++) {
+ newProviders[i] = remapper.mapType(providers[i]);
+ }
+ super.visitProvide(remapper.mapType(service), newProviders);
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleResolutionAttribute.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleResolutionAttribute.java
new file mode 100644
index 0000000..203ce9d
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleResolutionAttribute.java
@@ -0,0 +1,106 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.persistence.internal.libraries.asm.commons;
+
+import org.eclipse.persistence.internal.libraries.asm.Attribute;
+import org.eclipse.persistence.internal.libraries.asm.ByteVector;
+import org.eclipse.persistence.internal.libraries.asm.ClassReader;
+import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
+import org.eclipse.persistence.internal.libraries.asm.Label;
+
+/**
+ * ModuleResolution_attribute.
+ * This attribute is specific to the OpenJDK and may change in the future.
+ *
+ * @author Remi Forax
+ */
+public final class ModuleResolutionAttribute extends Attribute {
+ /**
+ * Resolution state of a module meaning that the module is not available
+ * from the class-path by default.
+ */
+ public static final int RESOLUTION_DO_NOT_RESOLVE_BY_DEFAULT = 1;
+
+ /**
+ * Resolution state of a module meaning the module is marked as deprecated.
+ */
+ public static final int RESOLUTION_WARN_DEPRECATED = 2;
+
+ /**
+ * Resolution state of a module meaning the module is marked as deprecated
+ * and will be removed in a future release.
+ */
+ public static final int RESOLUTION_WARN_DEPRECATED_FOR_REMOVAL = 4;
+
+ /**
+ * Resolution state of a module meaning the module is not yet standardized,
+ * so in incubating mode.
+ */
+ public static final int RESOLUTION_WARN_INCUBATING = 8;
+
+ public int resolution;
+
+ /**
+ * Creates an attribute with a resolution state value.
+ * @param resolution the resolution state among
+ * {@link #RESOLUTION_WARN_DEPRECATED},
+ * {@link #RESOLUTION_WARN_DEPRECATED_FOR_REMOVAL}, and
+ * {@link #RESOLUTION_WARN_INCUBATING}.
+ */
+ public ModuleResolutionAttribute(final int resolution) {
+ super("ModuleResolution");
+ this.resolution = resolution;
+ }
+
+ /**
+ * Creates an empty attribute that can be used as prototype
+ * to be passed as argument of the method
+ * {@link ClassReader#accept(org.eclipse.persistence.internal.libraries.asm.ClassVisitor, Attribute[], int)}.
+ */
+ public ModuleResolutionAttribute() {
+ this(0);
+ }
+
+ @Override
+ protected Attribute read(ClassReader cr, int off, int len, char[] buf,
+ int codeOff, Label[] labels) {
+ int resolution = cr.readUnsignedShort(off);
+ return new ModuleResolutionAttribute(resolution);
+ }
+
+ @Override
+ protected ByteVector write(ClassWriter cw, byte[] code, int len,
+ int maxStack, int maxLocals) {
+ ByteVector v = new ByteVector();
+ v.putShort(resolution);
+ return v;
+ }
+}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleTargetAttribute.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleTargetAttribute.java
new file mode 100644
index 0000000..162b496
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/ModuleTargetAttribute.java
@@ -0,0 +1,81 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.persistence.internal.libraries.asm.commons;
+
+import org.eclipse.persistence.internal.libraries.asm.Attribute;
+import org.eclipse.persistence.internal.libraries.asm.ByteVector;
+import org.eclipse.persistence.internal.libraries.asm.ClassReader;
+import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
+import org.eclipse.persistence.internal.libraries.asm.Label;
+
+/**
+ * ModuleTarget attribute.
+ * This attribute is specific to the OpenJDK and may change in the future.
+ *
+ * @author Remi Forax
+ */
+public final class ModuleTargetAttribute extends Attribute {
+ public String platform;
+
+ /**
+ * Creates an attribute with a platform name.
+ * @param platform the platform name on which the module can run.
+ */
+ public ModuleTargetAttribute(final String platform) {
+ super("ModuleTarget");
+ this.platform = platform;
+ }
+
+ /**
+ * Creates an empty attribute that can be used as prototype
+ * to be passed as argument of the method
+ * {@link ClassReader#accept(org.eclipse.persistence.internal.libraries.asm.ClassVisitor, Attribute[], int)}.
+ */
+ public ModuleTargetAttribute() {
+ this(null);
+ }
+
+ @Override
+ protected Attribute read(ClassReader cr, int off, int len, char[] buf,
+ int codeOff, Label[] labels) {
+ String platform = cr.readUTF8(off, buf);
+ return new ModuleTargetAttribute(platform);
+ }
+
+ @Override
+ protected ByteVector write(ClassWriter cw, byte[] code, int len,
+ int maxStack, int maxLocals) {
+ ByteVector v = new ByteVector();
+ int index = (platform == null)? 0: cw.newUTF8(platform);
+ v.putShort(index);
+ return v;
+ }
+}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.java
index 95bc01a..d07793e 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.java
@@ -71,7 +71,7 @@ public void visit(int version, int access, String name, String signature,
}
@Override
- public ModuleVisitor visitModule() {
+ public ModuleVisitor visitModule(String name, int flags, String version) {
throw new RuntimeException("RemappingClassAdapter is deprecated, use ClassRemapper instead");
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.java
index ba6c3f0..786be37 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.java
@@ -96,18 +96,20 @@ public void visitFrame(int type, int nLocal, Object[] local, int nStack,
}
private Object[] remapEntries(int n, Object[] entries) {
- for (int i = 0; i < n; i++) {
- if (entries[i] instanceof String) {
- Object[] newEntries = new Object[n];
- if (i > 0) {
- System.arraycopy(entries, 0, newEntries, 0, i);
+ if (entries != null) {
+ for (int i = 0; i < n; i++) {
+ if (entries[i] instanceof String) {
+ Object[] newEntries = new Object[n];
+ if (i > 0) {
+ System.arraycopy(entries, 0, newEntries, 0, i);
+ }
+ do {
+ Object t = entries[i];
+ newEntries[i++] = t instanceof String ? remapper
+ .mapType((String) t) : t;
+ } while (i < n);
+ return newEntries;
}
- do {
- Object t = entries[i];
- newEntries[i++] = t instanceof String ? remapper
- .mapType((String) t) : t;
- } while (i < n);
- return newEntries;
}
}
return entries;
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/package.html
deleted file mode 100644
index 4ce0db8..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/package.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides some useful class and method adapters. <i>The preferred way of using
-these adapters is by chaining them together and to custom adapters (instead of
-inheriting from them)</i>. Indeed this approach provides more combination
-possibilities than inheritance. For instance, suppose you want to implement an
-adapter MyAdapter than needs sorted local variables and intermediate stack map
-frame values taking into account the local variables sort. By using inheritance,
-this would require MyAdapter to extend AnalyzerAdapter, itself extending
-LocalVariablesSorter. But AnalyzerAdapter is not a subclass of
-LocalVariablesSorter, so this is not possible. On the contrary, by using
-delegation, you can make LocalVariablesSorter delegate to AnalyzerAdapter,
-itself delegating to MyAdapter. In this case AnalyzerAdapter computes
-intermediate frames based on the output of LocalVariablesSorter, and MyAdapter
-can add new locals by calling the newLocal method on LocalVariablesSorter, and
-can get the stack map frame state before each instruction by reading the locals
-and stack fields in AnalyzerAdapter (this requires references from MyAdapter
-back to LocalVariablesSorter and AnalyzerAdapter).
-</body>
\ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/AnnotationConstantsCollector.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/AnnotationConstantsCollector.java
deleted file mode 100644
index 90aedf9..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/AnnotationConstantsCollector.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.Type;
-
-/**
- * An {@link AnnotationVisitor} that collects the {@link Constant}s of the
- * annotations it visits.
- *
- * @author Eric Bruneton
- */
-public class AnnotationConstantsCollector extends AnnotationVisitor {
-
- private final ConstantPool cp;
-
- public AnnotationConstantsCollector(final AnnotationVisitor av,
- final ConstantPool cp) {
- super(Opcodes.ASM6, av);
- this.cp = cp;
- }
-
- @Override
- public void visit(final String name, final Object value) {
- if (name != null) {
- cp.newUTF8(name);
- }
- if (value instanceof Byte) {
- cp.newInteger(((Byte) value).byteValue());
- } else if (value instanceof Boolean) {
- cp.newInteger(((Boolean) value).booleanValue() ? 1 : 0);
- } else if (value instanceof Character) {
- cp.newInteger(((Character) value).charValue());
- } else if (value instanceof Short) {
- cp.newInteger(((Short) value).shortValue());
- } else if (value instanceof Type) {
- cp.newUTF8(((Type) value).getDescriptor());
- } else if (value instanceof byte[]) {
- byte[] v = (byte[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newInteger(v[i]);
- }
- } else if (value instanceof boolean[]) {
- boolean[] v = (boolean[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newInteger(v[i] ? 1 : 0);
- }
- } else if (value instanceof short[]) {
- short[] v = (short[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newInteger(v[i]);
- }
- } else if (value instanceof char[]) {
- char[] v = (char[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newInteger(v[i]);
- }
- } else if (value instanceof int[]) {
- int[] v = (int[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newInteger(v[i]);
- }
- } else if (value instanceof long[]) {
- long[] v = (long[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newLong(v[i]);
- }
- } else if (value instanceof float[]) {
- float[] v = (float[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newFloat(v[i]);
- }
- } else if (value instanceof double[]) {
- double[] v = (double[]) value;
- for (int i = 0; i < v.length; i++) {
- cp.newDouble(v[i]);
- }
- } else {
- cp.newConst(value);
- }
- av.visit(name, value);
- }
-
- @Override
- public void visitEnum(final String name, final String desc,
- final String value) {
- if (name != null) {
- cp.newUTF8(name);
- }
- cp.newUTF8(desc);
- cp.newUTF8(value);
- av.visitEnum(name, desc, value);
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(final String name,
- final String desc) {
- if (name != null) {
- cp.newUTF8(name);
- }
- cp.newUTF8(desc);
- return new AnnotationConstantsCollector(av.visitAnnotation(name, desc),
- cp);
- }
-
- @Override
- public AnnotationVisitor visitArray(final String name) {
- if (name != null) {
- cp.newUTF8(name);
- }
- return new AnnotationConstantsCollector(av.visitArray(name), cp);
- }
-
- @Override
- public void visitEnd() {
- av.visitEnd();
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ClassConstantsCollector.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ClassConstantsCollector.java
deleted file mode 100644
index 5282773..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ClassConstantsCollector.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Attribute;
-import org.eclipse.persistence.internal.libraries.asm.ClassVisitor;
-import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
-import org.eclipse.persistence.internal.libraries.asm.MethodVisitor;
-import org.eclipse.persistence.internal.libraries.asm.ModuleVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.TypePath;
-
-/**
- * A {@link ClassVisitor} that collects the {@link Constant}s of the classes it
- * visits.
- *
- * @author Eric Bruneton
- */
-public class ClassConstantsCollector extends ClassVisitor {
-
- private final ConstantPool cp;
-
- public ClassConstantsCollector(final ClassVisitor cv, final ConstantPool cp) {
- super(Opcodes.ASM6, cv);
- this.cp = cp;
- }
-
- @Override
- public void visit(final int version, final int access, final String name,
- final String signature, final String superName,
- final String[] interfaces) {
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- cp.newUTF8("Deprecated");
- }
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- cp.newUTF8("Synthetic");
- }
- cp.newClass(name);
- if (signature != null) {
- cp.newUTF8("Signature");
- cp.newUTF8(signature);
- }
- if (superName != null) {
- cp.newClass(superName);
- }
- if (interfaces != null) {
- for (int i = 0; i < interfaces.length; ++i) {
- cp.newClass(interfaces[i]);
- }
- }
- cv.visit(version, access, name, signature, superName, interfaces);
- }
-
- @Override
- public void visitSource(final String source, final String debug) {
- if (source != null) {
- cp.newUTF8("SourceFile");
- cp.newUTF8(source);
- }
- if (debug != null) {
- cp.newUTF8("SourceDebugExtension");
- }
- cv.visitSource(source, debug);
- }
-
- @Override
- public ModuleVisitor visitModule() {
- cp.newUTF8("Module");
- return new ModuleConstantsCollector(cv.visitModule(), cp);
- }
-
- @Override
- public void visitOuterClass(final String owner, final String name,
- final String desc) {
- cp.newUTF8("EnclosingMethod");
- cp.newClass(owner);
- if (name != null && desc != null) {
- cp.newNameType(name, desc);
- }
- cv.visitOuterClass(owner, name, desc);
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleAnnotations");
- }
- return new AnnotationConstantsCollector(cv.visitAnnotation(desc,
- visible), cp);
- }
-
- @Override
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleTypeAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- return new AnnotationConstantsCollector(cv.visitAnnotation(desc,
- visible), cp);
- }
-
- @Override
- public void visitAttribute(final Attribute attr) {
- // can do nothing
- cv.visitAttribute(attr);
- }
-
- @Override
- public void visitInnerClass(final String name, final String outerName,
- final String innerName, final int access) {
- cp.newUTF8("InnerClasses");
- if (name != null) {
- cp.newClass(name);
- }
- if (outerName != null) {
- cp.newClass(outerName);
- }
- if (innerName != null) {
- cp.newUTF8(innerName);
- }
- cv.visitInnerClass(name, outerName, innerName, access);
- }
-
- @Override
- public FieldVisitor visitField(final int access, final String name,
- final String desc, final String signature, final Object value) {
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- cp.newUTF8("Synthetic");
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- cp.newUTF8("Deprecated");
- }
- cp.newUTF8(name);
- cp.newUTF8(desc);
- if (signature != null) {
- cp.newUTF8("Signature");
- cp.newUTF8(signature);
- }
- if (value != null) {
- cp.newConst(value);
- }
- return new FieldConstantsCollector(cv.visitField(access, name, desc,
- signature, value), cp);
- }
-
- @Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature, final String[] exceptions) {
- if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
- cp.newUTF8("Synthetic");
- }
- if ((access & Opcodes.ACC_DEPRECATED) != 0) {
- cp.newUTF8("Deprecated");
- }
- cp.newUTF8(name);
- cp.newUTF8(desc);
- if (signature != null) {
- cp.newUTF8("Signature");
- cp.newUTF8(signature);
- }
- if (exceptions != null) {
- cp.newUTF8("Exceptions");
- for (int i = 0; i < exceptions.length; ++i) {
- cp.newClass(exceptions[i]);
- }
- }
- return new MethodConstantsCollector(cv.visitMethod(access, name, desc,
- signature, exceptions), cp);
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ClassOptimizer.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ClassOptimizer.java
deleted file mode 100644
index 2caca10..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ClassOptimizer.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Attribute;
-import org.eclipse.persistence.internal.libraries.asm.ClassVisitor;
-import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Label;
-import org.eclipse.persistence.internal.libraries.asm.MethodVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.TypePath;
-import org.eclipse.persistence.internal.libraries.asm.commons.Remapper;
-import org.eclipse.persistence.internal.libraries.asm.commons.ClassRemapper;
-
-/**
- * A {@link ClassVisitor} that renames fields and methods, and removes debug
- * info.
- *
- * @author Eric Bruneton
- * @author Eugene Kuleshov
- */
-public class ClassOptimizer extends ClassRemapper {
-
- private String pkgName;
- String clsName;
-
- boolean isInterface = false;
- boolean hasClinitMethod = false;
- List<String> syntheticClassFields = new ArrayList<String>();
-
- public ClassOptimizer(final ClassVisitor cv, final Remapper remapper) {
- super(Opcodes.ASM6, cv, remapper);
- }
-
- FieldVisitor syntheticFieldVisitor(final int access, final String name,
- final String desc) {
- return super.visitField(access, name, desc, null, null);
- }
-
- // ------------------------------------------------------------------------
- // Overridden methods
- // ------------------------------------------------------------------------
-
- @Override
- public void visit(final int version, final int access, final String name,
- final String signature, final String superName,
- final String[] interfaces) {
- super.visit(Opcodes.V1_2, access, name, null, superName, interfaces);
- int index = name.lastIndexOf('/');
- if (index > 0) {
- pkgName = name.substring(0, index);
- } else {
- pkgName = "";
- }
- clsName = name;
- isInterface = (access & Opcodes.ACC_INTERFACE) != 0;
- }
-
- @Override
- public void visitSource(final String source, final String debug) {
- // remove debug info
- }
-
- @Override
- public void visitOuterClass(final String owner, final String name,
- final String desc) {
- // remove debug info
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- // remove annotations
- return null;
- }
-
- @Override
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- // remove annotations
- return null;
- }
-
- @Override
- public void visitAttribute(final Attribute attr) {
- // remove non standard attributes
- }
-
- @Override
- public void visitInnerClass(final String name, final String outerName,
- final String innerName, final int access) {
- // remove debug info
- }
-
- @Override
- public FieldVisitor visitField(final int access, final String name,
- final String desc, final String signature, final Object value) {
- String s = remapper.mapFieldName(className, name, desc);
- if ("-".equals(s)) {
- return null;
- }
- if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) {
- if ((access & Opcodes.ACC_FINAL) != 0
- && (access & Opcodes.ACC_STATIC) != 0 && desc.length() == 1) {
- return null;
- }
- if ("org/objectweb/asm".equals(pkgName) && s.equals(name)) {
- System.out.println("INFO: " + clsName + "." + s
- + " could be renamed");
- }
- super.visitField(access, name, desc, null, value);
- } else {
- if (!s.equals(name)) {
- throw new RuntimeException("The public or protected field "
- + className + '.' + name + " must not be renamed.");
- }
- super.visitField(access, name, desc, null, value);
- }
- return null; // remove debug info
- }
-
- @Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature, final String[] exceptions) {
- String s = remapper.mapMethodName(className, name, desc);
- if ("-".equals(s)) {
- return null;
- }
- if (name.equals("<clinit>") && !isInterface) {
- hasClinitMethod = true;
- MethodVisitor mv = super.visitMethod(access, name, desc, null,
- exceptions);
- return new MethodVisitor(Opcodes.ASM6, mv) {
- @Override
- public void visitCode() {
- super.visitCode();
- mv.visitMethodInsn(Opcodes.INVOKESTATIC, clsName,
- "_clinit_", "()V", false);
- }
- };
- }
-
- if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) {
- if ("org/objectweb/asm".equals(pkgName) && !name.startsWith("<")
- && s.equals(name)) {
- System.out.println("INFO: " + clsName + "." + s
- + " could be renamed");
- }
- return super.visitMethod(access, name, desc, null, exceptions);
- } else {
- if (!s.equals(name)) {
- throw new RuntimeException("The public or protected method "
- + className + '.' + name + desc
- + " must not be renamed.");
- }
- return super.visitMethod(access, name, desc, null, exceptions);
- }
- }
-
- @Override
- protected MethodVisitor createMethodRemapper(MethodVisitor mv) {
- return new MethodOptimizer(this, mv, remapper);
- }
-
- @Override
- public void visitEnd() {
- if (syntheticClassFields.isEmpty()) {
- if (hasClinitMethod) {
- MethodVisitor mv = cv.visitMethod(Opcodes.ACC_STATIC
- | Opcodes.ACC_SYNTHETIC, "_clinit_", "()V", null, null);
- mv.visitCode();
- mv.visitInsn(Opcodes.RETURN);
- mv.visitMaxs(0, 0);
- mv.visitEnd();
- }
- } else {
- MethodVisitor mv = cv.visitMethod(Opcodes.ACC_STATIC
- | Opcodes.ACC_SYNTHETIC, "class$",
- "(Ljava/lang/String;)Ljava/lang/Class;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- Label l1 = new Label();
- Label l2 = new Label();
- mv.visitTryCatchBlock(l0, l1, l2,
- "java/lang/ClassNotFoundException");
- mv.visitLabel(l0);
- mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Class",
- "forName", "(Ljava/lang/String;)Ljava/lang/Class;", false);
- mv.visitLabel(l1);
- mv.visitInsn(Opcodes.ARETURN);
- mv.visitLabel(l2);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
- "java/lang/ClassNotFoundException", "getMessage",
- "()Ljava/lang/String;", false);
- mv.visitVarInsn(Opcodes.ASTORE, 1);
- mv.visitTypeInsn(Opcodes.NEW, "java/lang/NoClassDefFoundError");
- mv.visitInsn(Opcodes.DUP);
- mv.visitVarInsn(Opcodes.ALOAD, 1);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
- "java/lang/NoClassDefFoundError", "<init>",
- "(Ljava/lang/String;)V", false);
- mv.visitInsn(Opcodes.ATHROW);
- mv.visitMaxs(3, 2);
- mv.visitEnd();
-
- if (hasClinitMethod) {
- mv = cv.visitMethod(Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE,
- "_clinit_", "()V", null, null);
- } else {
- mv = cv.visitMethod(Opcodes.ACC_STATIC, "<clinit>", "()V",
- null, null);
- }
- for (String ldcName : syntheticClassFields) {
- String fieldName = "class$" + ldcName.replace('/', '$');
- mv.visitLdcInsn(ldcName.replace('/', '.'));
- mv.visitMethodInsn(Opcodes.INVOKESTATIC, clsName, "class$",
- "(Ljava/lang/String;)Ljava/lang/Class;", false);
- mv.visitFieldInsn(Opcodes.PUTSTATIC, clsName, fieldName,
- "Ljava/lang/Class;");
- }
- mv.visitInsn(Opcodes.RETURN);
- mv.visitMaxs(1, 0);
- mv.visitEnd();
- }
- super.visitEnd();
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/Constant.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/Constant.java
deleted file mode 100644
index 178014a..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/Constant.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.util.Arrays;
-
-import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
-import org.eclipse.persistence.internal.libraries.asm.Handle;
-
-/**
- * A constant pool item.
- *
- * @author Eric Bruneton
- */
-class Constant {
-
- /**
- * Type of this constant pool item. A single class is used to represent all
- * constant pool item types, in order to minimize the bytecode size of this
- * package. The value of this field is I, J, F, D, S, s, C, T, G, M, N, y,
- * t, [h..r] (for Constant Integer, Long, Float, Double, STR, UTF8, Class,
- * NameType, Fieldref, Methodref, InterfaceMethodref, InvokeDynamic,
- * MethodType and MethodHandle constant pool items respectively).
- *
- * The 9 variable of MethodHandle constants are stored between h and r
- * following this table
- * tag type interface
- * H_GETFIELD 1 h false
- * H_GETSTATIC 2 i false
- * H_PUTFIELD 3 j false
- * H_PUTSTATIC 4 k false
- * H_INVOKEVIRTUAL 5 l false
- * H_INVOKESTATIC 6 m false
- * H_INVOKESPECIAL 7 n false
- * H_NEWINVOKESPECIAL 8 o false
- * H_INVOKEINTERFACE 9 p true
- * H_INVOKESTATIC 6 q true
- * H_INVOKESPECIAL 7 r true
- */
- char type;
-
- /**
- * Value of this item, for an integer item.
- */
- int intVal;
-
- /**
- * Value of this item, for a long item.
- */
- long longVal;
-
- /**
- * Value of this item, for a float item.
- */
- float floatVal;
-
- /**
- * Value of this item, for a double item.
- */
- double doubleVal;
-
- /**
- * First part of the value of this item, for items that do not hold a
- * primitive value.
- */
- String strVal1;
-
- /**
- * Second part of the value of this item, for items that do not hold a
- * primitive value.
- */
- String strVal2;
-
- /**
- * Third part of the value of this item, for items that do not hold a
- * primitive value.
- */
- Object objVal3;
-
- /**
- * InvokeDynamic's constant values.
- */
- Object[] objVals;
-
- /**
- * The hash code value of this constant pool item.
- */
- int hashCode;
-
- Constant() {
- }
-
- Constant(final Constant i) {
- type = i.type;
- intVal = i.intVal;
- longVal = i.longVal;
- floatVal = i.floatVal;
- doubleVal = i.doubleVal;
- strVal1 = i.strVal1;
- strVal2 = i.strVal2;
- objVal3 = i.objVal3;
- objVals = i.objVals;
- hashCode = i.hashCode;
- }
-
- /**
- * Sets this item to an integer item.
- *
- * @param intVal
- * the value of this item.
- */
- void set(final int intVal) {
- this.type = 'I';
- this.intVal = intVal;
- this.hashCode = 0x7FFFFFFF & (type + intVal);
- }
-
- /**
- * Sets this item to a long item.
- *
- * @param longVal
- * the value of this item.
- */
- void set(final long longVal) {
- this.type = 'J';
- this.longVal = longVal;
- this.hashCode = 0x7FFFFFFF & (type + (int) longVal);
- }
-
- /**
- * Sets this item to a float item.
- *
- * @param floatVal
- * the value of this item.
- */
- void set(final float floatVal) {
- this.type = 'F';
- this.floatVal = floatVal;
- this.hashCode = 0x7FFFFFFF & (type + (int) floatVal);
- }
-
- /**
- * Sets this item to a double item.
- *
- * @param doubleVal
- * the value of this item.
- */
- void set(final double doubleVal) {
- this.type = 'D';
- this.doubleVal = doubleVal;
- this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal);
- }
-
- /**
- * Sets this item to an item that do not hold a primitive value.
- *
- * @param type
- * the type of this item.
- * @param strVal1
- * first part of the value of this item.
- * @param strVal2
- * second part of the value of this item.
- * @param strVal3
- * third part of the value of this item.
- */
- void set(final char type, final String strVal1, final String strVal2,
- final String strVal3) {
- this.type = type;
- this.strVal1 = strVal1;
- this.strVal2 = strVal2;
- this.objVal3 = strVal3;
- switch (type) {
- case 's':
- case 'S':
- case 'C':
- case 't':
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
- return;
- case 'T':
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
- * strVal2.hashCode());
- return;
- // case 'G':
- // case 'M':
- // case 'N':
- // case 'h' ... 'r':
- default:
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
- * strVal2.hashCode() * strVal3.hashCode());
- }
- }
-
- /**
- * Set this item to an InvokeDynamic item.
- *
- * @param name
- * invokedynamic's name.
- * @param desc
- * invokedynamic's descriptor.
- * @param bsm
- * bootstrap method.
- * @param bsmArgs
- * bootstrap method constant arguments.
- */
- void set(final String name, final String desc, final Handle bsm,
- final Object[] bsmArgs) {
- this.type = 'y';
- this.strVal1 = name;
- this.strVal2 = desc;
- this.objVal3 = bsm;
- this.objVals = bsmArgs;
-
- int hashCode = 'y' + name.hashCode() * desc.hashCode() * bsm.hashCode();
- for (int i = 0; i < bsmArgs.length; i++) {
- hashCode *= bsmArgs[i].hashCode();
- }
- this.hashCode = 0x7FFFFFFF & hashCode;
- }
-
- void write(final ClassWriter cw) {
- switch (type) {
- case 'I':
- cw.newConst(intVal);
- break;
- case 'J':
- cw.newConst(longVal);
- break;
- case 'F':
- cw.newConst(floatVal);
- break;
- case 'D':
- cw.newConst(doubleVal);
- break;
- case 'S':
- cw.newConst(strVal1);
- break;
- case 's':
- cw.newUTF8(strVal1);
- break;
- case 'C':
- cw.newClass(strVal1);
- break;
- case 'T':
- cw.newNameType(strVal1, strVal2);
- break;
- case 'G':
- cw.newField(strVal1, strVal2, (String) objVal3);
- break;
- case 'M':
- cw.newMethod(strVal1, strVal2, (String) objVal3, false);
- break;
- case 'N':
- cw.newMethod(strVal1, strVal2, (String) objVal3, true);
- break;
- case 'y':
- cw.newInvokeDynamic(strVal1, strVal2, (Handle) objVal3, objVals);
- break;
- case 't':
- cw.newMethodType(strVal1);
- break;
- default: // 'h' ... 'r' : handle
- cw.newHandle(type - 'h' + 1 - ((type >= 'q')? 4: 0), strVal1, strVal2, (String) objVal3, type >= 'p');
- }
- }
-
- @Override
- public boolean equals(final Object o) {
- if (!(o instanceof Constant)) {
- return false;
- }
- Constant c = (Constant) o;
- if (c.type == type) {
- switch (type) {
- case 'I':
- return c.intVal == intVal;
- case 'J':
- return c.longVal == longVal;
- case 'F':
- return Float.compare(c.floatVal, floatVal) == 0;
- case 'D':
- return Double.compare(c.doubleVal, doubleVal) == 0;
- case 's':
- case 'S':
- case 'C':
- case 't':
- return c.strVal1.equals(strVal1);
- case 'T':
- return c.strVal1.equals(strVal1) && c.strVal2.equals(strVal2);
- case 'y':
- return c.strVal1.equals(strVal1) && c.strVal2.equals(strVal2)
- && c.objVal3.equals(objVal3)
- && Arrays.equals(c.objVals, objVals);
- // case 'G':
- // case 'M':
- // case 'N':
- // case 'h' ... 'r':
- default:
- return c.strVal1.equals(strVal1) && c.strVal2.equals(strVal2)
- && c.objVal3.equals(objVal3);
- }
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return hashCode;
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ConstantPool.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ConstantPool.java
deleted file mode 100644
index f835e86..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ConstantPool.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.util.HashMap;
-
-import org.eclipse.persistence.internal.libraries.asm.Handle;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.Type;
-
-/**
- * A constant pool.
- *
- * @author Eric Bruneton
- */
-public class ConstantPool extends HashMap<Constant, Constant> {
-
- private static final long serialVersionUID = 1L;
-
- private final Constant key1 = new Constant();
-
- private final Constant key2 = new Constant();
-
- private final Constant key3 = new Constant();
-
- private final Constant key4 = new Constant();
-
- private final Constant key5 = new Constant();
-
- public Constant newInteger(final int value) {
- key1.set(value);
- Constant result = get(key1);
- if (result == null) {
- result = new Constant(key1);
- put(result);
- }
- return result;
- }
-
- public Constant newFloat(final float value) {
- key1.set(value);
- Constant result = get(key1);
- if (result == null) {
- result = new Constant(key1);
- put(result);
- }
- return result;
- }
-
- public Constant newLong(final long value) {
- key1.set(value);
- Constant result = get(key1);
- if (result == null) {
- result = new Constant(key1);
- put(result);
- }
- return result;
- }
-
- public Constant newDouble(final double value) {
- key1.set(value);
- Constant result = get(key1);
- if (result == null) {
- result = new Constant(key1);
- put(result);
- }
- return result;
- }
-
- public Constant newUTF8(final String value) {
- key1.set('s', value, null, null);
- Constant result = get(key1);
- if (result == null) {
- result = new Constant(key1);
- put(result);
- }
- return result;
- }
-
- private Constant newString(final String value) {
- key2.set('S', value, null, null);
- Constant result = get(key2);
- if (result == null) {
- newUTF8(value);
- result = new Constant(key2);
- put(result);
- }
- return result;
- }
-
- public Constant newClass(final String value) {
- key2.set('C', value, null, null);
- Constant result = get(key2);
- if (result == null) {
- newUTF8(value);
- result = new Constant(key2);
- put(result);
- }
- return result;
- }
-
- public Constant newMethodType(final String methodDescriptor) {
- key2.set('t', methodDescriptor, null, null);
- Constant result = get(key2);
- if (result == null) {
- newUTF8(methodDescriptor);
- result = new Constant(key2);
- put(result);
- }
- return result;
- }
-
- public Constant newHandle(final int tag, final String owner,
- final String name, final String desc, final boolean itf) {
- key4.set((char) ('h' + tag - 1 + (itf && tag != Opcodes.H_INVOKEINTERFACE? 4: 0)), owner, name, desc);
- Constant result = get(key4);
- if (result == null) {
- if (tag <= Opcodes.H_PUTSTATIC) {
- newField(owner, name, desc);
- } else {
- newMethod(owner, name, desc, itf);
- }
- result = new Constant(key4);
- put(result);
- }
- return result;
- }
-
- public Constant newConst(final Object cst) {
- if (cst instanceof Integer) {
- int val = ((Integer) cst).intValue();
- return newInteger(val);
- } else if (cst instanceof Float) {
- float val = ((Float) cst).floatValue();
- return newFloat(val);
- } else if (cst instanceof Long) {
- long val = ((Long) cst).longValue();
- return newLong(val);
- } else if (cst instanceof Double) {
- double val = ((Double) cst).doubleValue();
- return newDouble(val);
- } else if (cst instanceof String) {
- return newString((String) cst);
- } else if (cst instanceof Type) {
- Type t = (Type) cst;
- int s = t.getSort();
- if (s == Type.OBJECT) {
- return newClass(t.getInternalName());
- } else if (s == Type.METHOD) {
- return newMethodType(t.getDescriptor());
- } else { // s == primitive type or array
- return newClass(t.getDescriptor());
- }
- } else if (cst instanceof Handle) {
- Handle h = (Handle) cst;
- return newHandle(h.getTag(), h.getOwner(), h.getName(), h.getDesc(), h.isInterface());
- } else {
- throw new IllegalArgumentException("value " + cst);
- }
- }
-
- public Constant newField(final String owner, final String name,
- final String desc) {
- key3.set('G', owner, name, desc);
- Constant result = get(key3);
- if (result == null) {
- newClass(owner);
- newNameType(name, desc);
- result = new Constant(key3);
- put(result);
- }
- return result;
- }
-
- public Constant newMethod(final String owner, final String name,
- final String desc, final boolean itf) {
- key3.set(itf ? 'N' : 'M', owner, name, desc);
- Constant result = get(key3);
- if (result == null) {
- newClass(owner);
- newNameType(name, desc);
- result = new Constant(key3);
- put(result);
- }
- return result;
- }
-
- public Constant newInvokeDynamic(String name, String desc, Handle bsm,
- Object... bsmArgs) {
- key5.set(name, desc, bsm, bsmArgs);
- Constant result = get(key5);
- if (result == null) {
- newNameType(name, desc);
- newHandle(bsm.getTag(), bsm.getOwner(), bsm.getName(),
- bsm.getDesc(), bsm.isInterface());
- for (int i = 0; i < bsmArgs.length; i++) {
- newConst(bsmArgs[i]);
- }
- result = new Constant(key5);
- put(result);
- }
- return result;
- }
-
- public Constant newNameType(final String name, final String desc) {
- key2.set('T', name, desc, null);
- Constant result = get(key2);
- if (result == null) {
- newUTF8(name);
- newUTF8(desc);
- result = new Constant(key2);
- put(result);
- }
- return result;
- }
-
- private Constant get(final Constant key) {
- return get((Object) key);
- }
-
- private void put(final Constant cst) {
- put(cst, cst);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/FieldConstantsCollector.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/FieldConstantsCollector.java
deleted file mode 100644
index 2a2b867..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/FieldConstantsCollector.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Attribute;
-import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.TypePath;
-
-/**
- * A {@link FieldVisitor} that collects the {@link Constant}s of the fields it
- * visits.
- *
- * @author Eric Bruneton
- */
-public class FieldConstantsCollector extends FieldVisitor {
-
- private final ConstantPool cp;
-
- public FieldConstantsCollector(final FieldVisitor fv, final ConstantPool cp) {
- super(Opcodes.ASM6, fv);
- this.cp = cp;
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleAnnotations");
- }
- return new AnnotationConstantsCollector(fv.visitAnnotation(desc,
- visible), cp);
- }
-
- @Override
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleTypeAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- return new AnnotationConstantsCollector(fv.visitAnnotation(desc,
- visible), cp);
- }
-
- @Override
- public void visitAttribute(final Attribute attr) {
- // can do nothing
- fv.visitAttribute(attr);
- }
-
- @Override
- public void visitEnd() {
- fv.visitEnd();
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/JarOptimizer.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/JarOptimizer.java
deleted file mode 100644
index e08139e..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/JarOptimizer.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.persistence.internal.libraries.asm.ClassReader;
-import org.eclipse.persistence.internal.libraries.asm.ClassVisitor;
-import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
-import org.eclipse.persistence.internal.libraries.asm.MethodVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-
-/**
- * A Jar file optimizer.
- *
- * @author Eric Bruneton
- */
-public class JarOptimizer {
-
- static final Set<String> API = new HashSet<String>();
- static final Map<String, String> HIERARCHY = new HashMap<String, String>();
- static boolean nodebug = false;
-
- public static void main(final String[] args) throws IOException {
- File f = new File(args[0]);
- InputStream is = new GZIPInputStream(new FileInputStream(f));
- BufferedReader lnr = new LineNumberReader(new InputStreamReader(is));
- while (true) {
- String line = lnr.readLine();
- if (line != null) {
- if (line.startsWith("class")) {
- String c = line.substring(6, line.lastIndexOf(' '));
- String sc = line.substring(line.lastIndexOf(' ') + 1);
- HIERARCHY.put(c, sc);
- } else {
- API.add(line);
- }
- } else {
- break;
- }
- }
-
- int argIndex = 1;
- if (args[argIndex].equals("-nodebug")) {
- nodebug = true;
- argIndex++;
- }
-
- optimize(new File(args[argIndex]));
- }
-
- static void optimize(final File f) throws IOException {
- if (nodebug && f.getName().contains("debug")) {
- return;
- }
-
- if (f.isDirectory()) {
- File[] files = f.listFiles();
- for (int i = 0; i < files.length; ++i) {
- optimize(files[i]);
- }
- } else if (f.getName().endsWith(".jar")) {
- File g = new File(f.getParentFile(), f.getName() + ".new");
- ZipFile zf = new ZipFile(f);
- ZipOutputStream out = new ZipOutputStream(new FileOutputStream(g));
- Enumeration<? extends ZipEntry> e = zf.entries();
- byte[] buf = new byte[10000];
- while (e.hasMoreElements()) {
- ZipEntry ze = e.nextElement();
- if (ze.isDirectory()) {
- out.putNextEntry(ze);
- continue;
- }
- out.putNextEntry(ze);
- if (ze.getName().endsWith(".class")) {
- ClassReader cr = new ClassReader(zf.getInputStream(ze));
- // cr.accept(new ClassDump(), 0);
- cr.accept(new ClassVerifier(), 0);
- }
- InputStream is = zf.getInputStream(ze);
- int n;
- do {
- n = is.read(buf, 0, buf.length);
- if (n != -1) {
- out.write(buf, 0, n);
- }
- } while (n != -1);
- out.closeEntry();
- }
- out.close();
- zf.close();
- if (!f.delete()) {
- throw new IOException("Cannot delete file " + f);
- }
- if (!g.renameTo(f)) {
- throw new IOException("Cannot rename file " + g);
- }
- }
- }
-
- static class ClassDump extends ClassVisitor {
-
- String owner;
-
- public ClassDump() {
- super(Opcodes.ASM6);
- }
-
- @Override
- public void visit(final int version, final int access,
- final String name, final String signature,
- final String superName, final String[] interfaces) {
- owner = name;
- if (owner.startsWith("java/")) {
- System.out.println("class " + name + ' ' + superName);
- }
- }
-
- @Override
- public FieldVisitor visitField(final int access, final String name,
- final String desc, final String signature, final Object value) {
- if (owner.startsWith("java/")) {
- System.out.println(owner + ' ' + name);
- }
- return null;
- }
-
- @Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature,
- final String[] exceptions) {
- if (owner.startsWith("java/")) {
- System.out.println(owner + ' ' + name + desc);
- }
- return null;
- }
- }
-
- static class ClassVerifier extends ClassVisitor {
-
- String owner;
-
- String method;
-
- public ClassVerifier() {
- super(Opcodes.ASM6);
- }
-
- @Override
- public void visit(final int version, final int access,
- final String name, final String signature,
- final String superName, final String[] interfaces) {
- owner = name;
- }
-
- @Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature,
- final String[] exceptions) {
- method = name + desc;
- return new MethodVisitor(Opcodes.ASM6) {
- @Override
- public void visitFieldInsn(final int opcode,
- final String owner, final String name, final String desc) {
- check(owner, name);
- }
-
- @Override
- public void visitMethodInsn(final int opcode,
- final String owner, final String name,
- final String desc, final boolean itf) {
- check(owner, name + desc);
- }
- };
- }
-
- void check(String owner, String member) {
- if (owner.startsWith("java/")) {
- String o = owner;
- while (o != null) {
- if (API.contains(o + ' ' + member)) {
- return;
- }
- o = HIERARCHY.get(o);
- }
- System.out.println("WARNING: " + owner + ' ' + member
- + " called in " + this.owner + ' ' + method
- + " is not defined in JDK 1.3 API");
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/MethodConstantsCollector.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/MethodConstantsCollector.java
deleted file mode 100644
index ec47bd2..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/MethodConstantsCollector.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Handle;
-import org.eclipse.persistence.internal.libraries.asm.Label;
-import org.eclipse.persistence.internal.libraries.asm.MethodVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.TypePath;
-
-/**
- * An {@link MethodVisitor} that collects the {@link Constant}s of the methods
- * it visits.
- *
- * @author Eric Bruneton
- */
-public class MethodConstantsCollector extends MethodVisitor {
-
- private final ConstantPool cp;
-
- public MethodConstantsCollector(final MethodVisitor mv,
- final ConstantPool cp) {
- super(Opcodes.ASM6, mv);
- this.cp = cp;
- }
-
- @Override
- public void visitParameter(String name, int access) {
- cp.newUTF8("MethodParameters");
- if (name != null) {
- cp.newUTF8(name);
- }
- mv.visitParameter(name, access);
- }
-
- @Override
- public AnnotationVisitor visitAnnotationDefault() {
- cp.newUTF8("AnnotationDefault");
- return new AnnotationConstantsCollector(mv.visitAnnotationDefault(), cp);
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleAnnotations");
- }
- return new AnnotationConstantsCollector(mv.visitAnnotation(desc,
- visible), cp);
- }
-
- @Override
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleTypeAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- return new AnnotationConstantsCollector(mv.visitAnnotation(desc,
- visible), cp);
- }
-
- @Override
- public AnnotationVisitor visitParameterAnnotation(final int parameter,
- final String desc, final boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleParameterAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleParameterAnnotations");
- }
- return new AnnotationConstantsCollector(mv.visitParameterAnnotation(
- parameter, desc, visible), cp);
- }
-
- @Override
- public void visitTypeInsn(final int opcode, final String type) {
- cp.newClass(type);
- mv.visitTypeInsn(opcode, type);
- }
-
- @Override
- public void visitFieldInsn(final int opcode, final String owner,
- final String name, final String desc) {
- cp.newField(owner, name, desc);
- mv.visitFieldInsn(opcode, owner, name, desc);
- }
-
- @Override
- public void visitMethodInsn(final int opcode, final String owner,
- final String name, final String desc, final boolean itf) {
- cp.newMethod(owner, name, desc, itf);
- mv.visitMethodInsn(opcode, owner, name, desc, itf);
- }
-
- @Override
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
- cp.newInvokeDynamic(name, desc, bsm, bsmArgs);
- mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
- }
-
- @Override
- public void visitLdcInsn(final Object cst) {
- cp.newConst(cst);
- mv.visitLdcInsn(cst);
- }
-
- @Override
- public void visitMultiANewArrayInsn(final String desc, final int dims) {
- cp.newClass(desc);
- mv.visitMultiANewArrayInsn(desc, dims);
- }
-
- @Override
- public AnnotationVisitor visitInsnAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleTypeAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- return new AnnotationConstantsCollector(mv.visitInsnAnnotation(typeRef,
- typePath, desc, visible), cp);
- }
-
- @Override
- public void visitTryCatchBlock(final Label start, final Label end,
- final Label handler, final String type) {
- if (type != null) {
- cp.newClass(type);
- }
- mv.visitTryCatchBlock(start, end, handler, type);
- }
-
- @Override
- public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleTypeAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- return new AnnotationConstantsCollector(mv.visitTryCatchAnnotation(
- typeRef, typePath, desc, visible), cp);
- }
-
- @Override
- public void visitLocalVariable(final String name, final String desc,
- final String signature, final Label start, final Label end,
- final int index) {
- if (signature != null) {
- cp.newUTF8("LocalVariableTypeTable");
- cp.newUTF8(name);
- cp.newUTF8(signature);
- }
- cp.newUTF8("LocalVariableTable");
- cp.newUTF8(name);
- cp.newUTF8(desc);
- mv.visitLocalVariable(name, desc, signature, start, end, index);
- }
-
- @Override
- public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
- TypePath typePath, Label[] start, Label[] end, int[] index,
- String desc, boolean visible) {
- cp.newUTF8(desc);
- if (visible) {
- cp.newUTF8("RuntimeVisibleTypeAnnotations");
- } else {
- cp.newUTF8("RuntimeInvisibleTypeAnnotations");
- }
- return new AnnotationConstantsCollector(
- mv.visitLocalVariableAnnotation(typeRef, typePath, start, end,
- index, desc, visible), cp);
- }
-
- @Override
- public void visitLineNumber(final int line, final Label start) {
- cp.newUTF8("LineNumberTable");
- mv.visitLineNumber(line, start);
- }
-
- @Override
- public void visitMaxs(final int maxStack, final int maxLocals) {
- cp.newUTF8("Code");
- mv.visitMaxs(maxStack, maxLocals);
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/MethodOptimizer.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/MethodOptimizer.java
deleted file mode 100644
index 051ea3d..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/MethodOptimizer.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.util.HashMap;
-
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Attribute;
-import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Label;
-import org.eclipse.persistence.internal.libraries.asm.MethodVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-import org.eclipse.persistence.internal.libraries.asm.Type;
-import org.eclipse.persistence.internal.libraries.asm.TypePath;
-import org.eclipse.persistence.internal.libraries.asm.commons.Remapper;
-import org.eclipse.persistence.internal.libraries.asm.commons.MethodRemapper;
-
-/**
- * A {@link MethodVisitor} that renames fields and methods, and removes debug
- * info.
- *
- * @author Eugene Kuleshov
- */
-public class MethodOptimizer extends MethodRemapper implements Opcodes {
-
- private final ClassOptimizer classOptimizer;
-
- public MethodOptimizer(ClassOptimizer classOptimizer, MethodVisitor mv,
- Remapper remapper) {
- super(Opcodes.ASM6, mv, remapper);
- this.classOptimizer = classOptimizer;
- }
-
- // ------------------------------------------------------------------------
- // Overridden methods
- // ------------------------------------------------------------------------
-
- @Override
- public void visitParameter(String name, int access) {
- // remove parameter info
- }
-
- @Override
- public AnnotationVisitor visitAnnotationDefault() {
- // remove annotations
- return null;
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- // remove annotations
- return null;
- }
-
- @Override
- public AnnotationVisitor visitTypeAnnotation(int typeRef,
- TypePath typePath, String desc, boolean visible) {
- return null;
- }
-
- @Override
- public AnnotationVisitor visitParameterAnnotation(final int parameter,
- final String desc, final boolean visible) {
- // remove annotations
- return null;
- }
-
- @Override
- public void visitLocalVariable(final String name, final String desc,
- final String signature, final Label start, final Label end,
- final int index) {
- // remove debug info
- }
-
- @Override
- public void visitLineNumber(final int line, final Label start) {
- // remove debug info
- }
-
- @Override
- public void visitFrame(int type, int local, Object[] local2, int stack,
- Object[] stack2) {
- // remove frame info
- }
-
- @Override
- public void visitAttribute(Attribute attr) {
- // remove non standard attributes
- }
-
- @Override
- public void visitLdcInsn(Object cst) {
- if (!(cst instanceof Type)) {
- super.visitLdcInsn(cst);
- return;
- }
-
- // transform Foo.class for 1.2 compatibility
- String ldcName = ((Type) cst).getInternalName();
- String fieldName = "class$" + ldcName.replace('/', '$');
- if (!classOptimizer.syntheticClassFields.contains(ldcName)) {
- classOptimizer.syntheticClassFields.add(ldcName);
- FieldVisitor fv = classOptimizer.syntheticFieldVisitor(ACC_STATIC
- | ACC_SYNTHETIC, fieldName, "Ljava/lang/Class;");
- fv.visitEnd();
- }
-
- String clsName = classOptimizer.clsName;
- mv.visitFieldInsn(GETSTATIC, clsName, fieldName, "Ljava/lang/Class;");
- }
-
- @Override
- public void visitMethodInsn(int opcode, String owner, String name,
- String desc, boolean itf) {
- // rewrite boxing method call to use constructor to keep 1.3/1.4
- // compatibility
- String[] constructorParams;
- if (opcode == INVOKESTATIC && name.equals("valueOf")
- && (constructorParams = BOXING_MAP.get(owner + desc)) != null) {
- String type = constructorParams[0];
- String initDesc = constructorParams[1];
- super.visitTypeInsn(NEW, type);
- super.visitInsn(DUP);
- super.visitInsn((initDesc == "(J)V" || initDesc == "(D)V") ? DUP2_X2
- : DUP2_X1);
- super.visitInsn(POP2);
- super.visitMethodInsn(INVOKESPECIAL, type, "<init>", initDesc,
- false);
- return;
- }
- super.visitMethodInsn(opcode, owner, name, desc, itf);
- }
-
- private static final HashMap<String, String[]> BOXING_MAP;
- static {
- String[][] boxingNames = {
- // Boolean.valueOf is 1.4 and is used by the xml package, so no
- // rewrite
- { "java/lang/Byte", "(B)V" }, { "java/lang/Short", "(S)V" },
- { "java/lang/Character", "(C)V" },
- { "java/lang/Integer", "(I)V" }, { "java/lang/Long", "(J)V" },
- { "java/lang/Float", "(F)V" }, { "java/lang/Double", "(D)V" }, };
- HashMap<String, String[]> map = new HashMap<String, String[]>();
- for (String[] boxingName : boxingNames) {
- String wrapper = boxingName[0];
- String desc = boxingName[1];
- String boxingMethod = wrapper + '(' + desc.charAt(1) + ")L"
- + wrapper + ';';
- map.put(boxingMethod, boxingName);
- }
- BOXING_MAP = map;
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ModuleConstantsCollector.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ModuleConstantsCollector.java
deleted file mode 100644
index 7eba191..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/ModuleConstantsCollector.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import org.eclipse.persistence.internal.libraries.asm.ModuleVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Opcodes;
-
-/**
- * A {@link ModuleVisitor} that collects the {@link Constant}s of the
- * module declaration it visits.
- *
- * @author Remi Forax
- */
-public class ModuleConstantsCollector extends ModuleVisitor {
-
- private final ConstantPool cp;
-
- public ModuleConstantsCollector(final ModuleVisitor mv, final ConstantPool cp) {
- super(Opcodes.ASM6, mv);
- this.cp = cp;
- }
-
- @Override
- public void visitRequire(String module, int access) {
- cp.newUTF8(module);
- mv.visitRequire(module, access);
- }
-
- @Override
- public void visitExport(String packaze, String... modules) {
- cp.newUTF8(packaze);
- if (modules != null && modules.length > 0) {
- for(String to: modules) {
- cp.newUTF8(to);
- }
- }
- mv.visitExport(packaze, modules);
- }
-
- @Override
- public void visitUse(String service) {
- cp.newClass(service);
- mv.visitUse(service);
- }
-
- @Override
- public void visitProvide(String service, String impl) {
- cp.newClass(service);
- cp.newClass(impl);
- mv.visitProvide(service, impl);
- }
-
- @Override
- public void visitEnd() {
- mv.visitEnd();
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/NameMapping.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/NameMapping.java
deleted file mode 100644
index c1764bb..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/NameMapping.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-import org.eclipse.persistence.internal.libraries.asm.Type;
-
-/**
- * A MAPPING from names to names, used to rename classes, fields and methods.
- *
- * @author Eric Bruneton
- */
-public class NameMapping {
-
- public final Properties mapping;
-
- public final Set<Object> unused;
-
- public NameMapping(final String file) throws IOException {
- mapping = new Properties();
- InputStream is = null;
- try {
- is = new BufferedInputStream(new FileInputStream(file));
- mapping.load(is);
- unused = new HashSet<Object>(mapping.keySet());
- } finally {
- if (is != null) {
- is.close();
- }
- }
- }
-
- public String map(final String name) {
- String s = (String) mapping.get(name);
- if (s == null) {
- int p = name.indexOf('.');
- if (p == -1) {
- s = name;
- } else {
- int q = name.indexOf('(');
- if (q == -1) {
- s = name.substring(p + 1);
- } else {
- s = name.substring(p + 1, q);
- }
- }
- } else {
- unused.remove(name);
- }
- return s;
- }
-
- public String fix(final String desc) {
- if (desc.startsWith("(")) {
- Type[] arguments = Type.getArgumentTypes(desc);
- Type result = Type.getReturnType(desc);
- for (int i = 0; i < arguments.length; ++i) {
- arguments[i] = fix(arguments[i]);
- }
- result = fix(result);
- return Type.getMethodDescriptor(result, arguments);
- } else {
- return fix(Type.getType(desc)).getDescriptor();
- }
- }
-
- private Type fix(final Type t) {
- if (t.getSort() == Type.OBJECT) {
- return Type.getObjectType(map(t.getInternalName()));
- } else if (t.getSort() == Type.ARRAY) {
- String s = fix(t.getElementType()).getDescriptor();
- for (int i = 0; i < t.getDimensions(); ++i) {
- s = '[' + s;
- }
- return Type.getType(s);
- } else {
- return t;
- }
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/Shrinker.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/Shrinker.java
deleted file mode 100644
index f0701cc..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/Shrinker.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm.optimizer;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.persistence.internal.libraries.asm.ClassReader;
-import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
-import org.eclipse.persistence.internal.libraries.asm.Handle;
-import org.eclipse.persistence.internal.libraries.asm.Type;
-import org.eclipse.persistence.internal.libraries.asm.commons.Remapper;
-import org.eclipse.persistence.internal.libraries.asm.commons.SimpleRemapper;
-
-/**
- * A class file shrinker utility.
- *
- * @author Eric Bruneton
- * @author Eugene Kuleshov
- */
-public class Shrinker {
-
- static final HashMap<String, String> MAPPING = new HashMap<String, String>();
-
- public static void main(final String[] args) throws IOException {
- Properties properties = new Properties();
- int n = args.length - 1;
- for (int i = 0; i < n - 1; ++i) {
- properties.load(new FileInputStream(args[i]));
- }
-
- for (Map.Entry<Object, Object> entry : properties.entrySet()) {
- MAPPING.put((String) entry.getKey(), (String) entry.getValue());
- }
-
- final Set<String> unused = new HashSet<String>(MAPPING.keySet());
-
- File f = new File(args[n - 1]);
- File d = new File(args[n]);
-
- optimize(f, d, new SimpleRemapper(MAPPING) {
- @Override
- public String map(String key) {
- String s = super.map(key);
- if (s != null) {
- unused.remove(key);
- }
- return s;
- }
- });
-
- Iterator<String> i = unused.iterator();
- while (i.hasNext()) {
- String s = i.next();
- if (!s.endsWith("/remove")) {
- System.out.println("INFO: unused mapping " + s);
- }
- }
- }
-
- static void optimize(final File f, final File d, final Remapper remapper)
- throws IOException {
- if (f.isDirectory()) {
- File[] files = f.listFiles();
- for (int i = 0; i < files.length; ++i) {
- optimize(files[i], d, remapper);
- }
- } else if (f.getName().endsWith(".class")) {
- ConstantPool cp = new ConstantPool();
- ClassReader cr = new ClassReader(new FileInputStream(f));
- // auto-boxing removal requires to recompute the maxs
- ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- ClassConstantsCollector ccc = new ClassConstantsCollector(cw, cp);
- ClassOptimizer co = new ClassOptimizer(ccc, remapper);
- cr.accept(co, ClassReader.SKIP_DEBUG);
-
- Set<Constant> constants = new TreeSet<Constant>(
- new ConstantComparator());
- constants.addAll(cp.values());
-
- cr = new ClassReader(cw.toByteArray());
- cw = new ClassWriter(0);
- Iterator<Constant> i = constants.iterator();
- while (i.hasNext()) {
- Constant c = i.next();
- c.write(cw);
- }
- cr.accept(cw, ClassReader.SKIP_DEBUG);
-
- if (MAPPING.get(cr.getClassName() + "/remove") != null) {
- return;
- }
- String n = remapper.mapType(cr.getClassName());
- File g = new File(d, n + ".class");
- if (!g.exists() || g.lastModified() < f.lastModified()) {
- if (!g.getParentFile().exists() && !g.getParentFile().mkdirs()) {
- throw new IOException("Cannot create directory "
- + g.getParentFile());
- }
- OutputStream os = new FileOutputStream(g);
- try {
- os.write(cw.toByteArray());
- } finally {
- os.close();
- }
- }
- }
- }
-
- static class ConstantComparator implements Comparator<Constant> {
-
- public int compare(final Constant c1, final Constant c2) {
- int d = getSort(c1) - getSort(c2);
- if (d == 0) {
- switch (c1.type) {
- case 'I':
- return ((Integer)c1.intVal).compareTo(c2.intVal);
- case 'J':
- return ((Long)c1.longVal).compareTo(c2.longVal);
- case 'F':
- return ((Float)c1.floatVal).compareTo(c2.floatVal);
- case 'D':
- return ((Double)c1.doubleVal).compareTo(c2.doubleVal);
- case 's':
- case 'S':
- case 'C':
- case 't':
- return c1.strVal1.compareTo(c2.strVal1);
- case 'T':
- d = c1.strVal1.compareTo(c2.strVal1);
- if (d == 0) {
- d = c1.strVal2.compareTo(c2.strVal2);
- }
- break;
- case 'y':
- d = c1.strVal1.compareTo(c2.strVal1);
- if (d == 0) {
- d = c1.strVal2.compareTo(c2.strVal2);
- if (d == 0) {
- Handle bsm1 = (Handle) c1.objVal3;
- Handle bsm2 = (Handle) c2.objVal3;
- d = compareHandle(bsm1, bsm2);
- if (d == 0) {
- d = compareObjects(c1.objVals, c2.objVals);
- }
- }
- }
- break;
-
- default:
- d = c1.strVal1.compareTo(c2.strVal1);
- if (d == 0) {
- d = c1.strVal2.compareTo(c2.strVal2);
- if (d == 0) {
- d = ((String) c1.objVal3)
- .compareTo((String) c2.objVal3);
- }
- }
- }
- }
- return d;
- }
-
- private static int compareHandle(Handle h1, Handle h2) {
- int d = h1.getTag() - h2.getTag();
- if (d == 0) {
- d = h1.getOwner().compareTo(h2.getOwner());
- if (d == 0) {
- d = h1.getName().compareTo(h2.getName());
- if (d == 0) {
- d = h1.getDesc().compareTo(h2.getDesc());
- }
- }
- }
- return d;
- }
-
- private static int compareType(Type mtype1, Type mtype2) {
- return mtype1.getDescriptor().compareTo(mtype2.getDescriptor());
- }
-
- @SuppressWarnings("unchecked")
- private static int compareObjects(Object[] objVals1, Object[] objVals2) {
- int length = objVals1.length;
- int d = length - objVals2.length;
- if (d == 0) {
- for (int i = 0; i < length; i++) {
- Object objVal1 = objVals1[i];
- Object objVal2 = objVals2[i];
- d = objVal1.getClass().getName()
- .compareTo(objVal2.getClass().getName());
- if (d == 0) {
- if (objVal1 instanceof Type) {
- d = compareType((Type) objVal1, (Type) objVal2);
- } else if (objVal1 instanceof Handle) {
- d = compareHandle((Handle) objVal1,
- (Handle) objVal2);
- } else {
- d = ((Comparable<Object>) objVal1).compareTo(objVal2);
- }
- }
-
- if (d != 0) {
- return d;
- }
- }
- }
- return 0;
- }
-
- private static int getSort(final Constant c) {
- switch (c.type) {
- case 'I':
- return 0;
- case 'J':
- return 1;
- case 'F':
- return 2;
- case 'D':
- return 3;
- case 's':
- return 4;
- case 'S':
- return 5;
- case 'C':
- return 6;
- case 'T':
- return 7;
- case 'G':
- return 8;
- case 'M':
- return 9;
- case 'N':
- return 10;
- case 'y':
- return 11;
- case 't':
- return 12;
- default:
- return 100 + c.type - 'h';
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-annotations.properties b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-annotations.properties
deleted file mode 100644
index 5e77482..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-annotations.properties
+++ /dev/null
@@ -1,53 +0,0 @@
-###############################################################################
-#ASM: a very small and fast Java bytecode manipulation framework
-#Copyright (c) 2000-2011 INRIA, France Telecom
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#3. Neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-#THE POSSIBILITY OF SUCH DAMAGE.
-###############################################################################
-
-# class mappings
-
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter/remove=true
-
-# field mappings
-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.anns=-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.ianns=-
-
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.anns=-
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.ianns=-
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.annd=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.anns=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.ianns=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.panns=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.ipanns=-
-
-# method mappings
-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readAnnotationValue(I[CLjava/lang/String;Lorg/eclipse/persistence/internal/libraries/asm/AnnotationVisitor;)I=-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readAnnotationValues(I[CZLorg/eclipse/persistence/internal/libraries/asm/AnnotationVisitor;)I=-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readParameterAnnotations(I[CZLorg/eclipse/persistence/internal/libraries/asm/MethodVisitor;)V=-
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-frames.properties b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-frames.properties
deleted file mode 100644
index 990de82..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-frames.properties
+++ /dev/null
@@ -1,62 +0,0 @@
-###############################################################################
-#ASM: a very small and fast Java bytecode manipulation framework
-#Copyright (c) 2000-2011 INRIA, France Telecom
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#3. Neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-#THE POSSIBILITY OF SUCH DAMAGE.
-###############################################################################
-
-# class mappings
-
-org/eclipse/persistence/internal/libraries/asm/Frame/remove=true
-
-# field mappings
-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.typeCount=-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.typeTable=-
-
-org/eclipse/persistence/internal/libraries/asm/Label.frame=-
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.frameCount=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.stackMap=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.previousFrameOffset=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.previousFrame=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.frameIndex=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.frame=-
-
-# method mappings
-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readFrameType([Ljava/lang/Object;II[C[Lorg/eclipse/persistence/internal/libraries/asm/Label;)I=-
-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.addType(Ljava/lang/String;)I=-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.addUninitializedType(Ljava/lang/String;I)I=-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.addType(Lorg/eclipse/persistence/internal/libraries/asm/Item;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.getMergedType(II)I=-
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.startFrame(III)V=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.endFrame()V=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeFrame()V=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeFrameTypes(II)V=-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeFrameType(Ljava/lang/Object;)V=-
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-resize.properties b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-resize.properties
deleted file mode 100644
index 0c65cff..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-resize.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-#ASM: a very small and fast Java bytecode manipulation framework
-#Copyright (c) 2000-2011 INRIA, France Telecom
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#3. Neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-#THE POSSIBILITY OF SUCH DAMAGE.
-###############################################################################
-
-# class mappings
-
-# field mappings
-
-# method mappings
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.resizeInstructions()V=-
\ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-signatures.properties b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-signatures.properties
deleted file mode 100644
index 8f8e166..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-signatures.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-#ASM: a very small and fast Java bytecode manipulation framework
-#Copyright (c) 2000-2011 INRIA, France Telecom
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#3. Neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-#THE POSSIBILITY OF SUCH DAMAGE.
-###############################################################################
-
-# class mappings
-
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader/remove=true
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor/remove=true
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter/remove=true
-
-# field mappings
-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.signature=-
-
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.signature=-
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.signature=-
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-writer.properties b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-writer.properties
deleted file mode 100644
index 40d8a25..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink-writer.properties
+++ /dev/null
@@ -1,67 +0,0 @@
-###############################################################################
-#ASM: a very small and fast Java bytecode manipulation framework
-#Copyright (c) 2000-2011 INRIA, France Telecom
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#3. Neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-#THE POSSIBILITY OF SUCH DAMAGE.
-###############################################################################
-
-# class mappings
-
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter/remove=true
-org/eclipse/persistence/internal/libraries/asm/ByteVector/remove=true
-org/eclipse/persistence/internal/libraries/asm/ClassWriter/remove=true
-org/eclipse/persistence/internal/libraries/asm/Edge/remove=true
-org/eclipse/persistence/internal/libraries/asm/FieldWriter/remove=true
-org/eclipse/persistence/internal/libraries/asm/Frame/remove=true
-org/eclipse/persistence/internal/libraries/asm/Handler/remove=true
-org/eclipse/persistence/internal/libraries/asm/Item/remove=true
-org/eclipse/persistence/internal/libraries/asm/MethodWriter/remove=true
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter/remove=true
-
-# field mappings
-
-org/eclipse/persistence/internal/libraries/asm/Label.position=-
-org/eclipse/persistence/internal/libraries/asm/Label.referenceCount=-
-org/eclipse/persistence/internal/libraries/asm/Label.srcAndRefPositions=-
-org/eclipse/persistence/internal/libraries/asm/Label.inputStackTop=-
-org/eclipse/persistence/internal/libraries/asm/Label.outputStackMax=-
-org/eclipse/persistence/internal/libraries/asm/Label.frame=-
-org/eclipse/persistence/internal/libraries/asm/Label.successor=-
-org/eclipse/persistence/internal/libraries/asm/Label.successors=-
-org/eclipse/persistence/internal/libraries/asm/Label.next=-
-
-# method mappings
-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.copyPool(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;)V=-
-
-org/eclipse/persistence/internal/libraries/asm/Label.addReference(II)V=-
-org/eclipse/persistence/internal/libraries/asm/Label.put(Lorg/eclipse/persistence/internal/libraries/asm/MethodWriter;Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;IZ)V=-
-org/eclipse/persistence/internal/libraries/asm/Label.resolve(Lorg/eclipse/persistence/internal/libraries/asm/MethodWriter;I[B)Z=-
-org/eclipse/persistence/internal/libraries/asm/Label.getFirst()Lorg/eclipse/persistence/internal/libraries/asm/Label;=-
-org/eclipse/persistence/internal/libraries/asm/Label.inSubroutine(J)Z=-
-org/eclipse/persistence/internal/libraries/asm/Label.inSameSubroutine(Lorg/eclipse/persistence/internal/libraries/asm/Label;)Z=-
-org/eclipse/persistence/internal/libraries/asm/Label.addToSubroutine(JI)V=-
-org/eclipse/persistence/internal/libraries/asm/Label.visitSubroutine(Lorg/eclipse/persistence/internal/libraries/asm/Label;JI)V=-
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink.properties b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink.properties
deleted file mode 100644
index 80ee89f..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/optimizer/shrink.properties
+++ /dev/null
@@ -1,398 +0,0 @@
-###############################################################################
-#ASM: a very small and fast Java bytecode manipulation framework
-#Copyright (c) 2000-2011 INRIA, France Telecom
-#All rights reserved.
-#
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#3. Neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-#THE POSSIBILITY OF SUCH DAMAGE.
-###############################################################################
-
-# class mappings
-
-#org/eclipse/persistence/internal/libraries/asm/Edge=org/objectweb/asm/a
-#org/eclipse/persistence/internal/libraries/asm/Item=org/eclipse/persistence/internal/libraries/asm/b
-#org/eclipse/persistence/internal/libraries/asm/FieldWriter=org/eclipse/persistence/internal/libraries/asm/c
-#org/eclipse/persistence/internal/libraries/asm/MethodWriter=org/eclipse/persistence/internal/libraries/asm/d
-#org/eclipse/persistence/internal/libraries/asm/AnnotationWriter=org/eclipse/persistence/internal/libraries/asm/e
-#org/eclipse/persistence/internal/libraries/asm/Context=org/eclipse/persistence/internal/libraries/asm/f
-
-java/lang/StringBuilder=java/lang/StringBuffer
-
-
-# field mappings
-
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.cw=a
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.size=b
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.named=c
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.bv=d
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.parent=e
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.offset=f
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.next=g
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.prev=h
-
-org/eclipse/persistence/internal/libraries/asm/Attribute.next=a
-org/eclipse/persistence/internal/libraries/asm/Attribute.value=b
-
-org/eclipse/persistence/internal/libraries/asm/ByteVector.data=a
-org/eclipse/persistence/internal/libraries/asm/ByteVector.length=b
-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.items=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.strings=c
-org/eclipse/persistence/internal/libraries/asm/ClassReader.maxStringLength=d
-#org/eclipse/persistence/internal/libraries/asm/ClassReader.header=e
-
-org/eclipse/persistence/internal/libraries/asm/Context.attrs=a
-org/eclipse/persistence/internal/libraries/asm/Context.flags=b
-org/eclipse/persistence/internal/libraries/asm/Context.buffer=c
-org/eclipse/persistence/internal/libraries/asm/Context.bootstrapMethods=d
-org/eclipse/persistence/internal/libraries/asm/Context.access=e
-org/eclipse/persistence/internal/libraries/asm/Context.name=f
-org/eclipse/persistence/internal/libraries/asm/Context.desc=g
-org/eclipse/persistence/internal/libraries/asm/Context.labels=h
-org/eclipse/persistence/internal/libraries/asm/Context.typeRef=i
-org/eclipse/persistence/internal/libraries/asm/Context.typePath=j
-org/eclipse/persistence/internal/libraries/asm/Context.offset=k
-org/eclipse/persistence/internal/libraries/asm/Context.start=l
-org/eclipse/persistence/internal/libraries/asm/Context.end=m
-org/eclipse/persistence/internal/libraries/asm/Context.index=n
-org/eclipse/persistence/internal/libraries/asm/Context.offset=o
-org/eclipse/persistence/internal/libraries/asm/Context.mode=p
-org/eclipse/persistence/internal/libraries/asm/Context.localCount=q
-org/eclipse/persistence/internal/libraries/asm/Context.localDiff=r
-org/eclipse/persistence/internal/libraries/asm/Context.local=s
-org/eclipse/persistence/internal/libraries/asm/Context.stackCount=t
-org/eclipse/persistence/internal/libraries/asm/Context.stack=u
-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.TYPE=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.version=b
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.index=c
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.pool=d
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.items=e
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.threshold=f
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.key=g
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.key2=h
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.key3=i
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.key4=j
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.access=k
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.name=l
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.signature=m
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.superName=n
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.interfaceCount=o
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.interfaces=p
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.sourceFile=q
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.sourceDebug=r
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.enclosingMethodOwner=s
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.enclosingMethod=t
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.anns=u
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.ianns=v
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.tanns=N
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.itanns=O
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.attrs=w
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.innerClassesCount=x
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.innerClasses=y
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.bootstrapMethodsCount=z
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.bootstrapMethods=A
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.firstField=B
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.lastField=C
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.firstMethod=D
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.lastMethod=E
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.computeMaxs=F
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.typeCount=G
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.typeTable=H
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.thisName=I
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.computeFrames=J
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.computeMaxs=K
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.invalidFrames=L
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.cr=M
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.moduleWriter=N
-
-org/eclipse/persistence/internal/libraries/asm/Edge.info=a
-org/eclipse/persistence/internal/libraries/asm/Edge.successor=b
-org/eclipse/persistence/internal/libraries/asm/Edge.next=c
-
-org/eclipse/persistence/internal/libraries/asm/Handler.start=a
-org/eclipse/persistence/internal/libraries/asm/Handler.end=b
-org/eclipse/persistence/internal/libraries/asm/Handler.handler=c
-org/eclipse/persistence/internal/libraries/asm/Handler.desc=d
-org/eclipse/persistence/internal/libraries/asm/Handler.type=e
-org/eclipse/persistence/internal/libraries/asm/Handler.next=f
-
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.cw=b
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.access=c
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.name=d
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.desc=e
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.signature=f
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.value=g
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.anns=h
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.ianns=i
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.tanns=k
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.itanns=l
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.attrs=j
-
-org/eclipse/persistence/internal/libraries/asm/Item.index=a
-org/eclipse/persistence/internal/libraries/asm/Item.type=b
-org/eclipse/persistence/internal/libraries/asm/Item.intVal=c
-org/eclipse/persistence/internal/libraries/asm/Item.longVal=d
-org/eclipse/persistence/internal/libraries/asm/Item.strVal1=g
-org/eclipse/persistence/internal/libraries/asm/Item.strVal2=h
-org/eclipse/persistence/internal/libraries/asm/Item.strVal3=i
-org/eclipse/persistence/internal/libraries/asm/Item.hashCode=j
-org/eclipse/persistence/internal/libraries/asm/Item.next=k
-
-org/eclipse/persistence/internal/libraries/asm/Label.status=a
-org/eclipse/persistence/internal/libraries/asm/Label.line=b
-org/eclipse/persistence/internal/libraries/asm/Label.position=c
-org/eclipse/persistence/internal/libraries/asm/Label.referenceCount=d
-org/eclipse/persistence/internal/libraries/asm/Label.srcAndRefPositions=e
-org/eclipse/persistence/internal/libraries/asm/Label.inputStackTop=f
-org/eclipse/persistence/internal/libraries/asm/Label.outputStackMax=g
-org/eclipse/persistence/internal/libraries/asm/Label.frame=h
-org/eclipse/persistence/internal/libraries/asm/Label.successor=i
-org/eclipse/persistence/internal/libraries/asm/Label.successors=j
-org/eclipse/persistence/internal/libraries/asm/Label.next=k
-
-org/eclipse/persistence/internal/libraries/asm/Frame.SIZE=a
-org/eclipse/persistence/internal/libraries/asm/Frame.owner=b
-org/eclipse/persistence/internal/libraries/asm/Frame.inputLocals=c
-org/eclipse/persistence/internal/libraries/asm/Frame.inputStack=d
-org/eclipse/persistence/internal/libraries/asm/Frame.outputLocals=e
-org/eclipse/persistence/internal/libraries/asm/Frame.outputStack=f
-org/eclipse/persistence/internal/libraries/asm/Frame.outputStackTop=g
-org/eclipse/persistence/internal/libraries/asm/Frame.initializationCount=h
-org/eclipse/persistence/internal/libraries/asm/Frame.initializations=i
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.cw=b
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.access=c
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.name=d
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.desc=e
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.descriptor=f
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.signature=g
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.classReaderOffset=h
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.classReaderLength=i
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.exceptionCount=j
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.exceptions=k
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.annd=l
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.anns=m
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.ianns=n
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.tanns=U
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.itanns=V
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.panns=o
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.ipanns=p
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.attrs=q
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.code=r
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.maxStack=s
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.maxLocals=t
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.currentLocals=T
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.frameCount=u
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.stackMap=v
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.previousFrameOffset=w
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.previousFrame=x
-#org/eclipse/persistence/internal/libraries/asm/MethodWriter.frameIndex=y
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.frame=z
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.handlerCount=A
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.firstHandler=B
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.lastHandler=C
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.methodParametersCount=Z
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.methodParameters=$
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.localVarCount=D
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.localVar=E
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.localVarTypeCount=F
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.localVarType=G
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.lineNumberCount=H
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.lineNumber=I
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.lastCodeOffset=Y
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.ctanns=W
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.ictanns=X
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.cattrs=J
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.resize=K
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.subroutines=L
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.compute=M
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.labels=N
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.previousBlock=O
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.currentBlock=P
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.stackSize=Q
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.maxStackSize=R
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.synthetics=S
-
-org/eclipse/persistence/internal/libraries/asm/Type.sort=a
-org/eclipse/persistence/internal/libraries/asm/Type.buf=b
-org/eclipse/persistence/internal/libraries/asm/Type.off=c
-org/eclipse/persistence/internal/libraries/asm/Type.len=d
-
-org/eclipse/persistence/internal/libraries/asm/TypeReference.value=a
-
-org/eclipse/persistence/internal/libraries/asm/TypePath.b=a
-org/eclipse/persistence/internal/libraries/asm/TypePath.offset=b
-
-org/eclipse/persistence/internal/libraries/asm/Handle.tag=a
-org/eclipse/persistence/internal/libraries/asm/Handle.owner=b
-org/eclipse/persistence/internal/libraries/asm/Handle.name=c
-org/eclipse/persistence/internal/libraries/asm/Handle.desc=d
-org/eclipse/persistence/internal/libraries/asm/Handle.itf=e
-
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.cw=a
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.size=b
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.requireCount=c
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.requires=d
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.exportCount=e
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.exports=f
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.useCount=g
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.uses=h
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.provideCount=i
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.provides=j
-
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.signature=a
-
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.buf=a
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.hasFormals=b
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.hasParameters=c
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.argumentStack=d
-
-# method mappings
-
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.getSize()I=a
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.put([Lorg/eclipse/persistence/internal/libraries/asm/AnnotationWriter;ILorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.put(Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.putTarget(ILorg/eclipse/persistence/internal/libraries/asm/TypePath;Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-
-org/eclipse/persistence/internal/libraries/asm/Attribute.getCount()I=a
-org/eclipse/persistence/internal/libraries/asm/Attribute.getSize(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;[BIII)I=a
-org/eclipse/persistence/internal/libraries/asm/Attribute.put(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;[BIIILorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-
-org/eclipse/persistence/internal/libraries/asm/ByteVector.enlarge(I)V=a
-org/eclipse/persistence/internal/libraries/asm/ByteVector.put11(II)Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;=a
-org/eclipse/persistence/internal/libraries/asm/ByteVector.put12(II)Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;=b
-org/eclipse/persistence/internal/libraries/asm/ByteVector.encodeUTF8(Ljava/lang/String;II)Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;=c
-
-org/eclipse/persistence/internal/libraries/asm/ClassReader.copyPool(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;)V=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.copyBootstrapMethods(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;[Lorg/eclipse/persistence/internal/libraries/asm/Item;[C)V=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readField(Lorg/eclipse/persistence/internal/libraries/asm/ClassVisitor;Lorg/eclipse/persistence/internal/libraries/asm/Context;I)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readMethod(Lorg/eclipse/persistence/internal/libraries/asm/ClassVisitor;Lorg/eclipse/persistence/internal/libraries/asm/Context;I)I=b
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readCode(Lorg/eclipse/persistence/internal/libraries/asm/MethodVisitor;Lorg/eclipse/persistence/internal/libraries/asm/Context;I)V=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readTypeAnnotations(Lorg/eclipse/persistence/internal/libraries/asm/MethodVisitor;Lorg/eclipse/persistence/internal/libraries/asm/Context;IZ)[I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readAnnotationTarget(Lorg/eclipse/persistence/internal/libraries/asm/Context;I)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readAnnotationValues(I[CZLorg/eclipse/persistence/internal/libraries/asm/AnnotationVisitor;)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readAnnotationValue(I[CLjava/lang/String;Lorg/eclipse/persistence/internal/libraries/asm/AnnotationVisitor;)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.getAttributes()I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readAttribute([Lorg/eclipse/persistence/internal/libraries/asm/Attribute;Ljava/lang/String;II[CI[Lorg/eclipse/persistence/internal/libraries/asm/Label;)Lorg/eclipse/persistence/internal/libraries/asm/Attribute;=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readClass(Ljava/io/InputStream;Z)[B=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readParameterAnnotations(Lorg/eclipse/persistence/internal/libraries/asm/MethodVisitor;Lorg/eclipse/persistence/internal/libraries/asm/Context;IZ)V=b
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readUTF(II[C)Ljava/lang/String;=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.getImplicitFrame(Lorg/eclipse/persistence/internal/libraries/asm/Context;)V=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readFrame(IZZLorg/eclipse/persistence/internal/libraries/asm/Context;)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readFrameType([Ljava/lang/Object;II[C[Lorg/eclipse/persistence/internal/libraries/asm/Label;)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassReader.readModule(Lorg/eclipse/persistence/internal/libraries/asm/ClassVisitor;Lorg/eclipse/persistence/internal/libraries/asm/Context;I)V=c
-
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.get(Lorg/eclipse/persistence/internal/libraries/asm/Item;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newClassItem(Ljava/lang/String;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newConstItem(Ljava/lang/Object;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newDouble(D)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newFloat(F)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newInteger(I)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newLong(J)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newMethodItem(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newString(Ljava/lang/String;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=b
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.put122(III)V=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.put112(III)V=b
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.put(Lorg/eclipse/persistence/internal/libraries/asm/Item;)V=b
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newFieldItem(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.addType(Ljava/lang/String;)I=c
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.addUninitializedType(Ljava/lang/String;I)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.addType(Lorg/eclipse/persistence/internal/libraries/asm/Item;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=c
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.getMergedType(II)I=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newNameTypeItem(Ljava/lang/String;Ljava/lang/String;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newMethodTypeItem(Ljava/lang/String;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=c
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newHandleItem(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-org/eclipse/persistence/internal/libraries/asm/ClassWriter.newInvokeDynamicItem(Ljava/lang/String;Ljava/lang/String;Lorg/eclipse/persistence/internal/libraries/asm/Handle;[Ljava/lang/Object;)Lorg/eclipse/persistence/internal/libraries/asm/Item;=a
-
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.getSize()I=a
-org/eclipse/persistence/internal/libraries/asm/FieldWriter.put(Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-
-org/eclipse/persistence/internal/libraries/asm/Item.isEqualTo(Lorg/eclipse/persistence/internal/libraries/asm/Item;)Z=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(D)V=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(F)V=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(I)V=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(J)V=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(Ljava/lang/String;Ljava/lang/String;I)V=a
-org/eclipse/persistence/internal/libraries/asm/Item.set(II)V=a
-
-org/eclipse/persistence/internal/libraries/asm/Label.addReference(II)V=a
-org/eclipse/persistence/internal/libraries/asm/Label.put(Lorg/eclipse/persistence/internal/libraries/asm/MethodWriter;Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;IZ)V=a
-org/eclipse/persistence/internal/libraries/asm/Label.resolve(Lorg/eclipse/persistence/internal/libraries/asm/MethodWriter;I[B)Z=a
-org/eclipse/persistence/internal/libraries/asm/Label.getFirst()Lorg/eclipse/persistence/internal/libraries/asm/Label;=a
-org/eclipse/persistence/internal/libraries/asm/Label.inSubroutine(J)Z=a
-org/eclipse/persistence/internal/libraries/asm/Label.inSameSubroutine(Lorg/eclipse/persistence/internal/libraries/asm/Label;)Z=a
-org/eclipse/persistence/internal/libraries/asm/Label.addToSubroutine(JI)V=a
-org/eclipse/persistence/internal/libraries/asm/Label.visitSubroutine(Lorg/eclipse/persistence/internal/libraries/asm/Label;JI)V=b
-
-org/eclipse/persistence/internal/libraries/asm/Frame.get(I)I=a
-org/eclipse/persistence/internal/libraries/asm/Frame.set(II)V=a
-org/eclipse/persistence/internal/libraries/asm/Frame.push(I)V=b
-org/eclipse/persistence/internal/libraries/asm/Frame.push(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;Ljava/lang/String;)V=a
-org/eclipse/persistence/internal/libraries/asm/Frame.type(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;Ljava/lang/String;)I=b
-org/eclipse/persistence/internal/libraries/asm/Frame.pop()I=a
-org/eclipse/persistence/internal/libraries/asm/Frame.pop(Ljava/lang/String;)V=a
-org/eclipse/persistence/internal/libraries/asm/Frame.pop(I)V=c
-org/eclipse/persistence/internal/libraries/asm/Frame.init(I)V=d
-org/eclipse/persistence/internal/libraries/asm/Frame.init(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;I)I=a
-org/eclipse/persistence/internal/libraries/asm/Frame.initInputFrame(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;I[Lorg/eclipse/persistence/internal/libraries/asm/Type;I)V=a
-org/eclipse/persistence/internal/libraries/asm/Frame.execute(IILorg/eclipse/persistence/internal/libraries/asm/ClassWriter;Lorg/eclipse/persistence/internal/libraries/asm/Item;)V=a
-org/eclipse/persistence/internal/libraries/asm/Frame.merge(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;Lorg/eclipse/persistence/internal/libraries/asm/Frame;I)Z=a
-org/eclipse/persistence/internal/libraries/asm/Frame.merge(Lorg/eclipse/persistence/internal/libraries/asm/ClassWriter;I[II)Z=a
-
-org/eclipse/persistence/internal/libraries/asm/Handler.remove(Lorg/eclipse/persistence/internal/libraries/asm/Handler;Lorg/eclipse/persistence/internal/libraries/asm/Label;Lorg/eclipse/persistence/internal/libraries/asm/Label;)Lorg/eclipse/persistence/internal/libraries/asm/Handler;=a
-
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.visitSwitchInsn(Lorg/eclipse/persistence/internal/libraries/asm/Label;[Lorg/eclipse/persistence/internal/libraries/asm/Label;)V=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.addSuccessor(ILorg/eclipse/persistence/internal/libraries/asm/Label;)V=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.getNewOffset([I[III)I=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.getSize()I=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.put(Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.readInt([BI)I=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.readShort([BI)S=b
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.readUnsignedShort([BI)I=c
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeShort([BII)V=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.visitFrame(Lorg/eclipse/persistence/internal/libraries/asm/Frame;)V=b
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.visitImplicitFirstFrame()V=f
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.startFrame(III)I=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.endFrame()V=b
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeFrame()V=c
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.resizeInstructions()V=d
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.noSuccessor()V=e
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeFrameTypes(II)V=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.writeFrameType(Ljava/lang/Object;)V=a
-org/eclipse/persistence/internal/libraries/asm/MethodWriter.getNewOffset([I[ILorg/eclipse/persistence/internal/libraries/asm/Label;)V=a
-
-org/eclipse/persistence/internal/libraries/asm/Type.getType([CI)Lorg/eclipse/persistence/internal/libraries/asm/Type;=a
-org/eclipse/persistence/internal/libraries/asm/Type.getDescriptor(Ljava/lang/StringBuilder;)V=a
-org/eclipse/persistence/internal/libraries/asm/Type.getDescriptor(Ljava/lang/StringBuilder;Ljava/lang/Class;)V=a
-
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.getSize()I=a
-org/eclipse/persistence/internal/libraries/asm/ModuleWriter.put(Lorg/eclipse/persistence/internal/libraries/asm/ByteVector;)V=a
-
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.parseType(Ljava/lang/String;ILorg/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor;)I=a
-
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.endFormals()V=a
-org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.endArguments()V=b
-
\ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/package.html
deleted file mode 100644
index 2d4a765..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/package.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides a small and fast bytecode manipulation framework.
-
-<p>
-The <a href="http://www.objectweb.org/asm">ASM</a> framework is organized
-around the {@link org.objectweb.asm.ClassVisitor ClassVisitor},
-{@link org.objectweb.asm.FieldVisitor FieldVisitor},
-{@link org.objectweb.asm.MethodVisitor MethodVisitor} and
-{@link org.objectweb.asm.AnnotationVisitor AnnotationVisitor} abstract classes,
-which allow one to visit the fields, methods and annotations of a class,
-including the bytecode instructions of each method.
-
-<p>
-In addition to these main abstract classes, ASM provides a {@link
-org.objectweb.asm.ClassReader ClassReader} class, that can parse an
-existing class and make a given visitor visit it. ASM also provides
-a {@link org.objectweb.asm.ClassWriter ClassWriter} class, which is
-a visitor that generates Java class files.
-
-<p>
-In order to generate a class from scratch, only the {@link
-org.objectweb.asm.ClassWriter ClassWriter} class is necessary. Indeed,
-in order to generate a class, one must just call its visit<i>Xxx</i>
-methods with the appropriate arguments to generate the desired fields
-and methods. See the "helloworld" example in the ASM distribution for
-more details about class generation.
-
-<p>
-In order to modify existing classes, one must use a {@link
-org.objectweb.asm.ClassReader ClassReader} class to analyze
-the original class, a class modifier, and a {@link org.objectweb.asm.ClassWriter
-ClassWriter} to construct the modified class. The class modifier
-is just a {@link org.objectweb.asm.ClassVisitor ClassVisitor}
-that delegates most of the work to another {@link org.objectweb.asm.ClassVisitor
-ClassVisitor}, but that sometimes changes some parameter values,
-or call additional methods, in order to implement the desired
-modification process. In order to make it easier to implement such
-class modifiers, the {@link org.objectweb.asm.ClassVisitor
-ClassVisitor} and {@link org.objectweb.asm.MethodVisitor MethodVisitor}
-classes delegate by default all the method calls they receive to an
-optional visitor. See the "adapt" example in the ASM
-distribution for more details about class modification.
-
-<p>
-The size of the core ASM library, <tt>asm.jar</tt>, is only 45KB, which is much
-smaller than the size of the
-<a href="http://jakarta.apache.org/bcel">BCEL</a> library (504KB), and than the
-size of the
-<a href="http://serp.sourceforge.net">SERP</a> library (150KB). ASM is also
-much faster than these tools. Indeed the overhead of a load time class
-transformation process is of the order of 60% with ASM, 700% or more with BCEL,
-and 1100% or more with SERP (see the <tt>test/perf</tt> directory in the ASM
-distribution)!
-
-@since ASM 1.3
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/package.html
deleted file mode 100644
index 0c07d12..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides support for type signatures.
-
-@since ASM 2.0
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.java
index 38d9c4a..d55a3cc 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.java
@@ -36,7 +36,7 @@
import org.eclipse.persistence.internal.libraries.asm.Opcodes;
/**
- * A node that represents an annotationn.
+ * A node that represents an annotation.
*
* @author Eric Bruneton
*/
@@ -52,8 +52,8 @@ public class AnnotationNode extends AnnotationVisitor {
* as two consecutive elements in the list. The name is a {@link String},
* and the value may be a {@link Byte}, {@link Boolean}, {@link Character},
* {@link Short}, {@link Integer}, {@link Long}, {@link Float},
- * {@link Double}, {@link String} or {@link org.eclipse.persistence.internal.libraries.asm.Type}, or an
- * two elements String array (for enumeration values), a
+ * {@link Double}, {@link String} or {@link org.eclipse.persistence.internal.libraries.asm.Type}, or a
+ * two elements String array (for enumeration values), an
* {@link AnnotationNode}, or a {@link List} of values of one of the
* preceding types. The list may be <tt>null</tt> if there is no name value
* pair.
@@ -114,7 +114,65 @@ public void visit(final String name, final Object value) {
if (this.desc != null) {
values.add(name);
}
- values.add(value);
+ if (value instanceof byte[]) {
+ byte[] v = (byte[]) value;
+ ArrayList<Byte> l = new ArrayList<Byte>(v.length);
+ for (byte b : v) {
+ l.add(b);
+ }
+ values.add(l);
+ } else if (value instanceof boolean[]) {
+ boolean[] v = (boolean[]) value;
+ ArrayList<Boolean> l = new ArrayList<Boolean>(v.length);
+ for (boolean b : v) {
+ l.add(b);
+ }
+ values.add(l);
+ } else if (value instanceof short[]) {
+ short[] v = (short[]) value;
+ ArrayList<Short> l = new ArrayList<Short>(v.length);
+ for (short s : v) {
+ l.add(s);
+ }
+ values.add(l);
+ } else if (value instanceof char[]) {
+ char[] v = (char[]) value;
+ ArrayList<Character> l = new ArrayList<Character>(v.length);
+ for (char c : v) {
+ l.add(c);
+ }
+ values.add(l);
+ } else if (value instanceof int[]) {
+ int[] v = (int[]) value;
+ ArrayList<Integer> l = new ArrayList<Integer>(v.length);
+ for (int i : v) {
+ l.add(i);
+ }
+ values.add(l);
+ } else if (value instanceof long[]) {
+ long[] v = (long[]) value;
+ ArrayList<Long> l = new ArrayList<Long>(v.length);
+ for (long lng : v) {
+ l.add(lng);
+ }
+ values.add(l);
+ } else if (value instanceof float[]) {
+ float[] v = (float[]) value;
+ ArrayList<Float> l = new ArrayList<Float>(v.length);
+ for (float f : v) {
+ l.add(f);
+ }
+ values.add(l);
+ } else if (value instanceof double[]) {
+ double[] v = (double[]) value;
+ ArrayList<Double> l = new ArrayList<Double>(v.length);
+ for (double d : v) {
+ l.add(d);
+ }
+ values.add(l);
+ } else {
+ values.add(value);
+ }
}
@Override
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.java
index bc22f94..fe7d037 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.java
@@ -244,8 +244,9 @@ public void visitSource(final String file, final String debug) {
}
@Override
- public ModuleVisitor visitModule() {
- return module = new ModuleNode();
+ public ModuleVisitor visitModule(final String name, final int access,
+ final String version) {
+ return module = new ModuleNode(name, access, version);
}
@Override
@@ -344,7 +345,12 @@ public void visitEnd() {
* {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
*/
public void check(final int api) {
- if (api == Opcodes.ASM4) {
+ if (api < Opcodes.ASM6) {
+ if (module != null) {
+ throw new RuntimeException();
+ }
+ }
+ if (api < Opcodes.ASM5) {
if (visibleTypeAnnotations != null
&& visibleTypeAnnotations.size() > 0) {
throw new RuntimeException();
@@ -353,12 +359,31 @@ public void check(final int api) {
&& invisibleTypeAnnotations.size() > 0) {
throw new RuntimeException();
}
- for (FieldNode f : fields) {
- f.check(api);
- }
- for (MethodNode m : methods) {
- m.check(api);
- }
+ }
+ // checks attributes
+ int i, n;
+ n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ visibleAnnotations.get(i).check(api);
+ }
+ n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ invisibleAnnotations.get(i).check(api);
+ }
+ n = visibleTypeAnnotations == null ? 0 : visibleTypeAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ visibleTypeAnnotations.get(i).check(api);
+ }
+ n = invisibleTypeAnnotations == null ? 0 : invisibleTypeAnnotations
+ .size();
+ for (i = 0; i < n; ++i) {
+ invisibleTypeAnnotations.get(i).check(api);
+ }
+ for (FieldNode f : fields) {
+ f.check(api);
+ }
+ for (MethodNode m : methods) {
+ m.check(api);
}
}
@@ -377,6 +402,10 @@ public void accept(final ClassVisitor cv) {
if (sourceFile != null || sourceDebug != null) {
cv.visitSource(sourceFile, sourceDebug);
}
+ // visits module
+ if (module != null) {
+ module.accept(cv);
+ }
// visits outer class
if (outerClass != null) {
cv.visitOuterClass(outerClass, outerMethod, outerMethodDesc);
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableAnnotationNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableAnnotationNode.java
index c25c20a..5b0036b 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableAnnotationNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableAnnotationNode.java
@@ -152,6 +152,6 @@ public void accept(final MethodVisitor mv, boolean visible) {
index[i] = this.index.get(i);
}
accept(mv.visitLocalVariableAnnotation(typeRef, typePath, start, end,
- index, desc, true));
+ index, desc, visible));
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleExportNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleExportNode.java
index 9fbdce0..8ce0c6d 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleExportNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleExportNode.java
@@ -43,6 +43,12 @@ public class ModuleExportNode {
* The package name.
*/
public String packaze;
+
+ /**
+ * The access flags (see {@link org.eclipse.persistence.internal.libraries.asm.Opcodes}).
+ * Valid values are {@code ACC_SYNTHETIC} and {@code ACC_MANDATED}.
+ */
+ public int access;
/**
* A list of modules that can access to this exported package.
@@ -58,8 +64,9 @@ public class ModuleExportNode {
* @param modules
* a list of modules that can access to this exported package.
*/
- public ModuleExportNode(final String packaze, final List<String> modules) {
+ public ModuleExportNode(final String packaze, final int access, final List<String> modules) {
this.packaze = packaze;
+ this.access = access;
this.modules = modules;
}
@@ -70,6 +77,6 @@ public ModuleExportNode(final String packaze, final List<String> modules) {
* a module visitor.
*/
public void accept(final ModuleVisitor mv) {
- mv.visitExport(packaze, (modules == null)? null: modules.toArray(new String[0]));
+ mv.visitExport(packaze, access, (modules == null) ? null : modules.toArray(new String[0]));
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleNode.java
index 99e81c7..cfac6ba 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleNode.java
@@ -43,6 +43,35 @@
*/
public class ModuleNode extends ModuleVisitor {
/**
+ * Module name
+ */
+ public String name;
+
+ /**
+ * Module access flags, among {@code ACC_OPEN}, {@code ACC_SYNTHETIC}
+ * and {@code ACC_MANDATED}.
+ */
+ public int access;
+
+ /**
+ * Version of the module.
+ * May be <tt>null</tt>.
+ */
+ public String version;
+
+ /**
+ * Name of the main class in internal form
+ * May be <tt>null</tt>.
+ */
+ public String mainClass;
+
+ /**
+ * A list of packages that are declared by the current module.
+ * May be <tt>null</tt>.
+ */
+ public List<String> packages;
+
+ /**
* A list of modules can are required by the current module.
* May be <tt>null</tt>.
*/
@@ -55,6 +84,12 @@ public class ModuleNode extends ModuleVisitor {
public List<ModuleExportNode> exports;
/**
+ * A list of packages that are opened by the current module.
+ * May be <tt>null</tt>.
+ */
+ public List<ModuleOpenNode> opens;
+
+ /**
* A list of classes in their internal forms that are used
* as a service by the current module. May be <tt>null</tt>.
*/
@@ -66,18 +101,30 @@ public class ModuleNode extends ModuleVisitor {
*/
public List<ModuleProvideNode> provides;
- public ModuleNode() {
+ public ModuleNode(final String name, final int access,
+ final String version) {
super(Opcodes.ASM6);
+ this.name = name;
+ this.access = access;
+ this.version = version;
}
public ModuleNode(final int api,
- List<ModuleRequireNode> requires,
- List<ModuleExportNode> exports,
- List<String> uses,
- List<ModuleProvideNode> provides) {
- super(Opcodes.ASM6);
+ final String name,
+ final int access,
+ final String version,
+ final List<ModuleRequireNode> requires,
+ final List<ModuleExportNode> exports,
+ final List<ModuleOpenNode> opens,
+ final List<String> uses,
+ final List<ModuleProvideNode> provides) {
+ super(api);
+ this.name = name;
+ this.access = access;
+ this.version = version;
this.requires = requires;
this.exports = exports;
+ this.opens = opens;
this.uses = uses;
this.provides = provides;
if (getClass() != ModuleNode.class) {
@@ -86,26 +133,54 @@ public ModuleNode(final int api,
}
@Override
- public void visitRequire(String module, int access) {
- if (requires == null) {
- requires = new ArrayList<ModuleRequireNode>(5);
- }
- requires.add(new ModuleRequireNode(module, access));
+ public void visitMainClass(String mainClass) {
+ this.mainClass = mainClass;
}
@Override
- public void visitExport(String packaze, String... modules) {
+ public void visitPackage(String packaze) {
+ if (packages == null) {
+ packages = new ArrayList<String>(5);
+ }
+ packages.add(packaze);
+ }
+
+ @Override
+ public void visitRequire(String module, int access, String version) {
+ if (requires == null) {
+ requires = new ArrayList<ModuleRequireNode>(5);
+ }
+ requires.add(new ModuleRequireNode(module, access, version));
+ }
+
+ @Override
+ public void visitExport(String packaze, int access, String... modules) {
if (exports == null) {
exports = new ArrayList<ModuleExportNode>(5);
}
List<String> moduleList = null;
if (modules != null) {
moduleList = new ArrayList<String>(modules.length);
- for(int i = 0; i < modules.length; i++) {
+ for (int i = 0; i < modules.length; i++) {
moduleList.add(modules[i]);
}
}
- exports.add(new ModuleExportNode(packaze, moduleList));
+ exports.add(new ModuleExportNode(packaze, access, moduleList));
+ }
+
+ @Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ if (opens == null) {
+ opens = new ArrayList<ModuleOpenNode>(5);
+ }
+ List<String> moduleList = null;
+ if (modules != null) {
+ moduleList = new ArrayList<String>(modules.length);
+ for (int i = 0; i < modules.length; i++) {
+ moduleList.add(modules[i]);
+ }
+ }
+ opens.add(new ModuleOpenNode(packaze, access, moduleList));
}
@Override
@@ -117,11 +192,16 @@ public void visitUse(String service) {
}
@Override
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
if (provides == null) {
provides = new ArrayList<ModuleProvideNode>(5);
}
- provides.add(new ModuleProvideNode(service, impl));
+ ArrayList<String> providerList =
+ new ArrayList<String>(providers.length);
+ for (int i = 0; i < providers.length; i++) {
+ providerList.add(providers[i]);
+ }
+ provides.add(new ModuleProvideNode(service, providerList));
}
@Override
@@ -129,27 +209,41 @@ public void visitEnd() {
}
public void accept(final ClassVisitor cv) {
- ModuleVisitor mv = cv.visitModule();
+ ModuleVisitor mv = cv.visitModule(name, access, version);
if (mv == null) {
return;
}
+ if (mainClass != null) {
+ mv.visitMainClass(mainClass);
+ }
+ if (packages != null) {
+ for (int i = 0; i < packages.size(); i++) {
+ mv.visitPackage(packages.get(i));
+ }
+ }
+
if (requires != null) {
- for(int i = 0; i < requires.size(); i++) {
+ for (int i = 0; i < requires.size(); i++) {
requires.get(i).accept(mv);
}
}
if (exports != null) {
- for(int i = 0; i < exports.size(); i++) {
+ for (int i = 0; i < exports.size(); i++) {
exports.get(i).accept(mv);
}
}
+ if (opens != null) {
+ for (int i = 0; i < opens.size(); i++) {
+ opens.get(i).accept(mv);
+ }
+ }
if (uses != null) {
- for(int i = 0; i < uses.size(); i++) {
+ for (int i = 0; i < uses.size(); i++) {
mv.visitUse(uses.get(i));
}
}
if (provides != null) {
- for(int i = 0; i < provides.size(); i++) {
+ for (int i = 0; i < provides.size(); i++) {
provides.get(i).accept(mv);
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleOpenNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleOpenNode.java
new file mode 100644
index 0000000..9bae1fb
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleOpenNode.java
@@ -0,0 +1,82 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.eclipse.persistence.internal.libraries.asm.tree;
+
+import java.util.List;
+
+import org.eclipse.persistence.internal.libraries.asm.ModuleVisitor;
+
+/**
+ * A node that represents an opened package with its name and the module that can access to it.
+ *
+ * @author Remi Forax
+ */
+public class ModuleOpenNode {
+ /**
+ * The package name.
+ */
+ public String packaze;
+
+ /**
+ * The access flags (see {@link org.eclipse.persistence.internal.libraries.asm.Opcodes}).
+ * Valid values are {@code ACC_SYNTHETIC} and {@code ACC_MANDATED}.
+ */
+ public int access;
+
+ /**
+ * A list of modules that can access to this exported package.
+ * May be <tt>null</tt>.
+ */
+ public List<String> modules;
+
+ /**
+ * Constructs a new {@link ModuleOpenNode}.
+ *
+ * @param packaze
+ * the parameter's name.
+ * @param modules
+ * a list of modules that can access to this open package.
+ */
+ public ModuleOpenNode(final String packaze, final int access, final List<String> modules) {
+ this.packaze = packaze;
+ this.access = access;
+ this.modules = modules;
+ }
+
+ /**
+ * Makes the given module visitor visit this open declaration.
+ *
+ * @param mv
+ * a module visitor.
+ */
+ public void accept(final ModuleVisitor mv) {
+ mv.visitExport(packaze, access, (modules == null) ? null : modules.toArray(new String[0]));
+ }
+}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleProvideNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleProvideNode.java
index 9743699..2fca62f 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleProvideNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleProvideNode.java
@@ -29,6 +29,8 @@
*/
package org.eclipse.persistence.internal.libraries.asm.tree;
+import java.util.List;
+
import org.eclipse.persistence.internal.libraries.asm.ModuleVisitor;
/**
@@ -43,21 +45,21 @@ public class ModuleProvideNode {
public String service;
/**
- * The implementation name (in its internal form).
+ * The service provider names (in their internal form).
*/
- public String impl;
+ public List<String> providers;
/**
* Constructs a new {@link ModuleProvideNode}.
*
* @param service
* the service name (in its internal form).
- * @param impl
- * the implementation name (in its internal form).
+ * @param providers
+ * the service provider names (in their internal form).
*/
- public ModuleProvideNode(final String service, final String impl) {
+ public ModuleProvideNode(final String service, final List<String> providers) {
this.service = service;
- this.impl = impl;
+ this.providers = providers;
}
/**
@@ -67,6 +69,6 @@ public ModuleProvideNode(final String service, final String impl) {
* a module visitor.
*/
public void accept(final ModuleVisitor mv) {
- mv.visitProvide(service, impl);
+ mv.visitProvide(service, providers.toArray(new String[0]));
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleRequireNode.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleRequireNode.java
index e4c98b8..7e6895c 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleRequireNode.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ModuleRequireNode.java
@@ -44,10 +44,15 @@ public class ModuleRequireNode {
/**
* The access flags (see {@link org.eclipse.persistence.internal.libraries.asm.Opcodes}).
- * Valid values are <tt>ACC_PUBLIC</tt>, <tt>ACC_SYNTHETIC</tt> and
- * <tt>ACC_MANDATED</tt>.
+ * Valid values are <tt>ACC_TRANSITIVE</tt>, <tt>ACC_STATIC_PHASE</tt>,
+ * <tt>ACC_SYNTHETIC</tt> and <tt>ACC_MANDATED</tt>.
*/
public int access;
+
+ /**
+ * Version at compile time of the required module or null.
+ */
+ public String version;
/**
* Constructs a new {@link ModuleRequireNode}.
@@ -56,21 +61,27 @@ public class ModuleRequireNode {
* the name of the required module.
* @param access
* The access flags. Valid values are
- * <tt>ACC_PUBLIC</tt>, <tt>ACC_SYNTHETIC</tt> or/and
- * <tt>ACC_MANDATED</tt> (see {@link org.eclipse.persistence.internal.libraries.asm.Opcodes}).
+ * <tt>ACC_TRANSITIVE</tt>, <tt>ACC_STATIC_PHASE</tt>,
+ * <tt>ACC_SYNTHETIC</tt> and <tt>ACC_MANDATED</tt>
+ * (see {@link org.eclipse.persistence.internal.libraries.asm.Opcodes}).
+ * @param version
+ * Version of the required module at compile time,
+ * null if not defined.
*/
- public ModuleRequireNode(final String module, final int access) {
+ public ModuleRequireNode(final String module, final int access,
+ final String version) {
this.module = module;
this.access = access;
+ this.version = version;
}
/**
- * Makes the given module visitor visit this require declaration.
+ * Makes the given module visitor visit this require directive.
*
* @param mv
* a module visitor.
*/
public void accept(final ModuleVisitor mv) {
- mv.visitRequire(module, access);
+ mv.visitRequire(module, access, version);
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/package.html
deleted file mode 100644
index 228da02..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/package.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-
-<p>
-Provides a framework for static code analysis based on the asm.tree package.
-</p>
-
-<p>
-Basic usage:
-</p>
-
-<pre>
-ClassReader cr = new ClassReader(bytecode);
-ClassNode cn = new ClassNode();
-cr.accept(cn, ClassReader.SKIP_DEBUG);
-
-List methods = cn.methods;
-for (int i = 0; i < methods.size(); ++i) {
- MethodNode method = (MethodNode) methods.get(i);
- if (method.instructions.size() > 0) {
- Analyzer a = new Analyzer(new BasicInterpreter());
- a.analyze(cn.name, method);
- Frame[] frames = a.getFrames();
- // Elements of the frames arrray now contains info for each instruction
- // from the analyzed method. BasicInterpreter creates BasicValue, that
- // is using simplified type system that distinguishes the UNINITIALZED,
- // INT, FLOAT, LONG, DOUBLE, REFERENCE and RETURNADDRESS types.
- ...
- }
-}
-</pre>
-
-<p>
-@since ASM 1.4.3
-</p>
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/package.html
deleted file mode 100644
index 940b876..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/package.html
+++ /dev/null
@@ -1,192 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-
-<p>
-Provides an ASM visitor that constructs a tree representation of the
-classes it visits. This class adapter can be useful to implement "complex"
-class manipulation operations, i.e., operations that would be very hard to
-implement without using a tree representation (such as optimizing the number
-of local variables used by a method).
-</p>
-
-<p>
-However, this class adapter has a cost: it makes ASM bigger and slower. Indeed
-it requires more than twenty new classes, and multiplies the time needed to
-transform a class by almost two (it is almost two times faster to read, "modify"
-and write a class with a ClassVisitor than with a ClassNode). This is why
-this package is bundled in an optional <tt>asm-tree.jar</tt> library that
-is separated from (but requires) the <tt>asm.jar</tt> library, which contains
-the core ASM framework. This is also why <i><font color="red">it is recommended
-not to use this class adapter when it is possible</font></i>.
-</p>
-
-<p>
-The root class is the ClassNode, that can be created from existing bytecode. For example:
-</p>
-
-<pre>
- ClassReader cr = new ClassReader(source);
- ClassNode cn = new ClassNode();
- cr.accept(cn, true);
-</pre>
-
-<p>
-Now the content of ClassNode can be modified and then
-serialized back into bytecode:
-</p>
-
-<pre>
- ClassWriter cw = new ClassWriter(true);
- cn.accept(cw);
-</pre>
-
-<p>
-Using a simple ClassVisitor it is possible to create MethodNode instances per-method.
-In this example MethodNode is acting as a buffer that is flushed out at visitEnd() call:
-</p>
-
-<pre>
- ClassReader cr = new ClassReader(source);
- ClassWriter cw = new ClassWriter();
- ClassVisitor cv = new ClassVisitor(cw) {
- public MethodVisitor visitMethod(int access, String name,
- String desc, String signature, String[] exceptions) {
- final MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
- MethodNode mn = new MethodNode(access, name, desc, signature, exceptions) {
- public void visitEnd() {
- // transform or analyze method code using tree API
- accept(mv);
- }
- };
- }
- };
- cr.accept(cv, true);
-</pre>
-
-<p>
-Several strategies can be used to construct method code from scratch. The first
-option is to create a MethodNode, and then create XxxInsnNode instances and
-add them to the instructions list:
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.instructions.add(new VarInsnNode(ALOAD, 0));
-...
-</pre>
-
-<p>
-Alternatively, you can use the fact that MethodNode is a MethodVisitor, and use
-that to create the XxxInsnNode and add them to the instructions list through
-the standard MethodVisitor methods:
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.visitVarInsn(ALOAD, 0);
-...
-</pre>
-
-<p>
-If you cannot generate all the instructions in sequential order, i.e. if you
-need to save some pointer in the instruction list and then insert instructions
-at that place after other instructions have been generated, you can use InsnList
-methods insert() and insertBefore() to insert instructions at a saved pointer.
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.visitVarInsn(ALOAD, 0);
-AbstractInsnNode ptr = m.instructions.getLast();
-m.visitVarInsn(ALOAD, 1);
-// inserts an instruction between ALOAD 0 and ALOAD 1
-m.instructions.insert(ptr, new VarInsnNode(ALOAD, 0));
-...
-</pre>
-
-<p>
-If you need to insert instructions while iterating over an existing instruction
-list, you can also use several strategies. The first one is to use a
-ListIterator over the instruction list:
-</p>
-
-<pre>
-ListIterator it = m.instructions.iterator();
-while (it.hasNext()) {
- AbstractInsnNode n = (AbstractInsnNode) it.next();
- if (...) {
- it.add(new VarInsnNode(ALOAD, 0));
- }
-}
-</pre>
-
-<p>
-It is also possible to convert an instruction list into an array and iterate trough
-array elements:
-</p>
-
-<pre>
-AbstractInsnNode[] insns = m.instructions.toArray();
-for(int i = 0; i<insns.length; i++) {
- AbstractInsnNode n = insns[i];
- if (...) {
- m.instructions.insert(n, new VarInsnNode(ALOAD, 0));
- }
-}
-</pre>
-
-<p>
-If you want to insert these instructions through the MethodVisitor methods,
-you can use another instance of MethodNode as a MethodVisitor and then
-insert instructions collected by that instance into the instruction list.
-For example:
-</p>
-
-<pre>
-AbstractInsnNode[] insns = m.instructions.toArray();
-for(int i = 0; i<insns.length; i++) {
- AbstractInsnNode n = insns[i];
- if (...) {
- MethodNode mn = new MethodNode();
- mn.visitVarInsn(ALOAD, 0);
- mn.visitVarInsn(ALOAD, 1);
- m.instructions.insert(n, mn.instructions);
- }
-}
-</pre>
-
-<p>
-@since ASM 1.3.3
-</p>
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifier.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifier.java
index 4c49023..3059c6a 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifier.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifier.java
@@ -79,6 +79,11 @@ public class ASMifier extends Printer {
* Pseudo access flag used to distinguish inner class flags.
*/
private static final int ACCESS_INNER = 1048576;
+
+ /**
+ * Pseudo access flag used to distinguish module requires/exports flags.
+ */
+ private static final int ACCESS_MODULE = 2097152;
/**
* Constructs a new {@link ASMifier}. <i>Subclasses must not use this
@@ -167,13 +172,17 @@ public void visit(final int version, final int access, final String name,
final String signature, final String superName,
final String[] interfaces) {
String simpleName;
- int n = name.lastIndexOf('/');
- if (n == -1) {
- simpleName = name;
+ if (name == null) {
+ simpleName = "module-info";
} else {
- text.add("package asm." + name.substring(0, n).replace('/', '.')
- + ";\n");
- simpleName = name.substring(n + 1).replace('-', '_');
+ int n = name.lastIndexOf('/');
+ if (n == -1) {
+ simpleName = name;
+ } else {
+ text.add("package asm." + name.substring(0, n).replace('/', '.')
+ + ";\n");
+ simpleName = name.substring(n + 1).replace('-', '_');
+ }
}
text.add("import java.util.*;\n");
text.add("import org.eclipse.persistence.internal.libraries.asm.*;\n");
@@ -211,8 +220,8 @@ public void visit(final int version, final int access, final String name,
case Opcodes.V1_8:
buf.append("V1_8");
break;
- case Opcodes.V1_9:
- buf.append("V1_9");
+ case Opcodes.V9:
+ buf.append("V9");
break;
default:
buf.append(version);
@@ -253,10 +262,20 @@ public void visitSource(final String file, final String debug) {
}
@Override
- public Printer visitModule() {
+ public Printer visitModule(final String name, final int flags,
+ final String version) {
+ buf.setLength(0);
+ buf.append("ModuleVisitor mdv = cw.visitModule(");
+ appendConstant(name);
+ buf.append(", ");
+ appendAccess(flags | ACCESS_MODULE);
+ buf.append(", ");
+ appendConstant(version);
+ buf.append(");\n\n");
+ text.add(buf.toString());
ASMifier a = createASMifier("mdv", 0);
- text.add("ModuleVisitor mdv = cw.visitModule();\n");
text.add(a.getText());
+ text.add("}\n");
return a;
}
@@ -375,21 +394,62 @@ public void visitClassEnd() {
// ------------------------------------------------------------------------
@Override
- public void visitRequire(String module, int access) {
+ public void visitMainClass(String mainClass) {
buf.setLength(0);
- buf.append("mdv.visitRequire(");
- appendConstant(buf, module);
- buf.append(", ");
- appendAccess(access);
+ buf.append("mdv.visitMainClass(");
+ appendConstant(buf, mainClass);
buf.append(");\n");
text.add(buf.toString());
}
@Override
- public void visitExport(String packaze, String... modules) {
+ public void visitPackage(String packaze) {
+ buf.setLength(0);
+ buf.append("mdv.visitPackage(");
+ appendConstant(buf, packaze);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ @Override
+ public void visitRequire(String module, int access, String version) {
+ buf.setLength(0);
+ buf.append("mdv.visitRequire(");
+ appendConstant(buf, module);
+ buf.append(", ");
+ appendAccess(access | ACCESS_MODULE);
+ buf.append(", ");
+ appendConstant(buf, version);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ @Override
+ public void visitExport(String packaze, int access, String... modules) {
buf.setLength(0);
buf.append("mdv.visitExport(");
appendConstant(buf, packaze);
+ buf.append(", ");
+ appendAccess(access | ACCESS_MODULE);
+ if (modules != null && modules.length > 0) {
+ buf.append(", new String[] {");
+ for (int i = 0; i < modules.length; ++i) {
+ buf.append(i == 0 ? " " : ", ");
+ appendConstant(modules[i]);
+ }
+ buf.append(" }");
+ }
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ @Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ buf.setLength(0);
+ buf.append("mdv.visitOpen(");
+ appendConstant(buf, packaze);
+ buf.append(", ");
+ appendAccess(access | ACCESS_MODULE);
if (modules != null && modules.length > 0) {
buf.append(", new String[] {");
for (int i = 0; i < modules.length; ++i) {
@@ -412,13 +472,16 @@ public void visitUse(String service) {
}
@Override
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
buf.setLength(0);
buf.append("mdv.visitProvide(");
appendConstant(buf, service);
- buf.append(", ");
- appendConstant(buf, impl);
- buf.append(");\n");
+ buf.append(", new String[] {");
+ for (int i = 0; i < providers.length; ++i) {
+ buf.append(i == 0 ? " " : ", ");
+ appendConstant(providers[i]);
+ }
+ buf.append(" });\n");
text.add(buf.toString());
}
@@ -527,7 +590,7 @@ public void visitFieldEnd() {
// ------------------------------------------------------------------------
// Methods
// ------------------------------------------------------------------------
-
+
@Override
public void visitParameter(String parameterName, int access) {
buf.setLength(0);
@@ -1043,7 +1106,11 @@ void appendAccess(final int access) {
if (!first) {
buf.append(" + ");
}
- buf.append("ACC_FINAL");
+ if ((access & ACCESS_MODULE) == 0) {
+ buf.append("ACC_FINAL");
+ } else {
+ buf.append("ACC_TRANSITIVE");
+ }
first = false;
}
if ((access & Opcodes.ACC_STATIC) != 0) {
@@ -1053,31 +1120,35 @@ void appendAccess(final int access) {
buf.append("ACC_STATIC");
first = false;
}
- if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
+ if ((access & (Opcodes.ACC_SYNCHRONIZED | Opcodes.ACC_SUPER | Opcodes.ACC_TRANSITIVE)) != 0) {
if (!first) {
buf.append(" + ");
}
if ((access & ACCESS_CLASS) == 0) {
- buf.append("ACC_SYNCHRONIZED");
+ if ((access & ACCESS_MODULE) == 0) {
+ buf.append("ACC_SYNCHRONIZED");
+ } else {
+ buf.append("ACC_TRANSITIVE");
+ }
} else {
buf.append("ACC_SUPER");
}
first = false;
}
- if ((access & Opcodes.ACC_VOLATILE) != 0
- && (access & ACCESS_FIELD) != 0) {
+ if ((access & (Opcodes.ACC_VOLATILE | Opcodes.ACC_BRIDGE | Opcodes.ACC_STATIC_PHASE)) != 0) {
if (!first) {
buf.append(" + ");
}
- buf.append("ACC_VOLATILE");
- first = false;
- }
- if ((access & Opcodes.ACC_BRIDGE) != 0 && (access & ACCESS_CLASS) == 0
- && (access & ACCESS_FIELD) == 0) {
- if (!first) {
- buf.append(" + ");
+ if ((access & ACCESS_FIELD) == 0) {
+ if ((access & ACCESS_MODULE) == 0) {
+ buf.append("ACC_BRIDGE");
+ } else {
+ buf.append("ACC_STATIC_PHASE");
+ }
+ } else {
+ buf.append("ACC_VOLATILE");
}
- buf.append("ACC_BRIDGE");
+
first = false;
}
if ((access & Opcodes.ACC_VARARGS) != 0 && (access & ACCESS_CLASS) == 0
@@ -1156,7 +1227,7 @@ void appendAccess(final int access) {
buf.append("ACC_DEPRECATED");
first = false;
}
- if ((access & (Opcodes.ACC_MANDATED|Opcodes.ACC_MODULE)) != 0) {
+ if ((access & (Opcodes.ACC_MANDATED | Opcodes.ACC_MODULE)) != 0) {
if (!first) {
buf.append(" + ");
}
@@ -1210,7 +1281,8 @@ static void appendConstant(final StringBuffer buf, final Object cst) {
.append(", \"");
buf.append(h.getOwner()).append("\", \"");
buf.append(h.getName()).append("\", \"");
- buf.append(h.getDesc()).append("\")");
+ buf.append(h.getDesc()).append("\", ");
+ buf.append(h.isInterface()).append(")");
} else if (cst instanceof Byte) {
buf.append("new Byte((byte)").append(cst).append(')');
} else if (cst instanceof Boolean) {
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.java
index daf4009..348ea7c 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.java
@@ -151,6 +151,11 @@ public class CheckClassAdapter extends ClassVisitor {
* <tt>true</tt> if the visitEnd method has been called.
*/
private boolean end;
+
+ /**
+ * <tt>true</tt> if the visitModule method has been called.
+ */
+ private boolean module;
/**
* The already visited labels. This map associate Integer values to Label
@@ -381,7 +386,10 @@ public void visit(final int version, final int access, final String name,
+ Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM
+ Opcodes.ACC_DEPRECATED + Opcodes.ACC_MODULE
+ 0x40000); // ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
- if (name == null || !name.endsWith("package-info")) {
+ if (name == null) {
+ throw new IllegalArgumentException("Illegal class name (null)");
+ }
+ if (!name.endsWith("package-info")) {
CheckMethodAdapter.checkInternalName(name, "class name");
}
if ("java/lang/Object".equals(name)) {
@@ -423,8 +431,19 @@ public void visitSource(final String file, final String debug) {
}
@Override
- public ModuleVisitor visitModule() {
- return new CheckModuleAdapter(super.visitModule());
+ public ModuleVisitor visitModule(String name, int access, String version) {
+ checkState();
+ if (module) {
+ throw new IllegalStateException(
+ "visitModule can be called only once.");
+ }
+ module = true;
+ if (name == null) {
+ throw new IllegalArgumentException("Illegal module name (null)");
+ }
+ checkAccess(access, Opcodes.ACC_OPEN | Opcodes.ACC_SYNTHETIC);
+ return new CheckModuleAdapter(super.visitModule(name, access, version),
+ (access & Opcodes.ACC_OPEN) != 0);
}
@Override
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.java
index a75bf8f..2a9e5da 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.java
@@ -728,6 +728,12 @@ private void doVisitMethodInsn(int opcode, final String owner,
throw new IllegalArgumentException(
"INVOKEINTERFACE can't be used with classes");
}
+ if (opcode == Opcodes.INVOKESPECIAL && itf
+ && (version & 0xFFFF) < Opcodes.V1_8) {
+ throw new IllegalArgumentException(
+ "INVOKESPECIAL can't be used with interfaces prior to Java 8");
+ }
+
// Calling super.visitMethodInsn requires to call the correct version
// depending on this.api (otherwise infinite loops can occur). To
// simplify and to make it easier to automatically remove the backward
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckModuleAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckModuleAdapter.java
index 41633a4..383d1d6 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckModuleAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckModuleAdapter.java
@@ -29,6 +29,8 @@
*/
package org.eclipse.persistence.internal.libraries.asm.util;
+import java.util.HashSet;
+
import org.eclipse.persistence.internal.libraries.asm.ModuleVisitor;
import org.eclipse.persistence.internal.libraries.asm.Opcodes;
@@ -37,49 +39,94 @@
*/
public final class CheckModuleAdapter extends ModuleVisitor {
private boolean end;
+ private final boolean isOpen;
- public CheckModuleAdapter(final ModuleVisitor mv) {
+ private final HashSet<String> requireNames = new HashSet<String>();
+ private final HashSet<String> exportNames = new HashSet<String>();
+ private final HashSet<String> openNames = new HashSet<String>();
+ private final HashSet<String> useNames = new HashSet<String>();
+ private final HashSet<String> provideNames = new HashSet<String>();
+
+ public CheckModuleAdapter(final ModuleVisitor mv, final boolean isOpen) {
super(Opcodes.ASM6, mv);
+ this.isOpen = isOpen;
}
-
+
@Override
- public void visitRequire(String module, int access) {
+ public void visitRequire(String module, int access, String version) {
checkEnd();
if (module == null) {
throw new IllegalArgumentException("require cannot be null");
}
- super.visitRequire(module, access);
+ checkDeclared("requires", requireNames, module);
+ CheckClassAdapter.checkAccess(access, Opcodes.ACC_STATIC_PHASE
+ + Opcodes.ACC_TRANSITIVE + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_MANDATED);
+ super.visitRequire(module, access, version);
}
@Override
- public void visitExport(String packaze, String... modules) {
+ public void visitExport(String packaze, int access, String... modules) {
checkEnd();
if (packaze == null) {
- throw new IllegalArgumentException("require cannot be null");
+ throw new IllegalArgumentException("packaze cannot be null");
}
+ CheckMethodAdapter.checkInternalName(packaze, "package name");
+ checkDeclared("exports", exportNames, packaze);
+ CheckClassAdapter.checkAccess(access, Opcodes.ACC_SYNTHETIC
+ + Opcodes.ACC_MANDATED);
if (modules != null) {
- for(int i = 0; i < modules.length; i++) {
+ for (int i = 0; i < modules.length; i++) {
if (modules[i] == null) {
- throw new IllegalArgumentException("to at index " + i + " cannot be null");
+ throw new IllegalArgumentException("module at index " + i + " cannot be null");
}
}
}
- super.visitExport(packaze, modules);
+ super.visitExport(packaze, access, modules);
+ }
+
+ @Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ checkEnd();
+ if (isOpen) {
+ throw new IllegalArgumentException("an open module can not use open directive");
+ }
+ if (packaze == null) {
+ throw new IllegalArgumentException("packaze cannot be null");
+ }
+ CheckMethodAdapter.checkInternalName(packaze, "package name");
+ checkDeclared("opens", openNames, packaze);
+ CheckClassAdapter.checkAccess(access, Opcodes.ACC_SYNTHETIC
+ + Opcodes.ACC_MANDATED);
+ if (modules != null) {
+ for (int i = 0; i < modules.length; i++) {
+ if (modules[i] == null) {
+ throw new IllegalArgumentException("module at index " + i + " cannot be null");
+ }
+ }
+ }
+ super.visitOpen(packaze, access, modules);
}
@Override
public void visitUse(String service) {
checkEnd();
CheckMethodAdapter.checkInternalName(service, "service");
+ checkDeclared("uses", useNames, service);
super.visitUse(service);
}
@Override
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
checkEnd();
CheckMethodAdapter.checkInternalName(service, "service");
- CheckMethodAdapter.checkInternalName(impl, "impl");
- super.visitProvide(service, impl);
+ checkDeclared("provides", provideNames, service);
+ if (providers == null || providers.length == 0) {
+ throw new IllegalArgumentException("providers cannot be null or empty");
+ }
+ for (int i = 0; i < providers.length; i++) {
+ CheckMethodAdapter.checkInternalName(providers[i], "provider");
+ }
+ super.visitProvide(service, providers);
}
@Override
@@ -95,4 +142,10 @@ private void checkEnd() {
"Cannot call a visit method after visitEnd has been called");
}
}
+
+ private static void checkDeclared(String directive, HashSet<String> names, String name) {
+ if (!names.add(name)) {
+ throw new IllegalArgumentException(directive + " " + name + " already declared");
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.java
index 37c94d4..2553df2 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.java
@@ -146,7 +146,7 @@ public void visitFormalTypeParameter(final String name) {
|| (state != EMPTY && state != FORMAL && state != BOUND)) {
throw new IllegalStateException();
}
- CheckMethodAdapter.checkIdentifier(name, "formal type parameter");
+ checkIdentifier(name, "formal type parameter");
state = FORMAL;
if (sv != null) {
sv.visitFormalTypeParameter(name);
@@ -255,7 +255,7 @@ public void visitTypeVariable(final String name) {
if (type != TYPE_SIGNATURE || state != EMPTY) {
throw new IllegalStateException();
}
- CheckMethodAdapter.checkIdentifier(name, "type variable");
+ checkIdentifier(name, "type variable");
state = SIMPLE_TYPE;
if (sv != null) {
sv.visitTypeVariable(name);
@@ -277,7 +277,7 @@ public void visitClassType(final String name) {
if (type != TYPE_SIGNATURE || state != EMPTY) {
throw new IllegalStateException();
}
- CheckMethodAdapter.checkInternalName(name, "class name");
+ checkClassName(name, "class name");
state = CLASS_TYPE;
if (sv != null) {
sv.visitClassType(name);
@@ -289,7 +289,7 @@ public void visitInnerClassType(final String name) {
if (state != CLASS_TYPE) {
throw new IllegalStateException();
}
- CheckMethodAdapter.checkIdentifier(name, "inner class name");
+ checkIdentifier(name, "inner class name");
if (sv != null) {
sv.visitInnerClassType(name);
}
@@ -327,4 +327,30 @@ public void visitEnd() {
sv.visitEnd();
}
}
+
+ private void checkClassName(final String name, final String msg) {
+ if (name == null || name.length() == 0) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not be null or empty)");
+ }
+ for (int i = 0; i < name.length(); ++i) {
+ if (".;[<>:".indexOf(name.charAt(i)) != -1) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not contain . ; [ < > or :): " + name);
+ }
+ }
+ }
+
+ private void checkIdentifier(final String name, final String msg) {
+ if (name == null || name.length() == 0) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not be null or empty)");
+ }
+ for (int i = 0; i < name.length(); ++i) {
+ if (".;[/<>:".indexOf(name.charAt(i)) != -1) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not contain . ; [ / < > or :): " + name);
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Printer.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Printer.java
index 48f4924..f5f5ff5 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Printer.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Printer.java
@@ -198,7 +198,20 @@ public abstract void visit(final int version, final int access,
public abstract void visitSource(final String source, final String debug);
- public Printer visitModule() {
+ /**
+ * Module.
+ * See {@link org.eclipse.persistence.internal.libraries.asm.ClassVisitor#visitModule(String, int)}.
+ *
+ * @param name
+ * module name.
+ * @param access
+ * module flags, among {@code ACC_OPEN}, {@code ACC_SYNTHETIC}
+ * and {@code ACC_MANDATED}.
+ * @param version
+ * module version or null.
+ * @return
+ */
+ public Printer visitModule(String name, int access, String version) {
throw new RuntimeException("Must be overriden");
}
@@ -355,11 +368,23 @@ public abstract Printer visitMethod(final int access, final String name,
// Module
// ------------------------------------------------------------------------
- public void visitRequire(String module, int access) {
+ public void visitMainClass(String mainClass) {
+ throw new RuntimeException("Must be overriden");
+ }
+
+ public void visitPackage(String packaze) {
throw new RuntimeException("Must be overriden");
}
- public void visitExport(String packaze, String... modules) {
+ public void visitRequire(String module, int access, String version) {
+ throw new RuntimeException("Must be overriden");
+ }
+
+ public void visitExport(String packaze, int access, String... modules) {
+ throw new RuntimeException("Must be overriden");
+ }
+
+ public void visitOpen(String packaze, int access, String... modules) {
throw new RuntimeException("Must be overriden");
}
@@ -367,7 +392,7 @@ public void visitUse(String service) {
throw new RuntimeException("Must be overriden");
}
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
throw new RuntimeException("Must be overriden");
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Textifier.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Textifier.java
index 0f93fda..2d4f010 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Textifier.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Textifier.java
@@ -221,6 +221,10 @@ public static void main(final String[] args) throws Exception {
public void visit(final int version, final int access, final String name,
final String signature, final String superName,
final String[] interfaces) {
+ if ((access & Opcodes.ACC_MODULE) != 0) {
+ // visitModule will print the module
+ return;
+ }
this.access = access;
int major = version & 0xFFFF;
int minor = version >>> 16;
@@ -242,19 +246,15 @@ public void visit(final int version, final int access, final String name,
.append(sv.getDeclaration()).append('\n');
}
- String internalName = name;
- appendAccess(access & ~(Opcodes.ACC_SUPER|Opcodes.ACC_MODULE));
+ appendAccess(access & ~(Opcodes.ACC_SUPER | Opcodes.ACC_MODULE));
if ((access & Opcodes.ACC_ANNOTATION) != 0) {
buf.append("@interface ");
} else if ((access & Opcodes.ACC_INTERFACE) != 0) {
buf.append("interface ");
- } else if ((access & Opcodes.ACC_MODULE) != 0) {
- buf.append("module ");
- internalName = name.substring(0, name.length() - "/module-info".length());
} else if ((access & Opcodes.ACC_ENUM) == 0) {
buf.append("class ");
}
- appendDescriptor(INTERNAL_NAME, internalName);
+ appendDescriptor(INTERNAL_NAME, name);
if (superName != null && !"java/lang/Object".equals(superName)) {
buf.append(" extends ");
@@ -290,7 +290,18 @@ public void visitSource(final String file, final String debug) {
}
@Override
- public Printer visitModule() {
+ public Printer visitModule(final String name, final int access,
+ final String version) {
+ buf.setLength(0);
+ if ((access & Opcodes.ACC_OPEN) != 0) {
+ buf.append("open ");
+ }
+ buf.append("module ")
+ .append(name)
+ .append(" { ")
+ .append(version == null ? "" : "// " + version)
+ .append("\n\n");
+ text.add(buf.toString());
Textifier t = createTextifier();
text.add(t.getText());
return t;
@@ -319,7 +330,7 @@ public Textifier visitClassAnnotation(final String desc,
}
@Override
- public Textifier visitClassTypeAnnotation(int typeRef, TypePath typePath,
+ public Printer visitClassTypeAnnotation(int typeRef, TypePath typePath,
String desc, boolean visible) {
text.add("\n");
return visitTypeAnnotation(typeRef, typePath, desc, visible);
@@ -425,7 +436,7 @@ public Textifier visitMethod(final int access, final String name,
}
buf.append(tab);
- appendAccess(access & ~Opcodes.ACC_VOLATILE);
+ appendAccess(access & ~(Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT));
if ((access & Opcodes.ACC_NATIVE) != 0) {
buf.append("native ");
}
@@ -469,31 +480,82 @@ public void visitClassEnd() {
// ------------------------------------------------------------------------
@Override
- public void visitRequire(String require, int access) {
+ public void visitMainClass(String mainClass) {
+ buf.setLength(0);
+ buf.append(" // main class ").append(mainClass).append('\n');
+ text.add(buf.toString());
+ }
+
+ @Override
+ public void visitPackage(String packaze) {
+ buf.setLength(0);
+ buf.append(" // package ").append(packaze).append('\n');
+ text.add(buf.toString());
+ }
+
+ @Override
+ public void visitRequire(String require, int access, String version) {
buf.setLength(0);
buf.append(tab).append("requires ");
- if ((access & Opcodes.ACC_PUBLIC) != 0) {
- buf.append("public ");
+ if ((access & Opcodes.ACC_TRANSITIVE) != 0) {
+ buf.append("transitive ");
+ }
+ if ((access & Opcodes.ACC_STATIC_PHASE) != 0) {
+ buf.append("static ");
}
buf.append(require)
.append("; // access flags 0x")
.append(Integer.toHexString(access).toUpperCase())
.append('\n');
+ if (version != null) {
+ buf.append(" // version ")
+ .append(version)
+ .append('\n');
+ }
text.add(buf.toString());
}
@Override
- public void visitExport(String export, String... tos) {
+ public void visitExport(String export, int access, String... modules) {
buf.setLength(0);
- buf.append(tab).append("exports ").append(export);
- if (tos != null && tos.length > 0) {
- buf.append(" to\n");
- for (int i = 0; i < tos.length; ++i) {
- buf.append(tab2).append(tos[i]);
- buf.append(i != tos.length - 1 ? ",\n": "");
+ buf.append(tab).append("exports ");
+ buf.append(export);
+ if (modules != null && modules.length > 0) {
+ buf.append(" to");
+ } else {
+ buf.append(';');
+ }
+ buf.append(" // access flags 0x")
+ .append(Integer.toHexString(access).toUpperCase())
+ .append('\n');
+ if (modules != null && modules.length > 0) {
+ for (int i = 0; i < modules.length; ++i) {
+ buf.append(tab2).append(modules[i]);
+ buf.append(i != modules.length - 1 ? ",\n": ";\n");
}
}
- buf.append(";\n");
+ text.add(buf.toString());
+ }
+
+ @Override
+ public void visitOpen(String export, int access, String... modules) {
+ buf.setLength(0);
+ buf.append(tab).append("opens ");
+ buf.append(export);
+ if (modules != null && modules.length > 0) {
+ buf.append(" to");
+ } else {
+ buf.append(';');
+ }
+ buf.append(" // access flags 0x")
+ .append(Integer.toHexString(access).toUpperCase())
+ .append('\n');
+ if (modules != null && modules.length > 0) {
+ for (int i = 0; i < modules.length; ++i) {
+ buf.append(tab2).append(modules[i]);
+ buf.append(i != modules.length - 1 ? ",\n": ";\n");
+ }
+ }
text.add(buf.toString());
}
@@ -507,13 +569,16 @@ public void visitUse(String use) {
}
@Override
- public void visitProvide(String provide, String with) {
+ public void visitProvide(String provide, String... providers) {
buf.setLength(0);
buf.append(tab).append("provides ");
appendDescriptor(INTERNAL_NAME, provide);
- buf.append(" with\n").append(tab2);
- appendDescriptor(INTERNAL_NAME, with);
- buf.append(";\n");
+ buf.append(" with\n");
+ for (int i = 0; i < providers.length; ++i) {
+ buf.append(tab2);
+ appendDescriptor(INTERNAL_NAME, providers[i]);
+ buf.append(i != providers.length - 1 ? ",\n": ";\n");
+ }
text.add(buf.toString());
}
@@ -712,7 +777,7 @@ public Textifier visitFieldAnnotation(final String desc,
}
@Override
- public Textifier visitFieldTypeAnnotation(int typeRef, TypePath typePath,
+ public Printer visitFieldTypeAnnotation(int typeRef, TypePath typePath,
String desc, boolean visible) {
return visitTypeAnnotation(typeRef, typePath, desc, visible);
}
@@ -756,7 +821,7 @@ public Textifier visitMethodAnnotation(final String desc,
}
@Override
- public Textifier visitMethodTypeAnnotation(int typeRef, TypePath typePath,
+ public Printer visitMethodTypeAnnotation(int typeRef, TypePath typePath,
String desc, boolean visible) {
return visitTypeAnnotation(typeRef, typePath, desc, visible);
}
@@ -1037,7 +1102,7 @@ public void visitMultiANewArrayInsn(final String desc, final int dims) {
}
@Override
- public Textifier visitInsnAnnotation(int typeRef, TypePath typePath,
+ public Printer visitInsnAnnotation(int typeRef, TypePath typePath,
String desc, boolean visible) {
return visitTypeAnnotation(typeRef, typePath, desc, visible);
}
@@ -1059,7 +1124,7 @@ public void visitTryCatchBlock(final Label start, final Label end,
}
@Override
- public Textifier visitTryCatchAnnotation(int typeRef, TypePath typePath,
+ public Printer visitTryCatchAnnotation(int typeRef, TypePath typePath,
String desc, boolean visible) {
buf.setLength(0);
buf.append(tab2).append("TRYCATCHBLOCK @");
@@ -1104,7 +1169,7 @@ public void visitLocalVariable(final String name, final String desc,
}
@Override
- public Textifier visitLocalVariableAnnotation(int typeRef, TypePath typePath,
+ public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath,
Label[] start, Label[] end, int[] index, String desc,
boolean visible) {
buf.setLength(0);
@@ -1336,13 +1401,16 @@ protected void appendHandle(final Handle h) {
appendDescriptor(INTERNAL_NAME, h.getOwner());
buf.append('.');
buf.append(h.getName());
- if(!isMethodHandle){
+ if (!isMethodHandle) {
buf.append('(');
}
appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
- if(!isMethodHandle){
+ if (!isMethodHandle) {
buf.append(')');
}
+ if (h.isInterface()) {
+ buf.append(" itf");
+ }
}
/**
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.java
index 2666a16..f951c31 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.java
@@ -152,9 +152,10 @@ public void visitSource(final String file, final String debug) {
}
@Override
- public ModuleVisitor visitModule() {
- Printer p = this.p.visitModule();
- ModuleVisitor mv = super.visitModule();
+ public ModuleVisitor visitModule(String name, int flags,
+ String version) {
+ Printer p = this.p.visitModule(name, flags, version);
+ ModuleVisitor mv = super.visitModule(name, flags, version);
return new TraceModuleVisitor(mv, p);
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceModuleVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceModuleVisitor.java
index b39c61d..204bb7a 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceModuleVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceModuleVisitor.java
@@ -52,15 +52,33 @@ public TraceModuleVisitor(final ModuleVisitor mv, final Printer p) {
}
@Override
- public void visitRequire(String module, int access) {
- p.visitRequire(module, access);
- super.visitRequire(module, access);
+ public void visitMainClass(String mainClass) {
+ p.visitMainClass(mainClass);
+ super.visitMainClass(mainClass);
}
@Override
- public void visitExport(String packaze, String... modules) {
- p.visitExport(packaze, modules);
- super.visitExport(packaze, modules);
+ public void visitPackage(String packaze) {
+ p.visitPackage(packaze);
+ super.visitPackage(packaze);
+ }
+
+ @Override
+ public void visitRequire(String module, int access, String version) {
+ p.visitRequire(module, access, version);
+ super.visitRequire(module, access, version);
+ }
+
+ @Override
+ public void visitExport(String packaze, int access, String... modules) {
+ p.visitExport(packaze, access, modules);
+ super.visitExport(packaze, access, modules);
+ }
+
+ @Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ p.visitOpen(packaze, access, modules);
+ super.visitOpen(packaze, access, modules);
}
@Override
@@ -70,9 +88,9 @@ public void visitUse(String use) {
}
@Override
- public void visitProvide(String service, String impl) {
- p.visitProvide(service, impl);
- super.visitProvide(service, impl);
+ public void visitProvide(String service, String... providers) {
+ p.visitProvide(service, providers);
+ super.visitProvide(service, providers);
}
@Override
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.java
index b23fc90..2e11dc3 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.java
@@ -94,6 +94,9 @@ public class ASMContentHandler extends DefaultHandler implements Opcodes {
ModuleRule moduleRule = new ModuleRule();
RULES.add(BASE + "/module", moduleRule);
+ RULES.add(BASE + "/module/main-class", moduleRule);
+ RULES.add(BASE + "/module/target", moduleRule);
+ RULES.add(BASE + "/module/packages", moduleRule);
RULES.add(BASE + "/module/requires", moduleRule);
RULES.add(BASE + "/module/exports", moduleRule);
RULES.add(BASE + "/module/exports/to", moduleRule);
@@ -688,6 +691,12 @@ protected final int getAccess(final String s) {
if (s.indexOf("module") != -1) {
access |= ACC_MODULE;
}
+ if (s.indexOf("open") != -1) {
+ access |= ACC_OPEN;
+ }
+ if (s.indexOf("transitive") != -1) {
+ access |= ACC_TRANSITIVE;
+ }
return access;
}
}
@@ -758,22 +767,39 @@ public final void end(final String element) {
}
/**
- * ModuleRule: module, requires, exports, restricted-to, uses and provides
+ * ModuleRule: module, requires, exports, opens, uses and provides
*/
final class ModuleRule extends Rule {
@Override
public final void begin(final String element, final Attributes attrs)
throws SAXException {
if ("module".equals(element)) {
- push(cv.visitModule());
+ push(cv.visitModule(attrs.getValue("name"),
+ getAccess(attrs.getValue("access")),
+ attrs.getValue("version")));
+ } else if ("main-class".equals(element)) {
+ ModuleVisitor mv = (ModuleVisitor) peek();
+ mv.visitMainClass(attrs.getValue("name"));
+ } else if ("packages".equals(element)) {
+ ModuleVisitor mv = (ModuleVisitor) peek();
+ mv.visitPackage(attrs.getValue("name"));
} else if ("requires".equals(element)) {
ModuleVisitor mv = (ModuleVisitor) peek();
+ int access = getAccess(attrs.getValue("access"));
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ access = access & ~Opcodes.ACC_STATIC | Opcodes.ACC_STATIC_PHASE;
+ }
mv.visitRequire(attrs.getValue("module"),
- getAccess(attrs.getValue("access")));
+ access, attrs.getValue("version"));
} else if ("exports".equals(element)) {
- // encode the name of the exported package as the first item
+ push(attrs.getValue("name"));
+ push(getAccess(attrs.getValue("access")));
ArrayList<String> list = new ArrayList<String>();
- list.add(attrs.getValue("name"));
+ push(list);
+ } else if ("opens".equals(element)) {
+ push(attrs.getValue("name"));
+ push(getAccess(attrs.getValue("access")));
+ ArrayList<String> list = new ArrayList<String>();
push(list);
} else if ("to".equals(element)) {
@SuppressWarnings("unchecked")
@@ -783,23 +809,41 @@ public final void begin(final String element, final Attributes attrs)
ModuleVisitor mv = (ModuleVisitor) peek();
mv.visitUse(attrs.getValue("service"));
} else if ("provides".equals(element)) {
- ModuleVisitor mv = (ModuleVisitor) peek();
- mv.visitProvide(attrs.getValue("service"), attrs.getValue("impl"));
- }
+ push(attrs.getValue("service"));
+ push(0); // see end() below
+ ArrayList<String> list = new ArrayList<String>();
+ push(list);
+ } else if ("with".equals(element)) {
+ @SuppressWarnings("unchecked")
+ ArrayList<String> list = (ArrayList<String>) peek();
+ list.add(attrs.getValue("provider"));
+ }
}
@Override
public void end(final String element) {
- if ("exports".equals(element)) {
+ boolean exports = "exports".equals(element);
+ boolean opens = "opens".equals(element);
+ boolean provides = "provides".equals(element);
+ if (exports | opens | provides) {
@SuppressWarnings("unchecked")
ArrayList<String> list = (ArrayList<String>) pop();
- String export = list.remove(0); // name of the exported package
+ int access = (Integer) pop();
+ String name = (String) pop();
String[] tos = null;
if (!list.isEmpty()) {
tos = list.toArray(new String[list.size()]);
}
ModuleVisitor mv = (ModuleVisitor) peek();
- mv.visitExport(export, tos);
+ if (exports) {
+ mv.visitExport(name, access, tos);
+ } else {
+ if (opens) {
+ mv.visitOpen(name, access, tos);
+ } else {
+ mv.visitProvide(name, tos);
+ }
+ }
} else if ("module".equals(element)) {
((ModuleVisitor) pop()).visitEnd();
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.java
index 4cffdc4..1463342 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.java
@@ -70,6 +70,16 @@ public final class SAXClassAdapter extends ClassVisitor {
* Pseudo access flag used to distinguish inner class flags.
*/
private static final int ACCESS_INNER = 1048576;
+
+ /**
+ * Pseudo access flag used to distinguish module flags.
+ */
+ static final int ACCESS_MODULE = 2097152;
+
+ /**
+ * Pseudo access flag used to distinguish module requires flags.
+ */
+ static final int ACCESS_MODULE_REQUIRES = 4194304;
/**
* Constructs a new {@link SAXClassAdapter SAXClassAdapter} object.
@@ -104,8 +114,16 @@ public void visitSource(final String source, final String debug) {
}
@Override
- public ModuleVisitor visitModule() {
+ public ModuleVisitor visitModule(final String name, final int access,
+ final String version) {
AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "name", "name", "", name);
+ StringBuilder sb = new StringBuilder();
+ appendAccess(access | ACCESS_MODULE, sb);
+ att.addAttribute("", "access", "access", "", sb.toString());
+ if (version != null) {
+ att.addAttribute("", "version", "version", "", encode(version));
+ }
sa.addStart("module", att);
return new SAXModuleAdapter(sa);
}
@@ -286,14 +304,26 @@ static void appendAccess(final int access, final StringBuilder sb) {
sb.append("protected ");
}
if ((access & Opcodes.ACC_FINAL) != 0) {
- sb.append("final ");
+ if ((access & ACCESS_MODULE) == 0) {
+ sb.append("final ");
+ } else {
+ sb.append("transitive ");
+ }
}
if ((access & Opcodes.ACC_STATIC) != 0) {
sb.append("static ");
}
if ((access & Opcodes.ACC_SUPER) != 0) {
if ((access & ACCESS_CLASS) == 0) {
- sb.append("synchronized ");
+ if ((access & ACCESS_MODULE_REQUIRES) != 0) {
+ sb.append("transitive ");
+ } else {
+ if ((access & ACCESS_MODULE) == 0) {
+ sb.append("synchronized ");
+ } else {
+ sb.append("open ");
+ }
+ }
} else {
sb.append("super ");
}
@@ -302,7 +332,11 @@ static void appendAccess(final int access, final StringBuilder sb) {
if ((access & ACCESS_FIELD) == 0) {
sb.append("bridge ");
} else {
- sb.append("volatile ");
+ if ((access & ACCESS_MODULE_REQUIRES) == 0) {
+ sb.append("volatile ");
+ } else {
+ sb.append("static ");
+ }
}
}
if ((access & Opcodes.ACC_TRANSIENT) != 0) {
@@ -336,7 +370,7 @@ static void appendAccess(final int access, final StringBuilder sb) {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
sb.append("deprecated ");
}
- if ((access & (Opcodes.ACC_MANDATED|Opcodes.ACC_MODULE)) != 0) {
+ if ((access & Opcodes.ACC_MANDATED) != 0) {
if ((access & ACCESS_CLASS) == 0) {
sb.append("module ");
} else {
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXModuleAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXModuleAdapter.java
index 52c4a63..24733bc 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXModuleAdapter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXModuleAdapter.java
@@ -48,22 +48,42 @@ public SAXModuleAdapter(final SAXAdapter sa) {
}
@Override
- public void visitRequire(String module, int access) {
+ public void visitMainClass(String mainClass) {
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "name", "name", "", mainClass);
+ sa.addElement("main-class", att);
+ }
+
+ @Override
+ public void visitPackage(String packaze) {
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "name", "name", "", packaze);
+ sa.addElement("packages", att);
+ }
+
+ @Override
+ public void visitRequire(String module, int access, String version) {
AttributesImpl att = new AttributesImpl();
StringBuilder sb = new StringBuilder();
- SAXClassAdapter.appendAccess(access, sb);
+ SAXClassAdapter.appendAccess(access | SAXClassAdapter.ACCESS_MODULE, sb);
att.addAttribute("", "module", "module", "", module);
att.addAttribute("", "access", "access", "", sb.toString());
+ if (version != null) {
+ att.addAttribute("", "access", "access", "", version);
+ }
sa.addElement("requires", att);
}
@Override
- public void visitExport(String packaze, String... modules) {
+ public void visitExport(String packaze, int access, String... modules) {
AttributesImpl att = new AttributesImpl();
+ StringBuilder sb = new StringBuilder();
+ SAXClassAdapter.appendAccess(access | SAXClassAdapter.ACCESS_MODULE, sb);
att.addAttribute("", "name", "name", "", packaze);
+ att.addAttribute("", "access", "access", "", sb.toString());
sa.addStart("exports", att);
if (modules != null && modules.length > 0) {
- for(String to: modules) {
+ for (String to : modules) {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "module", "module", "", to);
sa.addElement("to", atts);
@@ -71,6 +91,24 @@ public void visitExport(String packaze, String... modules) {
}
sa.addEnd("exports");
}
+
+ @Override
+ public void visitOpen(String packaze, int access, String... modules) {
+ AttributesImpl att = new AttributesImpl();
+ StringBuilder sb = new StringBuilder();
+ SAXClassAdapter.appendAccess(access | SAXClassAdapter.ACCESS_MODULE, sb);
+ att.addAttribute("", "name", "name", "", packaze);
+ att.addAttribute("", "access", "access", "", sb.toString());
+ sa.addStart("opens", att);
+ if (modules != null && modules.length > 0) {
+ for (String to : modules) {
+ AttributesImpl atts = new AttributesImpl();
+ atts.addAttribute("", "module", "module", "", to);
+ sa.addElement("to", atts);
+ }
+ }
+ sa.addEnd("opens");
+ }
@Override
public void visitUse(String service) {
@@ -80,11 +118,16 @@ public void visitUse(String service) {
}
@Override
- public void visitProvide(String service, String impl) {
+ public void visitProvide(String service, String... providers) {
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "service", "service", "", service);
- att.addAttribute("", "impl", "impl", "", impl);
- sa.addElement("provides", att);
+ sa.addStart("provides", att);
+ for (String provider : providers) {
+ AttributesImpl atts = new AttributesImpl();
+ atts.addAttribute("", "provider", "provider", "", provider);
+ sa.addElement("with", atts);
+ }
+ sa.addEnd("provides");
}
@Override
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd
deleted file mode 100644
index b2be0d9..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd
+++ /dev/null
@@ -1,363 +0,0 @@
-<!--
- ASM XML Adapter
- Copyright (c) 2004-2011, Eugene Kuleshov
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<!--
- This DTD must be used to create XML documents to be processed by
- org.objectweb.asm.xml.ASMContentHandler
--->
-
-<!--
- Root element used to aggregate multiple classes into single document.
--->
-<!ELEMENT classes ( class+ )>
-
-<!--
- Root element for a single class.
--->
-<!ELEMENT class ( interfaces, module?, ( field | innerclass | method )*)>
-<!ATTLIST class access CDATA #REQUIRED>
-<!ATTLIST class name CDATA #REQUIRED>
-<!ATTLIST class parent CDATA #REQUIRED>
-<!ATTLIST class major CDATA #REQUIRED>
-<!ATTLIST class minor CDATA #REQUIRED>
-<!ATTLIST class source CDATA #IMPLIED>
-
-<!ELEMENT interfaces ( interface* )>
-<!ELEMENT interface EMPTY>
-<!ATTLIST interface name CDATA #REQUIRED>
-
-<!ELEMENT module ( requires*, exports*, uses*, provides* )>
-<!ELEMENT requires EMPTY>
-<!ATTLIST requires module CDATA #REQUIRED>
-<!ATTLIST requires access CDATA #REQUIRED>
-<!ELEMENT exports ( to* )>
-<!ATTLIST exports name CDATA #REQUIRED>
-<!ELEMENT to EMPTY>
-<!ATTLIST to module CDATA #REQUIRED>
-<!ELEMENT uses EMPTY>
-<!ATTLIST uses service CDATA #REQUIRED>
-<!ELEMENT provides EMPTY>
-<!ATTLIST provides service CDATA #REQUIRED>
-<!ATTLIST provides impl CDATA #REQUIRED>
-
-<!ELEMENT field EMPTY>
-<!ATTLIST field access CDATA #REQUIRED>
-<!ATTLIST field desc CDATA #REQUIRED>
-<!ATTLIST field name CDATA #REQUIRED>
-<!--
- All characters out of interval 0x20 to 0x7f (inclusive) must
- be encoded (\uXXXX) and character '\' must be replaced by "\\"
--->
-<!ATTLIST field value CDATA #IMPLIED>
-
-<!ELEMENT innerclass EMPTY>
-<!ATTLIST innerclass access CDATA #REQUIRED>
-<!ATTLIST innerclass innerName CDATA #IMPLIED>
-<!ATTLIST innerclass name CDATA #REQUIRED>
-<!ATTLIST innerclass outerName CDATA #IMPLIED>
-
-<!--
- Root element for method definition.
--->
-<!ELEMENT method ( exceptions, code? )>
-<!ATTLIST method access CDATA #REQUIRED>
-<!ATTLIST method desc CDATA #REQUIRED>
-<!ATTLIST method name CDATA #REQUIRED>
-
-<!ELEMENT exceptions ( exception* )>
-<!ELEMENT exception EMPTY>
-<!ATTLIST exception name CDATA #REQUIRED>
-
-<!--
- code element contains bytecode instructions and definitions for labels, line numbers, try/catch and max
--->
-<!ELEMENT code (( AALOAD | AASTORE | ACONST_NULL | ALOAD | ANEWARRAY | ARETURN | ARRAYLENGTH | ASTORE | ATHROW | BALOAD | BASTORE | BIPUSH | CALOAD | CASTORE | CHECKCAST | D2F | D2I | D2L | DADD | DALOAD | DASTORE | DCMPG | DCMPL | DCONST_0 | DCONST_1 | DDIV | DLOAD | DMUL | DNEG | DREM | DRETURN | DSTORE | DSUB | DUP | DUP2 | DUP2_X1 | DUP2_X2 | DUP_X1 | DUP_X2 | SWAP | F2D | F2I | F2L | FADD | FALOAD | FASTORE | FCMPG | FCMPL | FCONST_0 | FCONST_1 | FCONST_2 | FDIV | FLOAD | FMUL | FNEG | FREM | FRETURN | FSTORE | FSUB | GETFIELD | GETSTATIC | GOTO | I2B | I2C | I2D | I2F | I2L | I2S | IADD | IALOAD | IAND | IASTORE | ICONST_0 | ICONST_1 | ICONST_2 | ICONST_3 | ICONST_4 | ICONST_5 | ICONST_M1 | IDIV | IFEQ | IFGE | IFGT | IFLE | IFLT | IFNE | IFNONNULL | IFNULL | IF_ACMPEQ | IF_ACMPNE | IF_ICMPEQ | IF_ICMPGE | IF_ICMPGT | IF_ICMPLE | IF_ICMPLT | IF_ICMPNE | IINC | ILOAD | IMUL | INEG | INSTANCEOF | INVOKEINTERFACE | INVOKESPECIAL | INVOKESTATIC | INVOKEVIRTUAL | IOR | IREM | IRETURN | ISHL | ISHR | ISTORE | ISUB | IUSHR | IXOR | JSR | L2D | L2F | L2I | LADD | LALOAD | LAND | LASTORE | LCMP | LCONST_0 | LCONST_1 | LDC | LDIV | LLOAD | LMUL | LNEG | LOOKUPSWITCH | LOR | LREM | LRETURN | LSHL | LSHR | LSTORE | LSUB | LUSHR | LXOR | MONITORENTER | MONITOREXIT | MULTIANEWARRAY | NEW | NEWARRAY | NOP | POP | POP2 | PUTFIELD | PUTSTATIC | RET | RETURN | SALOAD | SASTORE | SIPUSH | TABLESWITCH | Label | LineNumber | TryCatch )*, Max)>
-
-<!ELEMENT Label EMPTY>
-<!ATTLIST Label name CDATA #REQUIRED>
-
-<!ELEMENT TryCatch EMPTY>
-<!ATTLIST TryCatch end CDATA #REQUIRED>
-<!ATTLIST TryCatch handler CDATA #REQUIRED>
-<!ATTLIST TryCatch start CDATA #REQUIRED>
-<!ATTLIST TryCatch type CDATA #IMPLIED>
-
-<!ELEMENT LineNumber EMPTY>
-<!ATTLIST LineNumber line CDATA #REQUIRED>
-<!ATTLIST LineNumber start CDATA #REQUIRED>
-
-<!ELEMENT Max EMPTY>
-<!ATTLIST Max maxLocals CDATA #REQUIRED>
-<!ATTLIST Max maxStack CDATA #REQUIRED>
-
-<!ELEMENT AALOAD EMPTY>
-<!ELEMENT AASTORE EMPTY>
-<!ELEMENT ACONST_NULL EMPTY>
-<!ELEMENT ALOAD EMPTY>
-<!ATTLIST ALOAD var CDATA #REQUIRED>
-<!ELEMENT ANEWARRAY EMPTY>
-<!ATTLIST ANEWARRAY desc CDATA #REQUIRED>
-<!ELEMENT ARETURN EMPTY>
-<!ELEMENT ARRAYLENGTH EMPTY>
-<!ELEMENT ASTORE EMPTY>
-<!ATTLIST ASTORE var CDATA #REQUIRED>
-<!ELEMENT ATHROW EMPTY>
-<!ELEMENT BALOAD EMPTY>
-<!ELEMENT BASTORE EMPTY>
-<!ELEMENT BIPUSH EMPTY>
-<!ATTLIST BIPUSH value CDATA #REQUIRED>
-<!ELEMENT CALOAD EMPTY>
-<!ELEMENT CASTORE EMPTY>
-<!ELEMENT CHECKCAST EMPTY>
-<!ATTLIST CHECKCAST desc CDATA #REQUIRED>
-<!ELEMENT D2F EMPTY>
-<!ELEMENT D2I EMPTY>
-<!ELEMENT D2L EMPTY>
-<!ELEMENT DADD EMPTY>
-<!ELEMENT DALOAD EMPTY>
-<!ELEMENT DASTORE EMPTY>
-<!ELEMENT DCMPG EMPTY>
-<!ELEMENT DCMPL EMPTY>
-<!ELEMENT DCONST_0 EMPTY>
-<!ELEMENT DCONST_1 EMPTY>
-<!ELEMENT DDIV EMPTY>
-<!ELEMENT DLOAD EMPTY>
-<!ATTLIST DLOAD var CDATA #REQUIRED>
-<!ELEMENT DMUL EMPTY>
-<!ELEMENT DNEG EMPTY>
-<!ELEMENT DREM EMPTY>
-<!ELEMENT DRETURN EMPTY>
-<!ELEMENT DSTORE EMPTY>
-<!ATTLIST DSTORE var CDATA #REQUIRED>
-<!ELEMENT DSUB EMPTY>
-<!ELEMENT DUP EMPTY>
-<!ELEMENT DUP2 EMPTY>
-<!ELEMENT DUP2_X1 EMPTY>
-<!ELEMENT DUP2_X2 EMPTY>
-<!ELEMENT DUP_X1 EMPTY>
-<!ELEMENT DUP_X2 EMPTY>
-<!ELEMENT SWAP EMPTY>
-<!ELEMENT F2D EMPTY>
-<!ELEMENT F2I EMPTY>
-<!ELEMENT F2L EMPTY>
-<!ELEMENT FADD EMPTY>
-<!ELEMENT FALOAD EMPTY>
-<!ELEMENT FASTORE EMPTY>
-<!ELEMENT FCMPG EMPTY>
-<!ELEMENT FCMPL EMPTY>
-<!ELEMENT FCONST_0 EMPTY>
-<!ELEMENT FCONST_1 EMPTY>
-<!ELEMENT FCONST_2 EMPTY>
-<!ELEMENT FDIV EMPTY>
-<!ELEMENT FLOAD EMPTY>
-<!ATTLIST FLOAD var CDATA #REQUIRED>
-<!ELEMENT FMUL EMPTY>
-<!ELEMENT FNEG EMPTY>
-<!ELEMENT FREM EMPTY>
-<!ELEMENT FRETURN EMPTY>
-<!ELEMENT FSTORE EMPTY>
-<!ATTLIST FSTORE var CDATA #REQUIRED>
-<!ELEMENT FSUB EMPTY>
-<!ELEMENT GETFIELD EMPTY>
-<!ATTLIST GETFIELD desc CDATA #REQUIRED>
-<!ATTLIST GETFIELD name CDATA #REQUIRED>
-<!ATTLIST GETFIELD owner CDATA #REQUIRED>
-<!ELEMENT GETSTATIC EMPTY>
-<!ATTLIST GETSTATIC desc CDATA #REQUIRED>
-<!ATTLIST GETSTATIC name CDATA #REQUIRED>
-<!ATTLIST GETSTATIC owner CDATA #REQUIRED>
-<!ELEMENT GOTO EMPTY>
-<!ATTLIST GOTO label CDATA #REQUIRED>
-<!ELEMENT I2B EMPTY>
-<!ELEMENT I2C EMPTY>
-<!ELEMENT I2D EMPTY>
-<!ELEMENT I2F EMPTY>
-<!ELEMENT I2L EMPTY>
-<!ELEMENT I2S EMPTY>
-<!ELEMENT IADD EMPTY>
-<!ELEMENT IALOAD EMPTY>
-<!ELEMENT IAND EMPTY>
-<!ELEMENT IASTORE EMPTY>
-<!ELEMENT ICONST_0 EMPTY>
-<!ELEMENT ICONST_1 EMPTY>
-<!ELEMENT ICONST_2 EMPTY>
-<!ELEMENT ICONST_3 EMPTY>
-<!ELEMENT ICONST_4 EMPTY>
-<!ELEMENT ICONST_5 EMPTY>
-<!ELEMENT ICONST_M1 EMPTY>
-<!ELEMENT IDIV EMPTY>
-<!ELEMENT IFEQ EMPTY>
-<!ATTLIST IFEQ label CDATA #REQUIRED>
-<!ELEMENT IFGE EMPTY>
-<!ATTLIST IFGE label CDATA #REQUIRED>
-<!ELEMENT IFGT EMPTY>
-<!ATTLIST IFGT label CDATA #REQUIRED>
-<!ELEMENT IFLE EMPTY>
-<!ATTLIST IFLE label CDATA #REQUIRED>
-<!ELEMENT IFLT EMPTY>
-<!ATTLIST IFLT label CDATA #REQUIRED>
-<!ELEMENT IFNE EMPTY>
-<!ATTLIST IFNE label CDATA #REQUIRED>
-<!ELEMENT IFNONNULL EMPTY>
-<!ATTLIST IFNONNULL label CDATA #REQUIRED>
-<!ELEMENT IFNULL EMPTY>
-<!ATTLIST IFNULL label CDATA #REQUIRED>
-<!ELEMENT IF_ACMPEQ EMPTY>
-<!ATTLIST IF_ACMPEQ label CDATA #REQUIRED>
-<!ELEMENT IF_ACMPNE EMPTY>
-<!ATTLIST IF_ACMPNE label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPEQ EMPTY>
-<!ATTLIST IF_ICMPEQ label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPGE EMPTY>
-<!ATTLIST IF_ICMPGE label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPGT EMPTY>
-<!ATTLIST IF_ICMPGT label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPLE EMPTY>
-<!ATTLIST IF_ICMPLE label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPLT EMPTY>
-<!ATTLIST IF_ICMPLT label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPNE EMPTY>
-<!ATTLIST IF_ICMPNE label CDATA #REQUIRED>
-<!ELEMENT IINC EMPTY>
-<!ATTLIST IINC inc CDATA #REQUIRED>
-<!ATTLIST IINC var CDATA #REQUIRED>
-<!ELEMENT ILOAD EMPTY>
-<!ATTLIST ILOAD var CDATA #REQUIRED>
-<!ELEMENT IMUL EMPTY>
-<!ELEMENT INEG EMPTY>
-<!ELEMENT INSTANCEOF EMPTY>
-<!ATTLIST INSTANCEOF desc CDATA #REQUIRED>
-<!ELEMENT INVOKEINTERFACE EMPTY>
-<!ATTLIST INVOKEINTERFACE desc CDATA #REQUIRED>
-<!ATTLIST INVOKEINTERFACE name CDATA #REQUIRED>
-<!ATTLIST INVOKEINTERFACE owner CDATA #REQUIRED>
-<!ELEMENT INVOKESPECIAL EMPTY>
-<!ATTLIST INVOKESPECIAL desc CDATA #REQUIRED>
-<!ATTLIST INVOKESPECIAL name CDATA #REQUIRED>
-<!ATTLIST INVOKESPECIAL owner CDATA #REQUIRED>
-<!ELEMENT INVOKESTATIC EMPTY>
-<!ATTLIST INVOKESTATIC desc CDATA #REQUIRED>
-<!ATTLIST INVOKESTATIC name CDATA #REQUIRED>
-<!ATTLIST INVOKESTATIC owner CDATA #REQUIRED>
-<!ELEMENT INVOKEVIRTUAL EMPTY>
-<!ATTLIST INVOKEVIRTUAL desc CDATA #REQUIRED>
-<!ATTLIST INVOKEVIRTUAL name CDATA #REQUIRED>
-<!ATTLIST INVOKEVIRTUAL owner CDATA #REQUIRED>
-<!ELEMENT INVOKEDYNAMIC ( bsmArgs+ )>
-<!ATTLIST INVOKEDYNAMIC desc CDATA #REQUIRED>
-<!ATTLIST INVOKEDYNAMIC name CDATA #REQUIRED>
-<!ATTLIST INVOKEDYNAMIC bsm CDATA #REQUIRED>
-<!ELEMENT bsmArgs EMPTY>
-<!ATTLIST bsmArgs cst CDATA #REQUIRED>
-<!ATTLIST bsmArgs desc CDATA #REQUIRED>
-<!ELEMENT IOR EMPTY>
-<!ELEMENT IREM EMPTY>
-<!ELEMENT IRETURN EMPTY>
-<!ELEMENT ISHL EMPTY>
-<!ELEMENT ISHR EMPTY>
-<!ELEMENT ISTORE EMPTY>
-<!ATTLIST ISTORE var CDATA #REQUIRED>
-<!ELEMENT ISUB EMPTY>
-<!ELEMENT IUSHR EMPTY>
-<!ELEMENT IXOR EMPTY>
-<!ELEMENT JSR EMPTY>
-<!ATTLIST JSR label CDATA #REQUIRED>
-<!ELEMENT L2D EMPTY>
-<!ELEMENT L2F EMPTY>
-<!ELEMENT L2I EMPTY>
-<!ELEMENT LADD EMPTY>
-<!ELEMENT LALOAD EMPTY>
-<!ELEMENT LAND EMPTY>
-<!ELEMENT LASTORE EMPTY>
-<!ELEMENT LCMP EMPTY>
-<!ELEMENT LCONST_0 EMPTY>
-<!ELEMENT LCONST_1 EMPTY>
-<!ELEMENT LDC EMPTY>
-<!--
- All characters out of interval 0x20 to 0x7f (inclusive) must
- be encoded (\uXXXX) and character '\' must be replaced by "\\"
--->
-<!ATTLIST LDC cst CDATA #REQUIRED>
-<!ATTLIST LDC desc CDATA #REQUIRED>
-<!ELEMENT LDIV EMPTY>
-<!ELEMENT LLOAD EMPTY>
-<!ATTLIST LLOAD var CDATA #REQUIRED>
-<!ELEMENT LMUL EMPTY>
-<!ELEMENT LNEG EMPTY>
-<!ELEMENT LOR EMPTY>
-<!ELEMENT LREM EMPTY>
-<!ELEMENT LRETURN EMPTY>
-<!ELEMENT LSHL EMPTY>
-<!ELEMENT LSHR EMPTY>
-<!ELEMENT LSTORE EMPTY>
-<!ATTLIST LSTORE var CDATA #REQUIRED>
-<!ELEMENT LSUB EMPTY>
-<!ELEMENT LUSHR EMPTY>
-<!ELEMENT LXOR EMPTY>
-<!ELEMENT MONITORENTER EMPTY>
-<!ELEMENT MONITOREXIT EMPTY>
-<!ELEMENT MULTIANEWARRAY EMPTY>
-<!ATTLIST MULTIANEWARRAY desc CDATA #REQUIRED>
-<!ATTLIST MULTIANEWARRAY dims CDATA #REQUIRED>
-<!ELEMENT NEW EMPTY>
-<!ATTLIST NEW desc CDATA #REQUIRED>
-<!ELEMENT NEWARRAY EMPTY>
-<!ATTLIST NEWARRAY value CDATA #REQUIRED>
-<!ELEMENT NOP EMPTY>
-<!ELEMENT POP EMPTY>
-<!ELEMENT POP2 EMPTY>
-<!ELEMENT PUTFIELD EMPTY>
-<!ATTLIST PUTFIELD desc CDATA #REQUIRED>
-<!ATTLIST PUTFIELD name CDATA #REQUIRED>
-<!ATTLIST PUTFIELD owner CDATA #REQUIRED>
-<!ELEMENT PUTSTATIC EMPTY>
-<!ATTLIST PUTSTATIC desc CDATA #REQUIRED>
-<!ATTLIST PUTSTATIC name CDATA #REQUIRED>
-<!ATTLIST PUTSTATIC owner CDATA #REQUIRED>
-<!ELEMENT RET EMPTY>
-<!ATTLIST RET var CDATA #REQUIRED>
-<!ELEMENT RETURN EMPTY>
-<!ELEMENT SALOAD EMPTY>
-<!ELEMENT SASTORE EMPTY>
-<!ELEMENT SIPUSH EMPTY>
-<!ATTLIST SIPUSH value CDATA #REQUIRED>
-
-<!ELEMENT LOOKUPSWITCH ( label+ )>
-<!ATTLIST LOOKUPSWITCH dflt CDATA #REQUIRED>
-
-<!ELEMENT TABLESWITCH ( label+ )>
-<!ATTLIST TABLESWITCH dflt CDATA #REQUIRED>
-<!ATTLIST TABLESWITCH max CDATA #REQUIRED>
-<!ATTLIST TABLESWITCH min CDATA #REQUIRED>
-
-<!ELEMENT label EMPTY>
-<!ATTLIST label key CDATA #IMPLIED>
-<!ATTLIST label name CDATA #REQUIRED>
-
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/package.html b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/package.html
deleted file mode 100644
index d7bbe66..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/package.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<html>
-<!--
- * ASM XML Adapter
- * Copyright (c) 2004-2011, Eugene Kuleshov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides <a href="http://sax.sourceforge.net/">SAX 2.0</a> adapters for ASM
-visitors to convert classes to and from XML.
-These adapters can be chained with other SAX compliant content handlers and
-filters, eg. XSLT or XQuery engines. This package is bundled as
-a separate <tt>asm-xml.jar</tt> library and requires <tt>asm.jar</tt>.
-<p>
-<tt>ASMContentHandler</tt> and <tt>SAXClassAdapter/SAXCodeAdapter</tt>
-are using <a href="asm-xml.dtd">asm-xml.dtd</a>.
-Here is the example of bytecode to bytecode XSLT transformation.
-
-<pre>
- SAXTransformerFactory saxtf = ( SAXTransformerFactory) TransformerFactory.newInstance();
- Templates templates = saxtf.newTemplates( xsltSource);
-
- TransformerHandler handler = saxtf.newTransformerHandler( templates);
- handler.setResult( new SAXResult( new ASMContentHandler( outputStream, computeMax)));
-
- ClassReader cr = new ClassReader( bytecode);
- cr.accept( new SAXClassAdapter( handler, cr.getVersion(), false), false);
-</pre>
-
-See JAXP and SAX documentation for more detils.
-
-<p>
-There are few illustrations of the bytecode transformation with XSLT in
-examples directory. The following XSLT procesors has been tested.
-
-<blockquote>
-<table border="1" cellspacing="0" cellpadding="3">
-<tr>
-<th>Engine</td>
-<th>javax.xml.transform.TransformerFactory property</td>
-</tr>
-
-<tr>
-<td>jd.xslt</td>
-<td>jd.xml.xslt.trax.TransformerFactoryImpl</td>
-</tr>
-
-<tr>
-<td>Saxon</td>
-<td>net.sf.saxon.TransformerFactoryImpl</td>
-</tr>
-
-<tr>
-<td>Caucho</td>
-<td>com.caucho.xsl.Xsl</td>
-</tr>
-
-<tr>
-<td>Xalan interpeter</td>
-<td>org.apache.xalan.processor.TransformerFactory</td>
-</tr>
-
-<tr>
-<td>Xalan xsltc</td>
-<td>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</td>
-</tr>
-</table>
-</blockquote>
-
-@since ASM 1.4.3
-
-</body>
-</html>