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

GuavaSelfEquals NPE #434

Closed
ben-manes opened this issue Jul 16, 2016 · 1 comment
Closed

GuavaSelfEquals NPE #434

ben-manes opened this issue Jul 16, 2016 · 1 comment

Comments

@ben-manes
Copy link

/Users/ben/projects/caffeine/caffeine/src/test/java/com/github/benmanes/caffeine/cache/MultiThreadedTest.java:145: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
      (cache, key) -> cache.equals(cache),
                                  ^
Please report this at https://github.com/google/error-prone/issues/new and include the following:

error-prone version: 2.0.10
Stack Trace:
java.lang.NullPointerException
at com.google.errorprone.bugpatterns.GuavaSelfEquals.generateFix(GuavaSelfEquals.java:133)
at com.google.errorprone.bugpatterns.SelfEquals.describe(SelfEquals.java:87)
at com.google.errorprone.bugpatterns.SelfEquals.matchMethodInvocation(SelfEquals.java:70)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:954)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1614)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:45)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
at com.sun.source.util.TreeScanner.visitLambdaExpression(TreeScanner.java:560)
at com.google.errorprone.scanner.ErrorProneScanner.visitLambdaExpression(ErrorProneScanner.java:880)
at com.google.errorprone.scanner.ErrorProneScanner.visitLambdaExpression(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1775)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:45)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
at com.sun.source.util.TreeScanner.visitMethodInvocation(TreeScanner.java:510)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:960)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1614)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:45)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
at com.sun.source.util.TreeScanner.visitVariable(TreeScanner.java:224)
at com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:1203)
at com.google.errorprone.scanner.ErrorProneScanner.visitVariable(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:938)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:45)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:91)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:188)
at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:637)
at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:778)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:91)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:45)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:106)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114)
at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:145)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:652)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:146)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:561)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:53)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:70)
at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:45)
at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:125)
at com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:113)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1303)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1247)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:858)
at com.sun.tools.javac.main.Main.compile(Main.java:253)
at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:190)
at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:101)
at com.google.errorprone.ErrorProneCompiler.run(ErrorProneCompiler.java:131)
at com.google.errorprone.ErrorProneCompiler.compile(ErrorProneCompiler.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.ltgt.gradle.errorprone.ErrorProneCompiler.execute(ErrorProneCompiler.java:57)
at net.ltgt.gradle.errorprone.ErrorProneCompiler.execute(ErrorProneCompiler.java:25)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:163)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:145)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
@cushon
Copy link
Collaborator

cushon commented Jul 16, 2016

The check is assuming that expressions always have an enclosing block, and crashing on expression-bodied lambdas. The same issue affects field initializers.

ben-manes added a commit to ben-manes/caffeine that referenced this issue Jul 16, 2016
ben-manes added a commit to ben-manes/caffeine that referenced this issue Jul 16, 2016
ben-manes added a commit to ben-manes/caffeine that referenced this issue Jul 16, 2016
ben-manes added a commit to ben-manes/caffeine that referenced this issue Jul 17, 2016
@cushon cushon closed this as completed in f79eb25 Jul 22, 2016
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

No branches or pull requests

2 participants