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

Slf4jIllegalPassedClass check: NoSuchMethodError: MethodMatchers$MethodNameMatcher.withParameters() #153

Closed
remal opened this issue Feb 9, 2022 · 4 comments
Labels
invalid This doesn't seem right

Comments

@remal
Copy link

remal commented Feb 9, 2022

I'm getting this error after updating errorprone-slf4j to 0.1.6:

java.lang.NoSuchMethodError: 'com.google.errorprone.matchers.method.MethodMatchers$ParameterMatcher com.google.errorprone.matchers.method.MethodMatchers$MethodNameMatcher.withParameters(java.lang.String, java.lang.String[])'

Click here to view full log
     BugPattern: Slf4jIllegalPassedClass
     Stack Trace:
     java.lang.NoSuchMethodError: 'com.google.errorprone.matchers.method.MethodMatchers$ParameterMatcher com.google.errorprone.matchers.method.MethodMatchers$MethodNameMatcher.withParameters(java.lang.String, java.lang.String[])'
  	at jp.skypencil.errorprone.slf4j.IllegalPassedClass$LoggerInitializerVisitor.<init>(IllegalPassedClass.java:114)
  	at jp.skypencil.errorprone.slf4j.IllegalPassedClass$LoggerInitializerVisitor.<init>(IllegalPassedClass.java:96)
  	at jp.skypencil.errorprone.slf4j.IllegalPassedClass.matchMethodInvocation(IllegalPassedClass.java:43)
  	at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:746)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:150)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1650)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitVariable(TreeScanner.java:223)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:885)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:150)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:974)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:548)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:150)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:560)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58)
  	at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
  	at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:152)
  	at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1418)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1365)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:960)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
  	at ...

ErrorProne version: 2.10.0
Java version: 11

Is there a chance that errorprone-slf4j 0.1.6 requires ErrorProne 2.11?

@KengoTODA
Copy link
Owner

memo: according to google/error-prone#2909 (comment) this fix should be fixed by #137 but we still have a usage:

@KengoTODA
Copy link
Owner

Ah, I understand.

ErrorProne version: 2.10.0

You should use 2.11 instead, because Errorprone apply an breaking change to their API.

@KengoTODA KengoTODA added the invalid This doesn't seem right label Feb 11, 2022
@KengoTODA
Copy link
Owner

Updated the release note to tell this problem to other users:
https://github.com/KengoTODA/errorprone-slf4j/releases/tag/v0.1.6

I'll try to introduce code to check Errorprone version on the fly.

@remal
Copy link
Author

remal commented Feb 11, 2022

I supposed that this issue is connected to ErrorProne 2.11, thanks for the confirmation!

However, we can't upgrade ErrorProne at the moment, as we faced another issue with 2.11: mockito/mockito#2554 😞. We'll be waiting to get all the issues fixed and then upgrade errorprone-slf4j.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants