Bug 550896 - Refactor dialog inconsistent with other compare dialogs
Summary: Refactor dialog inconsistent with other compare dialogs
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-09 07:55 EDT by Lars Vogel CLA
Modified: 2022-11-13 07:12 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-09-09 07:55:12 EDT
If I compare files changes in the Git Staging view I see a different behavior compared to the refactor dialog.

Consider the following scenario:

1. Preview of a refactoring change - the new code is displayed on the right
2. Preview in EGit compared with HEAD - the new code is displayed on the left (the same when comparing with local history and in CVS)

The PMC decided that we should switch the default for Compare, so this inconsistency might vanish soon. See https://wiki.eclipse.org/Eclipse/PMC August 27, 2019
Comment 1 Stephan Herrmann CLA 2019-09-09 10:08:25 EDT
(In reply to Lars Vogel from comment #0)
> If I compare files changes in the Git Staging view I see a different
> behavior compared to the refactor dialog.
> 
> Consider the following scenario:
> 
> 1. Preview of a refactoring change - the new code is displayed on the right
> 2. Preview in EGit compared with HEAD - the new code is displayed on the
> left (the same when comparing with local history and in CVS)
> 
> The PMC decided that we should switch the default for Compare, so this
> inconsistency might vanish soon. See https://wiki.eclipse.org/Eclipse/PMC
> August 27, 2019

In addition to left-right confusion, I seem to recall that refactoring preview also showed additions with a red background, removals with green. Perhaps this is directly connected?
Comment 2 Lars Vogel CLA 2019-09-09 10:12:10 EDT
(In reply to Stephan Herrmann from comment #1)

> In addition to left-right confusion, I seem to recall that refactoring
> preview also showed additions with a red background, removals with green.
> Perhaps this is directly connected?

Compare started to show colors in the 4.13 release, so I think this is unrelated. Please open a new bug, if the refactor dialog still uses wrong colors.
Comment 3 Eclipse Genie CLA 2021-11-27 10:35:41 EST
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 4 Jack McKalling CLA 2022-01-31 12:44:10 EST
This bug still occurs in 4.22. The colours are still mismatched, and the opposite compare direction is observed as with git compare editor.

For me it is the other way around than the description (left vs right), but it wasn't stated whether the "Swap left and right view" button was activated or not (for me it is). If I disable the button again, the problem persists but in the opposite direction.

This means that the "refactored code" side shows added lines in red, and lines removed from the "original source" side in green.

Both the colours and swapped left/right have the result that the compare view specifically is confusing the user with the opposite of what it is doing.
Comment 5 Petr Bodnar CLA 2022-11-13 06:41:13 EST
@Jack McKalling, confirmed. Yet, for this coloring problem a dedicated bug 557993 was already created.
Comment 6 Petr Bodnar CLA 2022-11-13 07:12:42 EST
(In reply to Lars Vogel from comment #0)
> If I compare files changes in the Git Staging view I see a different
> behavior compared to the refactor dialog.

Yes, unfortunately, this problem still persists, but it is actually being discussed for a long time - see below.

> 
> Consider the following scenario:
> 
> 1. Preview of a refactoring change - the new code is displayed on the right
> 2. Preview in EGit compared with HEAD - the new code is displayed on the
> left (the same when comparing with local history and in CVS)
> 

Yes, as described already in comment here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=213780#c9. And after bug 213780 got implemented, users can activate "Swap left and right" in the workspace preferences to see new code on the right in the Compare dialog (like you will see it in 99% of tools out there by default).

Unfortunately as described in bug 508257, the panels in the Refactoring preview get swapped when activating this new option, like if nobody listened to the comment linked above. So IMHO this issue is kind of duplicate of bug 508257, only the suggested solutions to the existing problem differ.

> The PMC decided that we should switch the default for Compare, so this
> inconsistency might vanish soon. See https://wiki.eclipse.org/Eclipse/PMC
> August 27, 2019

Hm, interesting, IMO this would be probably the simplest solution of how to get out of this "vicious circle", together with "somehow" deprecating the "Swap left and right" option probably. But once again, the situation seems to be a little bit more complicated, because some people state "they don't want to break existing APIs, clients etc." - that's why a proposal bug 516450 came out from discussion in bug 508257.

When looking at all of this, I'm not really sure whether we can ever get to a consensus. It seems like we are stuck now, unable to change at least some problematic part. It has turned out there are some fundamental design discrepancies all over the Eclipse's comparison features, so some people would probably like to solve them all together, but I'm not sure if that is possible. Maybe it will be easier to wait for the new Eclipse and hope its authors will be more cautious there?