JDK-8058291 : Missing some checks during parameter validation
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 8u40,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-09-12
  • Updated: 2015-06-04
  • Resolved: 2014-09-16
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 8 JDK 9
8u40Fixed 9 b32Fixed
Description
After 2014-09-10 MethodHandle MethodType changes (possible related to change of JDK-8057656, JDK-8057654), JCK test api/java_lang/invoke/MethodHandles/index.html start failing on all platforms.

Failed test:
api/java_lang/invoke/MethodHandles/index_ExceptionsTests TestCase [dropArgumentsIAE01]
api/java_lang/invoke/MethodHandles/index_ExceptionsTests TestCase [dropArgumentsIAE03] 
api/java_lang/invoke/MethodHandles/index_ExceptionsTests TestCase [explicitCastArgumentsIAE]

Expected exception java.lang.IllegalArgumentException was not thrown by testcase "dropArgumentsIAE01"
"java.lang.ArrayIndexOutOfBoundsException: 5" was thrown instead
java.lang.ArrayIndexOutOfBoundsException: 5
	at java.lang.invoke.LambdaForm.argument(LambdaForm.java:1607)
	at java.lang.invoke.LambdaForm.internArgument(LambdaForm.java:1613)
	at java.lang.invoke.LambdaForm.normalize(LambdaForm.java:393)
	at java.lang.invoke.LambdaForm.<init>(LambdaForm.java:251)
	at java.lang.invoke.LambdaForm.addArguments(LambdaForm.java:907)
	at java.lang.invoke.LambdaForm.addArguments(LambdaForm.java:911)
	at java.lang.invoke.MethodHandles.dropArguments(MethodHandles.java:2491)
	at java.lang.invoke.MethodHandles.dropArguments(MethodHandles.java:2559)
	at javasoft.sqe.tests.api.java.lang.invoke.MethodHandles.ExceptionsTests.dropArgumentsIAE01(ExceptionsTests.java:319)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.tck.lib.tgf.Util.invokeMethod(Util.java:435)
	at com.sun.tck.lib.tgf.Runner.invokeTestCase(Runner.java:276)
	at com.sun.tck.lib.tgf.Runner.runWithNoArgs(Runner.java:172)
	at com.sun.tck.lib.tgf.Runner.executeTestMethods(Runner.java:133)
	at com.sun.tck.lib.tgf.Runner.run(Runner.java:116)
	at com.sun.tck.lib.tgf.Runner.execute(Runner.java:108)
	at com.sun.tck.lib.tgf.TGFTest.run(TGFTest.java:58)
	at com.sun.tck.lib.tgf.TGFTest.run(TGFTest.java:64)
	at javasoft.sqe.tests.api.java.lang.invoke.MethodHandles.ExceptionsTests.main(ExceptionsTests.java:57)
dropArgumentsIAE01: Failed. Expected exception java.lang.IllegalArgumentException was not thrown by testcase "dropArgumentsIAE01"
dropArgumentsIAE02: Passed. test cases: 4; all passed
Expected exception java.lang.IllegalArgumentException was not thrown by testcase "dropArgumentsIAE03"
"java.lang.ArrayIndexOutOfBoundsException: 5" was thrown instead
java.lang.ArrayIndexOutOfBoundsException: 5
	at java.lang.invoke.LambdaForm.argument(LambdaForm.java:1607)
	at java.lang.invoke.LambdaForm.internArgument(LambdaForm.java:1613)
	at java.lang.invoke.LambdaForm.normalize(LambdaForm.java:393)
	at java.lang.invoke.LambdaForm.<init>(LambdaForm.java:251)
	at java.lang.invoke.LambdaForm.addArguments(LambdaForm.java:907)
	at java.lang.invoke.LambdaForm.addArguments(LambdaForm.java:911)
	at java.lang.invoke.MethodHandles.dropArguments(MethodHandles.java:2491)
	at javasoft.sqe.tests.api.java.lang.invoke.MethodHandles.ExceptionsTests.dropArgumentsIAE03(ExceptionsTests.java:385)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.tck.lib.tgf.Util.invokeMethod(Util.java:435)
	at com.sun.tck.lib.tgf.Runner.invokeTestCase(Runner.java:276)
	at com.sun.tck.lib.tgf.Runner.runWithNoArgs(Runner.java:172)
	at com.sun.tck.lib.tgf.Runner.executeTestMethods(Runner.java:133)
	at com.sun.tck.lib.tgf.Runner.run(Runner.java:116)
	at com.sun.tck.lib.tgf.Runner.execute(Runner.java:108)
	at com.sun.tck.lib.tgf.TGFTest.run(TGFTest.java:58)
	at com.sun.tck.lib.tgf.TGFTest.run(TGFTest.java:64)
	at javasoft.sqe.tests.api.java.lang.invoke.MethodHandles.ExceptionsTests.main(ExceptionsTests.java:57)
dropArgumentsIAE03: Failed. Expected exception java.lang.IllegalArgumentException was not thrown by testcase "dropArgumentsIAE03"
...
Expected exception java.lang.invoke.WrongMethodTypeException was not thrown by testcase "explicitCastArgumentsIAE"
explicitCastArgumentsIAE: Failed. Expected exception java.lang.invoke.WrongMethodTypeException was not thrown by testcase "explicitCastArgumentsIAE"
...
result: Failed. test cases: 42; passed: 39; failed: 3; first test case failure: dropArgumentsIAE01

java under test: 
java version "1.9.0-ea" 
Java(TM) SE Runtime Environment (build 1.9.0-ea-langtools-nightly-h1284-20140910-b30) 

jck suite info: 
JCK version: 9/b01 



Comments
Mentioned JCK test passed with jdk9/b32, jck9/b03
26-09-2014