Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,27 +277,23 @@ protected Object checkInstanceLocation(Shell shell, Map applicationArguments) {
// 1. directory is already in use
// 2. directory could not be created
File workspaceDirectory = new File(instanceLoc.getURL().getFile());
if (workspaceDirectory.exists()) {
if (isDevLaunchMode(applicationArguments)) {
return EXIT_WORKSPACE_LOCKED;
}
boolean workspaceDirectoryExists = workspaceDirectory.exists();

// check if there is a lock info then append it to error message.
String lockInfo = WorkspaceLock.getWorkspaceLockDetails(instanceLoc.getURL());
if (lockInfo != null) {
hideSplash(shell);
WorkspaceLock.showWorkspaceLockedDialog(shell, workspaceDirectory.getAbsolutePath(),
lockInfo);
} else {
hideSplash(shell);
MessageDialog.openError(shell,
IDEWorkbenchMessages.IDEApplication_workspaceCannotBeSetTitle,
IDEWorkbenchMessages.IDEApplication_workspaceCannotBeSetMessage);
}
// In dev (PDE) launch mode let the launcher report the locked workspace.
if (workspaceDirectoryExists && 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 = workspaceDirectoryExists
? WorkspaceLock.getWorkspaceLockDetails(instanceLoc.getURL())
: null;
hideSplash(shell);
if (lockInfo != null) {
WorkspaceLock.showWorkspaceLockedDialog(shell, workspaceDirectory.getAbsolutePath(), lockInfo);
} else {
hideSplash(shell);
MessageDialog.openError(
shell,
MessageDialog.openError(shell,
IDEWorkbenchMessages.IDEApplication_workspaceCannotBeSetTitle,
IDEWorkbenchMessages.IDEApplication_workspaceCannotBeSetMessage);
}
Expand Down
Loading