JDK-8027253 : javac illegally accepts array as bound
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-10-24
  • Updated: 2013-12-13
  • Resolved: 2013-11-11
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 Other
8 b117Fixed port-stage-ppc-aixFixed
Related Reports
Blocks :  
Blocks :  
Description
Javac 8b112 accepts the following code: 
class Class<M extends Object[]> { }

As per JLS 7, 4.4. Type Variables

Grammar: 

TypeParameter:
    TypeVariable TypeBoundopt

TypeBound:
    extends TypeVariable
    extends ClassOrInterfaceType AdditionalBoundListopt

4.3. Reference Types and Values:
ReferenceType:
    ClassOrInterfaceType
    TypeVariable
    ArrayType

This means ArrayType should not be allowed. 

The following JCK tests fail:

 	lang/TYPE/type140/type14003m0/type14003m0.html
	lang/TYPE/type140/type14003m1/type14003m1.html
	lang/TYPE/type140/type14003m2/type14003m2.html
	lang/TYPE/type140/type14003m3/type14003m3.html
 	lang/TYPE/type140/type14003m0/type14003m01.html
	lang/TYPE/type140/type14003m1/type14003m11.html
	lang/TYPE/type140/type14003m2/type14003m21.html
	lang/TYPE/type140/type14003m3/type14003m31.html
Comments
verification: lang/TYPE/type140/type14003m0/type14003m01.html not run in jck 8/b59 build(???). checking excluded tests. All other tests pass with recent jdk 8 builds and jck 8/b59 looks like an incorrect listing. should be lang/TYPE/type140/type14003m01/type14003m01
05-12-2013

Affected tests (see JCK-7301818 that was closed as a duplicate of this bug): lang/TYPE/type140/type14003m01/type14003m01 lang/TYPE/type140/type14003m11/type14003m11 lang/TYPE/type140/type14003m21/type14003m21 lang/TYPE/type140/type14003m31/type14003m31 Logs (JDK 8 b116 + JCK 8 b35): http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=317740.ute.st2-1
18-11-2013

Under review
06-11-2013

8-critical-dev: this bug is a tck-red blocked by a small change in the spec. It will take a few days more than the allowed time for a ZBB bug but planning to be completed by or before Nov 11.
06-11-2013

Blocked by requested spec change
01-11-2013

Fixing this would reopen JDK-8021339. Recommended action: amend the lambda spec and back out the fix for JDK-8021339
31-10-2013

The test failed on JDK 8 b112 + JCK 8 b32: http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=308606.ute.st2-1
25-10-2013

If this is not a bug I need a spec that modifies 4.4 saying that TypeBound can be ArrayType.
24-10-2013

Suspect this is not a bug. The ability to have an array in an intersection type was added as a result of this bug: JDK-8021339
24-10-2013