Code clean up.
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenImplementationAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenImplementationAction.java
index a1a7acf..6e47b15 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenImplementationAction.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenImplementationAction.java
@@ -102,12 +102,16 @@
public void run(ITextSelection selection) {
if (!ActionUtil.isProcessable(fEditor))
return;
- IJavaElement element;
+ IJavaElement element= null;
try {
- element= elementAtOffset();
+ IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, true);
+ if (elements.length == 1)
+ element= elements[0];
} catch (InvocationTargetException e) {
ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OpenAction_error_message);
return;
+ } catch (InterruptedException e) {
+ return;
}
if (element == null || !((element instanceof IMethod) && canBeOverriddenMethod((IMethod)element))) {
@@ -135,24 +139,6 @@
}
/**
- * Returns the java element corresponding to the selection offset.
- *
- * @return the java element that corresponds to the selection, <code>null</code> if no Java
- * element was found
- * @throws InvocationTargetException in case code resolve failed
- */
- private IJavaElement elementAtOffset() throws InvocationTargetException {
- try {
- IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, true);
- if (elements.length == 1)
- return elements[0];
- } catch (InterruptedException e) {
- // Ignore
- }
- return null;
- }
-
- /**
* Checks whether a method can be overridden.
*
* @param method the method