Bug 76503 - Refactoring replay feature [refactoring] [general issue]
Summary: Refactoring replay feature [refactoring] [general issue]
Status: RESOLVED DUPLICATE of bug 106207
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 87871 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-18 16:44 EDT by Frederic Plante CLA
Modified: 2005-08-15 11:38 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Plante CLA 2004-10-18 16:44:22 EDT
We are developing a large Eclipse-based product and our plug-ins' source code 
is architected through layers. Plug-ins in layer N are built against plug-ins 
of layer N-1 which are in the target environment as opposed to sit in the 
workspace. Lower layers publish baselines on a regular basis that are 
subsequently adopted by upper layers.

The refactoring feature is very useful when the only affected plug-ins belong 
to the same layer. But becomes useless when the scope crosses the layer 
boundary since we never can have a single baseline with all plug-ins' source 
code together in the same workspace.

It would be extremely convenient to be able to serialize refactoring 
operations so they could be later "replayed" during the adoption of a 
refactored layer.
Comment 1 Frederic Fusier CLA 2004-10-27 09:17:03 EDT
Move to JDT/UI
Comment 2 Dirk Baeumer CLA 2004-10-28 06:06:32 EDT
We have looked into this for 3.1 but an investigation has shown that this isn't
easy to achive. There are three big issues to be solved for distributed
refactorings (for which we don't have a good solution yet):

- most refactorings assume that the code compiles. So if you (re)apply a 
  refactoring you must refactor the original code as well (in our example 
  the N-1 code has to be refactored on the client side as well). Otherwise a 
  second refactoring might fail since the client code doesn't compile anymore 
  This requires that the source exists on client sides.

- not all modifications are currently done using refactorings. What can happen is 
  that you do a rename, modify some other parts by hand and execute another 
  rename. If we now apply the first rename on the client side and refactor the 
  WTP code as well we still miss the modification done by hand. As a result the 
  second rename might fail since it depends on such modifications.

- when executing the refactoring at the client side, preconditions might fail 
  which didn't when applying the refactoring on the library only. This can lead 
  to refactorings which aren't semantic preserving. However the solution here is 
  easy. Just warn the user and apply the changes.

Given that J2SE 5.0 is the focus for 3.1 nothing will happen here.
Comment 3 Mike Wilson CLA 2004-11-02 10:39:57 EST
Note that the expectation here is to *reduce* the amount of work that is required when 
reacting to changes in other layers, not to eliminate it.

In this case, they are already living in a world where their code does not compile 
because of changes in the lower layer. I believe what is being asked for is just a way to 
partially automate the process of responding to those changes in the next layer up.

Comment 4 Dirk Baeumer CLA 2004-11-02 11:00:40 EST
I understand the expectations. But the way refactoring currently works
(especially the fact that code containing errors can't be refactored since we
don't get an AST with bindings for it) would require a "rewrite" of the
refactorings or to improve AST creation in the presence of errors. This is out
of the scope for 3.1
Comment 5 Frederic Plante CLA 2004-11-02 11:04:55 EST
Would it make it simpler to implement if the refactoring playback of layer N 
was made using the pre-refactored version of layer N-1 in the target 
environment; the result of the refactoring would not compile until the target 
is manually updated after the refactoring operation?
Comment 6 Dirk Baeumer CLA 2005-03-14 06:17:54 EST
*** Bug 87871 has been marked as a duplicate of this bug. ***
Comment 7 Frederic Plante CLA 2005-05-18 09:51:57 EDT
Could someone comment on the proposal from comment #5. This is a real issue as 
we are developing larger Eclipse-based applications and cannot afford a 
central build of all components.

Thanks
Comment 8 Dirk Baeumer CLA 2005-05-18 10:51:40 EDT
As outlined in comment #2 this only works if you play back one refactoring. For
one refactoring it doesn't make a difference if you reapply the refactoring to
layer N-1 or if you update the code afterwards by loading a new library version.



Comment 9 Frederic Plante CLA 2005-05-18 12:21:06 EDT
I guess I miss something, if I can reapply in layer N a "rename" or a "move" 
refactoring operation that occured in a version of layer N-1 that I haven't 
adopted yet, then it will save me the time of having to manually fix each 
compile error that would occur after the adoption.
Comment 10 Dirk Baeumer CLA 2005-05-19 04:23:16 EDT
Frederic, the problem comes when you want to replay two refactorings, both
happened in layer N-1. I agree that if you only want to replay one refactoring
in layer N-1 the approach you described works.
Comment 11 Frederic Plante CLA 2005-05-19 09:05:56 EDT
Right, that was my understanding. I personnally believe support for even a 
single refactoring operation is better than none, but that's subjective.
Comment 12 Dirk Baeumer CLA 2005-08-15 11:38:18 EDT
I will mark this PR as a dup of 106207, which is the official plan item for 3.2
for this feature.
Comment 13 Dirk Baeumer CLA 2005-08-15 11:38:30 EDT

*** This bug has been marked as a duplicate of 106207 ***