Bug 16226

Summary: Renaming and recreating of elements
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: UIAssignee: Dirk Baeumer <dirk_baeumer>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: akiezun, heatonkm
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dirk Baeumer CLA 2002-05-17 06:04:35 EDT
Build 20020518

Scenario:

- create a WEB project (WSAD M5 driver)
- select the folder Web Content
- rename that folder to Web Content2

observe: during the rename WASD somehow recreates the old Web Content folder. 
As a result undoing the rename ends in an error dialog saying that the resource 
already exists.

There are several options to fix this:

- the undo manager also listens to resource deltas (currently only listens to
  Java Model deltas) to flush the undo stack in this case.

- we don't provide undo for renaming non Java resources. In this case we would
  use the Workbench actions instead of the Java actions.

Doesn't block us to start first test fix pass. But should be addressed in first 
fix pass.
Comment 1 Dirk Baeumer CLA 2002-05-28 08:38:24 EDT
Listening to resource deltas doesn't fix the problem since refactoring 
unregisters the listener during change execution. The problem is that WSAD 
changes the element tree in PRE or POST auto build and refactoring has no 
change to figure this out. 

Talking to Core how to solve the problem
Comment 2 Dirk Baeumer CLA 2002-06-07 10:22:18 EDT
Lowering priority since this will not be addressed in F3
Comment 3 Dirk Baeumer CLA 2004-05-18 05:29:30 EDT
There is now way how refactoring can detect this case and do the right thing. 
The refactoring still flags the undo as not processable which results in the 
fact that the refactoring can't be undo in this case.

Instead of recreating the element WSAD should now use the new refactoring 
participant architecture.