diff --git a/org.eclipse.jdt.debug.tests/testfiles/AmbiguityTest/bin/a/Sample.java b/org.eclipse.jdt.debug.tests/testfiles/AmbiguityTest/bin/a/Sample.java deleted file mode 100644 index e52d37d128..0000000000 --- a/org.eclipse.jdt.debug.tests/testfiles/AmbiguityTest/bin/a/Sample.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2024 IBM Corporation. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package a; -import java.net.URL; -/** - * Test class - */ -public class Sample { - public static void main(String[] args) { - System.out.println("Main Method"); - test(); - } - public static void test() { - System.out.println("Testing.."); - } - public void testMethod() { - System.out.println("Random"); - } - public static void tes3(int x) { - System.out.println("Expected_Single_Parameter"); - } - public void tes2() { - - } - public static void tesComplex(String[] x, java.net.URL[] sx) { - System.out.println("Expected_One_normal_&_One_fully_qualified"); - } - public void testBlank() { - System.out.println("Expected_No_Signature"); - } -} \ No newline at end of file diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java index d5a228ba34..94d3d61892 100644 --- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java +++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java @@ -220,12 +220,11 @@ public IStatus runInUIThread(IProgressMonitor monitor) { processSearchResult(exactMatchesFiltered.get(0), typeName, lineNumber); return Status.OK_STATUS; } - List filteredResults = filterBinResults(exactMatchesFiltered); - if (filteredResults.size() == 1) { - processSearchResult(filteredResults.get(0), typeName, lineNumber); + if (exactMatchesFiltered.size() == 1) { + processSearchResult(exactMatchesFiltered.get(0), typeName, lineNumber); return Status.OK_STATUS; } - return openClipboard(filteredResults, line, typeName); + return openClipboard(exactMatchesFiltered, line, typeName); } return openClipboard(matches, line, typeName); @@ -239,40 +238,6 @@ public IStatus runInUIThread(IProgressMonitor monitor) { job.schedule(); } - /** - * Further filters the extracted results - * - * @param exactMatchesFiltered - * extracted matches method name - * @return returns List - */ - private List filterBinResults(List exactMatchesFiltered) { - List itemsToBeDeleted = new ArrayList<>(); - List fileredResults = new ArrayList<>(); - for (Object res : exactMatchesFiltered) { - if (res instanceof IType type) { - if (type.getFullyQualifiedName().startsWith("bin.")) { //$NON-NLS-1$ - String currentTarget = type.getFullyQualifiedName().substring(4); - long counts = exactMatchesFiltered.stream().filter(obj -> obj instanceof IType).map(obj -> (IType) obj).filter(ob -> { - String current = ob.getFullyQualifiedName(); - if (current.startsWith("bin.")) { //$NON-NLS-1$ - current = current.substring(4); - } - return current.equals(currentTarget); - }).count(); - if (counts > 1) { - itemsToBeDeleted.add(res); - } - } - } - } - for (Object obj : exactMatchesFiltered) { - if (!itemsToBeDeleted.contains(obj)) { - fileredResults.add(obj); - } - } - return fileredResults; - } /** * Filter classes based on matching method name *