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 210172 - Annotations for ASTTransformations do not compile
Summary: Annotations for ASTTransformations do not compile
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: Martin Janicek
URL: http://groovy.329449.n5.nabble.com/De...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-27 11:36 UTC by timdudgeon
Modified: 2012-05-11 10:12 UTC (History)
2 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 timdudgeon 2012-03-27 11:36:24 UTC
Groovy AST transformations using annotations are not working in the current 7.2 dev builds (I imagine this never worked).

Example:

import groovy.transform.Field

@Field String foo = 'hello'
println foo

Gives error like this:

Compiling 1 source file to C:\Users\timbo\Documents\NetBeansProjects\GroovyTest\build\classes
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\Users\timbo\Documents\NetBeansProjects\GroovyTest\src\GroovyScript1.groovy: Not an ASTTransformation: org.codehaus.groovy.transform.FieldASTTransformation declared by groovy.transform.Field
1 error
C:\Users\timbo\Documents\NetBeansProjects\GroovyTest\nbproject\build-impl.xml:633: The following error occurred while executing this line:
C:\Users\timbo\Documents\NetBeansProjects\GroovyTest\nbproject\groovy-build.xml:25: Compilation Failed
BUILD FAILED (total time: 0 seconds)
Comment 1 Martin Janicek 2012-03-28 05:28:27 UTC
Well this couldn't work earlier, because until now we were supporting only Groovy 1.6.4 version where groovy.transform package didn't exists at all. Easily reproducible --> Setting TM = 7.2
Comment 2 timdudgeon 2012-03-28 06:19:45 UTC
Yes, agreed. Since arriving in 1.8 these AST transfoms have become pretty widespread in use. Most real world groovy code now uses them, so I think its essential to support this.
Comment 3 Martin Janicek 2012-05-10 13:50:39 UTC
Fixed in: web-main #c0fe5fd19cbb
Comment 4 Quality Engineering 2012-05-11 10:12:21 UTC
Integrated into 'main-golden', will be available in build *201205110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c0fe5fd19cbb
User: Martin Janicek <mjanicek@netbeans.org>
Log: #210172 - Annotations for ASTTransformations do not compile