JDK-8163890 : 4.5.1: Clarify that ? <= ? extends Object
  • Type: Bug
  • Component: specification
  • Sub-Component: language
  • Affected Version: 8
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2016-08-11
  • Updated: 2016-12-08
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.
Other
tbd_majorUnresolved
Related Reports
Relates :  
Description
Per JDK-6480391 and its update to 4.5.1, "The wildcard ? extends Object is equivalent to the unbounded wildcard ?"

This is a subtle point and easy to overlook in a system that represents these two wildcards differently, so JDK-6480391 also added the following rules for type argument containment:
? extends T <= ?
? super T <= ? extends Object

Another rule should be added, also for clarity:
***? <= ? extends Object***

(Note that 18.2.3 already includes a similar rule for inference involving type argument containment.)

Comments
Extra cleanup: since containment is defined by "the reflexive and transitive closure" of these rules, there's some redundancy. The following rules could be adjusted (or, alternately, we could just skip the reflexive/transitive closure step, with some additional tweaks to the rules): Remove this (given by reflexive closure): T <= T Remove one of these (given by transitive closure): ? super T <= ? ? super T <= ? extends Object Optionally, (due to transitivity) rewrite ? extends T <= ? to ? extends Object <= ?
18-08-2016

Spec change is trivial: just add the indicated rule.
11-08-2016