diff --git a/jcl/src/java.base/share/classes/java/lang/Class.java b/jcl/src/java.base/share/classes/java/lang/Class.java index 8577348f84b..6027f031646 100644 --- a/jcl/src/java.base/share/classes/java/lang/Class.java +++ b/jcl/src/java.base/share/classes/java/lang/Class.java @@ -2663,20 +2663,6 @@ public Class asNullRestrictedType() { return this; } -/** - * Return class file version (minorVersion << 16 + majorVersion) in an int. - * - * @return the class file version - */ -int getClassFileVersion() { - Class thisObject = this; - while (thisObject.isArray()) { - thisObject = thisObject.getComponentType(); - } - return thisObject.getClassFileVersion0(); -} -private native int getClassFileVersion0(); - /** * ToDo: add comments for public methods - https://github.com/eclipse-openj9/openj9/issues/13615 */ @@ -5802,6 +5788,24 @@ public Set accessFlags() { } return AccessFlag.maskToAccessFlags(rawModifiers, location); } + + /** + * Return class file version (minorVersion << 16 + majorVersion) in an int. + * + * @return the class file version + */ +/*[IF !INLINE-TYPES]*/ + private +/*[ENDIF] !INLINE-TYPES */ + int getClassFileVersion() { + Class thisObject = this; + while (thisObject.isArray()) { + thisObject = thisObject.getComponentType(); + } + return thisObject.getClassFileVersion0(); + } + + private native int getClassFileVersion0(); /*[ENDIF] JAVA_SPEC_VERSION >= 20 */ /*[IF JAVA_SPEC_VERSION == 21]*/ /** diff --git a/runtime/bcutil/ClassFileOracle.cpp b/runtime/bcutil/ClassFileOracle.cpp index d2319c5f5a3..da689d20c4a 100644 --- a/runtime/bcutil/ClassFileOracle.cpp +++ b/runtime/bcutil/ClassFileOracle.cpp @@ -829,9 +829,9 @@ ClassFileOracle::walkInterfaces() InterfaceVisitor interfaceVisitor(this, _constantPoolMap); #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) interfacesDo(&interfaceVisitor, 0); -#else +#else /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */ interfacesDo(&interfaceVisitor); -#endif /* J9VM_OPT_VALHALLA_VALUE_TYPES */ +#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */ _isCloneable = interfaceVisitor.wasCloneableSeen(); _isSerializable = interfaceVisitor.wasSerializableSeen(); } diff --git a/runtime/bcutil/ROMClassBuilder.cpp b/runtime/bcutil/ROMClassBuilder.cpp index 575fe543352..52b0e910eec 100644 --- a/runtime/bcutil/ROMClassBuilder.cpp +++ b/runtime/bcutil/ROMClassBuilder.cpp @@ -396,16 +396,7 @@ ROMClassBuilder::handleAnonClassName(J9CfrClassFile *classfile, ROMClassCreation if (newCPEntry) { anonClassName->slot2 = 0; anonClassName->tag = CFR_CONSTANT_Utf8; -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - /** - * The following line should be put inside if (classfile->majorVersion > 61) according to the SPEC. However, the current - * OpenJDK Valhalla implementation is not updated on this yet. There are cases that the new VT form is used in old classes - * from OpenJDK Valhalla JCL. - */ - anonClassName->flags1 |= CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE; -#else /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ anonClassName->flags1 = 0; -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ anonClassName->nextCPIndex = 0; anonClassName->romAddress = 0; } diff --git a/runtime/bcutil/cfreader.c b/runtime/bcutil/cfreader.c index 97838504e60..263e0a52337 100644 --- a/runtime/bcutil/cfreader.c +++ b/runtime/bcutil/cfreader.c @@ -1326,14 +1326,6 @@ readPool(J9CfrClassFile* classfile, U_8* data, U_8* dataEnd, U_8* segment, U_8* previousUTF8 = info; } classfile->lastUTF8CPIndex = i; -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - /** - * The following line should be put inside if (classfile->majorVersion > 61) according to the SPEC. However, the current - * OpenJDK Valhalla implementation is not updated on this yet. There are cases that the new VT form is used in old classes - * from OpenJDK Valhalla JCL. - */ - info->flags1 |= CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE; -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ i++; break; diff --git a/runtime/oti/cfr.h b/runtime/oti/cfr.h index 7b1d5ae0d42..73448bc2571 100644 --- a/runtime/oti/cfr.h +++ b/runtime/oti/cfr.h @@ -994,9 +994,6 @@ typedef struct J9CfrClassFile { #define CFR_FOUND_CHARS_IN_EXTENDED_MUE_FORM 0x1 #define CFR_FOUND_SEPARATOR_IN_MUE_FORM 0x2 -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) -#define CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE 0x4 -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ #ifdef __cplusplus } diff --git a/runtime/oti/j9.h b/runtime/oti/j9.h index be6621c0c6e..698439158b8 100644 --- a/runtime/oti/j9.h +++ b/runtime/oti/j9.h @@ -363,8 +363,6 @@ static const struct { \ #define VALUE_TYPES_MAJOR_VERSION 67 #define PREVIEW_MINOR_VERSION 65535 -#define J9_IS_STRING_DESCRIPTOR(str, strLen) (((strLen) > 2) && (IS_REF_OR_VAL_SIGNATURE(*(str))) && (';' == *((str) + (strLen) - 1))) - #if defined(J9VM_OPT_CRIU_SUPPORT) #define J9_IS_CRIU_OR_CRAC_CHECKPOINT_ENABLED(vm) (J9_ARE_ANY_BITS_SET(vm->checkpointState.flags, J9VM_CRAC_IS_CHECKPOINT_ENABLED | J9VM_CRIU_IS_CHECKPOINT_ENABLED)) #define J9_IS_SINGLE_THREAD_MODE(vm) (J9_ARE_ALL_BITS_SET((vm)->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_CRIU_SINGLE_THREAD_MODE)) diff --git a/runtime/util/romhelp.c b/runtime/util/romhelp.c index e0e3f1560ad..0f8cc752524 100644 --- a/runtime/util/romhelp.c +++ b/runtime/util/romhelp.c @@ -74,7 +74,6 @@ getOriginalROMMethod(J9Method * method) } #if JAVA_SPEC_VERSION >= 20 -/* J9VM_OPT_VALHALLA_VALUE_TYPES is enabled for Java 21 and up. */ U_32 getClassFileVersion(J9VMThread *currentThread, J9Class *cls) { diff --git a/runtime/verutil/chverify.c b/runtime/verutil/chverify.c index edaeb089902..eb4b6d2d8a0 100644 --- a/runtime/verutil/chverify.c +++ b/runtime/verutil/chverify.c @@ -30,8 +30,7 @@ * Methods, fields, local variables can not contain: '.', ';', '[' '/'. * Methods, other than and cannot contain '<' or '>'. * Classes can contain '[' only at the front if they are array classes. - * Classes can end with ';' only if they are array classes for class file major version < 62 - * For class major file version >= 62. They can be array classes or descriptors of form "LClassName;". + * Classes can end with ';' only if they are array classes * Classes can contain '/' * if not the first character, * if not the last character, @@ -83,29 +82,9 @@ checkNameImpl (J9CfrConstantPoolInfo * info, BOOLEAN isClass, BOOLEAN isMethod, } return -1; case ';': - if (isClass) { -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - if (J9_ARE_ALL_BITS_SET(info->flags1, CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE)) { - /* If CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE is set (class major file version >= 62) - * Valid at the end of array classes - * or descriptors of form "LClassName;". - */ - if ((arity || IS_REF_OR_VAL_SIGNATURE(*info->bytes)) - && ((c + 1) == end) - ) { - break; - } - } else { -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ - /* Valid at the end of array classes */ - if ((arity) - && ((c + 1) == end) - ) { - break; - } -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - } -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ + /* Valid at the end of array classes */ + if (isClass && arity && ((c + 1) == end)) { + break; } return -1; case '<': /* Fall through */ diff --git a/runtime/vm/BytecodeInterpreter.hpp b/runtime/vm/BytecodeInterpreter.hpp index 6dc3c1eeef9..b60267492be 100644 --- a/runtime/vm/BytecodeInterpreter.hpp +++ b/runtime/vm/BytecodeInterpreter.hpp @@ -8492,7 +8492,7 @@ class INTERPRETER_CLASS j9object_t instance = NULL; #if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) if (J9_ARE_NO_BITS_SET(arrayClass->classFlags, J9ClassContainsUnflattenedFlattenables)) -#endif +#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ { instance = VM_VMHelpers::inlineAllocateIndexableObject(_currentThread, &_objectAllocate, arrayClass, (U_32) size); } diff --git a/runtime/vm/ObjectMonitor.cpp b/runtime/vm/ObjectMonitor.cpp index 4ff15122684..2e903c12850 100644 --- a/runtime/vm/ObjectMonitor.cpp +++ b/runtime/vm/ObjectMonitor.cpp @@ -320,9 +320,9 @@ objectMonitorEnterNonBlocking(J9VMThread *currentThread, j9object_t object) UDATA result = (UDATA)object; J9JavaVM *vm = currentThread->javaVM; j9objectmonitor_t volatile *lwEA = VM_ObjectMonitor::inlineGetLockAddress(currentThread, object); -#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) || (JAVA_SPEC_VERSION >= 16) +#if JAVA_SPEC_VERSION >= 16 J9Class * objClass = J9OBJECT_CLAZZ(currentThread, object); -#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) || (JAVA_SPEC_VERSION >= 16) */ +#endif /* JAVA_SPEC_VERSION >= 16 */ #if defined(J9VM_OPT_CRIU_SUPPORT) BOOLEAN retry = FALSE; #endif /* defined(J9VM_OPT_CRIU_SUPPORT) */ diff --git a/runtime/vm/classsupport.c b/runtime/vm/classsupport.c index 35d07b0d227..1f99a502ccc 100644 --- a/runtime/vm/classsupport.c +++ b/runtime/vm/classsupport.c @@ -974,13 +974,6 @@ loadNonArrayClass(J9VMThread* vmThread, J9Module *j9module, U_8* className, UDAT BOOLEAN fastMode = J9_ARE_ALL_BITS_SET(vm->extendedRuntimeFlags, J9_EXTENDED_RUNTIME_FAST_CLASS_HASH_TABLE); BOOLEAN loaderMonitorLocked = FALSE; -#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) - if (J9_IS_STRING_DESCRIPTOR(className, classNameLength)) { - className += 1; /* 1 for 'L' */ - classNameLength -= 2; /* 2 for 'L' and ';' */ - } -#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */ - vmThread->privateFlags &= ~J9_PRIVATE_FLAGS_CLOAD_NO_MEM; if (J9CLASSLOADER_PARALLEL_CAPABLE == (J9CLASSLOADER_PARALLEL_CAPABLE & classLoader->flags)) { diff --git a/runtime/vm/createramclass.cpp b/runtime/vm/createramclass.cpp index 58faf5570d3..37c5d851c79 100644 --- a/runtime/vm/createramclass.cpp +++ b/runtime/vm/createramclass.cpp @@ -1733,12 +1733,7 @@ loadSuperClassAndInterfaces(J9VMThread *vmThread, J9ClassLoader *classLoader, J9 setCurrentExceptionForBadClass(vmThread, superclassName, J9VMCONSTANTPOOL_JAVALANGINCOMPATIBLECLASSCHANGEERROR, J9NLS_VM_CLASS_LOADING_ERROR_SUPERCLASS_IS_INTERFACE); return FALSE; } -#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) - /** - * TODO: From the latest spec, for a value class or an abstract class with ACC_PERMITS_VALUE, its direct super class must have ACC_PERMITS_VALUE set, - * otherwise throw IncompatibleClassChangeError. OpenJDK Valhalla implementation is not complete on this yet. We are seeing bootstrap classes in violation of this. - */ -#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */ + /* JEP 360 sealed classes: if superclass is sealed it must contain the romClass's name in its PermittedSubclasses attribute */ if (! isClassPermittedBySealedSuper(superclass->romClass, J9UTF8_DATA(className), J9UTF8_LENGTH(className))) { Trc_VM_CreateRAMClassFromROMClass_classIsNotPermittedBySealedSuperclass(vmThread, superclass, J9UTF8_LENGTH(className), J9UTF8_DATA(className)); diff --git a/runtime/vm/description.c b/runtime/vm/description.c index 8883bc83843..25e21ae3f14 100644 --- a/runtime/vm/description.c +++ b/runtime/vm/description.c @@ -336,12 +336,12 @@ checkLockwordNeeded(J9JavaVM *vm, J9ROMClass *romClass, J9Class *ramSuperClass, if (J9ROMCLASS_IS_ARRAY(romClass)) { return NO_LOCKWORD_NEEDED; } -#ifdef J9VM_OPT_VALHALLA_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) /* ValueTypes don not have lockwords */ if (J9ROMCLASS_IS_VALUE(romClass)) { return NO_LOCKWORD_NEEDED; } -#endif +#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */ /* check for primitive types or java.lang.Object */ if (ramSuperClass == NULL) { diff --git a/runtime/vm/jvminit.c b/runtime/vm/jvminit.c index 57c38ab791c..9572b0b19d4 100644 --- a/runtime/vm/jvminit.c +++ b/runtime/vm/jvminit.c @@ -3820,7 +3820,7 @@ processVMArgsFromFirstToLast(J9JavaVM * vm) } } -#if (JAVA_SPEC_VERSION <= 19) && !defined(J9VM_OPT_VALHALLA_VALUE_TYPES) +#if (JAVA_SPEC_VERSION <= 19) { /** * From the spec, the ACC_SUPER semantics became mandatory. The bit CFR_ACC_SUPER is reused as CFR_ACC_IDENTITY in Valhalla. @@ -3834,7 +3834,7 @@ processVMArgsFromFirstToLast(J9JavaVM * vm) vm->extendedRuntimeFlags &= ~(UDATA)J9_EXTENDED_RUNTIME_ALLOW_NON_VIRTUAL_CALLS; } } -#endif /* (JAVA_SPEC_VERSION <= 19) && !defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */ +#endif /* (JAVA_SPEC_VERSION <= 19) */ { IDATA debugInterpreter = FIND_AND_CONSUME_VMARG(EXACT_MATCH, VMOPT_XXDEBUGINTERPRETER, NULL); diff --git a/test/functional/Valhalla/src_qtypes/org/openj9/test/lworld/ValueTypeGenerator.java b/test/functional/Valhalla/src_qtypes/org/openj9/test/lworld/ValueTypeGenerator.java index ad6a132335e..3ef54d8ebe1 100644 --- a/test/functional/Valhalla/src_qtypes/org/openj9/test/lworld/ValueTypeGenerator.java +++ b/test/functional/Valhalla/src_qtypes/org/openj9/test/lworld/ValueTypeGenerator.java @@ -446,7 +446,7 @@ private static void makeValue(ClassWriter cw, String valueName, String makeValue boolean doubleDetected = false; MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "makeValue", "(" + makeValueSig + ")" + getSigFromSimpleName(valueName), null, null); mv.visitCode(); - mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, getSigFromSimpleName(valueName)); + mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, valueName); for (int i = 0, count = 0; i < fields.length; i++) { String nameAndSig[] = fields[i].split(":"); if ((nameAndSig.length < 3) || !(nameAndSig[2].equals("static"))) { @@ -490,7 +490,7 @@ private static void makeValue(ClassWriter cw, String valueName, String makeValue private static void makeValueTypeDefaultValue(ClassWriter cw, String valueName, String makeValueSig, String[] fields, int makeMaxLocal) { MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "makeValueTypeDefaultValue", "()Ljava/lang/Object;", null, null); mv.visitCode(); - mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, getSigFromSimpleName(valueName)); + mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, valueName); mv.visitInsn(ARETURN); mv.visitMaxs(1, 0); mv.visitEnd(); @@ -499,7 +499,7 @@ private static void makeValueTypeDefaultValue(ClassWriter cw, String valueName, private static void testCheckCastValueTypeOnNonNullType(ClassWriter cw, String className, String[] fields) { MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "testCheckCastValueTypeOnNonNullType", "()Ljava/lang/Object;", null, null); mv.visitCode(); - mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, getSigFromSimpleName(className)); + mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, className); mv.visitTypeInsn(CHECKCAST, className); mv.visitInsn(ARETURN); mv.visitMaxs(1, 2); @@ -510,7 +510,7 @@ private static void testCheckCastValueTypeOnNull(ClassWriter cw, String classNam MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "testCheckCastValueTypeOnNull", "()Ljava/lang/Object;", null, null); mv.visitCode(); mv.visitInsn(ACONST_NULL); - mv.visitTypeInsn(CHECKCAST, getSigFromSimpleName(className)); + mv.visitTypeInsn(CHECKCAST, className); mv.visitInsn(ARETURN); mv.visitMaxs(1, 2); mv.visitEnd(); @@ -543,13 +543,13 @@ private static void testUnresolvedValueTypeDefaultValue(ClassWriter cw, String c Label falseLabel = new Label(); Label endLabel = new Label(); mv.visitJumpInsn(IFEQ, falseLabel); - mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, getSigFromSimpleName(valueUsedInCode)); + mv.visitTypeInsn(ValhallaUtils.ACONST_INIT, valueUsedInCode); mv.visitJumpInsn(GOTO, endLabel); mv.visitLabel(falseLabel); mv.visitFrame(F_SAME, 1, new Object[] {INTEGER}, 0, new Object[]{}); mv.visitInsn(ACONST_NULL); mv.visitLabel(endLabel); - mv.visitFrame(F_SAME1, 1, new Object[] {INTEGER}, 1, new Object[] {"Ljava/lang/Object;"}); + mv.visitFrame(F_SAME1, 1, new Object[] {INTEGER}, 1, new Object[] {"java/lang/Object"}); mv.visitInsn(ARETURN); mv.visitMaxs(1, 1); mv.visitEnd(); @@ -571,10 +571,10 @@ private static void testUnresolvedValueTypeWithField(ClassWriter cw, String clas } mv.visitJumpInsn(GOTO, endLabel); mv.visitLabel(falseLabel); - mv.visitFrame(F_SAME, 2, new Object[] {INTEGER, "Ljava/lang/Object;"}, 0, new Object[]{}); + mv.visitFrame(F_SAME, 2, new Object[] {INTEGER, "java/lang/Object"}, 0, new Object[]{}); mv.visitInsn(ACONST_NULL); mv.visitLabel(endLabel); - mv.visitFrame(F_SAME1, 2, new Object[] {INTEGER, "Ljava/lang/Object;"}, 1, new Object[] {"Ljava/lang/Object;"}); + mv.visitFrame(F_SAME1, 2, new Object[] {INTEGER, "java/lang/Object"}, 1, new Object[] {"java/lang/Object"}); mv.visitInsn(ARETURN); mv.visitMaxs(2, 2); mv.visitEnd(); @@ -595,16 +595,16 @@ private static void testUnresolvedValueTypeGetField(ClassWriter cw, String class for (int i = 0; i < fieldCount; i++) { String nameAndSigValue[] = containerFields[i].split(":"); mv.visitLabel(caseLabels[i]); - mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "Ljava/lang/Object;"}, 0, new Object[]{}); + mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "java/lang/Object"}, 0, new Object[]{}); mv.visitVarInsn(ALOAD, 1); mv.visitFieldInsn(GETFIELD, containerClassName, nameAndSigValue[0], nameAndSigValue[1]); mv.visitJumpInsn(GOTO, endLabel); } mv.visitLabel(defaultLabel); - mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "Ljava/lang/Object;"}, 0, new Object[]{}); + mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "java/lang/Object"}, 0, new Object[]{}); mv.visitInsn(ACONST_NULL); mv.visitLabel(endLabel); - mv.visitFrame(F_SAME1, 3, new Object[] {INTEGER, containerClassName, "Ljava/lang/Object;"}, 1, new Object[]{"Ljava/lang/Object;"}); + mv.visitFrame(F_SAME1, 3, new Object[] {INTEGER, containerClassName, "java/lang/Object"}, 1, new Object[]{"java/lang/Object"}); mv.visitInsn(ARETURN); mv.visitMaxs(1, 2); mv.visitEnd(); @@ -625,16 +625,17 @@ private static void testUnresolvedValueTypePutField(ClassWriter cw, String class for (int i = 0; i < fieldCount; i++) { String nameAndSigValue[] = containerFields[i].split(":"); mv.visitLabel(caseLabels[i]); - mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "Ljava/lang/Object;"}, 0, new Object[]{}); + mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "java/lang/Object"}, 0, new Object[]{}); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); - mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1]); + // TODO do I need to check if this (and other cases) are objects or not? + mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1].substring(1, nameAndSigValue[1].length() - 1)); mv.visitFieldInsn(PUTFIELD, containerClassName, nameAndSigValue[0], nameAndSigValue[1]); mv.visitJumpInsn(GOTO, endLabel); } mv.visitLabel(defaultLabel); mv.visitLabel(endLabel); - mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "Ljava/lang/Object;"}, 0, new Object[]{}); + mv.visitFrame(F_SAME, 3, new Object[] {INTEGER, containerClassName, "java/lang/Object"}, 0, new Object[]{}); mv.visitInsn(RETURN); mv.visitMaxs(2, 3); mv.visitEnd(); @@ -872,7 +873,7 @@ private static void generateStaticSetterGeneric(ClassWriter cw, String[] nameAnd break; default: if ((nameAndSigValue[1].length() >= 1) && (nameAndSigValue[1].charAt(0) == 'L')) { - mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1]); + mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1].substring(1, nameAndSigValue[1].length() - 1)); } break; } @@ -926,7 +927,7 @@ private static void generateSetterGeneric(ClassWriter cw, String[] nameAndSigVal break; default: if ((nameAndSigValue[1].length() >= 1) && (nameAndSigValue[1].charAt(0) == 'L')) { - mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1]); + mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1].substring(1, nameAndSigValue[1].length() - 1)); } break; } @@ -1015,7 +1016,7 @@ private static void generateWitherGeneric(ClassWriter cw, String[] nameAndSigVal break; default: if ((nameAndSigValue[1].length() >= 1) && (nameAndSigValue[1].charAt(0) == 'L')) { - mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1]); + mv.visitTypeInsn(CHECKCAST, nameAndSigValue[1].substring(1, nameAndSigValue[1].length() - 1)); } break; }