Skip to content

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

Closed
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy10615
Closed

GROOVY-10615: Bump Codenarc to 3.0.1 (build dependency)#1719
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy10615

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

No description provided.

@paulk-asert paulk-asert marked this pull request as draft May 3, 2022 13:17
@paulk-asert
Copy link
Copy Markdown
Contributor Author

paulk-asert commented May 3, 2022

@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

@eric-milles
Copy link
Copy Markdown
Member

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.

@paulk-asert
Copy link
Copy Markdown
Contributor Author

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

@paulk-asert
Copy link
Copy Markdown
Contributor Author

We'll wait for the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants