Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulk-asert
Copy link
Contributor

@paulk-asert paulk-asert commented May 3, 2022

No description provided.

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

@paulk-asert 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
Member

@eric-milles eric-milles commented May 3, 2022

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
Contributor Author

@paulk-asert paulk-asert commented May 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants