Skip to content

Search view: double clicking a search results opens the same file in a different project #4412

Open

Description

@jpstotz

Steps to reproduce

From a fresh installation and clean workspace:

  • Set-up: Create two projects
    • Java Maven project
    • OSGi/Eclipse Plugin project
  • Copy some source files to the src/main/java folder Java Maven project
  • In the plugin project open the project specific "Build Path" dialog and select the "Source" tab
  • Use the "Link Source..." button to add the src/main/java folder of the Java Maven project to the Plugin project.

Bug:

  • Open Menu Search -> File
  • In the File Search search for a text string that is contained in at least one of the source files that had been copied to the src/main/java folder Java Maven project
  • In the Search view for each finding there should be two results, one from Java Maven project and one from Plugin project.
  • Double click each search result, some of them will open the right file in the wrong project (not 100% deterministic). In my case when I double click a search result that belongs to the Java Maven project Eclipse instead opens the file in the Plugin project.

I expected: When double clicking a search result the file in the correct project should be opened

But got: When double clicking a search result the file in the opened project is not the one the search result belonged to

Tested under this environment:

  • OS & version: Windows 25H2, Eclipse 2026-09
  • Eclipse Version: 2026-09 (4.41.0) Build id: 20260903-0720

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.

With the help of AI located the problem in https://github.com/eclipse-platform/eclipse.platform.ui/blob/master/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileSearchPage.java
methods showMatch and handleOpen.

I am working on a fix. Due to the fact that the bug is not fully deterministic I will first test the patch in my common Eclipse installation.

Activity

  1. jpstotz commented on Sep 28, 2026

    @jpstotz
    Author

    The code for fixing this bug is here: https://github.com/jpstotz/eclipse.platform.ui/tree/searchbug

    After testing it for a while I will open up a PR.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions