You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2019/11/27 16:20:00 UTC

[jira] [Commented] (GROOVY-5736) Log4j, Commons, Slf4j ast transforms are broken in Groovy-Eclipse

    [ https://issues.apache.org/jira/browse/GROOVY-5736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16983684#comment-16983684 ] 

Eric Milles commented on GROOVY-5736:
-------------------------------------

Patch still exists in groovy-eclipse: https://github.com/groovy/groovy-eclipse/blob/aa050514e34591f950f1ac177bff87db15354ee0/base/org.codehaus.groovy30/src/org/codehaus/groovy/transform/LogASTTransformation.java#L347

> 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
>            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.3.4#803005)