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

Summary: import static is marked as failure
Product: groovy Reporter: hypfvieh
Component: EditorAssignee: Martin Janicek <mjanicek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Sample project for demonstrating the import static 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).