Community
Participate
Working Groups
Build ID: I20070424-0930 Steps To Reproduce: 1. Set "Team>Reuse open compare editors" preference on 2. Open Synchronize View with at least two outgoing changes 3. Select two files with outgoing changes and select "Open in Compare Editor" from context menu 4. Two compare editors will open for both files 5. Select the later file and select "Open in Compare Editor" from context menu 6. First editor will be used for comparision, which will result with 2 editors opened for the same outgoing change. I think that using the one with the file already opened would be a better solution.
This should be a fairly straight forward fix.
Created attachment 66103 [details] Patch I've divided the loop from the findReusableCompareEditor into 2 loops. First one is looking for an editor with the same input. If none is found and "Reuse open compare editors" preference is on the method will return a non-dirty editor (if available).
The second loop is missing the condition used in the first loop. I think it needs it.
The second loop is run only when isReuseOpenEditor() is true. I've moved the condition you're talking about to the line before the second loop. This way it's checked only once which should have the same result as checking it for every element inside the loop.
I'm talking about this check: if(part != null && (part.getEditorInput() instanceof SyncInfoCompareInput || part.getEditorInput() instanceof ModelCompareEditorInput) && part instanceof IReusableEditor) It appears in the first loop but not the second. Without it, the code will return the first non-dirty editor it finds.
Created attachment 66247 [details] Patch v2 You're absolutely right Michael. Sorry, it's my fault. I hope this patch looks much better.
Patch reviewed and released.
Verified in I20070517-0010.