Skip to content

Commit

Permalink
JavaStackStrace ambiguity Itype fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SougandhS committed Sep 18, 2024
1 parent e249738 commit 13316ba
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.core.search.TypeNameMatch;
import org.eclipse.jdt.core.search.TypeNameMatchRequestor;
import org.eclipse.jdt.internal.core.SourceType;
import org.eclipse.jdt.internal.debug.core.JavaDebugUtils;
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
import org.eclipse.jdt.internal.debug.ui.actions.OpenFromClipboardAction;
Expand Down Expand Up @@ -211,21 +210,20 @@ public IStatus runInUIThread(IProgressMonitor monitor) {
if (firstMethodStartIndex != -1 && firstMethodClosing != -1) {
String firstMethod = originalHyperLink2.substring(firstMethodStartIndex + 1, firstMethodClosing + 1);
for (Object obj : matches) {
@SuppressWarnings("restriction")
SourceType source = (SourceType) obj;
try {
@SuppressWarnings("restriction")
IMethod[] methods = source.getMethods();
for (IMethod method : methods) {
int indexOfClosing = method.toString().indexOf(')');
int indexOfStart = method.toString().substring(0, indexOfClosing + 1).lastIndexOf(' ');
String methodName = method.toString().substring(indexOfStart + 1, indexOfClosing + 1);
if (methodName.equals(firstMethod)) {
exactMatchesFiltered.add(obj);
if (obj instanceof IType type) {
try {
IMethod[] methods = type.getMethods();
for (IMethod method : methods) {
int indexOfClosing = method.toString().indexOf(')');
int indexOfStart = method.toString().substring(0, indexOfClosing + 1).lastIndexOf(' ');
String methodName = method.toString().substring(indexOfStart + 1, indexOfClosing + 1);
if (methodName.equals(firstMethod)) {
exactMatchesFiltered.add(obj);
}
}
} catch (JavaModelException e) {
JDIDebugUIPlugin.log(e);
}
} catch (JavaModelException e) {
JDIDebugUIPlugin.log(e);
}
}
}
Expand Down

0 comments on commit 13316ba

Please sign in to comment.