Skip to content

Java Projects view creates duplicate project entries when multiple projects from different locations are opened in one workspace #4478

Description

@angsag212223-svg

Description

I am facing an issue with the Red Hat Java extension where the JAVA PROJECTS view shows duplicate/inconsistent project entries when multiple Java projects from different filesystem locations are opened in the same workspace.

Steps to reproduce

  1. Open VS Code.
  2. Create/open a workspace.
  3. Add two Java projects from different locations.
  4. Make sure both projects are valid Maven/Java projects.
  5. Open the JAVA PROJECTS view.
  6. Observe the project tree.

For example:

Workspace
├── D:\workspace\project1
└── D:\another-location\project2

When the projects are opened together, the Java Projects tree can show duplicate project entries or an incorrect hierarchy.

Example:

JAVA PROJECTS
├── timestamp
│   └── timestamp
└── timestamp

Expected behavior

Each Java project should appear only once and should be associated with its correct project/workspace location.

Actual behavior

The same Java project can appear multiple times in the JAVA PROJECTS tree, and the hierarchy can become inconsistent.

The issue is especially noticeable when the projects are located in different filesystem locations. When projects are located under the same location, I do not observe the issue.

Additional information

I initially observed this issue in an Eclipse Theia-based editor using the Red Hat Java extension. I then reproduced the same behavior in standard VS Code as well.

Therefore, the issue does not appear to be specific to my Theia implementation.

I also observed related errors while opening files/projects, including:

TextEditor(vs.editor.ICodeEditor:8,$model11) has been disposed

and:

Widget was activated, but did not accept focus after 2000ms:
code-editor-opener:file:///...

Could you please investigate whether this is related to Java project identification/project URI handling or the Java Projects TreeDataProvider when multiple workspace folders/projects are present?

I can provide extension logs, JDT LS logs, workspace configuration, and a minimal reproduction project if required.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions