Bug 167284 - Editor shows error when importing annotation type inside groovy file
Editor shows error when importing annotation type inside groovy file
Status: RESOLVED FIXED
Product: groovy
Classification: Unclassified
Component: Editor
6.x
Macintosh Mac OS X
: P3 with 5 votes (vote)
: 7.2
Assigned To: Martin Janicek
issues@groovy
:
: 170517 188611 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-18 09:22 UTC by matroska80
Modified: 2012-10-09 02:05 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Project with a test controller with Secured class import with errors (118.15 KB, text/plain)
2009-06-18 19:02 UTC, matroska80
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matroska80 2009-06-18 09:22:54 UTC
The editor of netbeans cannot resolve grails plugins classes located in the home. With 'Resolve plugins' nothing happens
and the import errors still remain.
Tried with grails 1.1 on ubuntu and netbeans 6.7 rc2.
Comment 1 Petr Hejl 2009-06-18 09:55:16 UTC
This is strange. Can you provide a steps to reproduce (or the project itself)? For example create project, do this and that.

BTW Do the home directory contains the jars? If you have checkout the project you have to run it once to download
missing plugins.
Comment 2 matroska80 2009-06-18 10:39:56 UTC
I will provide a simple project. In the meanwhile I can say that I have created a simple grails 1.1.1 project (I am
using ubuntu 9.04) with netbeans 6.7rc2, added acegi plugin (spring security), tried to use @Secured annotation (import
org.codehaus.groovy.grails.plugins.springsecurity.Secured) but the editor marks it as an error but the project runs
flawlessy. Thank you.
Comment 3 matroska80 2009-06-18 19:02:53 UTC
Created attachment 83773 [details]
Project with a test controller with Secured class import with errors
Comment 4 Petr Hejl 2009-06-19 17:56:42 UTC
Reproducible.
Comment 5 Petr Hejl 2009-06-30 14:20:33 UTC
Fixed in web-main 0441f185a7c8.
Comment 6 Quality Engineering 2009-07-01 05:26:54 UTC
Integrated into 'main-golden', will be available in build *200907010200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0441f185a7c8
User: phejl@netbeans.org
Log: #167284 Editor doesn't resolve grails plugin classes
Comment 7 henrik1409 2010-08-18 07:31:07 UTC
This issue has still not been resolved. I am running the latest development build (from yesterday) on Mac OSX 10.6, and my collegue has the same issue on Ubuntu 10.4 on Netbeans 6.9
Comment 8 henrik1409 2010-08-18 07:33:48 UTC
(In reply to comment #7)
> This issue has still not been resolved. I am running the latest development
> build (from yesterday) on Mac OSX 10.6, and my collegue has the same issue on
> Ubuntu 10.4 on Netbeans 6.9

Just forgot - I am also running Grails 1.3.4
Comment 9 nick1258 2010-08-23 23:20:47 UTC
I too am experiencing this issue with Netbeans 6.9/Grails 1.3.4 on Windows XP and with Netbeans 6.9.1 and Grails 1.3.4 on Windows Vista.
Comment 10 dynamind 2011-01-05 10:14:34 UTC
Same problem here. Very annoying...

Product Version: NetBeans IDE 6.9.1 (Build 201011082200)
Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM 17.1-b03-307
System: Mac OS X version 10.6.5 running on x86_64; MacRoman; nl_NL (nb)
Grails: 1.3.5
Groovy: 1.7.5

I created the project from the command line; also installed the Spring Security Core plugin from the command line (it does show up in the plugins list in NetBeans).

Building up the following statement using autocomplete works, but after that it complains that it can not resolve the class.

import grails.plugins.springsecurity.Secured // <-- Can not resolve class grails.plugins.springsecurity.Secured

The code does compile and run without problems
Comment 11 dynamind 2011-01-05 10:33:04 UTC
Additional info.

When I type:

import grails.plugins.springsecurity.*
@Secured('ROLE_ADMIN')

the resolve problem on the import goes away, but now it complains about resolving @Secured.

When I import another class from the same package, there's no issue:

import grails.plugins.springsecurity.SecurityConfigType // works
import grails.plugins.springsecurity.DigestAuthPasswordEncoder // works
import grails.plugins.springsecurity.Secured // fails to resolve

Secured is a public @interface. Maybe that's the issue?
Comment 12 Martin Janicek 2011-12-23 12:58:17 UTC
Hi guys, I'm trying to fix the issue but I not able to unpack attached project for some reason. Could anyone provide a similar simple project so I'll be able to reproduce the issue?

From the latest comments it seems that the issue is happening only with Grails 1.3.4 / 1.3.5, so it might be already fixed together with issue 206198. (the fix improves classpath resolving for subdirectories)
Comment 13 Martin Janicek 2011-12-23 13:10:56 UTC
*** Bug 188611 has been marked as a duplicate of this bug. ***
Comment 14 Martin Janicek 2011-12-23 13:13:19 UTC
*** Bug 170517 has been marked as a duplicate of this bug. ***
Comment 15 Martin Janicek 2011-12-23 13:15:48 UTC
I've fixed the unpacking problem - I'm able to reproduce the issue even with 206198 fix.
Comment 16 Martin Janicek 2012-01-12 13:38:05 UTC
I've been looking around a little bit and the problem is definitely caused by annotation types (doesn't matter if it's spring Secured or some annotation created by user).
Comment 17 Martin Janicek 2012-10-08 13:05:55 UTC
Fixed in: http://hg.netbeans.org/web-main/rev/ddd83054b1d4
It should be in the daily build in a few days.. would be great if anyone could confirm it works correctly (I've tried only most basic use case). Thanks in advance
Comment 18 Quality Engineering 2012-10-09 02:05:05 UTC
Integrated into 'main-golden', will be available in build *201210090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ddd83054b1d4
User: Martin Janicek <mjanicek@netbeans.org>
Log: #167284 - Editor shows error when importing annotation type inside groovy file


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo