aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Jungmann2014-05-01 09:40:47 (EDT)
committertware2014-05-02 09:04:32 (EDT)
commit9cfd226f814f5cf576f8a0460f867c8fa4c8e66e (patch)
treec67d8a7030f5d615e04496c64ae6128c2401be51
parent1ba20036cd43ca2ab80a74f6c14a78d7a98b7db2 (diff)
downloadeclipselink.runtime-9cfd226f814f5cf576f8a0460f867c8fa4c8e66e.zip
eclipselink.runtime-9cfd226f814f5cf576f8a0460f867c8fa4c8e66e.tar.gz
eclipselink.runtime-9cfd226f814f5cf576f8a0460f867c8fa4c8e66e.tar.bz2
Bug#429992: EclipseLink silently ignores Entity classes with lambda expressions (adopt ASM 5.0.1 to support JavaSE 8 language features in entites)
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
-rw-r--r--dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/dbws/SOAPResponseClassLoader.java4
-rw-r--r--dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr/XRClassWriter.java8
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicClassWriter.java14
-rw-r--r--jpa/org.eclipse.persistence.jpa/META-INF/MANIFEST.MF2
-rw-r--r--jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java64
-rw-r--r--jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/ClassWeaver.java139
-rw-r--r--jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/MethodWeaver.java64
-rw-r--r--jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/PersistenceWeaver.java9
-rw-r--r--jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/RestAdapterClassWriter.java8
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java20
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/MappingsGenerator.java16
-rw-r--r--sdo/org.eclipse.persistence.sdo/src/org/eclipse/persistence/sdo/helper/DynamicClassWriter.java18
-rw-r--r--utils/eclipselink.utils.sigcompare/src/eclipselink/utils/sigcompare/SignatureImporter.java26
13 files changed, 171 insertions, 221 deletions
diff --git a/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/dbws/SOAPResponseClassLoader.java b/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/dbws/SOAPResponseClassLoader.java
index a1a3696..179e47d 100644
--- a/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/dbws/SOAPResponseClassLoader.java
+++ b/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/dbws/SOAPResponseClassLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -64,7 +64,7 @@ public class SOAPResponseClassLoader extends ClassLoader {
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, SOAP_RESPONSE_CLASSNAME_SLASHES, "<init>", "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, SOAP_RESPONSE_CLASSNAME_SLASHES, "<init>", "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
diff --git a/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr/XRClassWriter.java b/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr/XRClassWriter.java
index cfae77f..1a4ee31 100644
--- a/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr/XRClassWriter.java
+++ b/dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr/XRClassWriter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -77,7 +77,7 @@ public class XRClassWriter extends DynamicClassWriter {
cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, classNameAsSlashes, null, XR_DYNAMIC_ENTITY_COLLECTION_CLASSNAME_SLASHES, null);
mv = cw.visitMethod(ACC_PUBLIC, INIT, "()V", null, null);
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, XR_DYNAMIC_ENTITY_COLLECTION_CLASSNAME_SLASHES, INIT, "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, XR_DYNAMIC_ENTITY_COLLECTION_CLASSNAME_SLASHES, INIT, "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
@@ -92,7 +92,7 @@ public class XRClassWriter extends DynamicClassWriter {
mv = cw.visitMethod(ACC_STATIC, CLINIT, "()V", null, null);
mv.visitTypeInsn(NEW, XR_DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES);
mv.visitInsn(DUP);
- mv.visitMethodInsn(INVOKESPECIAL, XR_DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES, INIT, "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, XR_DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES, INIT, "()V", false);
mv.visitFieldInsn(PUTSTATIC, classNameAsSlashes, PROPERTIES_MANAGER_FIELD, "L" + XR_DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES + ";");
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
@@ -103,7 +103,7 @@ public class XRClassWriter extends DynamicClassWriter {
// }
mv = cw.visitMethod(ACC_PUBLIC, INIT, "()V", null, null);
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, XR_DYNAMIC_ENTITY_CLASSNAME_SLASHES, INIT, "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, XR_DYNAMIC_ENTITY_CLASSNAME_SLASHES, INIT, "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicClassWriter.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicClassWriter.java
index 9d39457..3864d30 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicClassWriter.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicClassWriter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -186,7 +186,7 @@ public class DynamicClassWriter implements EclipseLinkClassWriter {
MethodVisitor mv = cw.visitMethod(ACC_STATIC, CLINIT, "()V", null, null);
mv.visitTypeInsn(NEW, DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES);
mv.visitInsn(DUP);
- mv.visitMethodInsn(INVOKESPECIAL, DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES, INIT, "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES, INIT, "()V", false);
mv.visitFieldInsn(PUTSTATIC, classNameAsSlashes, PROPERTIES_MANAGER_FIELD, "L" + DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES + ";");
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
@@ -196,7 +196,7 @@ public class DynamicClassWriter implements EclipseLinkClassWriter {
// }
mv = cw.visitMethod(ACC_PUBLIC, INIT, "()V", null, null);
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, parentClassNameAsSlashes, INIT, "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, parentClassNameAsSlashes, INIT, "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
@@ -254,7 +254,7 @@ public class DynamicClassWriter implements EclipseLinkClassWriter {
// Add the "values()" method
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "values", "()[L" + internalClassName + ";", null, null);
mv.visitFieldInsn(GETSTATIC, internalClassName, "$VALUES", "[L" + internalClassName + ";");
- mv.visitMethodInsn(INVOKEVIRTUAL, "[L" + internalClassName + ";", "clone", "()Ljava/lang/Object;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "[L" + internalClassName + ";", "clone", "()Ljava/lang/Object;", false);
mv.visitTypeInsn(CHECKCAST, "[L" + internalClassName + ";");
mv.visitInsn(ARETURN);
mv.visitMaxs(1, 0);
@@ -263,7 +263,7 @@ public class DynamicClassWriter implements EclipseLinkClassWriter {
mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "valueOf", "(Ljava/lang/String;)L" + internalClassName + ";", null, null);
mv.visitLdcInsn(Type.getType("L" + internalClassName + ";"));
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Enum", "valueOf", "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;");
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Enum", "valueOf", "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;", false);
mv.visitTypeInsn(CHECKCAST, internalClassName);
mv.visitInsn(ARETURN);
mv.visitMaxs(2, 1);
@@ -274,7 +274,7 @@ public class DynamicClassWriter implements EclipseLinkClassWriter {
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ALOAD, 1);
mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Enum", "<init>", "(Ljava/lang/String;I)V");
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Enum", "<init>", "(Ljava/lang/String;I)V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(3, 3);
@@ -294,7 +294,7 @@ public class DynamicClassWriter implements EclipseLinkClassWriter {
} else {
mv.visitIntInsn(SIPUSH, i);
}
- mv.visitMethodInsn(INVOKESPECIAL, internalClassName, "<init>", "(Ljava/lang/String;I)V");
+ mv.visitMethodInsn(INVOKESPECIAL, internalClassName, "<init>", "(Ljava/lang/String;I)V", false);
mv.visitFieldInsn(PUTSTATIC, internalClassName, enumValue, "L" + internalClassName + ";");
lastCount = i;
}
diff --git a/jpa/org.eclipse.persistence.jpa/META-INF/MANIFEST.MF b/jpa/org.eclipse.persistence.jpa/META-INF/MANIFEST.MF
index ce45cfc..5eb1d70 100644
--- a/jpa/org.eclipse.persistence.jpa/META-INF/MANIFEST.MF
+++ b/jpa/org.eclipse.persistence.jpa/META-INF/MANIFEST.MF
@@ -41,7 +41,7 @@ Created-By: 1.6.0_21 (Sun Microsystems Inc.)
HK2-Bundle-Name: org.eclipse.persistence:org.eclipse.persistence.jpa
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.persistence.core;bundle-version="2.6.0";visibility:=reexport,
- org.eclipse.persistence.asm;bundle-version="3.3.1";resolution:=optional
+ org.eclipse.persistence.asm;bundle-version="5.0.1";resolution:=optional
Bundle-Vendor: Eclipse.org - EclipseLink Project
Bundle-Version: 2.6.0.qualifier
Bundle-ManifestVersion: 2
diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java
index 822b200..3e9324c 100644
--- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java
+++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle, Hans Harz, Andrew Rustleund. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle, Hans Harz, Andrew Rustleund. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -17,6 +17,8 @@
* 08/10/2011-2.3 Lloyd Fernandes : Bug 336133 - Validation error during processing on parameterized generic OneToMany Entity relationship from MappedSuperclass
* 10/05/2012-2.4.1 Guy Pelletier
* - 373092: Exceptions using generics, embedded key and entity inheritance
+ * 19/04/2014-2.6 Lukas Jungmann
+ * - 429992: JavaSE 8/ASM 5.0.1 support (EclipseLink silently ignores Entity classes with lambda expressions)
******************************************************************************/
package org.eclipse.persistence.internal.jpa.metadata.accessors.objects;
@@ -34,8 +36,8 @@ 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;
import org.eclipse.persistence.internal.libraries.asm.Type;
-import org.eclipse.persistence.internal.libraries.asm.commons.EmptyVisitor;
/**
* INTERNAL: A metadata factory that uses ASM technology and no reflection
@@ -199,13 +201,14 @@ public class MetadataAsmFactory extends MetadataFactory {
/**
* Walk the class byte codes and collect the class info.
*/
- public class ClassMetadataVisitor implements ClassVisitor {
+ public class ClassMetadataVisitor extends ClassVisitor {
private boolean isLazy;
private boolean processedMemeber;
private MetadataClass classMetadata;
ClassMetadataVisitor(MetadataClass metadataClass, boolean isLazy) {
+ super(Opcodes.ASM5);
this.isLazy = isLazy;
this.classMetadata = metadataClass;
}
@@ -226,13 +229,6 @@ public class MetadataAsmFactory extends MetadataFactory {
}
}
- /**
- * Reference to the inner class, the inner class must be processed
- * independently
- */
- public void visitInnerClass(String name, String outerName, String innerName, int access) {
- }
-
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
this.processedMemeber = true;
if (this.classMetadata.isLazy()) {
@@ -260,17 +256,6 @@ public class MetadataAsmFactory extends MetadataFactory {
return null;
}
- public void visitAttribute(Attribute attr) {
- }
-
- public void visitEnd() {
- }
-
- public void visitSource(String source, String debug) {
- }
-
- public void visitOuterClass(String owner, String name, String desc) {
- }
}
/**
@@ -279,7 +264,7 @@ public class MetadataAsmFactory extends MetadataFactory {
*
* @see MetadataAnnotationArrayVisitor for population of array attributes
*/
- class MetadataAnnotationVisitor implements AnnotationVisitor {
+ class MetadataAnnotationVisitor extends AnnotationVisitor {
/**
* Element the annotation is being applied to. If this is null the
@@ -294,12 +279,14 @@ public class MetadataAsmFactory extends MetadataFactory {
private MetadataAnnotation annotation;
MetadataAnnotationVisitor(MetadataAnnotatedElement element, String name) {
+ super(Opcodes.ASM5);
this.element = element;
this.annotation = new MetadataAnnotation();
this.annotation.setName(processDescription(name, false).get(0));
}
public MetadataAnnotationVisitor(MetadataAnnotation annotation) {
+ super(Opcodes.ASM5);
this.annotation = annotation;
}
@@ -333,7 +320,7 @@ public class MetadataAsmFactory extends MetadataFactory {
* Specialized visitor to handle the population of arrays of annotation
* values.
*/
- class MetadataAnnotationArrayVisitor implements AnnotationVisitor {
+ class MetadataAnnotationArrayVisitor extends AnnotationVisitor {
private MetadataAnnotation annotation;
@@ -342,6 +329,7 @@ public class MetadataAsmFactory extends MetadataFactory {
private List<Object> values;
public MetadataAnnotationArrayVisitor(MetadataAnnotation annotation, String name) {
+ super(Opcodes.ASM5);
this.annotation = annotation;
this.attributeName = name;
this.values = new ArrayList<Object>();
@@ -362,11 +350,6 @@ public class MetadataAsmFactory extends MetadataFactory {
return new MetadataAnnotationVisitor(mda);
}
- public AnnotationVisitor visitArray(String name) {
- // Ignore nested array case?
- return null;
- }
-
public void visitEnd() {
this.annotation.addAttribute(this.attributeName, this.values.toArray());
}
@@ -376,12 +359,13 @@ public class MetadataAsmFactory extends MetadataFactory {
* Factory for the creation of {@link MetadataField} handling basic type,
* generics, and annotations.
*/
- class MetadataFieldVisitor implements FieldVisitor {
+ class MetadataFieldVisitor extends FieldVisitor {
private MetadataField field;
public MetadataFieldVisitor(MetadataClass classMetadata, int access, String name, String desc, String signature, Object value) {
- this.field = new MetadataField(classMetadata);
+ super(Opcodes.ASM5);
+ this.field = new MetadataField(classMetadata);
this.field.setModifiers(access);
this.field.setName(name);
this.field.setAttributeName(name);
@@ -396,9 +380,6 @@ public class MetadataAsmFactory extends MetadataFactory {
return null;
}
- public void visitAttribute(Attribute attr) {
- }
-
public void visitEnd() {
this.field.getDeclaringClass().addField(this.field);
}
@@ -410,11 +391,12 @@ public class MetadataAsmFactory extends MetadataFactory {
*/
// Note: Subclassed EmptyListener to minimize signature requirements for
// ignored MethodVisitor API
- class MetadataMethodVisitor extends EmptyVisitor {
+ class MetadataMethodVisitor extends MethodVisitor {
private MetadataMethod method;
public MetadataMethodVisitor(MetadataClass classMetadata, int access, String name, String desc, String signature, String[] exceptions) {
+ super(Opcodes.ASM5);
this.method = new MetadataMethod(MetadataAsmFactory.this, classMetadata);
this.method.setName(name);
@@ -438,20 +420,6 @@ public class MetadataAsmFactory extends MetadataFactory {
}
return null;
}
- @Override
- public AnnotationVisitor visitAnnotationDefault() {
- return null;
- }
-
- @Override
- public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
- return null;
- }
-
- @Override
- public AnnotationVisitor visitAnnotation(String name, String desc) {
- return null;
- }
/**
* At the end of visiting this method add it to the
diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/ClassWeaver.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/ClassWeaver.java
index 9ac90c4..83d9590 100644
--- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/ClassWeaver.java
+++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/ClassWeaver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -14,19 +14,20 @@
* - 323043: application.xml module ordering may cause weaving not to occur causing an NPE.
* warn if expected "_persistence_*_vh" method not found
* instead of throwing NPE during deploy validation.
+ * 19/04/2014-2.6 Lukas Jungmann
+ * - 429992: JavaSE 8/ASM 5.0.1 support (EclipseLink silently ignores Entity classes with lambda expressions)
******************************************************************************/
package org.eclipse.persistence.internal.jpa.weaving;
import java.util.Iterator;
import org.eclipse.persistence.internal.helper.Helper;
-import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
+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.Type;
-import org.eclipse.persistence.internal.libraries.asm.commons.SerialVersionUIDAdder;
/**
* INTERNAL: Weaves classes to allow them to support EclipseLink indirection.
@@ -38,7 +39,7 @@ import org.eclipse.persistence.internal.libraries.asm.commons.SerialVersionUIDAd
* @see org.eclipse.persistence.internal.weaving.MethodWeaver
*/
-public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
+public class ClassWeaver extends ClassVisitor implements Opcodes {
// PersistenceWeaved
public static final String PERSISTENCE_WEAVED_SHORT_SIGNATURE = "org/eclipse/persistence/internal/weaving/PersistenceWeaved";
@@ -155,28 +156,28 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
String wrapper = wrapperFor(attribute.getReferenceClassType().getSort());
switch (attribute.getReferenceClassType().getSort()) {
case Type.BOOLEAN:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "booleanValue", "()Z");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "booleanValue", "()Z", false);
return;
case Type.BYTE:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "byteValue", "()B");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "byteValue", "()B", false);
return;
case Type.CHAR:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "charValue", "()C");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "charValue", "()C", false);
return;
case Type.SHORT:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "shortValue", "()S");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "shortValue", "()S", false);
return;
case Type.INT:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "intValue", "()I");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "intValue", "()I", false);
return;
case Type.FLOAT:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "floatValue", "()F");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "floatValue", "()F", false);
return;
case Type.LONG:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "longValue", "()J");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "longValue", "()J", false);
return;
case Type.DOUBLE:
- visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "doubleValue", "()D");
+ visitor.visitMethodInsn(INVOKEVIRTUAL, wrapper, "doubleValue", "()D", false);
return;
}
}
@@ -211,8 +212,8 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
return isJAXBOnPath;
}
- public ClassWeaver(ClassWriter classWriter, ClassDetails classDetails) {
- super(classWriter);
+ public ClassWeaver(ClassVisitor classWriter, ClassDetails classDetails) {
+ super(ASM5, classWriter);
this.classDetails = classDetails;
}
@@ -316,8 +317,8 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_addPC.visitVarInsn(ALOAD, 1);
cv_addPC.visitVarInsn(ALOAD, 2);
cv_addPC.visitVarInsn(ALOAD, 3);
- cv_addPC.visitMethodInsn(INVOKESPECIAL, PCE_SHORT_SIGNATURE, "<init>", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V");
- cv_addPC.visitMethodInsn(INVOKEINTERFACE, PCL_SHORT_SIGNATURE, "propertyChange", "(" + PCE_SIGNATURE + ")V");
+ cv_addPC.visitMethodInsn(INVOKESPECIAL, PCE_SHORT_SIGNATURE, "<init>", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", false);
+ cv_addPC.visitMethodInsn(INVOKEINTERFACE, PCL_SHORT_SIGNATURE, "propertyChange", "(" + PCE_SIGNATURE + ")V", true);
// }
cv_addPC.visitLabel(l0);
@@ -357,9 +358,9 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
if (attributeDetails.hasField()) {
cv_init_VH.visitVarInsn(ALOAD, 0);
cv_init_VH.visitFieldInsn(GETFIELD, className, attribute, attributeDetails.getReferenceClassType().getDescriptor());
- cv_init_VH.visitMethodInsn(INVOKESPECIAL, VH_SHORT_SIGNATURE, "<init>", "(Ljava/lang/Object;)V");
+ cv_init_VH.visitMethodInsn(INVOKESPECIAL, VH_SHORT_SIGNATURE, "<init>", "(Ljava/lang/Object;)V", false);
} else {
- cv_init_VH.visitMethodInsn(INVOKESPECIAL, VH_SHORT_SIGNATURE, "<init>", "()V");
+ cv_init_VH.visitMethodInsn(INVOKESPECIAL, VH_SHORT_SIGNATURE, "<init>", "()V", false);
}
cv_init_VH.visitFieldInsn(PUTFIELD, className, PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, VHI_SIGNATURE);
@@ -367,7 +368,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_init_VH.visitVarInsn(ALOAD, 0);
cv_init_VH.visitFieldInsn(GETFIELD, className, PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, VHI_SIGNATURE);
cv_init_VH.visitInsn(ICONST_1);
- cv_init_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "setIsNewlyWeavedValueHolder", "(Z)V");
+ cv_init_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "setIsNewlyWeavedValueHolder", "(Z)V", true);
// }
cv_init_VH.visitLabel(l0);
@@ -395,18 +396,18 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
// _persistence_initialize_attributeName_vh();
cv_get_VH.visitVarInsn(ALOAD, 0);
- cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V");
+ cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V", false);
// if (_toplink_foo_vh.isCoordinatedWithProperty() ||
// _toplink_foo_vh.isNewlyWeavedValueHolder()){
cv_get_VH.visitVarInsn(ALOAD, 0);
cv_get_VH.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, VHI_SIGNATURE);
- cv_get_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "isCoordinatedWithProperty", "()Z");
+ cv_get_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "isCoordinatedWithProperty", "()Z", true);
Label l0 = new Label();
cv_get_VH.visitJumpInsn(IFNE, l0);
cv_get_VH.visitVarInsn(ALOAD, 0);
cv_get_VH.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, VHI_SIGNATURE);
- cv_get_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "isNewlyWeavedValueHolder", "()Z");
+ cv_get_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "isNewlyWeavedValueHolder", "()Z", true);
Label l1 = new Label();
cv_get_VH.visitJumpInsn(IFEQ, l1);
cv_get_VH.visitLabel(l0);
@@ -414,10 +415,10 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
// EntityC object = (EntityC)getFoo();
if (attributeDetails.getGetterMethodName() != null) {
- cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), attributeDetails.getGetterMethodName(), "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";");
+ cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), attributeDetails.getGetterMethodName(), "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";", false);
cv_get_VH.visitTypeInsn(CHECKCAST, attributeDetails.getReferenceClassName().replace('.', '/'));
} else {
- cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), PERSISTENCE_GET + attributeDetails.attributeName, "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";");
+ cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), PERSISTENCE_GET + attributeDetails.attributeName, "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";", false);
}
cv_get_VH.visitVarInsn(ASTORE, 1);
@@ -425,16 +426,16 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_get_VH.visitVarInsn(ALOAD, 1);
cv_get_VH.visitVarInsn(ALOAD, 0);
cv_get_VH.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, VHI_SIGNATURE);
- cv_get_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;");
+ cv_get_VH.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;", true);
cv_get_VH.visitJumpInsn(IF_ACMPEQ, l1);
// setFoo(object);
cv_get_VH.visitVarInsn(ALOAD, 0);
cv_get_VH.visitVarInsn(ALOAD, 1);
if (attributeDetails.getSetterMethodName() != null) {
- cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), attributeDetails.getSetterMethodName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V");
+ cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), attributeDetails.getSetterMethodName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V", false);
} else {
- cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), PERSISTENCE_SET + attributeDetails.getAttributeName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V");
+ cv_get_VH.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), PERSISTENCE_SET + attributeDetails.getAttributeName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V", false);
}
// }
@@ -471,22 +472,22 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
// if (valueholderinterface.isInstantiated()){
cv_set_value.visitVarInsn(ALOAD, 1);
- cv_set_value.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "isInstantiated", "()Z");
+ cv_set_value.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "isInstantiated", "()Z", true);
Label l0 = new Label();
cv_set_value.visitJumpInsn(IFEQ, l0);
// Object object = getFoo();
cv_set_value.visitVarInsn(ALOAD, 0);
if (attributeDetails.getGetterMethodName() != null) {
- cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, attributeDetails.getGetterMethodName(), "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";");
+ cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, attributeDetails.getGetterMethodName(), "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";", false);
} else {
- cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, PERSISTENCE_GET + attributeDetails.attributeName, "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";");
+ cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, PERSISTENCE_GET + attributeDetails.attributeName, "()L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";", false);
}
cv_set_value.visitVarInsn(ASTORE, 2);
// Object value = valueholderinterface.getValue();
cv_set_value.visitVarInsn(ALOAD, 1);
- cv_set_value.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;");
+ cv_set_value.visitMethodInsn(INVOKEINTERFACE, VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;", true);
cv_set_value.visitVarInsn(ASTORE, 3);
// if (object != value){
@@ -498,7 +499,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_set_value.visitVarInsn(ALOAD, 0);
cv_set_value.visitVarInsn(ALOAD, 3);
cv_set_value.visitTypeInsn(CHECKCAST, attributeDetails.getReferenceClassName().replace('.', '/'));
- cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, attributeDetails.getSetterMethodName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V");
+ cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, attributeDetails.getSetterMethodName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V", false);
//}
cv_set_value.visitLabel(l0);
} else {
@@ -508,7 +509,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_set_value.visitVarInsn(ALOAD, 0);
cv_set_value.visitVarInsn(ALOAD, 3);
cv_set_value.visitTypeInsn(CHECKCAST, attributeDetails.getReferenceClassName().replace('.', '/'));
- cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, PERSISTENCE_SET + attributeDetails.getAttributeName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V");
+ cv_set_value.visitMethodInsn(INVOKEVIRTUAL, className, PERSISTENCE_SET + attributeDetails.getAttributeName(), "(L" + attributeDetails.getReferenceClassName().replace('.', '/') + ";)V", false);
// }
cv_set_value.visitLabel(l1);
cv_set_value.visitFrame(F_SAME, 0, null, 0, null);
@@ -557,20 +558,20 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitLdcInsn(attribute);
// _persistence_checkFetchedForSet("variableName");
- cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V");
+ cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V", false);
}
if (classDetails.shouldWeaveChangeTracking()) {
if (attributeDetails.weaveValueHolders()) {
// _persistence_initialize_variableName_vh();
cv_set.visitVarInsn(ALOAD, 0);
- cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V");
+ cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V", false);
// _persistenc_variableName_vh.getValue();
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
- cv_set.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;");
+ cv_set.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;", true);
// Add the cast:
// (<VariableClass>)_persistenc_variableName_vh.getValue()
@@ -602,32 +603,32 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
if (wrapper != null) {
// invoke the constructor for wrapping
// e.g. new Integer(variableName)
- cv_set.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V");
+ cv_set.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V", false);
// wrap the method argument
// e.g. new Integer(argument)
cv_set.visitTypeInsn(NEW, wrapper);
cv_set.visitInsn(DUP);
cv_set.visitVarInsn(opcode, 1);
- cv_set.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V");
+ cv_set.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V", false);
} else {
// if we are not wrapping the argument, just load it
cv_set.visitVarInsn(ALOAD, 1);
}
// _persistence_propertyChange("variableName", variableName,
// argument);
- cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_propertyChange", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V");
+ cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_propertyChange", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", false);
} else {
if (attributeDetails.weaveValueHolders()) {
// _persistence_initialize_variableName_vh();
cv_set.visitVarInsn(ALOAD, 0);
- cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V");
+ cv_set.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V", false);
// _persistenc_variableName_vh.getValue();
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
- cv_set.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;");
+ cv_set.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;", true);
// Add the cast:
// (<VariableClass>)_persistenc_variableName_vh.getValue()
@@ -651,7 +652,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
cv_set.visitVarInsn(ALOAD, 1);
- cv_set.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "setValue", "(Ljava/lang/Object;)V");
+ cv_set.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "setValue", "(Ljava/lang/Object;)V", true);
}
cv_set.visitInsn(RETURN);
@@ -678,19 +679,19 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_get.visitVarInsn(ALOAD, 0);
cv_get.visitLdcInsn(attribute);
// _persistence_checkFetched("variableName");
- cv_get.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_checkFetched", "(Ljava/lang/String;)V");
+ cv_get.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_checkFetched", "(Ljava/lang/String;)V", false);
}
if (attributeDetails.weaveValueHolders()) {
// _persistence_initialize_variableName_vh();
cv_get.visitVarInsn(ALOAD, 0);
- cv_get.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V");
+ cv_get.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, "()V", false);
// _persistenc_variableName_vh.getValue();
cv_get.visitVarInsn(ALOAD, 0);
cv_get.visitVarInsn(ALOAD, 0);
cv_get.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attribute + PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
- cv_get.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;");
+ cv_get.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;", true);
// Add the cast:
// (<VariableClass>)_persistenc_variableName_vh.getValue()
@@ -740,7 +741,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
// super._persistence_post_clone()
if (classDetails.getSuperClassDetails() != null && classDetails.getSuperClassDetails().shouldWeaveInternal()) {
cv_clone.visitVarInsn(ALOAD, 0);
- cv_clone.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "_persistence_post_clone", "()Ljava/lang/Object;");
+ cv_clone.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "_persistence_post_clone", "()Ljava/lang/Object;", false);
}
if (classDetails.shouldWeaveValueHolders()) {
@@ -757,7 +758,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_clone.visitVarInsn(ALOAD, 0);
cv_clone.visitVarInsn(ALOAD, 0);
cv_clone.visitFieldInsn(GETFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
- cv_clone.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "clone", "()Ljava/lang/Object;");
+ cv_clone.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "clone", "()Ljava/lang/Object;", true);
cv_clone.visitTypeInsn(CHECKCAST, ClassWeaver.VHI_SHORT_SIGNATURE);
cv_clone.visitFieldInsn(PUTFIELD, classDetails.getClassName(), PERSISTENCE_FIELDNAME_PREFIX + attributeDetails.getAttributeName() + PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
cv_clone.visitLabel(label);
@@ -854,7 +855,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
// return super.clone();
cv_clone.visitVarInsn(ALOAD, 0);
- cv_clone.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "clone", "()Ljava/lang/Object;");
+ cv_clone.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "clone", "()Ljava/lang/Object;", false);
cv_clone.visitInsn(ARETURN);
cv_clone.visitMaxs(0, 0);
@@ -877,13 +878,13 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_new.visitTypeInsn(NEW, classDetails.getClassName());
cv_new.visitInsn(DUP);
if (!classDetails.canWeaveConstructorOptimization()) {
- cv_new.visitMethodInsn(INVOKESPECIAL, classDetails.getClassName(), "<init>", "()V");
+ cv_new.visitMethodInsn(INVOKESPECIAL, classDetails.getClassName(), "<init>", "()V", false);
cv_new.visitInsn(ARETURN);
cv_new.visitMaxs(0, 0);
return;
} else {
cv_new.visitVarInsn(ALOAD, 1);
- cv_new.visitMethodInsn(INVOKESPECIAL, classDetails.getClassName(), "<init>", "(" + PERSISTENCE_OBJECT_SIGNATURE + ")V");
+ cv_new.visitMethodInsn(INVOKESPECIAL, classDetails.getClassName(), "<init>", "(" + PERSISTENCE_OBJECT_SIGNATURE + ")V", false);
}
cv_new.visitInsn(ARETURN);
cv_new.visitMaxs(0, 0);
@@ -894,11 +895,11 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_constructor.visitVarInsn(ALOAD, 0);
if (classDetails.getSuperClassDetails() == null) {
// super();
- cv_constructor.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "<init>", "()V");
+ cv_constructor.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "<init>", "()V", false);
} else {
// super(factory);
cv_constructor.visitVarInsn(ALOAD, 1);
- cv_constructor.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "<init>", "(" + PERSISTENCE_OBJECT_SIGNATURE + ")V");
+ cv_constructor.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "<init>", "(" + PERSISTENCE_OBJECT_SIGNATURE + ")V", false);
}
cv_constructor.visitInsn(RETURN);
cv_constructor.visitMaxs(0, 0);
@@ -939,7 +940,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
if (wrapper != null) {
// Call valueOf on the wrapper (more optimal than
// constructor).
- cv_get.visitMethodInsn(INVOKESTATIC, wrapper, "valueOf", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")L" + wrapper + ";");
+ cv_get.visitMethodInsn(INVOKESTATIC, wrapper, "valueOf", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")L" + wrapper + ";", false);
}
cv_get.visitInsn(ARETURN);
@@ -955,7 +956,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
} else {
cv_get.visitVarInsn(ALOAD, 0);
cv_get.visitVarInsn(ALOAD, 1);
- cv_get.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "_persistence_get", "(Ljava/lang/String;)Ljava/lang/Object;");
+ cv_get.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "_persistence_get", "(Ljava/lang/String;)Ljava/lang/Object;", false);
}
cv_get.visitInsn(ARETURN);
@@ -998,7 +999,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_set.visitVarInsn(ALOAD, 0);
cv_set.visitVarInsn(ALOAD, 1);
cv_set.visitVarInsn(ALOAD, 2);
- cv_set.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "_persistence_set", "(Ljava/lang/String;Ljava/lang/Object;)V");
+ cv_set.visitMethodInsn(INVOKESPECIAL, classDetails.getSuperClassName(), "_persistence_set", "(Ljava/lang/String;Ljava/lang/Object;)V", false);
}
cv_set.visitInsn(RETURN);
@@ -1151,7 +1152,7 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
cv_isAttributeFetched.visitVarInsn(ALOAD, 0);
cv_isAttributeFetched.visitFieldInsn(GETFIELD, classDetails.getClassName(), "_persistence_fetchGroup", FETCHGROUP_SIGNATURE);
cv_isAttributeFetched.visitVarInsn(ALOAD, 1);
- cv_isAttributeFetched.visitMethodInsn(INVOKEVIRTUAL, FETCHGROUP_SHORT_SIGNATURE, "containsAttributeInternal", "(Ljava/lang/String;)Z");
+ cv_isAttributeFetched.visitMethodInsn(INVOKEVIRTUAL, FETCHGROUP_SHORT_SIGNATURE, "containsAttributeInternal", "(Ljava/lang/String;)Z", false);
Label gotoFalse = new Label();
cv_isAttributeFetched.visitJumpInsn(IFEQ, gotoFalse);
cv_isAttributeFetched.visitLabel(gotoTrue);
@@ -1167,13 +1168,13 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
MethodVisitor cv_checkFetched = cv.visitMethod(ACC_PUBLIC, "_persistence_checkFetched", "(Ljava/lang/String;)V", null, null);
cv_checkFetched.visitVarInsn(ALOAD, 0);
cv_checkFetched.visitVarInsn(ALOAD, 1);
- cv_checkFetched.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_isAttributeFetched", "(Ljava/lang/String;)Z");
+ cv_checkFetched.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_isAttributeFetched", "(Ljava/lang/String;)Z", false);
gotoReturn = new Label();
cv_checkFetched.visitJumpInsn(IFNE, gotoReturn);
cv_checkFetched.visitVarInsn(ALOAD, 0);
cv_checkFetched.visitTypeInsn(CHECKCAST, FETCHGROUP_TRACKER_SHORT_SIGNATURE);
cv_checkFetched.visitVarInsn(ALOAD, 1);
- cv_checkFetched.visitMethodInsn(INVOKESTATIC, ENTITY_MANAGER_IMPL_SHORT_SIGNATURE, "processUnfetchedAttribute", "(" + FETCHGROUP_TRACKER_SIGNATURE + "Ljava/lang/String;)V");
+ cv_checkFetched.visitMethodInsn(INVOKESTATIC, ENTITY_MANAGER_IMPL_SHORT_SIGNATURE, "processUnfetchedAttribute", "(" + FETCHGROUP_TRACKER_SIGNATURE + "Ljava/lang/String;)V", false);
cv_checkFetched.visitLabel(gotoReturn);
cv_checkFetched.visitInsn(RETURN);
cv_checkFetched.visitMaxs(0, 0);
@@ -1181,13 +1182,13 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
MethodVisitor cv_checkFetchedForSet = cv.visitMethod(ACC_PUBLIC, "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V", null, null);
cv_checkFetchedForSet.visitVarInsn(ALOAD, 0);
cv_checkFetchedForSet.visitVarInsn(ALOAD, 1);
- cv_checkFetchedForSet.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_isAttributeFetched", "(Ljava/lang/String;)Z");
+ cv_checkFetchedForSet.visitMethodInsn(INVOKEVIRTUAL, classDetails.getClassName(), "_persistence_isAttributeFetched", "(Ljava/lang/String;)Z", false);
gotoReturn = new Label();
cv_checkFetchedForSet.visitJumpInsn(IFNE, gotoReturn);
cv_checkFetchedForSet.visitVarInsn(ALOAD, 0);
cv_checkFetchedForSet.visitTypeInsn(CHECKCAST, FETCHGROUP_TRACKER_SHORT_SIGNATURE);
cv_checkFetchedForSet.visitVarInsn(ALOAD, 1);
- cv_checkFetchedForSet.visitMethodInsn(INVOKESTATIC, ENTITY_MANAGER_IMPL_SHORT_SIGNATURE, "processUnfetchedAttributeForSet", "(" + FETCHGROUP_TRACKER_SIGNATURE + "Ljava/lang/String;)V");
+ cv_checkFetchedForSet.visitMethodInsn(INVOKESTATIC, ENTITY_MANAGER_IMPL_SHORT_SIGNATURE, "processUnfetchedAttributeForSet", "(" + FETCHGROUP_TRACKER_SIGNATURE + "Ljava/lang/String;)V", false);
cv_checkFetchedForSet.visitLabel(gotoReturn);
cv_checkFetchedForSet.visitInsn(RETURN);
cv_checkFetchedForSet.visitMaxs(0, 0);
@@ -1201,15 +1202,6 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
*/
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-
- // Capture original values for SerialVersionUID generation (if needed)
- this.computeSVUID = (access & Opcodes.ACC_INTERFACE) == 0;
- if (computeSVUID) {
- this.name = name;
- this.access = access;
- this.interfaces = interfaces;
- }
-
boolean weaveCloneable = true;
// To prevent 'double' weaving: scan for PersistenceWeaved interface.
for (int index = 0; index < interfaces.length; index++) {
@@ -1373,15 +1365,6 @@ public class ClassWeaver extends SerialVersionUIDAdder implements Opcodes {
public void visitEnd() {
if (!alreadyWeaved) {
- // Add 'serialversionUID' if one does not exist.
- if (computeSVUID && !hasSVUID) {
- try {
- cv.visitField(Opcodes.ACC_FINAL + Opcodes.ACC_STATIC, "serialVersionUID", "J", null, new Long(computeSVUID()));
- } catch (Throwable e) {
- throw new RuntimeException("Error while computing SVUID for " + name, e);
- }
- }
-
if (this.classDetails.shouldWeaveInternal()) {
// Add a persistence and shallow clone method.
diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/MethodWeaver.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/MethodWeaver.java
index 10427ed..35fa3fd 100644
--- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/MethodWeaver.java
+++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/MethodWeaver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -9,12 +9,18 @@
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
+ * 19/04/2014-2.6 Lukas Jungmann
+ * - 429992: JavaSE 8/ASM 5.0.1 support (EclipseLink silently ignores Entity classes with lambda expressions)
******************************************************************************/
package org.eclipse.persistence.internal.jpa.weaving;
//ASM imports
import org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo;
-import org.eclipse.persistence.internal.libraries.asm.*;
+import org.eclipse.persistence.internal.libraries.asm.Attribute;
+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;
/**
* Processes all the methods of a class to weave in persistence code such as,
@@ -26,7 +32,7 @@ import org.eclipse.persistence.internal.libraries.asm.*;
*
*/
-public class MethodWeaver extends MethodAdapter implements Opcodes {
+public class MethodWeaver extends MethodVisitor implements Opcodes {
protected ClassWeaver tcw;
protected String methodName;
@@ -36,7 +42,7 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
protected boolean methodStarted = false;
public MethodWeaver(ClassWeaver tcw, String methodName, String methodDescriptor, MethodVisitor mv) {
- super(mv);
+ super(ASM5, mv);
this.tcw = tcw;
this.methodName = methodName;
this.methodDescriptor = methodDescriptor;
@@ -76,7 +82,7 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
}
@Override
- public void visitMethodInsn (final int opcode, final String owner, final String name, final String desc) {
+ public void visitMethodInsn (final int opcode, final String owner, final String name, final String desc, boolean intf) {
weaveBeginningOfMethodIfRequired();
String descClassName = "";
if (desc.length() > 3){
@@ -90,11 +96,11 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
* For completeness, we check to ensure the return type is in that same hierarchy */
this.tcw.classDetails.isInSuperclassHierarchy(owner) && this.tcw.classDetails.isInMetadataHierarchy(descClassName) &&
(this.tcw.classDetails.getNameOfSuperclassImplementingCloneMethod() == null)) {
- super.visitMethodInsn(opcode, owner, name, desc);
+ super.visitMethodInsn(opcode, owner, name, desc, intf);
super.visitTypeInsn(CHECKCAST, this.tcw.classDetails.getClassName());
- super.visitMethodInsn(INVOKEVIRTUAL, this.tcw.classDetails.getClassName(), "_persistence_post_clone", "()Ljava/lang/Object;");
+ super.visitMethodInsn(INVOKEVIRTUAL, this.tcw.classDetails.getClassName(), "_persistence_post_clone", "()Ljava/lang/Object;", false);
} else {
- super.visitMethodInsn(opcode, owner, name, desc);
+ super.visitMethodInsn(opcode, owner, name, desc, intf);
}
}
@@ -123,7 +129,7 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
}
@Override
- public void visitTableSwitchInsn (final int min, final int max, final Label dflt, final Label[] labels) {
+ public void visitTableSwitchInsn (final int min, final int max, final Label dflt, final Label... labels) {
weaveBeginningOfMethodIfRequired();
super.visitTableSwitchInsn(min, max, dflt, labels);
}
@@ -189,13 +195,13 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
}
if (opcode == GETFIELD) {
if (attributeDetails.weaveValueHolders() || tcw.classDetails.shouldWeaveFetchGroups()) {
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_GET + name, "()" + attributeDetails.getReferenceClassType().getDescriptor());
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_GET + name, "()" + attributeDetails.getReferenceClassType().getDescriptor(), false);
} else {
super.visitFieldInsn(opcode, owner, name, desc);
}
} else if (opcode == PUTFIELD) {
if ((attributeDetails.weaveValueHolders()) || (tcw.classDetails.shouldWeaveChangeTracking()) || (tcw.classDetails.shouldWeaveFetchGroups())) {
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_SET + name, "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_SET + name, "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V", false);
} else {
super.visitFieldInsn(opcode, owner, name, desc);
}
@@ -316,17 +322,17 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
mv.visitLdcInsn(attributeName);
}
// _persistence_checkFetched("attributeName");
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_checkFetched", "(Ljava/lang/String;)V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_checkFetched", "(Ljava/lang/String;)V", false);
}
if (!isVirtual && attributeDetails.weaveValueHolders()) {
// _persistence_initialize_attributeName_vh();
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_initialize_" + attributeName + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, "()V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_initialize_" + attributeName + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, "()V", false);
// if (!_persistence_attributeName_vh.isInstantiated()) {
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_FIELDNAME_PREFIX + attributeName + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
- mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "isInstantiated", "()Z");
+ mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "isInstantiated", "()Z", true);
Label l0 = new Label();
mv.visitJumpInsn(IFNE, l0);
@@ -345,9 +351,9 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_FIELDNAME_PREFIX + attributeName + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
- mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;");
+ mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "getValue", "()Ljava/lang/Object;", true);
mv.visitTypeInsn(CHECKCAST, referenceClassName.replace('.','/'));
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), setterMethodName, "(" + referenceClassType.getDescriptor() + ")V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), setterMethodName, "(" + referenceClassType.getDescriptor() + ")V", false);
if (tcw.classDetails.shouldWeaveChangeTracking()) {
// _persistence_listener = temp_persistence_listener;
@@ -423,10 +429,10 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
getterReturn = ClassWeaver.OBJECT_SIGNATURE;
mv.visitVarInsn(ALOAD, 1);
}
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), getterMethodName, "(" + getterArgument + ")" + getterReturn);
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), getterMethodName, "(" + getterArgument + ")" + getterReturn, false);
if (wrapper != null){
// 2nd part of using constructor.
- mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + referenceClassType.getDescriptor() + ")V");
+ mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + referenceClassType.getDescriptor() + ")V", false);
mv.visitVarInsn(ASTORE, valueStorageLocation + 1);
} else {
// store the result
@@ -443,7 +449,7 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
} else {
mv.visitLdcInsn(attributeName);
}
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V", false);
mv.visitLabel(l1);
mv.visitVarInsn(ALOAD, 0);
@@ -465,9 +471,9 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
int opcode = referenceClassType.getOpcode(ILOAD);
mv.visitVarInsn(opcode, valueHoldingLocation);
if (wrapper != null){
- mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + referenceClassType.getDescriptor() + ")V");
+ mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + referenceClassType.getDescriptor() + ")V", false);
}
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_propertyChange", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_propertyChange", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", false);
} else {
// tcw.classDetails.shouldWeaveFetchGroups()
/**
@@ -496,10 +502,10 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
getterReturn = ClassWeaver.OBJECT_SIGNATURE;
mv.visitVarInsn(ALOAD, 1);
}
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), getterMethodName, "(" + getterArgument + ")" + getterReturn);
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), getterMethodName, "(" + getterArgument + ")" + getterReturn, false);
if (wrapper != null){
// 2nd part of using constructor.
- mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V");
+ mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + attributeDetails.getReferenceClassType().getDescriptor() + ")V", false);
mv.visitVarInsn(ASTORE, valueStorageLocation + 1);
} else {
// store the result
@@ -524,9 +530,9 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
int opcode = referenceClassType.getOpcode(ILOAD);
mv.visitVarInsn(opcode, valueHoldingLocation);
if (wrapper != null) {
- mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + referenceClassType.getDescriptor() + ")V");
+ mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>", "(" + referenceClassType.getDescriptor() + ")V", false);
}
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_propertyChange", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_propertyChange", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", false);
}
} else {
// !tcw.classDetails.shouldWeaveChangeTracking()
@@ -538,7 +544,7 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
mv.visitLdcInsn(attributeName);
}
// _persistence_checkFetchedForSet("variableName");
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_checkFetchedForSet", "(Ljava/lang/String;)V", false);
}
}
}
@@ -566,19 +572,19 @@ public class MethodWeaver extends MethodAdapter implements Opcodes {
if (isSetMethod && !attributeDetails.hasField()) {
if (attributeDetails.weaveValueHolders()) {
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, "()V");
+ mv.visitMethodInsn(INVOKEVIRTUAL, tcw.classDetails.getClassName(), "_persistence_initialize_" + attributeDetails.getAttributeName() + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, "()V", false);
//_persistence_attributeName_vh.setValue(argument);
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_FIELDNAME_PREFIX + attributeDetails.getAttributeName() + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "setValue", "(Ljava/lang/Object;)V");
+ mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "setValue", "(Ljava/lang/Object;)V", true);
// _persistence_attributeName_vh.setIsCoordinatedWithProperty(true);
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, tcw.classDetails.getClassName(), ClassWeaver.PERSISTENCE_FIELDNAME_PREFIX + attributeDetails.getAttributeName() + ClassWeaver.PERSISTENCE_FIELDNAME_POSTFIX, ClassWeaver.VHI_SIGNATURE);
mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "setIsCoordinatedWithProperty", "(Z)V");
+ mv.visitMethodInsn(INVOKEINTERFACE, ClassWeaver.VHI_SHORT_SIGNATURE, "setIsCoordinatedWithProperty", "(Z)V", true);
}
}
}
diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/PersistenceWeaver.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/PersistenceWeaver.java
index 2794d03..b3c2a1a 100644
--- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/PersistenceWeaver.java
+++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/PersistenceWeaver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -9,6 +9,8 @@
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
+ * 19/04/2014-2.6 Lukas Jungmann
+ * - 429992: JavaSE 8/ASM 5.0.1 support (EclipseLink silently ignores Entity classes with lambda expressions)
******************************************************************************/
package org.eclipse.persistence.internal.jpa.weaving;
@@ -22,7 +24,9 @@ import javax.persistence.spi.ClassTransformer;
import org.eclipse.persistence.config.SystemProperties;
import org.eclipse.persistence.internal.helper.Helper;
import org.eclipse.persistence.internal.libraries.asm.ClassReader;
+import org.eclipse.persistence.internal.libraries.asm.ClassVisitor;
import org.eclipse.persistence.internal.libraries.asm.ClassWriter;
+import org.eclipse.persistence.internal.libraries.asm.commons.SerialVersionUIDAdder;
import org.eclipse.persistence.internal.sessions.AbstractSession;
import org.eclipse.persistence.logging.SessionLog;
import org.eclipse.persistence.sessions.Session;
@@ -90,7 +94,8 @@ public class PersistenceWeaver implements ClassTransformer {
classWriter = new ComputeClassWriter(loader, ClassWriter.COMPUTE_FRAMES);
}
ClassWeaver classWeaver = new ClassWeaver(classWriter, classDetails);
- classReader.accept(classWeaver, 0);
+ ClassVisitor sv = new SerialVersionUIDAdder(classWeaver);
+ classReader.accept(sv, 0);
if (classWeaver.alreadyWeaved) {
((AbstractSession)session).log(SessionLog.FINEST, SessionLog.WEAVER, "end_weaving_class", className);
return null;
diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/RestAdapterClassWriter.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/RestAdapterClassWriter.java
index 2efed72..755b507 100644
--- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/RestAdapterClassWriter.java
+++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/weaving/RestAdapterClassWriter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -9,6 +9,8 @@
*
* Contributors:
* tware - initial API and implementation from Oracle TopLink
+ * 19/04/2014-2.6 Lukas Jungmann
+ * - 429992: JavaSE 8/ASM 5.0.1 support (EclipseLink silently ignores Entity classes with lambda expressions)
******************************************************************************/
package org.eclipse.persistence.internal.jpa.weaving;
@@ -63,7 +65,7 @@ public class RestAdapterClassWriter implements EclipseLinkClassWriter, Opcodes {
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, REFERENCE_ADAPTER_SHORT_SIGNATURE, "<init>", "()V");
+ mv.visitMethodInsn(INVOKESPECIAL, REFERENCE_ADAPTER_SHORT_SIGNATURE, "<init>", "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -73,7 +75,7 @@ public class RestAdapterClassWriter implements EclipseLinkClassWriter, Opcodes {
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ALOAD, 1);
mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKESPECIAL, REFERENCE_ADAPTER_SHORT_SIGNATURE, "<init>", "(Ljava/lang/String;Lorg/eclipse/persistence/jpa/rs/PersistenceContext;)V");
+ mv.visitMethodInsn(INVOKESPECIAL, REFERENCE_ADAPTER_SHORT_SIGNATURE, "<init>", "(Ljava/lang/String;Lorg/eclipse/persistence/jpa/rs/PersistenceContext;)V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(3, 3);
mv.visitEnd();
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
index 5bf5956..0f73d43 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
@@ -4133,7 +4133,7 @@ public class AnnotationsProcessor {
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "org/eclipse/persistence/internal/jaxb/many/MapValue", "<init>", "()V");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "org/eclipse/persistence/internal/jaxb/many/MapValue", "<init>", "()V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -4172,7 +4172,7 @@ public class AnnotationsProcessor {
mv = cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_BRIDGE + Opcodes.ACC_SYNTHETIC, "getItem", "()Ljava/lang/Object;", null, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "getItem", "()L" + mapType.getInternalName() + SEMI_COLON);
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "getItem", "()L" + mapType.getInternalName() + SEMI_COLON, false);
mv.visitInsn(Opcodes.ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -4181,7 +4181,7 @@ public class AnnotationsProcessor {
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 1);
mv.visitTypeInsn(Opcodes.CHECKCAST, mapType.getInternalName());
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setItem", "(L" + mapType.getInternalName() + ";)V");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setItem", "(L" + mapType.getInternalName() + ";)V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
@@ -4412,7 +4412,7 @@ public class AnnotationsProcessor {
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(superType), "<init>", "()V");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(superType), "<init>", "()V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -4441,7 +4441,7 @@ public class AnnotationsProcessor {
mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitFieldInsn(Opcodes.GETFIELD, classNameSeparatedBySlash, "adaptedValue", "Ljava/util/Collection;");
- mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Collection", "size", "()I");
+ mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Collection", "size", "()I", false);
mv.visitVarInsn(Opcodes.ISTORE, 1);
mv.visitVarInsn(Opcodes.ILOAD, 1);
mv.visitTypeInsn(Opcodes.ANEWARRAY, componentClassNameSeparatedBySlash);
@@ -4449,7 +4449,7 @@ public class AnnotationsProcessor {
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitFieldInsn(Opcodes.GETFIELD, classNameSeparatedBySlash, "adaptedValue", "Ljava/util/Collection;");
mv.visitVarInsn(Opcodes.ALOAD, 2);
- mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Collection", "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;");
+ mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Collection", "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", true);
mv.visitInsn(Opcodes.POP);
mv.visitVarInsn(Opcodes.ALOAD, 2);
@@ -4470,7 +4470,7 @@ public class AnnotationsProcessor {
mv.visitVarInsn(Opcodes.ASTORE, 2);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 2);
- mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/util/Arrays", "asList", "([Ljava/lang/Object;)Ljava/util/List;");
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/util/Arrays", "asList", "([Ljava/lang/Object;)Ljava/util/List;", false);
mv.visitFieldInsn(Opcodes.PUTFIELD, classNameSeparatedBySlash, "adaptedValue", "Ljava/util/Collection;");
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(2, 3);
@@ -4533,7 +4533,7 @@ public class AnnotationsProcessor {
mv.visitCode();
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(superType), "getAdaptedValue", "()Ljava/util/Collection;");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(superType), "getAdaptedValue", "()Ljava/util/Collection;", false);
mv.visitInsn(Opcodes.ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -4545,7 +4545,7 @@ public class AnnotationsProcessor {
mv.visitCode();
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 1);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(superType), "setAdaptedValue", "(Ljava/util/Collection;)V");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(superType), "setAdaptedValue", "(Ljava/util/Collection;)V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
@@ -4596,7 +4596,7 @@ public class AnnotationsProcessor {
return generatedClass;
}
- // Made static final for performance reasons.
+ // Made static final for performance reasons.
/**
* Inner class used for ordering a list of Properties alphabetically by
* property name.
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/MappingsGenerator.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/MappingsGenerator.java
index 7cac252..0a4598a 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/MappingsGenerator.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/MappingsGenerator.java
@@ -1975,7 +1975,7 @@ public class MappingsGenerator {
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -2013,7 +2013,7 @@ public class MappingsGenerator {
if(!qualifiedInternalValueClassName.equals("java/lang/Object")){
mv = cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_BRIDGE + Opcodes.ACC_SYNTHETIC, "getValue", "()Ljava/lang/Object;", null, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "getValue", "()L"+qualifiedInternalValueClassName+";");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "getValue", "()L"+qualifiedInternalValueClassName+";", false);
mv.visitInsn(Opcodes.ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -2022,7 +2022,7 @@ public class MappingsGenerator {
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 1);
mv.visitTypeInsn(Opcodes.CHECKCAST, qualifiedInternalValueClassName);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setValue", "(L"+qualifiedInternalValueClassName+";)V");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setValue", "(L"+qualifiedInternalValueClassName+";)V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
@@ -2031,7 +2031,7 @@ public class MappingsGenerator {
if(!qualifiedInternalKeyClassName.equals("java/lang/Object")){
mv = cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_BRIDGE + Opcodes.ACC_SYNTHETIC, "getKey", "()Ljava/lang/Object;", null, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,qualifiedInternalClassName, "getKey", "()L"+qualifiedInternalKeyClassName+";");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,qualifiedInternalClassName, "getKey", "()L"+qualifiedInternalKeyClassName+";", false);
mv.visitInsn(Opcodes.ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -2040,7 +2040,7 @@ public class MappingsGenerator {
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 1);
mv.visitTypeInsn(Opcodes.CHECKCAST, qualifiedInternalKeyClassName);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setKey", "(L"+qualifiedInternalKeyClassName+";)V");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setKey", "(L"+qualifiedInternalKeyClassName+";)V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
@@ -3214,11 +3214,11 @@ public class MappingsGenerator {
mv.visitInsn(Opcodes.DUP);
mv.visitLdcInsn(theQName.getNamespaceURI());
mv.visitLdcInsn(theQName.getLocalPart());
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName", "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName", "<init>", "(Ljava/lang/String;Ljava/lang/String;)V", false);
mv.visitLdcInsn(Type.getType(fieldType));
mv.visitInsn(Opcodes.ACONST_NULL);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "org/eclipse/persistence/internal/jaxb/WrappedValue", "<init>", "(Ljavax/xml/namespace/QName;Ljava/lang/Class;Ljava/lang/Object;)V");
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "org/eclipse/persistence/internal/jaxb/WrappedValue", "<init>", "(Ljavax/xml/namespace/QName;Ljava/lang/Class;Ljava/lang/Object;)V", false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(5, 1);
mv.visitEnd();
@@ -3367,7 +3367,7 @@ public class MappingsGenerator {
return areEquals(type, CoreClassConstants.APBYTE) ||areEquals(type, "javax.activation.DataHandler") || areEquals(type, "java.awt.Image") || areEquals(type, "javax.xml.transform.Source") || areEquals(type, "javax.mail.internet.MimeMultipart");
}
- // Made static final for performance reasons.
+ // Made static final for performance reasons.
/**
* <p>An InstantiationPolicy that does not construct any objects (and therefore
* will not throw validation errors caused by a lack of a no-arg constructor).</p>
diff --git a/sdo/org.eclipse.persistence.sdo/src/org/eclipse/persistence/sdo/helper/DynamicClassWriter.java b/sdo/org.eclipse.persistence.sdo/src/org/eclipse/persistence/sdo/helper/DynamicClassWriter.java
index 097a464..fd03326 100644
--- a/sdo/org.eclipse.persistence.sdo/src/org/eclipse/persistence/sdo/helper/DynamicClassWriter.java
+++ b/sdo/org.eclipse.persistence.sdo/src/org/eclipse/persistence/sdo/helper/DynamicClassWriter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -142,7 +142,7 @@ public class DynamicClassWriter {
private void addConstructors(ClassWriter cw) {
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[0]), null, new String[] { Type.getInternalName(Serializable.class) });
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getType(parentClass).getInternalName(), "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[0]));
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getType(parentClass).getInternalName(), "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[0]), false);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
@@ -176,15 +176,15 @@ public class DynamicClassWriter {
String builtIn = SDOUtil.getBuiltInType(returnType);
if (null != builtIn) {
if (property.getType().isDataType() && !builtIn.equals(LIST)) {
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, GET + builtIn, "(I)" + propertyInstanceClassDescriptor);
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, GET + builtIn, "(I)" + propertyInstanceClassDescriptor, false);
int iReturnOpcode = Type.getType(property.getType().getInstanceClass()).getOpcode(Opcodes.IRETURN);
mv.visitInsn(iReturnOpcode);
} else {
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, GET, "(I)Ljava/lang/Object;");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, GET, "(I)Ljava/lang/Object;", false);
mv.visitInsn(Opcodes.ARETURN);
}
} else {
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, GET, "(I)Ljava/lang/Object;");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, GET, "(I)Ljava/lang/Object;", false);
mv.visitInsn(Opcodes.ARETURN);
}
mv.visitMaxs(2, 1);
@@ -215,14 +215,14 @@ public class DynamicClassWriter {
if (property.getType().isDataType() && !builtIn.equals(LIST)) {
iLoadOpcode = Type.getType(property.getType().getInstanceClass()).getOpcode(Opcodes.ILOAD);
mv.visitVarInsn(iLoadOpcode, 1);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, SET + builtIn, "(I" + propertyInstanceClassDescriptor + ")V");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, SET + builtIn, "(I" + propertyInstanceClassDescriptor + ")V", false);
} else {
mv.visitVarInsn(iLoadOpcode, 1);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, SET, "(ILjava/lang/Object;)V");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, SET, "(ILjava/lang/Object;)V", false);
}
} else {
mv.visitVarInsn(iLoadOpcode, 1);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, SET, "(ILjava/lang/Object;)V");
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, typeImplClassDescriptor, SET, "(ILjava/lang/Object;)V", false);
}
mv.visitInsn(Opcodes.RETURN);
@@ -245,7 +245,7 @@ public class DynamicClassWriter {
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PROTECTED, method.getName(), Type.getMethodDescriptor(method), null, new String[] { Type.getInternalName(ObjectStreamException.class) });
mv.visitVarInsn(Opcodes.ALOAD, 0);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(parentClass), method.getName(), Type.getMethodDescriptor(method));
+ mv.visitMethodInsn(Opcodes.INVOKESPECIAL, Type.getInternalName(parentClass), method.getName(), Type.getMethodDescriptor(method), false);
mv.visitInsn(Opcodes.ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
diff --git a/utils/eclipselink.utils.sigcompare/src/eclipselink/utils/sigcompare/SignatureImporter.java b/utils/eclipselink.utils.sigcompare/src/eclipselink/utils/sigcompare/SignatureImporter.java
index e56bde8..7b3f5ec 100644
--- a/utils/eclipselink.utils.sigcompare/src/eclipselink/utils/sigcompare/SignatureImporter.java
+++ b/utils/eclipselink.utils.sigcompare/src/eclipselink/utils/sigcompare/SignatureImporter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010-2011 Oracle. All rights reserved.
+ * Copyright (c) 2010-2014 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -20,8 +20,6 @@ import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor;
-import org.eclipse.persistence.internal.libraries.asm.Attribute;
import org.eclipse.persistence.internal.libraries.asm.ClassReader;
import org.eclipse.persistence.internal.libraries.asm.ClassVisitor;
import org.eclipse.persistence.internal.libraries.asm.FieldVisitor;
@@ -52,12 +50,16 @@ public class SignatureImporter {
return visitor.classes;
}
- class SignatureClassVisitor implements ClassVisitor {
+ class SignatureClassVisitor extends ClassVisitor {
protected Map<String, ClassSignature> classes = new HashMap<String, ClassSignature>();
protected ClassSignature sig = null;
+ SignatureClassVisitor() {
+ super(Opcodes.ASM5);
+ }
+
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
if ((access & Opcodes.ACC_PUBLIC) > 0) {
this.sig = new ClassSignature(name, superName, interfaces);
@@ -78,22 +80,6 @@ public class SignatureImporter {
return null;
}
- public void visitInnerClass(String name, String outerName, String innerName, int access) {
- }
-
- public void visitOuterClass(String owner, String name, String desc) {
- }
-
- public void visitSource(String source, String debug) {
- }
-
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- return null;
- }
-
- public void visitAttribute(Attribute attr) {
- }
-
public void visitEnd() {
if (this.sig != null) {
this.classes.put(this.sig.getName(), this.sig);