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

Summary: Provide a warning on explicit type arguments on static method and constructor calls
Product: java Reporter: matthies <matthies>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

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 15.12.2.1, 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 15.12.2.1 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 
constructors.