Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
10.0
-
None
Description
After updating to nb-javac 1.51, when I try to open a class in a binary .jar file, it often fails with an exception like this
java.lang.ClassCastException: com.sun.tools.javac.code.Type$ClassType cannot be cast to com.sun.tools.javac.code.Type$ErrorType
at org.netbeans.modules.java.source.builder.TreeFactory.Type(TreeFactory.java:797)
at org.netbeans.api.java.source.TreeMaker.Type(TreeMaker.java:1083)
at org.netbeans.modules.java.classfile.CodeGenerator$TreeBuilder.visitExecutable(CodeGenerator.java:549)
...
This happens whenever the class references a class in a different .jar. For example, create a maven project, add org.apache.httpcomponents:httpclient (but don't download source!) and open the HttpClient class - it fails because of the various classes referenced from the httpcore dependency.
It looks like this started once http://hg.openjdk.java.net/jdk/jdk/rev/cc2673fa8c20 was merged into nb-javac - TreeFactory's assumption that getKind()==ERROR implies ErrorType is no longer true.
Attachments
Issue Links
- duplicates
-
NETBEANS-2392 Opening type from Go To Type fails
- Closed
- relates to
-
NETBEANS-2116 Sometimes classes are not opened from "Go to type"
- Open
- links to