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 254703 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCMethodDecl cannot be cast to com.sun.source.tree.ExpressionTree
Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCMethodDecl cannot be ca...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 12:02 UTC by Michel Graciano
Modified: 2015-09-01 11:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 219421


Attachments
stacktrace (3.17 KB, text/plain)
2015-08-25 12:02 UTC, Michel Graciano
Details
Sample project (2.87 KB, application/zip)
2015-08-25 12:06 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2015-08-25 12:02:58 UTC
Build: NetBeans IDE Dev (Build 20150825-31bf754c7e0d)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Java(TM) SE Runtime Environment, 1.8.0_51-b16
OS: Linux

User Comments:
hmichel: Trying to use Introduce Parameter refactoring




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCMethodDecl cannot be cast to com.sun.source.tree.ExpressionTree
   at org.netbeans.modules.refactoring.java.plugins.IntroduceParameterPlugin.initDelegate(IntroduceParameterPlugin.java:548)
   at org.netbeans.modules.refactoring.java.plugins.IntroduceParameterPlugin.fastCheckParameters(IntroduceParameterPlugin.java:104)
   at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$WorkingTask.run(JavaRefactoringPlugin.java:408)
   at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$WorkingTask.run(JavaRefactoringPlugin.java:378)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:480)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:609)
Comment 1 Michel Graciano 2015-08-25 12:02:59 UTC
Created attachment 155617 [details]
stacktrace
Comment 2 Michel Graciano 2015-08-25 12:06:24 UTC
Created attachment 155618 [details]
Sample project

Steps to reproduce:
1. Open class SampleClass
2. Put the cursor at sampleMethod2 method
3. Go to Refactor > Introduce > Parameter
4. Click on preview
5. The exception is thrown now.
Comment 3 Ralph Ruijs 2015-08-31 06:51:25 UTC
changeset:   0f9f8471515c
user:        Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date:        Mon Aug 31 08:41:24 2015 +0200
summary:     #254703 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCMethodDecl cannot be cast to com.sun.source.tree.ExpressionTree
Comment 4 Quality Engineering 2015-09-01 01:26:12 UTC
Integrated into 'main-silver', will be available in build *201509010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0f9f8471515c
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #254703 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCMethodDecl cannot be cast to com.sun.source.tree.ExpressionTree
Comment 5 Michel Graciano 2015-09-01 11:42:12 UTC
v. Build 20150901-35e5ab47fab7