JDK-7177306 : Regression: unchecked method call does not erase return type
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2012-06-15
  • Updated: 2014-02-05
  • Resolved: 2012-09-25
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
8 b120Fixed
Related Reports
Relates :  
Relates :  
Description
The following program does not compile anymore after 7166552:

import java.util.List;

class Test<A> {

    public static void test(List l) {
        Test<Object> to = m(l);
    }

    public static <E> Test<String> m(List<E> le) {
        return null;
    }
}

[used to compile with unchecked warnings]

Comments
verified b66
11-12-2012

SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/ad2ca2a4ab5e
25-09-2012

EVALUATION This regression is caused by 7166552 - when Infer.instantiateMethod carries out 15.12.2.8 it doesn't check that unchecked method call has been applied - in which case 15.12.2.8 should not apply (at least it didn't in the old code).
15-06-2012