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 233459 - import static is marked as failure
Summary: import static is marked as failure
Status: NEW
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-26 06:04 UTC by hypfvieh
Modified: 2013-08-05 13:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample project for demonstrating the import static bug (16.78 KB, application/x-tar)
2013-07-26 06:04 UTC, hypfvieh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hypfvieh 2013-07-26 06:04:04 UTC
Created attachment 137836 [details]
Sample project for demonstrating the import static bug

When using Constants imported via 'import static' in a static context (static class member or method) the editor marks it as failure.
It doesnt matter if you static import the constant by name or by using *.

The constants are defined in an (already compiled) Java-Class.

Compiling and running the groovy script is working fine, just the editor is complaining. 
The same code is also not marked as error when using eclipse+groovy plugin. 

I get this error in Netbeans 7.3.1 and 7.4 Beta. I also tried different JDK and Groovy Versions (JDK: 1.6.45 and 1.7.25, Groovy: 2.0.1 and 2.0.6) without any difference.


I attached an example project to demonstrate the issue.

If you need further information, please let me know.
Comment 1 Martin Janicek 2013-08-05 13:24:24 UTC
I'm able to reproduce the problem, thanks for the report. For some reason, the parser don't see the static field from Java class (I tried to create new Groovy class called "thingelse" and if I change the import to "import static some.thingelse.*" it works correctly).