Bug 67053 [Workbench] when locking fails with exception, wrong message is shown
3.0 RC2 The same message will be shown by UI when locking fails, regardless the nature of the failure. case 1) Location#lock returns false - the "Current workspace is already in use" is shown case 2) Location#lock throws an IOException - something like "An error happened trying to lock the workspace" should be shown to the user, and the IOException should be logged. The same message (case 1) is being shown in both cases. Follows the code I am talking about: public final class IDEApplication ... { ... private boolean checkInstanceLocation(Shell shell) { ... try { if (instanceLoc.lock()) { writeWorkspaceVersion(); return true; } } catch (IOException e) { // do nothing } MessageDialog.openError( shell, IDEWorkbenchMessages .getString("IDEApplication.workspaceCannotLockTitle"), //$NON-NLS-1$ IDEWorkbenchMessages .getString("IDEApplication.workspaceCannotLockMessage")); //$NON-NLS-1$ return false; ... } ... }
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEApplication.java
if (!workspace.exists())
                workspace.mkdir();
            try {
                
                  
                String path = workspace.getAbsolutePath().replace(
                        File.separatorChar, '/');
                url = new URL("file", null, path); 
            } catch (MalformedURLException e) {
                MessageDialog
                        .openError(
                                shell,
                                IDEWorkbenchMessages
                                        .getString("IDEApplication.workspaceInvalidTitle"), 
                                IDEWorkbenchMessages
                                        .getString("IDEApplication.workspaceInvalidMessage")); 
                continue;
            }
        } while (!checkValidWorkspace(shell, url));
        return url;
    }
    /**
     * Return true if the argument directory is ok to use as a workspace and
     * false otherwise. A version check will be performed, and a confirmation
     * box may be displayed on the argument shell if an older version is
     * detected.
     * 
     * @return true if the argument URL is ok to use as a workspace and false
     *         otherwise.
     */