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 211398

Summary: ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to javax.lang.model.element.ExecutableElement
Product: java Reporter: aldobrucale <aldobrucale>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED INCOMPLETE    
Severity: normal CC: aldobrucale
Priority: P3    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 187137
Attachments: stacktrace
stacktrace
stacktrace

Description aldobrucale 2012-04-18 14:33:01 UTC
Build: NetBeans IDE Dev (Build 201204170400)
VM: Java HotSpot(TM) Client VM, 22.1-b02, Java(TM) SE Runtime Environment, 1.7.0_03-b04
OS: Linux

User Comments:
aldobrucale: Tried to inline a protected final method




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to javax.lang.model.element.ExecutableElement
   at org.netbeans.modules.refactoring.java.plugins.InlineMethodTransformer.visitMethodInvocation(InlineMethodTransformer.java:152)
   at org.netbeans.modules.refactoring.java.plugins.InlineMethodTransformer.visitMethodInvocation(InlineMethodTransformer.java:63)
   at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1338)
   at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
   at org.netbeans.modules.refactoring.java.plugins.InlineMethodTransformer.scan(InlineMethodTransformer.java:91)
   at org.netbeans.modules.refactoring.java.plugins.InlineMethodTransformer.scan(InlineMethodTransformer.java:63)
Comment 1 aldobrucale 2012-04-18 14:33:07 UTC
Created attachment 118459 [details]
stacktrace
Comment 2 Ralph Ruijs 2012-04-19 09:46:23 UTC
Hard to fix without a reproducible test case. Are you able to reproduce the
issue? If so, could you please create a simple test case and attach it to the
issue? Thanks.
Comment 3 aldobrucale 2012-04-19 15:08:29 UTC
Created attachment 118525 [details]
stacktrace

Inline a public function
Comment 4 aldobrucale 2012-04-19 16:49:29 UTC
I've not been able to reproduce, but it happened again. Is there any logger I may enable to help understand what is happening?
Comment 5 aldobrucale 2012-04-26 13:56:29 UTC
Created attachment 118811 [details]
stacktrace

Tried to inline a public static method. The only reference to the method I'm inlining is in the class in which it is defined. I have just removed all other references but still not compiled all the projects that were using it.