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 254239 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCVariableDecl cannot be cast to com.sun.source.tree.MethodTree
Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCVariableDecl cannot be ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-10 11:14 UTC by akobberup
Modified: 2015-09-03 13:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 219059


Attachments
stacktrace (2.81 KB, text/plain)
2015-08-10 11:14 UTC, akobberup
Details
stacktrace (5.55 KB, text/plain)
2015-08-10 18:56 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description akobberup 2015-08-10 11:14:54 UTC
Build: NetBeans IDE Dev (Build 201508020002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.31-b07, Java(TM) SE Runtime Environment, 1.8.0_31-b13
OS: Windows 8

User Comments:
akobberup: Tried to introduce a member




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCVariableDecl cannot be cast to com.sun.source.tree.MethodTree
   at org.netbeans.modules.java.editor.codegen.GeneratorUtils.checkDuplicates(GeneratorUtils.java:445)
   at org.netbeans.modules.java.editor.codegen.GeneratorUtils.insertClassMembers(GeneratorUtils.java:202)
   at org.netbeans.modules.java.editor.codegen.GeneratorUtils.insertClassMember(GeneratorUtils.java:252)
   at org.netbeans.modules.java.hints.introduce.IntroduceHint$InsertClassMember.insertClassMember(IntroduceHint.java:966)
   at org.netbeans.modules.java.hints.introduce.IntroduceHint.insertField(IntroduceHint.java:755)
   at org.netbeans.modules.java.hints.introduce.IntroduceFieldFix$Worker.run(IntroduceFieldFix.java:365)
Comment 1 akobberup 2015-08-10 11:14:56 UTC
Created attachment 155248 [details]
stacktrace
Comment 2 Jesse Glick 2015-08-10 18:56:39 UTC
Created attachment 155252 [details]
stacktrace

Introduce Constant on a string literal used in a few places in one method failed.
Comment 3 Dusan Balek 2015-09-03 13:09:40 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/d06950c07aa1