Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8065953

java.lang.NullPointerException while compiling some trivial stream code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8u25, 8u40, 9
    • Fix Version/s: 9
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      javac 1.8.0_25


      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 64 bit


      A DESCRIPTION OF THE PROBLEM :
      The compiler throws java.lang.NullPointerException for the trivial program given.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just compile the code.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Successful compilation.

      ACTUAL -
      See the error message given. 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.Types.isConvertible(Types.java:290)
      at com.sun.tools.javac.comp.Check.assertConvertible(Check.java:922)
      at com.sun.tools.javac.comp.Check.checkMethod(Check.java:876)
      at com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:3838)
      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.main.Main.compile(Main.java:381)
      at com.sun.tools.javac.main.Main.compile(Main.java:370)
      at com.sun.tools.javac.main.Main.compile(Main.java:361)
      at com.sun.tools.javac.Main.compile(Main.java:56)
      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.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
      at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1159)
      at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:935)
      at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:145)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:435)
      at org.apache.tools.ant.Target.performTasks(Target.java:456)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
      at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
      at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
      at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package uat;

      import java.util.stream.IntStream;

      public final class Uat {
          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              System.out.println(IntStream.rangeClosed(1, 10).boxed().reduce(0.0, (Double x, Integer y) -> x + y, (u1, u2) -> 0.0));
          }
      }

      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: