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 255777 - undoing the renaming of a class doesn't change class name accordingly
Summary: undoing the renaming of a class doesn't change class name accordingly
Status: NEW
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-07 15:19 UTC by ytn01
Modified: 2015-11-18 12:32 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 ytn01 2015-10-07 15:19:12 UTC
Product Version = NetBeans IDE Dev (Build 201510070002)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_66-ea
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.66-b02

Reproducibility: Happens every time

STEPS:
  * Create a new project from: samples\groovy\NB-Project-Generators
  * Add a new Groovy class project with name "Foo" and package name "test"
  * add a method to Foo class named bar: 
	void bar() {  println "foobar"   }
  * add a new Groovy script to project, test package
  * add these lines:
	c = new Foo() 
	c.bar();
  * don't save file,... and switch back to Foo class
  * select Foo class from project window, and hit ctrl+R to invoke refactor-rename, provide a new name for it like "FooRenamed", and confirm refactor
  * switch back to groovy script file, notice that rename took place,... then press Ctrl+Z to invoke undo, and confirm


ACTUAL:
  FooRenamed class gets renamed back to Foo, and change is reflected also in the script file.
  However, name of class will not get renamed back to "Foo",... instead stays "FooRenamed", causing compilation error in the script file where it is used.

EXPECTED:
  Undoing the refactor task should also rename back the affected class file nam
Comment 1 bruno.flavio 2015-11-18 12:32:28 UTC
Thank you for reporting this.

After executing the test case provided I found it to be accurate: When reverting the rename class operation the file name is not reverted.

I've found no difference with respect to the sixth step, i.e: The incorrect behaviour prevailed whether I saved the files or left them in the unsaved state.