JDK-8059898 : 4.10.4: lub incorrect for '? extends T', '? super T' combination
  • Type: Bug
  • Component: specification
  • Sub-Component: language
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-10-07
  • Updated: 2018-08-03
  • Resolved: 2016-09-27
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 9
9Fixed
Related Reports
Relates :  
Description
Per JLS 4.10.4, lub(List<? extends Exception>, List<? super Exception>) = List<Exception>.

lcta(? extends U, ? super V) = U if U = V, otherwise ?

This is not correct -- the result is not a supertype of either of the inputs.  (Effectively this is computing a glb, not a lub.)

The right thing to do is to find a wildcard that includes the union of the ranges represented by two wildcards -- always an unbounded wildcard, '?'
Comments
The fix is simple: lcta(? extends U, ? super V) = ***?***
07-10-2014