See attached testcase (Test1.java, InstrumentationHandoff.java, retransformAgent.mf)
> javac Test1.java
> javac InstrumentationHandoff.java
> jar cvfm retransformAgent.jar retransformAgent.mf InstrumentationHandoff.class
> java -XX:MaxRAMPercentage=12 -javaagent:retransformAgent.jar Test1
Results:
InstrumentationHandoff JPLIS agent initialized
>>addTransformerToManager
>>transform
>>transform
Exception in thread "main" >>transform
>>transform
>>transform
java.lang.ClassCircularityError: java/lang/invoke/MethodHandleImpl$AsVarargsCollector
>>transform
>>transform
at java.base/java.lang.invoke.MethodHandleImpl.makeVarargsCollector(MethodHandleImpl.java:442)
at java.base/java.lang.invoke.MethodHandle.asVarargsCollector(MethodHandle.java:1433)
at java.base/java.lang.invoke.MethodHandle.withVarargs(MethodHandle.java:1114)
at java.base/java.lang.invoke.MethodHandle.setVarargs(MethodHandle.java:1637)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:3996)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:3944)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:4188)
at java.base/java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:4136)
at java.base/java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:615)
at Test1.addTransformerToManager(Test1.java:27)
at Test1.runTest(Test1.java:18)
at Test1.main(Test1.java:10)
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
> javac Test1.java
> javac InstrumentationHandoff.java
> jar cvfm retransformAgent.jar retransformAgent.mf InstrumentationHandoff.class
> java -XX:MaxRAMPercentage=12 -javaagent:retransformAgent.jar Test1
Results:
InstrumentationHandoff JPLIS agent initialized
>>addTransformerToManager
>>transform
>>transform
Exception in thread "main" >>transform
>>transform
>>transform
java.lang.ClassCircularityError: java/lang/invoke/MethodHandleImpl$AsVarargsCollector
>>transform
>>transform
at java.base/java.lang.invoke.MethodHandleImpl.makeVarargsCollector(MethodHandleImpl.java:442)
at java.base/java.lang.invoke.MethodHandle.asVarargsCollector(MethodHandle.java:1433)
at java.base/java.lang.invoke.MethodHandle.withVarargs(MethodHandle.java:1114)
at java.base/java.lang.invoke.MethodHandle.setVarargs(MethodHandle.java:1637)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:3996)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:3944)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:4188)
at java.base/java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:4136)
at java.base/java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:615)
at Test1.addTransformerToManager(Test1.java:27)
at Test1.runTest(Test1.java:18)
at Test1.main(Test1.java:10)
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
>>transform
- relates to
-
JDK-8164165 JVM throws incorrect exception when ClassFileTransformer.transform() triggers class loading of class already being loaded
- Open
-
JDK-8262002 java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh failed with "TestCaseScaffoldException: DummyClassWithLVT did not match .class file"
- Resolved
-
JDK-8311534 VerifyLocalVariableTableOnRetransformTest test fails with DummyClassWithLVT was not seen by transform()
- Open