JDK-6951833 : latest diamond implementation generates spurious raw type warnings
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2010-05-12
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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 7
7 b97Fixed
Related Reports
Relates :  
Description
The new diamond implementation generates spurious raw types diagnostics:

class Foo<X> {
   Foo() {}
   Foo<String> f = new Foo<>();
}

this produces the following output (when compiled with -Xlint):

TestX.java:3: warning: [rawtypes] found raw type: Foo
   Foo<String> f = new Foo<>();
                          ^
  missing type parameters for generic class Foo<X>
  where X is a type-variable:
    X extends Object declared in class Foo
1 warning

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk7/tl/langtools/rev/e9ef849ae0ed
19-05-2010

EVALUATION Type validation should be aware of diamond AST nodes (and warnings should be suppressed accordingly).
12-05-2010