This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269611 - ClassCastException: org.netbeans.modules.classfile.CPUTF8Info cannot be cast to org.netbeans.modules.classfile.CPModuleInfo
Summary: ClassCastException: org.netbeans.modules.classfile.CPUTF8Info cannot be cast ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Classfile (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: JDK_9
Depends on:
Blocks:
 
Reported: 2017-01-20 13:35 UTC by Martin Balin
Modified: 2017-01-22 02:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 227760


Attachments
stacktrace (5.59 KB, text/plain)
2017-01-20 13:36 UTC, Martin Balin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Balin 2017-01-20 13:35:57 UTC
Build: NetBeans IDE Dev (Build 20170120-5fbf1318ba1e)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.102-b14, Java(TM) SE Runtime Environment, 1.8.0_102-b14
OS: Linux

User Comments:
mbalin: Working with JavaSE Maven project. Changed source level and Java Platform to JDK9 then open POM.XML
in POM.XML I've inserted dependency on maven-compiler-plugin 3.6.0. This exception happened when I saved the pom.xml.




Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.classfile.CPUTF8Info cannot be cast to org.netbeans.modules.classfile.CPModuleInfo
   at org.netbeans.modules.classfile.Module.<init>(Module.java:67)
   at org.netbeans.modules.classfile.ClassFile.getModule(ClassFile.java:462)
   at org.netbeans.api.java.source.SourceUtils.readModuleName(SourceUtils.java:1681)
   at org.netbeans.api.java.source.SourceUtils.getModuleName(SourceUtils.java:1316)
   at org.netbeans.api.java.source.SourceUtils.getModuleName(SourceUtils.java:1272)
   at org.netbeans.modules.java.source.parsing.ModuleFileManager.moduleLocations(ModuleFileManager.java:350)
Comment 1 Martin Balin 2017-01-20 13:36:00 UTC
Created attachment 163439 [details]
stacktrace
Comment 2 Martin Balin 2017-01-20 13:47:05 UTC
Exception is later shown for any action like Clean, Build, project Open...
Comment 3 Tomas Zezula 2017-01-20 15:09:09 UTC
Caused by old module-info.class on the module path artefact.
The module-info.class has old Module attribute which is neither supported by javac (jvm) b148+ nor by the NetBeans.
Comment 4 Martin Balin 2017-01-20 15:13:38 UTC
Interesting. The project was created with latest daily build, then source and Java platform switched to 9 and JDK9 EA b151. Then module-info added and compiled. 1st compile is done using maven-compiler-plugin 3.1. After that it has to be changed to 3.6.0 and then CCException appeared.
Comment 5 Tomas Zezula 2017-01-20 15:44:04 UTC
http://hg.netbeans.org/jet-main/rev/e7c7f6806c97
The old module-info.class Module attribute does not cause an CCE, the attribute is ignored.
Comment 6 Quality Engineering 2017-01-22 02:42:54 UTC
Integrated into 'main-silver', will be available in build *201701220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e7c7f6806c97
User: Tomas Zezula <tzezula@netbeans.org>
Log: #269611:ClassCastException: org.netbeans.modules.classfile.CPUTF8Info cannot be cast to org.netbeans.modules.classfile.CPModuleInfo