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 219225

Summary: ClassCastException: org.netbeans.modules.refactoring.api.RenameRefactoring cannot be cast to org.netbeans.modules.refactoring.api.MoveRefactoring
Product: java Reporter: dds.dhawal
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED DUPLICATE    
Severity: normal CC: alara, charlweed, Chiana, dds.dhawal, emiddio, FrantaM, javydreamercsw, lehel, MackSix, marco76, mstarnacki, sreimers, ytn01
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 192886
Attachments: stacktrace

Description dds.dhawal 2012-09-30 09:20:13 UTC
This bug was originally marked as duplicate of bug 218766, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.3 Beta (Build 201209272333)
VM: Java HotSpot(TM) Client VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows XP

User Comments:
lehel: GUI Builder sanity test: TS_73_FormAndSupportSanity

 Test suite: Refactoring --> Renaming of a package --> doing the following steps:
1. Select 'refactortest' node in the Project Window and select 'Refactor>Rename' from its popup menu
2. Type "mydata" as a new package name and press 'Refactor' 
After pressing enter at point 2. the error came.

Chiana: Was trying to rename a package that clashed with and existing class;
Mutex -> MutexUtil
Also, this is the second time I get this, the first time I accidentally killed the entire IDE with the screen dumper (it is too easy to do) the supplied screendump is from that run, to mee it looks identical...

ytn01: Created a Java application with default settings,
Added a JPanel form to it, & added some controls to panel,
Added a JFrame form to the project, & added some controls to it,
Dragged & added the JPanel to the JFrame,
Refactore Renamed the base package

marco76: I changed the name of a main package (package aa). src/aa/bb
I was testing the CVS (http://wiki.netbeans.org/TS_70_CVS)  certification test 24. Refactoring.

mstarnacki: In Project Window I try to refactor from menu Refactor->Rename on package name.

javydreamercsw: Renaming a package in src/main/resources

sreimers: Trying to rename a package in a NetBeans Module Project

FrantaM: "Rename" package from "pck.sub1.sub2" to "pck"

MackSix: 1)Renamed project w/ renaming folder. 2) Renamed package.

dds.dhawal: Trying to refactor package name.

Steps:
1. Right Click on package
2. Select refactor -> rename
3. Enter desired name and click Ok.




Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.refactoring.api.RenameRefactoring cannot be cast to org.netbeans.modules.refactoring.api.MoveRefactoring
   at org.netbeans.modules.refactoring.java.plugins.MoveFileRefactoringPlugin.getRelevantFiles(MoveFileRefactoringPlugin.java:476)
   at org.netbeans.modules.refactoring.java.plugins.MoveFileRefactoringPlugin.prepare(MoveFileRefactoringPlugin.java:553)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:437)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:421)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:232)
   at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:1013)
Comment 1 dds.dhawal 2012-09-30 09:20:19 UTC
Created attachment 125114 [details]
stacktrace
Comment 2 Ralph Ruijs 2012-10-01 06:43:15 UTC

*** This bug has been marked as a duplicate of bug 218766 ***