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.
release50 Build 200512132030 java.lang.RuntimeException: java.lang.ClassCastException: org.netbeans.modules.javacore.parser.TypeParamRef at org.netbeans.modules.java.hints.JavaHintsProvider.getHints(JavaHintsProvider.java:153)
Created attachment 27863 [details] ClassCastException most likely when edit java with generics
I was unable to reproduce. Could you, please, provide the source, where it occured?
We no longer need the source and steps, we are able to reproduce.
The CCE happens if you have class like this: public class NewClass<E> { <T extends E> void hhhh(T x) { } } This class must be read from classfile (this happen when source is to available). Important think is that type parameter T must extends another type parameter. There is easy way how to reproduce this CCE in a different scenario. 1) Add above class to j2se project. 2) complie this class 3) go to Files Tab and in build firectory find the class file corresponding to the NewClass. 4) still in the Files Tab expand NewClass node. 5) CCE is here. :-) We already have trivial fix, which will go to release50 branch.
Fixed in trunk. Checking in src/org/netbeans/modules/javacore/parser/ClassFileInfoUtil.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/ClassFileInfoUtil.java,v <-- ClassFileInfoUtil.java new revision: 1.38; previous revision: 1.37 done
Created attachment 27870 [details] Fixed CCE when type parameter is bounded by another type parameter
I reviewed the fix and it can be merged to release50 branch.
Fix verified in trunk build 200512151900.
Merged to release50 branch. Checking in ./src/org/netbeans/modules/javacore/parser/ClassFileInfoUtil.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/ClassFileInfoUtil.java,v <-- ClassFileInfoUtil.java new revision: 1.37.2.1; previous revision: 1.37 done
Verified in release50-200601042030.
Reorganization of java component