[
https://issues.apache.org/jira/browse/GROOVY-5736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles reassigned GROOVY-5736:
-----------------------------------
Assignee: Eric Milles
> Log4j, Commons, Slf4j ast transforms are broken in Groovy-Eclipse
> -----------------------------------------------------------------
>
> Key: GROOVY-5736
> URL: https://issues.apache.org/jira/browse/GROOVY-5736
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.0.4
> Reporter: Andrew Eisenberg
> Assignee: Eric Milles
> Priority: Major
>
> Since Groovy-Eclipse moved to using the 2.0.4 compiler, the @Log4j and other
> log ast transformations are crashing the compiler. This is because in
> GROOVY-5574, there was a move to call {{Class.forName()}} in the Log AST
> transformation. In Groovy-Eclipse, you cannot use Class.forName since the
> classpath of the project is not on the classpath of the compiler.
> The workaround is to change
> {{org.codehaus.groovy.transform.LogASTTransformation.AbstractLoggingStrategy.classNode(String)}}.
> Instead of throwing a {{GroovyRuntimeException}}, you could simply call and
> return {{ClassHelper.make(name);}}.
> I know this adds code that was removed to fix GROOVY-5574, but for
> Groovy-Eclipse this is safe since {{ClassHelper.make(name);}} will correctly
> use the project's class path to generate the ClassNode and classloader issues
> will not happen.
> If you think that this solution is not a good one because of problems that
> could occur outside of eclipse, then we could talk about a different solution.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)