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 231788

Summary: ClassCastException: com.sun.tools.javac.code.Type$TypeVar cannot be cast to com.sun.tools.javac.code.Type$ClassType
Product: java Reporter: lforet <lforet>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 201680
Attachments: stacktrace

Description lforet 2013-06-25 15:26:23 UTC
Build: NetBeans IDE 7.4 Beta (Build 201306132201)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 7

User Comments:
lforet: I was dealing with generic types editing my class




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.code.Type$TypeVar cannot be cast to com.sun.tools.javac.code.Type$ClassType
   at com.sun.tools.javac.comp.MemberEnter$Synthesizer.visitTypeApply(MemberEnter.java:1591)
   at com.sun.tools.javac.tree.JCTree$JCTypeApply.accept(JCTree.java:2117)
   at com.sun.tools.javac.comp.MemberEnter$Synthesizer.visit(MemberEnter.java:1543)
   at com.sun.tools.javac.comp.MemberEnter$7.getModelType(MemberEnter.java:1525)
   at com.sun.tools.javac.code.Symbol$ClassSymbol.getSuperclass(Symbol.java:935)
   at com.sun.tools.javac.code.Symbol$ClassSymbol.getSuperclass(Symbol.java:769)
Comment 1 lforet 2013-06-25 15:26:24 UTC
Created attachment 136280 [details]
stacktrace
Comment 2 lforet 2013-06-25 15:47:02 UTC
It happens when I try to add a generic type to a class and the name of the type is the classname I extends. Example :

public class MyWidget<Widget> extends Widget

ofcourse what I wanted to write was 

public class MyWidget<W extends Widget> extends Widget

But I had the exception before.
Comment 4 Quality Engineering 2013-07-01 15:56:03 UTC
Integrated into 'main-silver', will be available in build *201307011244* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a84283bfb53f
User: Dusan Balek <dbalek@netbeans.org>
Log: Issues #231727, #231788, and #223560 - fixed.