Skip to content

Commit

Permalink
Merge pull request #19732 from theresa-m/valhalla_cleanup
Browse files Browse the repository at this point in the history
Clean up value type vm code
  • Loading branch information
hangshao0 authored Jun 24, 2024
2 parents a50fb4c + bb2e243 commit 2f3ea37
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 101 deletions.
32 changes: 18 additions & 14 deletions jcl/src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -5802,6 +5788,24 @@ public Set<AccessFlag> 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]*/
/**
Expand Down
4 changes: 2 additions & 2 deletions runtime/bcutil/ClassFileOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
9 changes: 0 additions & 9 deletions runtime/bcutil/ROMClassBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 0 additions & 8 deletions runtime/bcutil/cfreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions runtime/oti/cfr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 0 additions & 2 deletions runtime/oti/j9.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion runtime/util/romhelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
29 changes: 4 additions & 25 deletions runtime/verutil/chverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
* Methods, fields, local variables can not contain: '.', ';', '[' '/'.
* Methods, other than <init> and <clinit> 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,
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion runtime/vm/BytecodeInterpreter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/ObjectMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
7 changes: 0 additions & 7 deletions runtime/vm/classsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
7 changes: 1 addition & 6 deletions runtime/vm/createramclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/description.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/jvminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))) {
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2f3ea37

Please sign in to comment.