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 116228

Summary: [60cat] no undo after refactoring.
Product: editor Reporter: ahagopian <ahagopian>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: jlahoda
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description ahagopian 2007-09-20 21:50:29 UTC
[ BUILD # : 6.0 Beta1 ]
[ JDK VERSION : 1.6.2 ]

I am having an issue where my undo history is being cleared when working with refactoring.  I'll give an example to help describe my issue.  Say I have a block of code in a file like so:

int i=0;
while(i < 5) {
  i++;
}

And I start making some changes like so:

int a=0;
while(a < 5) {
  int j = 2;
  a++;
}

Then I decide to refactor the variable a=>i to match my newly added j.  I highlight a and right click.  I choose refactor->rename and modify the a to an i etc.

Once this is completed my undo arrow is now disabled and I can no longer undo any of my editing history like remove the int j=2 part.  I can undo the refactor by choosing "refactor"-> "Undo [rename]" which will undo the refactor but I still can't undo the int j=2 addition.

In addition to this if do not undo the refactor but change j=2 to j=i;  Then I can't undo the factor any more.  I can only undo back to j=2.  Then both my undo history is empty and the refactor undo is gone too.

This to me is not the expected result.  If I made a lot of changes in a file then did 1 refactor rename, I wouldn't expect to lose all my undo history.
Comment 1 Jan Becicka 2007-09-21 10:45:18 UTC
Thanks for your report. This is known issue.

*** This issue has been marked as a duplicate of 48427 ***