Close a project when its .project file is deleted - #2895
Open
vogella wants to merge 1 commit into
Open
Conversation
Contributor
vogella
force-pushed
the
close-project-without-description
branch
2 times, most recently
from
September 3, 2026 07:56
8d66678 to
9923ce5
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core project lifecycle, persistence, refresh, and partial-move recovery behavior requiring final human validation.
Pull request overview
Closes open Eclipse workspace projects when their .project file disappears, preventing saves from recreating deleted metadata.
Changes:
- Detects
.projectdeletion during resource deletion and refresh, then closes the project. - Stops save/close operations from recreating missing descriptions.
- Preserves partially moved project content and updates affected tests.
File summaries
| File | Description |
|---|---|
Snapshot2Test.java |
Retains .project during snapshot setup. |
TestBug12575.java |
Updates cross-session deletion expectations. |
IWorkspaceTest.java |
Verifies saves do not recreate .project. |
ISynchronizerTest.java |
Retains project descriptions during synchronization testing. |
IProjectTest.java |
Tests explicit description rewriting. |
IProjectDescriptionTest.java |
Covers deletion, refresh, close, reopen, and failed moves. |
LocalSyncTest.java |
Expects refresh to close deleted projects. |
SaveManager.java |
Removes automatic project-description repair during saves. |
ResourceTree.java |
Avoids source refresh after partial project moves. |
Resource.java |
Closes projects after workspace .project deletion. |
Project.java |
Extracts reusable internal project-closing logic. |
File.java |
Centralizes .project identification. |
RefreshLocalVisitor.java |
Tracks projects whose descriptions disappeared. |
FileSystemResourceManager.java |
Closes tracked projects after refresh. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
iloveeclipse
reviewed
Sep 3, 2026
vogella
force-pushed
the
close-project-without-description
branch
from
September 3, 2026 23:17
9923ce5 to
bb8ca9d
Compare
Contributor
Author
|
@iloveeclipse To your question: The code was done without bug reference AFAICS. John Arthorne on 2002-03-16 in commit f64fa15 ("Moved project description file to content area"), the Eclipse 2.0 change that moved .project out of .metadata into the project folder |
vogella
force-pushed
the
close-project-without-description
branch
from
September 4, 2026 07:53
bb8ca9d to
7a81528
Compare
When the project description file disappeared, the workspace kept the project open with the in-memory description, logged a refresh error and silently wrote the description back to disk at the next snapshot or on close. Switching to a git branch that no longer contains a project thus left a dirty working tree with a recreated .project file. A refresh that finds the description file deleted, and deleting the file through the workspace, now close the project instead. Closing a project and saving the workspace no longer recreate a missing description file. Opening the project again works once the file is back, as for a project with a missing description on startup. A project move whose content could only be moved partially now refreshes the destination after the tree has been moved, instead of the source before. The tree always ends up under the destination name, so the source refresh described the destination with the leftovers of the source: files already deleted there were dropped from the tree with their markers even though they exist at the destination, and with this change the source refresh would also have closed the project because its description file is gone. The destination refresh keeps the moved resources and their markers and trims what was never copied. Fixes eclipse-platform#1074 Assisted-by: multiple AI agents and layers of automated tooling 🤖
vogella
force-pushed
the
close-project-without-description
branch
from
September 4, 2026 11:38
7a81528 to
1a6e3bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
.projectfile disappears, for example after switching to a git branch that no longer contains the project, the workspace kept the project open and silently wrote the description back to disk at the next snapshot, save or close, leaving a dirty working tree (#1074).A refresh that finds
.projectdeleted, and deleting the file through the workspace, now close the project instead, and closing or saving no longer recreates a missing description file. The project can be reopened once the file is back, just like a project with a missing description on startup.A project move whose content could only be moved partially now refreshes the destination after the tree has been moved, instead of refreshing the source before. The tree always ends up under the destination name, so the old source refresh described the destination with the leftovers of the source and dropped moved files and their markers; it would now also close the project because its
.projectis gone. The destination refresh keeps the moved resources with their markers and trims whatever was never copied.Code that deletes every member of a project including
.projectand keeps using it now sees a closed project; five tests in this repository were adjusted accordingly. The fullorg.eclipse.core.tests.resourcessuite passes locally.Fixes #1074