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 146272 - Editor does not underline a compiler error
Summary: Editor does not underline a compiler error
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords:
: 167336 (view as bug list)
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2008-09-05 03:40 UTC by shche123
Modified: 2009-08-07 15:59 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shche123 2008-09-05 03:40:37 UTC
LinkedList<Integer> list = new <Integer>LinkedList();

The output window produces:

GenericsThreeTest.java:11: cannot find symbol
symbol  : constructor <java.lang.Integer>LinkedList()
location: class java.util.LinkedList
        LinkedList<Integer> list = new <Integer>LinkedList();
1 error
Comment 1 Peter Pis 2008-09-05 07:16:40 UTC
Reassigning to editor for evaluation.
Comment 2 Jiri Prox 2008-09-05 10:02:48 UTC
reproducible

all wrong invocation methods with generics are not highlighted
e.g. System.out.<Integer>println("");


Product Version: NetBeans IDE Dev (Build 20080905031732)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Linux version 2.6.22-15-generic running on i386; UTF-8; en_US (nb)
Comment 3 Jan Lahoda 2008-09-22 08:52:23 UTC
In fact, specifying the explicit type parameters to an invocation of a method that is not a generic method is not a
compile-time error - see JLS 15.12.2.1. JDK1.7b26 javac compiles such code without complaints.

So we should decide whether we should mark such invocations with errors for certain source levels, or with warning, or
do nothing, or ?.
Comment 4 Rastislav Komara 2009-02-03 10:55:32 UTC
Overtake.
Comment 5 Jan Lahoda 2009-06-18 21:46:33 UTC
*** Issue 167336 has been marked as a duplicate of this issue. ***
Comment 6 matthies 2009-06-19 15:32:41 UTC
IMO a warning is in order for static methods and constructors. For those methods the rationale given in JLS 15.12.2.1 
does no apply, because they can't be overriding a method from a supertype (just hide one, for static methods).
Comment 7 Dusan Balek 2009-08-07 09:56:37 UTC
Seems like a bug in 1.6 javac compiler that has been recently fixed in 1.7 javac (which is used as a base for the
internal NB-javac). If you try to set the project's Java platform to JDK 1.7, no compilation errors are reported.
Closing as WONTFIX on NB side.
Comment 8 matthies 2009-08-07 15:59:47 UTC
FYI: I filed issue 170050 for implementing a warning on static methods and constructors, as suggested above,