Bug 85930

Summary: [1.5][compiler] Incorrect warning given accessing enum in generic interface
Product: [Eclipse Project] JDT Reporter: Nik Silver <orangecutter>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Nik Silver CLA 2005-02-20 06:08:44 EST
Entering the following code gives a warning icon in the LHS margin in 3.1M5:

interface Callable<T>
{
    public enum Result { GOOD, BAD };
    public Result call(T arg);
}

public class StaticExample implements Callable<String>
{
    public Result call(String arg) { return Result.GOOD; } // Warning line
}

The warning appears for the token "Result" on the line indicated. It reads "Type
safety: The return type Callable<String>.Result for call(String) from the type
StaticExample needs unchecked conversion to conform to Callable.Result from the
type Callable<T>."

However compiling this with "javac -Xlint StaticExample.java" gives no warnings.
Comment 1 Philipe Mulet CLA 2005-02-20 06:56:17 EST
Reproduced. Indeed the warning makes no sense here.
Comment 2 Philipe Mulet CLA 2005-02-22 19:13:56 EST
Added GenericTypeTest#test518

*** This bug has been marked as a duplicate of 84944 ***