Simplify duplicated workspace-lock error handling in IDEApplication#4140
Open
vogella wants to merge 1 commit into
Open
Simplify duplicated workspace-lock error handling in IDEApplication#4140vogella wants to merge 1 commit into
vogella wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the workspace-lock failure handling in IDEApplication#checkInstanceLocation by collapsing duplicated splash-hiding and error-dialog code paths while keeping the same user-visible outcomes for the existing cases (dev-launch lock reporting, lock info present/absent, and missing workspace directory).
Changes:
- Consolidated the “workspace cannot be set” error handling into a single path and ensured
hideSplash(shell)is called once. - Only reads workspace lock details when the workspace directory exists.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+281
to
+290
| // In dev (PDE) launch mode let the launcher report the locked workspace. | ||
| if (workspaceDirectory.exists() && isDevLaunchMode(applicationArguments)) { | ||
| return EXIT_WORKSPACE_LOCKED; | ||
| } | ||
|
|
||
| // If the directory exists and carries lock info, show it; otherwise | ||
| // report that the workspace location could not be set. | ||
| String lockInfo = workspaceDirectory.exists() | ||
| ? WorkspaceLock.getWorkspaceLockDetails(instanceLoc.getURL()) | ||
| : null; |
39ec0e7 to
9580995
Compare
Contributor
The "already set" branch of checkInstanceLocation repeated hideSplash and the generic "cannot be set" error dialog across a nested if/else. Collapse to a single splash hide and one error path; behavior is unchanged.
9580995 to
90f1cd3
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.
The "already set" branch of
checkInstanceLocationhad three identicalhideSplashcalls and two identical "cannot be set" error dialogs spread across a nestedif/else. This collapses them to a single splash hide and one error path, reading the workspace lock details only when the directory actually exists. Behavior is unchanged across all four cases (dev-launch lock, lock info present, no lock info, missing directory). The bundle compiles cleanly.