This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 170050 - Provide a warning on explicit type arguments on static method and constructor calls
Summary: Provide a warning on explicit type arguments on static method and constructor...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2009-08-07 15:57 UTC by matthies
Modified: 2013-09-02 14:19 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2009-08-07 15:57:15 UTC
Please provide a warning on code like:

    System.out.<Integer> println("");

    List<?> list = new <Integer> ArrayList();

Such code is valid according to JLS, and javac is able to compile it since JDK 1.7 (see issue 146272). 
The '<Integer>' type argument is effectively ignored here. But the rational given in JLS with regard to 
substitutability only applies to instance methods, not to static methods and constructors, as these cannot be 
overridden in subtypes (only hidden, for static methods). Therefore a warning would be in order for static methods and