| Summary: | [rename][quick fix] Undoing RenameCompilationUnitChange changes the initial file contents | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Kivanc Muslu <kivancmuslu> | ||||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P5 | CC: | amj87.iitr, markus.kell.r | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | Macintosh | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
|
Description
Kivanc Muslu
Created attachment 190459 [details]
Test Case That Deterministically Shows The Bug
The reproducing steps are given with respect to this file, however the logic is normally the same and can be applied to any RenameCompilationUnitChange proposal.
Comment on attachment 190459 [details] Test Case That Deterministically Shows The Bug >package edu.washington.cs.bug; > >public class UndoBug2 >{} Created attachment 190460 [details]
Test Case That Deterministically Shows The Bug
(In reply to comment #3) > Created attachment 190460 [details] > Test Case That Deterministically Shows The Bug Excuse me for attaching the wrong test file (which has no compilation errors or quick fixes at all) in the beginning. I made a new attachment that is correct. Moving to JDT/UI. Reproduced in HEAD. The same happens when I rename the CU in the Package Explorer and then perform Undo. The problem is that ICompilationUnit#rename(*) in RenameCompilationUnitChange#doRename(*) loses the original information, since the implementation in JDT/Core automatically renames the main type if it exists (Undo case), but it doesn't do anything if no main type is available (Do case). We can only fix this by not using ICompilationUnit#rename(*), but that's bad for other reasons (have to reimplement the refactoring; will probably result in different Java element change events if we use IResource#move(*)). This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |