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 267341

Summary: Undo after renaming file with Hint causes new file created
Product: editor Reporter: MackSix
Component: RefactoringAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: MackSix
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: sample project
screenshot showing another file

Description MackSix 2016-07-28 05:52:49 UTC
Created attachment 161476 [details]
sample project

1. open attached project.
2. open javaapplication21.java in editor.
3. change package name from javaapplication21 to javaapplication22 (refactor)
4. change file name from javaapplication21.java to javaapplication22.java (refactor)
5. click undo twice
6. click redo twice, get error message popup "JavaApplication21.java seems no longer valid!"
7. click ok on error dialog
8. click hint next to line 7 and choose to rename the file to match class name JavaApplication22.java
9. open tree under package to view source files in Projecs window.
10. click undo

Results: Notice a new JavaApplication21.java is created along side the JavaApplication22.java file instead of the JavaApplicatino22.java file being renamed. (See screenshot)

Expected: JavaApplicatino22.java should have been renamed to JavaApplication21.java

Workaround: delete JavaApplication22.java file.
Comment 1 MackSix 2016-07-28 05:54:40 UTC
Created attachment 161477 [details]
screenshot showing another file