[JDK-6559179] Unchecked upcast not identified Created: 2007-05-18  Updated: 2010-04-02  Resolved: 2009-03-13

Status: Closed
Project: JDK
Component/s: tools
Affects Version/s: 6
Fix Version/s: None

Type: Bug Priority: P5
Reporter: Peter Ahe Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: javac-cast, javac-check-spec, javac-eclipse, peter.ahe
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates JDK-6467183 javac fails to raise unchecked warnin... Closed
Relates
relates to JDK-6790039 overhaul cast-conversion (umbrella) Closed
relates to JDK-6559178 upcast can never yield an unchecked w... Closed
Subcomponent: javac
CPU:
generic
OS:
generic
Imported:
Indexed:

 Description   
See also specification bug 6559178.

Also, it feels that the following (up)cast scenario should be flagged as
unchecked:

public class X<R> {
      static interface Interface extends Comparable<String> {}
      static final class Implements implements Interface {
            public int compareTo(String o) {
                  return 0;
            }
      }

      void method() {
            ((Comparable<R>) new Implements()).toString(); // unchecked ?
      }
}

Generated at Sat Aug 24 03:07:28 UTC 2019 using Jira 7.13.5#713005-sha1:8d78f1047b9cca7d35d4d13f706b37e27d869e07.