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 218766

Summary: ClassCastException: org.netbeans.modules.refactoring.api.RenameRefactoring cannot be cast to org.netbeans.modules.refactoring.api.MoveRefactoring
Product: java Reporter: Jiri Prox <jiriprox>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: VERIFIED FIXED    
Severity: normal CC: akobberup, Chiana, dds.dhawal, emiddio, FrantaM, javydreamercsw, lehel, MackSix, marco76, mmirilovic, mstarnacki, pjiricka, ytn01
Priority: P1    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 192638
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
Screenshot
stacktrace
stacktrace
stacktrace
Screenshot of error
messages.log folder for error trace

Description Jiri Prox 2012-09-21 12:50:44 UTC
Build: NetBeans IDE 7.3 Beta (Build 201209201306)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows 7

User Comments:
jiriprox: CCE when renaming package in project view




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 Jiri Prox 2012-09-21 12:50:46 UTC
Created attachment 124709 [details]
stacktrace
Comment 2 MackSix 2012-09-21 16:17:14 UTC
Created attachment 124732 [details]
stacktrace

1)Renamed project w/ renaming folder. 2) Renamed package.
Comment 3 MackSix 2012-09-21 16:25:31 UTC
This happens every time and there is no workaround. Plus it is regression. It should be marked P1.
Comment 4 Exceptions Reporter 2012-09-23 06:23:10 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=192638
Comment 5 Ralph Ruijs 2012-09-24 09:20:12 UTC
changeset   : 359ee70a9101
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Mon Sep 24 11:13:54 CEST 2012
Comment 6 FrantaM 2012-09-24 15:23:09 UTC
Created attachment 124816 [details]
stacktrace

"Rename" package from "pck.sub1.sub2" to "pck"
Comment 7 Chiana 2012-09-24 20:47:11 UTC
Created attachment 124827 [details]
stacktrace

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...
Comment 8 Chiana 2012-09-24 20:49:14 UTC
Created attachment 124828 [details]
Screenshot
Comment 9 Chiana 2012-09-24 20:50:37 UTC
Also noted it has NOT changed the "package" declaration.
Comment 10 Quality Engineering 2012-09-25 02:18:28 UTC
Integrated into 'main-golden', will be available in build *201209250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/359ee70a9101
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #218766 - ClassCastException: org.netbeans.modules.refactoring.api.RenameRefactoring cannot be cast to org.netbeans.modules.refactoring.api.MoveRefactoring
Comment 11 lehel 2012-09-26 16:08:13 UTC
Created attachment 124958 [details]
stacktrace

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.
Comment 12 javydreamercsw 2012-09-26 18:08:14 UTC
Created attachment 124963 [details]
stacktrace

Renaming a package in src/main/resources
Comment 13 Exceptions Reporter 2012-09-26 18:08:32 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=192638
Comment 14 ytn01 2012-09-28 00:14:14 UTC
Created attachment 125042 [details]
stacktrace

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
Comment 15 sks3286 2012-09-29 04:36:46 UTC
Created attachment 125093 [details]
Screenshot of error
Comment 16 sks3286 2012-09-29 04:37:27 UTC
Created attachment 125094 [details]
messages.log folder for error trace
Comment 17 Marian Mirilovic 2012-09-29 09:25:14 UTC
Ralph, 
could you please fix this also for NB 7.3 Beta (before 8pm CEST 30th September)? If so, please do that even without verification. Thanks in advance.
Comment 18 Ralph Ruijs 2012-09-29 12:13:32 UTC
http://hg.netbeans.org/releases/rev/3c5ce6a26def
Comment 19 Quality Engineering 2012-10-01 04:20:43 UTC
Integrated into 'releases', will be available in build *201210010205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/3c5ce6a26def
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #218766 - ClassCastException: org.netbeans.modules.refactoring.api.RenameRefactoring cannot be cast to org.netbeans.modules.refactoring.api.MoveRefactoring
Comment 20 Ralph Ruijs 2012-10-01 06:43:15 UTC
*** Bug 219225 has been marked as a duplicate of this bug. ***
Comment 21 Ralph Ruijs 2012-10-01 06:43:51 UTC
*** Bug 219154 has been marked as a duplicate of this bug. ***
Comment 22 Ralph Ruijs 2012-11-23 23:01:34 UTC
*** Bug 219089 has been marked as a duplicate of this bug. ***
Comment 23 Jiri Prox 2013-01-11 22:52:46 UTC
v.