-
Bug
-
Resolution: Fixed
-
P3
-
asm_tools_7.0
-
None
-
b07
-
b07
The code snippet
public interface ITestInterfaceA
version 56:0
{
....
static Method "<clinit>":"()V"
stack 2 locals 0
{
invokestatic Method java/lang/invoke/MethodHandles.lookup:"()Ljava/lang/invoke/MethodHandles$Lookup;";
putstatic Field LOOKUP:"Ljava/lang/invoke/MethodHandles$Lookup;";
ldc Dynamic REF_invokeStatic:ITestInterfaceA.condyBsmIA2:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;I)Ljava/lang/String;":condy:"Ljava/lang/String;" {
String "Hi",
int 2
};
putstatic Field sfS2:"Ljava/lang/String;";
return;
}
}
-----------------------
produces classfile that can't be loaded. Hotspot throws the exception:
java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class javasoft/sqe/tests/api/java/lang/constant/data/ITestInterfaceA. Method condyBsmIA2(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;I)Ljava/lang/String; at index 42 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
public interface ITestInterfaceA
version 56:0
{
....
static Method "<clinit>":"()V"
stack 2 locals 0
{
invokestatic Method java/lang/invoke/MethodHandles.lookup:"()Ljava/lang/invoke/MethodHandles$Lookup;";
putstatic Field LOOKUP:"Ljava/lang/invoke/MethodHandles$Lookup;";
ldc Dynamic REF_invokeStatic:ITestInterfaceA.condyBsmIA2:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;I)Ljava/lang/String;":condy:"Ljava/lang/String;" {
String "Hi",
int 2
};
putstatic Field sfS2:"Ljava/lang/String;";
return;
}
}
-----------------------
produces classfile that can't be loaded. Hotspot throws the exception:
java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class javasoft/sqe/tests/api/java/lang/constant/data/ITestInterfaceA. Method condyBsmIA2(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;I)Ljava/lang/String; at index 42 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
- relates to
-
CODETOOLS-7902648 jasm has no clues about how to interpret CONSTANT_MethodHandle_info:reference_kind in an invokedynamic instruction
- Resolved