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

VerifyException encountered in ReturnValueIgnored #1565

Closed
2is10 opened this issue Apr 8, 2020 · 0 comments · Fixed by #1566
Closed

VerifyException encountered in ReturnValueIgnored #1565

2is10 opened this issue Apr 8, 2020 · 0 comments · Fixed by #1566

Comments

@2is10
Copy link

2is10 commented Apr 8, 2020

Description of the problem / feature request:

Error prone failed with a stack trace and asked me to report the issue.

error: An unhandled exception was thrown by the Error Prone static analysis plugin.
16:15:08 parse.apply(value);
16:15:08 ^
16:15:08 Please report this at https://github.com/google/error-prone/issues/new and include the following:
16:15:08
16:15:08 error-prone version: 2.3.4.f1
16:15:08 BugPattern: ReturnValueIgnored
16:15:08 Stack Trace:
16:15:08 com.google.common.base.VerifyException
16:15:08 at java.base/java.util.Optional.orElseThrow(Optional.java:408)
16:15:08 at com.google.errorprone.matchers.Matchers.methodCallInDeclarationOfThrowingRunnable(Matchers.java:1262)
16:15:08 at com.google.errorprone.bugpatterns.AbstractReturnValueIgnored.lambda$static$8059ac76$1(AbstractReturnValueIgnored.java:225)
16:15:08 at com.google.errorprone.matchers.Matchers.lambda$allOf$93cd24cb$1(Matchers.java:132)
16:15:08 at com.google.errorprone.matchers.Matchers.lambda$anyOf$5390886b$1(Matchers.java:148)
16:15:08 at com.google.errorprone.bugpatterns.AbstractReturnValueIgnored.expectedExceptionTest(AbstractReturnValueIgnored.java:238)
16:15:08 at com.google.errorprone.bugpatterns.AbstractReturnValueIgnored.lambda$new$36f7786c$2(AbstractReturnValueIgnored.java:79)
16:15:08 at com.google.errorprone.matchers.Matchers.lambda$not$221e45ba$1(Matchers.java:121)
16:15:08 at com.google.errorprone.matchers.Matchers.lambda$allOf$93cd24cb$1(Matchers.java:132)
16:15:08 at com.google.errorprone.bugpatterns.AbstractReturnValueIgnored.matchMethodInvocation(AbstractReturnValueIgnored.java:102)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:748)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1650)
16:15:08 at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:72)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:46)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.visitExpressionStatement(TreeScanner.java:433)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitExpressionStatement(ErrorProneScanner.java:635)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitExpressionStatement(ErrorProneScanner.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1460)
16:15:08 at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:72)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:46)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:522)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
16:15:08 at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:72)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:46)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:206)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:742)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
16:15:08 at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:72)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:46)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:550)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
16:15:08 at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:72)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:46)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
16:15:08 at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:562)
16:15:08 at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
16:15:08 at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
16:15:08 at com.google.errorprone.scanner.Scanner.scan(Scanner.java:56)
16:15:08 at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
16:15:08 at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:152)
16:15:08 at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
16:15:08 at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1418)
16:15:08 at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1365)
16:15:08 at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:960)
16:15:08 at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
16:15:08 at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
16:15:08 at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
16:15:08 at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
16:15:08 at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:93)
16:15:08 at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
16:15:08 at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:54)
16:15:08 at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:39)
16:15:08 at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkAction.execute(AbstractDaemonCompiler.java:135)
16:15:08 at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
16:15:08 at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:47)
16:15:08 at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:41)
16:15:08 at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
16:15:08 at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:41)
16:15:08 at org.gradle.workers.internal.FlatClassLoaderWorker.execute(FlatClassLoaderWorker.java:32)
16:15:08 at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:84)
16:15:08 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:15:08 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:15:08 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:15:08 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
16:15:08 at org.gradle.process.internal.worker.request.WorkerAction$1.call(WorkerAction.java:129)
16:15:08 at org.gradle.process.internal.worker.child.WorkerLogEventListener.withWorkerLoggingProtocol(WorkerLogEventListener.java:41)
16:15:08 at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:126)
16:15:08 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:15:08 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:15:08 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:15:08 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
16:15:08 at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
16:15:08 at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
16:15:08 at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
16:15:08 at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
16:15:08 at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
16:15:08 at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
16:15:08 at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
16:15:08 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
16:15:08 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
16:15:08 at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
16:15:08 at java.base/java.lang.Thread.run(Thread.java:834)

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

enum MyEnum {
    A(Integer::valueOf);
    private final Function<String, ?> parse;
    MyEnum(Function<String, ?> parse) {
        this.parse = parse;
    }
    void validate(String value) {
        parse.apply(value);
    }
}

What version of Error Prone are you using?

2.3.4.f1

Have you found anything relevant by searching the web?

No.

nick-someone added a commit that referenced this issue Apr 9, 2020
…ations.

Before this change, a function call in a top-level enum declaration would explode with a VerifyException.

Fixes #1565

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=305686865
nick-someone added a commit that referenced this issue Apr 9, 2020
…ations.

Before this change, a function call in a top-level enum declaration would explode with a VerifyException.

Fixes #1565

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=305686865
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 a pull request may close this issue.

1 participant