FULL PRODUCT VERSION :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) Client VM (build 25.25-b02, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Compiler crashes with NullPointerException advising to submit a bug to this site
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try compiling the source code provided
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
get this compiled
ACTUAL -
compiler crashed
ERROR MESSAGES/STACK TRACES THAT OCCUR :
L:\TestApp\src\com\company>"C:\Program Files (x86)\Java\jdk1.8.0_25\bin\javac.ex
e" Main.java
An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J
ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking
the Bug Parade for duplicates. Include your program and the following diagnosti
c 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:27
9)
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.argumentsAccepta
ble(Resolve.java:731)
at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:8
35)
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.jav
a: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.j
ava: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:124
8)
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 com.sun.tools.javac.Main.main(Main.java:42)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package com.company;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) {
Map<Integer, String> mp = new HashMap<>();
mp.put(1, "a");
mp.put(2, "b");
mp.put(3, "c");
mp.put(4, "d");
System.out.println(mp.entrySet().stream().reduce(0,
(i, e) -> i + e.getKey(),
(i1, i2) -> i1 + i2));
}
}
---------- END SOURCE ----------