groovy icon indicating copy to clipboard operation
groovy copied to clipboard

GROOVY-10615: Bump Codenarc to 3.0.1 (build dependency)

Open paulk-asert opened this issue 2 years ago • 3 comments

paulk-asert avatar May 03 '22 13:05 paulk-asert

@eric-milles When the codenarcMain task is run, there are stack traces like below:

Error from [org.codenarc.rule.naming.ClassNameRule] processing source file [D:/projects/groovyCopy/subprojects/groovy-ant/src/main/groovy/groovy/ant/FileNameFinder.groovy]
groovy.lang.MissingMethodException: No signature of method: org.codenarc.rule.naming.AbstractTypeNameAstVisitor.visitClassEx() is applicable for argument types: (org.codehaus.groovy.ast.ClassNode) values: [groovy.ant.FileNameFinder]
Possible solutions: visitClassEx(org.codehaus.groovy.ast.ClassNode), visitClass(org.codehaus.groovy.ast.ClassNode), visitClass(org.codehaus.groovy.ast.ClassNode)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:72)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:148)
        at org.codenarc.rule.naming.AbstractTypeNameAstVisitor.visitClassEx(AbstractTypeNameAstVisitor.groovy:44)
        at org.codenarc.rule.AbstractAstVisitor.visitClass(AbstractAstVisitor.java:131)

Does that look like GROOVY-10302 to you? I haven't started to debug as yet. It might also be a classloader issue.

Relevant code is here: https://github.com/CodeNarc/CodeNarc/blob/master/src/main/groovy/org/codenarc/rule/naming/AbstractTypeNameAstVisitor.groovy#L44

paulk-asert avatar May 03 '22 13:05 paulk-asert

AbstractTypeNameAstVisitor or visitClassEx should be tagged @CompileStatic if the intent is to use it across major Groovy versions. The changes to super method indexing in MetaClassImpl can cause problems for old ScriptBytecodeAdapted.invokeMethodOnSuper call sites.

eric-milles avatar May 03 '22 14:05 eric-milles

Yes, for our use of CodeNarc, the following changes are required: https://github.com/CodeNarc/CodeNarc/pull/707 There might be more rules we don't use that also need a change.

paulk-asert avatar May 04 '22 06:05 paulk-asert

We'll wait for the next release

paulk-asert avatar Nov 15 '22 02:11 paulk-asert