JDK-8207027 : Lookup.accessClass fails for an array type in the same package when assertions are enabled
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-07-11
  • Updated: 2021-04-29
  • Resolved: 2018-07-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11 b23Fixed 12Fixed
Related Reports
Duplicate :  
Relates :  
Description
Test api/java_lang/invoke/ConstantBootstraps/index.html#VarHandleTests fails when -esa is used. It pass when no assertions are disabled.
Comments
This is likely a problem with an unnecessary assert in VerifyAccess.isSamePackage
11-07-2018

Testcase "arrVarHandle" has thrown an unexpected exception java.lang.AssertionError java.lang.AssertionError at java.base/sun.invoke.util.VerifyAccess.isSamePackage(VerifyAccess.java:336) at java.base/sun.invoke.util.VerifyAccess.isClassAccessible(VerifyAccess.java:227) at java.base/java.lang.invoke.MethodHandles$Lookup.accessClass(MethodHandles.java:1315) at java.base/java.lang.invoke.ConstantBootstraps.validateClassAccess(ConstantBootstraps.java:355) at java.base/java.lang.invoke.ConstantBootstraps.arrayVarHandle(ConstantBootstraps.java:350) at javasoft.sqe.tests.api.java.lang.invoke.ConstantBootstraps.VarHandleTests.arrVarHandle(VarHandleTests.java:185) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.oracle.tck.lib.autd2.processors.tc.TGFTestCaseMethodSetting.lambda$processSettingMethodPhase$0(TGFTestCaseMethodSetting.java:120) at com.oracle.tck.lib.autd2.processors.tc.DefaultThreadRunning.process(DefaultThreadRunning.java:58) at com.oracle.tck.lib.autd2.processors.tc.DefaultThreadRunning.process(DefaultThreadRunning.java:14) at com.oracle.tck.lib.autd2.AUTD2Utils.iterateThroughProcessorsUntilAllAreDone(AUTD2Utils.java:200) at com.oracle.tck.lib.autd2.AUTD2Utils.iterateLifePhases(AUTD2Utils.java:39) at com.oracle.tck.lib.autd2.AUTD2Utils.iterateTestCaseLifePhase(AUTD2Utils.java:379) at com.oracle.tck.lib.autd2.processors.tg.RunningTestCases.runTestCaseAsNeeded(RunningTestCases.java:60) at com.oracle.tck.lib.autd2.processors.tg.RunningTestCases.lambda$process$0(RunningTestCases.java:38) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at com.oracle.tck.lib.autd2.processors.tg.RunningTestCases.process(RunningTestCases.java:30) at com.oracle.tck.lib.autd2.processors.tg.RunningTestCases.process(RunningTestCases.java:20) at com.oracle.tck.lib.autd2.AUTD2Utils.iterateThroughProcessorsUntilAllAreDone(AUTD2Utils.java:200) at com.oracle.tck.lib.autd2.AUTD2Utils.iterateLifePhases(AUTD2Utils.java:39) at com.oracle.tck.lib.autd2.TestRunner.performRun(TestRunner.java:127) at com.oracle.tck.lib.autd2.TestRunner.run(TestRunner.java:315) at com.oracle.tck.lib.autd2.TestRunner.run(TestRunner.java:267) at com.oracle.tck.lib.autd2.AUTD2.run(AUTD2.java:22) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.sun.jck.lib.ExecJCKTestSameJVMCmd$Version2Test.execute(ExecJCKTestSameJVMCmd.java:566) at com.sun.jck.lib.ExecJCKTestSameJVMCmd$StandardTest.run(ExecJCKTestSameJVMCmd.java:523) at com.sun.jck.lib.ExecJCKTestSameJVMCmd.execute(ExecJCKTestSameJVMCmd.java:407) at com.sun.jck.lib.ExecJCKTestSameJVMCmd.run(ExecJCKTestSameJVMCmd.java:337) at com.sun.javatest.agent.Agent$Task$CommandExecutor$2.run(Agent.java:899) at java.base/java.lang.Thread.run(Thread.java:834) Testcase "arrVarHandle" failed with arguments [class [Ljavasoft.sqe.tests.api.java.lang.invoke.ConstantBootstraps.CustomClass2;] Testcase "arrVarHandle" is based on the following statements: - "Finds a {@link VarHandle} for an array type." -- from source: java.lang.invoke.ConstantBootstraps arrVarHandle: Failed. test cases: 12; passed: 11; failed: 1
11-07-2018