Bug 531958 - Empty error shown on launching with broken type search
Change-Id: I666f37f897266828858698a0483d6d235866eb44
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaLaunchShortcut.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaLaunchShortcut.java
index 61d7bea..0897a9d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaLaunchShortcut.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaLaunchShortcut.java
@@ -113,7 +113,12 @@
}
catch (InterruptedException e) {return;}
catch (CoreException e) {
- MessageDialog.openError(getShell(), LauncherMessages.JavaLaunchShortcut_0, e.getMessage());
+ JDIDebugUIPlugin.log(e);
+ String message = e.getMessage();
+ if (message == null || message.isEmpty()) {
+ message = LauncherMessages.JavaLaunchShortcut_1;
+ }
+ MessageDialog.openError(getShell(), LauncherMessages.JavaLaunchShortcut_0, message);
return;
}
IType type = null;
@@ -258,9 +263,6 @@
return JDIDebugUIPlugin.getActiveWorkbenchShell();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
- */
@Override
public void launch(IEditorPart editor, String mode) {
IEditorInput input = editor.getEditorInput();
@@ -270,9 +272,6 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String)
- */
@Override
public void launch(ISelection selection, String mode) {
if (selection instanceof IStructuredSelection) {
@@ -280,17 +279,11 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.ui.IEditorPart)
- */
@Override
public IResource getLaunchableResource(IEditorPart editorpart) {
return getLaunchableResource(editorpart.getEditorInput());
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.jface.viewers.ISelection)
- */
@Override
public IResource getLaunchableResource(ISelection selection) {
if (selection instanceof IStructuredSelection) {
@@ -320,18 +313,12 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.ui.IEditorPart)
- */
@Override
public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart) {
// let the framework resolve configurations based on resource mapping
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.jface.viewers.ISelection)
- */
@Override
public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection) {
// let the framework resolve configurations based on resource mapping