Skip to content

Incorrect Colors in LTK Refactoring Preview Wizard #3775

Closed

Description

@tobiasmelcher

Summary

The Refactoring Preview Wizard Page in Eclipse LTK (Language Toolkit) uses incorrect colors in the two-way compare viewer. Additions are shown in red and deletions are shown in green, which is the opposite of standard conventions.

Steps to Reproduce

  1. Open a Java file in the Eclipse editor
  2. Select a block of code that you want to extract into a separate method
  3. Open the Extract Method refactoring wizard:
    • Main menu: Refactor → Extract Method...
  4. Click the Preview > button in the "Extract Method" dialog to view the refactoring changes
  5. Observe the compare viewer in the Preview wizard page
Image

Actual Behavior

  • Additions (new code on the right side showing the extracted method call) are displayed in red color
  • Deletions (original code on the left side being replaced) are displayed in green color

Expected Behavior

  • Additions (new code) should be displayed in green color
  • Deletions (removed code) should be displayed in red color

Tested under this environment:

  • OS & version: Windows (I think the problem is not Platform dependent)

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.

Activity

  1. iloveeclipse commented on Mar 13, 2026

    @iloveeclipse
    Member

    Also note, the compare direction is not default, unfortunately the default for Eclipse is "new" on the left side, (which is what I personally would like to see changed at some time). May be that is the reason?

  2. tobiasmelcher commented on Mar 13, 2026

    @tobiasmelcher
    ContributorAuthor

    Also note, the compare direction is not default, unfortunately the default for Eclipse is "new" on the left side, (which is what I personally would like to see changed at some time). May be that is the reason?

    I also think that this makes the problem.

  3. iloveeclipse commented on Mar 13, 2026

    @iloveeclipse
    Member

    I also think that this makes the problem.

    Yep, just tried (note, additionally to the fix I'm also using flipped default as of eclipse-platform/eclipse.platform#2566):

    Image
  4. iloveeclipse commented on Mar 13, 2026

    @iloveeclipse
    Member

    Without the changed default, the fix would look like:

    Image
  5. BeckerWdf commented on Mar 13, 2026

    @BeckerWdf
    Member

    Without the changed default, the fix would look like:

    Image

    Which is also correct, isn't it?

  6. iloveeclipse commented on Mar 13, 2026

    @iloveeclipse
    Member

    Which is also correct, isn't it?

    It is formally correct, but wrong from the usability point of view.

  7. BeckerWdf commented on Mar 13, 2026

    @BeckerWdf
    Member

    Which is also correct, isn't it?

    It is formally correct, but wrong from the usability point of view.

    You mean it should be red in this case?

  8. iloveeclipse commented on Mar 13, 2026

    @iloveeclipse
    Member

    You mean it should be red in this case?

    No, I mean it should be on the right side :-)
    No one expects new changes to be left.

  9. self-assigned this
    on Mar 15, 2026
  10. modified the milestones: 4.40 RC1, 4.40 M1 on Mar 15, 2026
  11. tobiasmelcher commented on Mar 16, 2026

    @tobiasmelcher
    ContributorAuthor

    Thanks a lot for the very fast fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions