Bug 73438 - [synchronize] provide java stream merger
Summary: [synchronize] provide java stream merger
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-09-08 07:01 EDT by Sebastian Hentschel CLA
Modified: 2008-07-28 05:09 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 Sebastian Hentschel CLA 2004-09-08 07:01:17 EDT
It would be nice if the diffing(update,commit) process in a Team synchronization
looks at the content of sourcecode.

example:

public class Foo {

    private void fooA(){
//  ...
    }

    public Foo {
//  ...
    }

}

changes into:

public class Foo {

    public Foo {
//  ...
    }

    private void fooA(){
//  ...
    }

}

in this change there is no (no java-related) change. I think it would be very
hard to implement a feature that can figure out, if there is a semantic
diffrence. Unfortunatly i actually doesn't have time to implement it by myself,
but i think that a JDT(JavaModel) based save,load and diff is possible the key
to a real semantic ReleaseManagment.

I hope that someone catches my idea and implement it in (possible Eclipse x.0 |
(x>4)) ;-)
Comment 1 Jean-Michel Lemieux CLA 2004-09-08 08:45:17 EDT
The compare editors do look at the semantics of the java files (Java Structure
Compare), but we have never wanted to auto-merge using semantics of the file.
This is however technically possible, the key is to provide a
org.eclipse.compare.streamMergers for java files then change the CVS plugin to
use the stream merger instead of the line-by-line servermerge.

We don't have time for this either :)
Comment 2 Michael Valenta CLA 2006-06-13 16:50:42 EDT
The model-based merge support in Team does allow models to use model semantics to perform the merge. For Java, it is JDT that would need to provide an IStorageMerger that could merge Java files.
Comment 3 Christophe Cornu CLA 2008-07-24 13:04:09 EDT
Here is a simple use case: merge java import declarations

import Bar;
import Foo;
...

I insert a new import:
import Bar;
import Cherry;
import Foo;

And someone in my team released a change adding a different import:
import Bar;
import Lemon;
import Foo;

Today we have to manually resolve the conflict. Java merge could automatically produce the following:
import Bar;
import Cherry;
import Lemon;
import Foo;

It's a real use case, happens quite frequently :-)