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 233796 - Regression: Editor reports errors in project even when compilation does not fail
Summary: Regression: Editor reports errors in project even when compilation does not fail
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-01 14:54 UTC by mjr_1974
Modified: 2013-08-06 14:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (59.87 KB, text/plain)
2013-08-01 14:54 UTC, mjr_1974
Details
Picture showing the errors in NB4 compared to NB3.7.1 (381.13 KB, image/png)
2013-08-01 15:13 UTC, mjr_1974
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mjr_1974 2013-08-01 14:54:10 UTC
Product Version = NetBeans IDE 7.4 Beta (Build 201307092200)
Operating System = Linux version 3.8.0-26-generic running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

I compiled a project with Netbeans 4 beta and shows that some files have errors. The same project opened with Netbeans 3.7.1 does not show them. See attached picture for details.
Comment 1 mjr_1974 2013-08-01 14:54:12 UTC
Created attachment 138134 [details]
IDE log
Comment 2 mjr_1974 2013-08-01 15:13:04 UTC
Created attachment 138136 [details]
Picture showing the errors in NB4 compared to NB3.7.1
Comment 3 Tomas Zezula 2013-08-02 09:26:10 UTC
Invalid.
The JDK used on command line (JDK 7 according to synopses) has a bug in finding search scope, NetBeans is correct.

The code will not compile neither on JDK 6 nor on JDK 8 where the bug in compiler was fixed.
The source code on screenshot is incorrect according to JLS. The compiler HAS NOT to find the static imported valueOf it HAS TO stop scope search in Enum and find only the <T extends Enum<T>> T Enum.valueOf(Class<T> enumType,String name) which is apparently not applicable, so the attribution has to emit the error. For details see JLS 15.12.1 http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.12.1
Comment 4 mjr_1974 2013-08-06 14:15:02 UTC
@Tomas
Thanks for the clarification. Indeed, if I rename the method the static import works fine. I changed to JDK8-preview and the code does not compile as you said.