Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.5.6
-
Fix Version/s: 1.7-beta-1
-
Component/s: bytecode, class generator, command line processing
-
Labels:None
-
Number of attachments :
Description
I want to use annotated classes im my Groovy beans, but org.springframework.scripting.groovy.GroovyScriptFactory#getScriptedObject uses getGroovyClassLoader().parseClass call, and it returns class instance with no annotations attached.
The same groovy
Activity
Max Ishchenko
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | groovy-2982-testcase.zip [ 36233 ] |
blackdrag blackdrag
made changes -
| Fix Version/s | 1.5.8 [ 14630 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.2 [ 15151 ] | |
| Fix Version/s | 1.5.8 [ 14630 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.2 [ 15151 ] | |
| Fix Version/s | 1.6.3 [ 15251 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Fix Version/s | 1.6.3 [ 15251 ] |
Paul King
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Paul King [ paulk_asert ] | |
| Resolution | Not A Bug [ 6 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Sorry, pressed "add" accidentally.
So, the same groovy file compiled with groovyc generated bytecode WITH annotations.
After some investigation I found, that groovy.lang.GroovyClassLoader#parseClass method invokes
int goalPhase = compile(Phases.CLASS_GENERATION),
unit.compile(goalPhase);
whereas FileSystemCompiler invokes unit.compile(), and it invokes compile((Phases.ALL)
The annotation is present in AST in both cases. But it is lost when goalPhase = Phases.CLASS_GENERATION