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 236323 - Copy Class Refactoring does not register a transaction
Summary: Copy Class Refactoring does not register a transaction
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-24 12:29 UTC by ssazonov
Modified: 2015-09-17 11:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ssazonov 2013-09-24 12:29:40 UTC
1. Create new java project

2. Create new package "mypackage"

3. Add to mypackage new java class ClassA

4. Add to mypackage new file EmptyFile.pass

5. Copy class ClassA

6. Past refactored copy of ClassA as ClassB into mypackage

7. Make some changes in ClassB (e.g. add some methods, vars...), assume you have spend all day on ClassB and now you are very happy, that you are finally done

8. Rename EmptyFile.pass to MyEmptyFile.pass

9. Now you noticed, that MyEmptyFile.pass looks too strange so you select the project and press Undo

10. NB asks you if you really want to undo copy ClassB, but you expect it asks you something like "Do you really want to undo rename?" so you don'read dialog and press Undo

11. Oops, ClassB have been deleted, so you press Redo and it's created again

>> You are very angry, when you find out, that now ClassB looks like in step (6) and all day work have been lost. Fortunately, user may update ClassB from local history of ClassB, but he may not know about this feature.

Product Version: NetBeans IDE 7.4 RC1 (Build 201309152201)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Comment 1 Ralph Ruijs 2013-09-24 12:54:09 UTC
The problem is specific to the Java Refactoring Copy Class. The implementation wrongly bypasses the transaction registration.
Comment 2 Martin Balin 2015-09-17 11:15:56 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.