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 212129 - Redo Move Class Package Declaration Not Updated
Summary: Redo Move Class Package Declaration Not Updated
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-05 17:04 UTC by MackSix
Modified: 2012-05-24 12:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project to use for reproduction. (41.18 KB, application/zip)
2012-05-05 17:04 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2012-05-05 17:04:15 UTC
Created attachment 119119 [details]
Project to use for reproduction.

1) Open attached project.
2) Drag & Drop JFrameview.java into "newpackage" with refacoring.
3) Click Undo button.
4) Click Redo button.

The package declaration is "package com.areaofthoughts.armageddon;" which is wrong. 

Should be: "package com.areaofthoughts.newpackage;"

Product Version: NetBeans IDE Dev (Build 201205050400)
Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 1 Jan Becicka 2012-05-09 11:44:52 UTC
I'm sorry I cannot reproduce.
Comment 2 MackSix 2012-05-09 13:14:30 UTC
(In reply to comment #1)
> I'm sorry I cannot reproduce.

I just tried it on dev 20120509 and it failed. Could you try again and do Undo/Redo 2 or 3 times and see if it fails? Thanks
Comment 3 Ralph Ruijs 2012-05-09 13:28:07 UTC
It looks to be windows specific. I was able to reproduce it on windows with the help of Jirka.
Comment 4 Jan Becicka 2012-05-10 12:06:43 UTC
Let's look at it on Monday in the office.
Comment 5 Jan Becicka 2012-05-14 19:50:35 UTC
I'm not sure what's going on exactly, but Redo is done correctly by refactoring undo facility. The problem is, that FormRefactoringUpdate somehow overwrites package declaration back to old value. It is done by FormRefactoringUpdate.java: 
542: fes.saveDocument();
please evaluate
Comment 7 Jan Stola 2012-05-23 15:27:21 UTC
I am able to reproduce this issue on Windows but only with JDK 7 (the same steps work fine on JDK 6 for me). I am also able to reproduce this issue when the file remains open in the editor (it works fine when the file is closed).
Comment 8 MackSix 2012-05-24 12:55:05 UTC
(In reply to comment #7)
> I am able to reproduce this issue on Windows but only with JDK 7 (the same
> steps work fine on JDK 6 for me). I am also able to reproduce this issue when
> the file remains open in the editor (it works fine when the file is closed).

I can reproduce it on JDK 6u32 and 7u4, Windows 7. For me it makes no difference if the file is open or closed. 

Product Version: NetBeans IDE Dev (Build 201205240002)
Java: 1.6.0_32; Java HotSpot(TM) Client VM 20.7-b02
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)