JDK-6384510 : improper handling of wildcard captures
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-02-11
  • Updated: 2017-05-19
  • Resolved: 2006-05-13
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 6
6 b85Fixed
Related Reports
Relates :  
Description
This program compiles with b71, 
but fails to compile with earlier mustang builds

import java.util.*;

public class rr {
    public static void main(String[] args) throws Throwable {
	List<?> x1 = new ArrayList<Integer>();
	List<?> x2 = new ArrayList<Integer>();
	x1.addAll(x2);
    }
}

The expected error is:

rr.java:8: cannot find symbol
symbol  : method addAll(java.util.List<capture of ?>)
location: interface java.util.List<capture of ?>
	x1.addAll(x2);
	  ^
1 error

(although the error message could be improved)

Comments
EVALUATION This was caused by the fix for 5049523.
11-02-2006