### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.debug.ui Index: ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java,v retrieving revision 1.38 diff -u -r1.38 JavaStackTraceHyperlink.java --- ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java 27 Apr 2007 18:24:48 -0000 1.38 +++ ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java 3 May 2011 17:26:20 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,14 +40,15 @@ import com.ibm.icu.text.MessageFormat; /** - * A hyperlink from a stack trace line of the form "*(*.java:*)" + * A hyper-link from a stack trace line of the form "*(*.java:*)" */ public class JavaStackTraceHyperlink implements IHyperlink { private TextConsole fConsole; /** - * Constructor for JavaStackTraceHyperlink. + * Constructor + * @param console the {@link TextConsole} this link detector is attached to */ public JavaStackTraceHyperlink(TextConsole console) { fConsole = console; @@ -91,6 +92,7 @@ * Starts a search for the type with the given name. Reports back to 'searchCompleted(...)'. * * @param typeName the type to search for + * @param lineNumber the line number to open the editor on */ protected void startSourceSearch(final String typeName, final int lineNumber) { Job search = new Job(ConsoleMessages.JavaStackTraceHyperlink_2) { @@ -99,12 +101,12 @@ Object result = null; try { if (launch != null) { - result = JavaDebugUtils.resolveSourceElement(JavaDebugUtils.generateSourceName(typeName), getLaunch()); - } - if (result == null) { // search for the type in the workspace result = OpenTypeAction.findTypeInWorkspace(typeName); } + if (result == null) { + result = JavaDebugUtils.resolveSourceElement(JavaDebugUtils.generateSourceName(typeName), getLaunch()); + } searchCompleted(result, typeName, lineNumber, null); } catch (CoreException e) { searchCompleted(null, typeName, lineNumber, e.getStatus()); @@ -116,6 +118,14 @@ search.schedule(); } + /** + * Reported back to from {@link JavaStackTraceHyperlink#startSourceSearch(String, int)} when results are found + * + * @param source the source object + * @param typeName the fully qualified type name + * @param lineNumber the line number in the type + * @param status the error status or null if none + */ protected void searchCompleted(final Object source, final String typeName, final int lineNumber, final IStatus status) { UIJob job = new UIJob("link search complete") { //$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { @@ -172,10 +182,10 @@ } /** - * Returns the launch associated with this hyperlink, or + * Returns the launch associated with this hyper-link, or * null if none * - * @return the launch associated with this hyperlink, or + * @return the launch associated with this hyper-link, or * null if none */ private ILaunch getLaunch() { @@ -188,7 +198,8 @@ /** * Returns the fully qualified name of the type to open - * + * + * @param linkText the complete text of the link to be parsed * @return fully qualified type name * @exception CoreException if unable to parse the type name */ @@ -233,6 +244,8 @@ /** * Returns the line number associated with the stack trace or -1 if none. * + * @param linkText the complete text of the link to be parsed + * @return the line number for the stack trace or -1 if one cannot be computed or has not been provided * @exception CoreException if unable to parse the number */ protected int getLineNumber(String linkText) throws CoreException { @@ -266,6 +279,7 @@ /** * Returns this link's text * + * @return the complete text of the link, never null * @exception CoreException if unable to retrieve the text */ protected String getLinkText() throws CoreException {