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
IDEWorkbenchMessages
                                    .getString("IDEApplication.workspaceCannotLockTitle"), 
                            IDEWorkbenchMessages
                                    .getString("IDEApplication.workspaceCannotLockMessage")); 
            return false;
        }
        
        ChooseWorkspaceData launchData = new ChooseWorkspaceData(instanceLoc
                .getDefault());
        boolean force = false;
        while (true) {
            URL workspaceUrl = promptForWorkspace(shell, launchData, force);
            if (workspaceUrl == null)
                return false;
            
            
            force = true;
            try {
                
                
                if (instanceLoc.setURL(workspaceUrl, true)) {
                    launchData.writePersistedData();
                    writeWorkspaceVersion();
                    return true;
                }
            } catch (IllegalStateException e) {
                MessageDialog
                        .openError(
                                shell,
                                IDEWorkbenchMessages