java.lang.NullPointerException

JDK Bug System | Webbug Group | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    FULL PRODUCT VERSION : java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : WIndows & Enterprise Service Pack 1 A DESCRIPTION OF THE PROBLEM : I cannot use to lambdas in the same call - each lambda works seperately but not together. The commented out version works fine. As does partial substitution of each Callback. //Pointcut definition @Pointcut("execution(* com.tda.amv.batch.tasklet..execute(..))") public void retryable() { log.debug("In retryable() Pointcut"); } @Around("retryable()") public Object aroundRetryableMethods(ProceedingJoinPoint joinPoint) { try { return retryTemplate.execute(retryContext -> (RepeatStatus)joinPoint.proceed(), retryContext -> RepeatStatus.FINISHED); // return retryTemplate.execute(new RetryCallback<RepeatStatus, Throwable>(){ // // @Override // public RepeatStatus doWithRetry(RetryContext retryContext) throws Throwable // { // return (RepeatStatus) joinPoint.proceed(); // } // // }, new RecoveryCallback<RepeatStatus>(){ // // @Override // public RepeatStatus recover(RetryContext arg0) throws Exception // { // return RepeatStatus.FINISHED; // } // // }); } catch (Throwable e) { throw new RuntimeException(e); } } // junit test method @Test public void test() throws Exception { log.debug("In test() method..."); server.expect(requestTo(url)) .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess("{\"totalCount\":3,\"failedCount\":0,\"completionCount\":0,\"processingCount\":2}", MediaType.APPLICATION_JSON)); getIrebalStatusTasklet.beforeStep(stepExecution); getIrebalStatusTasklet.execute(null, null); server.verify(); } //Tasklet class public class XYZTasklet implements Tasklet { Integer id; @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { log.debug("In execute() method..."); String url = UriComponentsBuilder.newInstance() .scheme("http") .host(host) .port(port) .path(getIrebalStatusPath) .build(false) .toString(); ResponseEntity<XYZ> response = restTemplate.getForEntity(url, XYZ.class,id); return RepeatStatus.FINISHED; } } STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : run the junit test EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - test completes ERROR MESSAGES/STACK TRACES THAT OCCUR : An exception has occurred in the compiler (1.8.0_05). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.trackable(Flow.java:1476) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitVarDef(Flow.java:1801) at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitVarDef(Flow.java:2516) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:846) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1367) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitLambda(Flow.java:2225) at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1618) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1367) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1596) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1608) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2205) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1459) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1367) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2370) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2353) at com.sun.tools.javac.comp.Flow.analyzeLambdaThrownTypes(Flow.java:242) at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2400) at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1618) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:270) at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:231) at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:218) at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:976) at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:822) at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:733) at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:831) at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:162) at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:566) at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:603) at com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3777) at com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3583) at com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3490) at com.sun.tools.javac.comp.Attr.checkMethodId(Attr.java:3469) at com.sun.tools.javac.comp.Attr.checkId(Attr.java:3456) at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3338) at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1891) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1828) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1459) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1689) at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1378) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665) at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:681) at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1127) at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:903) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665) at com.sun.tools.javac.comp.Attr.visitTry(Attr.java:1357) at com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1167) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665) at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:681) at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1127) at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:903) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665) at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1020) at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:772) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665) at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4305) at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4215) at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4149) at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4124) at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1251) at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:904) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:863) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126) at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785) at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) 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:483) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- @Before public void setUp() { log.debug("In setUp() method..."); url = UriComponentsBuilder.newInstance() .scheme("http") .host(host) .port(port) .path(path) .build(false) .toString(); url = Pattern.compile("\\{id\\}").matcher(url).replaceAll(ID.toString()); server = MockRestServiceServer.createServer(restTemplate); stepExecution.setExecutionContext(new ExecutionContext()); stepExecution.getExecutionContext().put(SpringConfiguration.PACKAGE_ID_KEY, ID); } @Test public void test() throws Exception { log.debug("In test() method..."); server.expect(requestTo(url)) .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess("{\"totalCount\":3,\"failedCount\":0,\"completionCount\":0,\"processingCount\":2}", MediaType.APPLICATION_JSON)); getIrebalStatusTasklet.beforeStep(stepExecution); getIrebalStatusTasklet.execute(null, null); server.verify(); } ---------- END SOURCE ----------

    JDK Bug System | 7 months ago | Webbug Group
    java.lang.NullPointerException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    FULL PRODUCT VERSION : javac 1.8.0_92 ADDITIONAL OS VERSION INFORMATION : Mac OS X 10.11.5 A DESCRIPTION OF THE PROBLEM : Have refactored my code, and wanted to make a clean&build with Maven. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Just a clean & build with Maven in Eclipse. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - no crash ACTUAL - see crash log ERROR MESSAGES/STACK TRACES THAT OCCUR : An exception has occurred in the compiler (1.8.0_92). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.comp.Attr.visitTypeParameter(Attr.java:4015) at com.sun.tools.javac.tree.JCTree$JCTypeParameter.accept(JCTree.java:2224) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:575) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:644) at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:660) at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4295) at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4271) at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4200) at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4175) at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1248) at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125) at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:171) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:886) at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/bojanantonovic/workspace-smood/picoterm/picoterm-nano/src/main/java/ch/antonovic/picoterm/nano/math/factory/NanoMathTermFactory.java:[50,8] cannot access ch.antonovic.picoterm.femto.util.FemtoMathTermFactory class file for ch.antonovic.picoterm.femto.util.FemtoMathTermFactory not found [ERROR] /Users/bojanantonovic/workspace-smood/picoterm/picoterm-nano/src/main/java/ch/antonovic/picoterm/nano/bool/factory/NanoBooleanTermFactory.java:[35,8] cannot access ch.antonovic.picoterm.femto.util.FemtoBooleanTermFactory class file for ch.antonovic.picoterm.femto.util.FemtoBooleanTermFactory not found REPRODUCIBILITY : This bug can be reproduced occasionally. ---------- BEGIN SOURCE ---------- https://github.com/bojanantonovic/picoterm ---------- END SOURCE ----------

    JDK Bug System | 9 months ago | Webbug Group
    java.lang.NullPointerException
  4. 0

    FULL PRODUCT VERSION : A DESCRIPTION OF THE PROBLEM : A compiler error happens when the provided code is compiled. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - The program compiles ACTUAL - The compiler crashes ERROR MESSAGES/STACK TRACES THAT OCCUR : An exception has occurred in the compiler (1.8.0_25). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.code.Scope.includes(Scope.java:296) at com.sun.tools.javac.comp.Flow$1.trackable(Flow.java:247) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitVarDef(Flow.java:1832) at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitVarDef(Flow.java:2569) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:398) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1376) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitLambda(Flow.java:2256) at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1624) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:398) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1376) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1627) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1639) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2236) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:398) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1376) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2423) at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2406) at com.sun.tools.javac.comp.Flow.analyzeLambdaThrownTypes(Flow.java:250) at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2423) at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1624) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:284) at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:245) at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:232) at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:993) at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:826) at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:731) at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:835) at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:162) at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:564) at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:601) at com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3809) at com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3615) at com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3522) at com.sun.tools.javac.comp.Attr.checkMethodId(Attr.java:3501) at com.sun.tools.javac.comp.Attr.checkId(Attr.java:3488) at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3370) at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1843) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:386) at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:279) at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:245) at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:232) at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:993) at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:826) at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:731) at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:835) at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:576) at com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1431) at com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1618) at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1689) at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1662) at com.sun.tools.javac.comp.Resolve$9.doLookup(Resolve.java:2415) at com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3074) at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3325) at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2412) at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2406) at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:3395) at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3281) at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1843) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:656) at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:1611) at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1296) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676) at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:692) at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1142) at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676) at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1035) at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607) at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:676) at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4342) at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4252) at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4181) at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4156) at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1248) at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126) at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785) at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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:483) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package it.giacomobergami.datatypelang.utils; import java.util.function.Function; /** * Created by vasistas on 11/12/16. */ public interface ThrowableFunction<K,V,E extends Throwable> { V apply(K k) throws E; } //// package it.giacomobergami.datatypelang.utils; import java.util.function.Function; public class OnExcpt<X,K> { private final X elem; public OnExcpt(X e) { this.elem = e; } public <E extends Throwable> K as(ThrowableFunction<X,K,E> sup, Function<X,K> def) { try { return sup.apply(elem); } catch (Throwable throwable) { return def.apply(elem); } } public static void main(String args[]) { System.out.println(new OnExcpt<String,String>("ciao").as(s -> { throw new RuntimeException(); }, x -> "cicco")); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Not known

    JDK Bug System | 3 months ago | Webbug Group
    java.lang.NullPointerException

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.trackable()
    2. Java Tools
      JavacTaskImpl.call
      1. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.trackable(Flow.java:1476)
      2. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitVarDef(Flow.java:1801)
      3. com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitVarDef(Flow.java:2516)
      4. com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:846)
      5. com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      6. com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
      7. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1367)
      8. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitLambda(Flow.java:2225)
      9. com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1618)
      10. com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      11. com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
      12. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1367)
      13. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1596)
      14. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1608)
      15. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2205)
      16. com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1459)
      17. com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      18. com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
      19. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1367)
      20. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2370)
      21. com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2353)
      22. com.sun.tools.javac.comp.Flow.analyzeLambdaThrownTypes(Flow.java:242)
      23. com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2400)
      24. com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1618)
      25. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      26. com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:270)
      27. com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:231)
      28. com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:218)
      29. com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:976)
      30. com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:822)
      31. com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:733)
      32. com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:831)
      33. com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:162)
      34. com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:566)
      35. com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:603)
      36. com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3777)
      37. com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3583)
      38. com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3490)
      39. com.sun.tools.javac.comp.Attr.checkMethodId(Attr.java:3469)
      40. com.sun.tools.javac.comp.Attr.checkId(Attr.java:3456)
      41. com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3338)
      42. com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1891)
      43. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      44. com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1828)
      45. com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1459)
      46. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      47. com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1689)
      48. com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1378)
      49. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      50. com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
      51. com.sun.tools.javac.comp.Attr.attribStats(Attr.java:681)
      52. com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1127)
      53. com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:903)
      54. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      55. com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
      56. com.sun.tools.javac.comp.Attr.visitTry(Attr.java:1357)
      57. com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1167)
      58. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      59. com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
      60. com.sun.tools.javac.comp.Attr.attribStats(Attr.java:681)
      61. com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1127)
      62. com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:903)
      63. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      64. com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
      65. com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1020)
      66. com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:772)
      67. com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
      68. com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
      69. com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4305)
      70. com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4215)
      71. com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4149)
      72. com.sun.tools.javac.comp.Attr.attrib(Attr.java:4124)
      73. com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1251)
      74. com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:904)
      75. com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:863)
      76. com.sun.tools.javac.main.Main.compile(Main.java:523)
      77. com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
      78. com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
      78 frames
    3. Plexus Javac Component
      JavacCompiler.performCompile
      1. org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
      2. org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
      2 frames
    4. Apache Maven Compiler Plugin
      CompilerMojo.execute
      1. org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
      2. org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
      2 frames
    5. Maven Plugin
      DefaultBuildPluginManager.executeMojo
      1. org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
      1 frame
    6. Maven Core
      DefaultMaven.execute
      1. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      2. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      3. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      4. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      5. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      6. org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      7. org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
      8. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
      9. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
      9 frames
    7. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
      2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
      3. org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
      3 frames
    8. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:483)
      4 frames
    9. Plexus
      Launcher.main
      1. org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      2. org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      3. org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      4. org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      4 frames