Skip to content

Commit ddf0a0a

Browse files
SougandhSjukzi
authored andcommitted
Filtering unqualified Stacktraces #115
Using method name to filter unqualified stacktraces generated in java stacktrace console to provide more accurate search results. Fixes #115
1 parent d9f4f95 commit ddf0a0a

File tree

12 files changed

+1221
-83
lines changed

12 files changed

+1221
-83
lines changed

org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/JavaStackTraceAmbiguityTest.java

Lines changed: 465 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
/**
15+
* Test class
16+
*/
17+
class InnerClassTest {
18+
public static void main(String[] ar) {
19+
20+
}
21+
class innerL1 {
22+
void check2() {
23+
System.out.println("EXPECTED_INNERCLASS");
24+
}
25+
class innerL2 {
26+
void check4() {
27+
System.out.println("EXPECTED_INNER-INNER_CLASS");
28+
}
29+
}
30+
}
31+
}
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
public class MyScheduledExecutor {
15+
public void executeTask() {
16+
Wor worker = new Wor();
17+
}
18+
class Worker {
19+
public void doWork2(Wor w) {
20+
21+
}
22+
public void doWorkParams(Wor w,Ran r) {
23+
System.out.println("Expected_Result");
24+
}
25+
}
26+
class Wor {
27+
28+
}
29+
class Ran {
30+
31+
}
32+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
/**
15+
* Test class
16+
*/
17+
class Node<E> {
18+
E data;
19+
Node<E> next;
20+
Node(E data){};
21+
}
22+
public class SampleGenerics<E> {
23+
private Node<E> head;
24+
public E remove() {
25+
System.out.print("EXPECTED_GENERICS");
26+
return null;
27+
}
28+
29+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
public class MyScheduledExecutor {
15+
public void executeTask() {
16+
Wor worker = new Wor();
17+
}
18+
class Worker {
19+
public void doWork(Wor w) {
20+
System.out.println("Expected_Result");
21+
}
22+
}
23+
class Wor {
24+
25+
}
26+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package a;
15+
import java.net.URL;
16+
/**
17+
* Test class
18+
*/
19+
public class Sample {
20+
public static void main(String[] args) {
21+
System.out.println("Main Method");
22+
test();
23+
}
24+
public static void test() {
25+
System.out.println("Testing..");
26+
}
27+
public void testMethod() {
28+
System.out.println("Random");
29+
}
30+
public static void tes3(int x) {
31+
System.out.println("Expected_Single_Parameter");
32+
}
33+
public void tes2() {
34+
35+
}
36+
public static void tesComplex(String[] x, java.net.URL[] sx) {
37+
System.out.println("Expected_One_normal_&_One_fully_qualified");
38+
}
39+
public void testBlank() {
40+
System.out.println("Expected_No_Signature");
41+
}
42+
public void tes2(java.lang.Object... objects ) {
43+
44+
}
45+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
/**
15+
* Test class
16+
*/
17+
class InnerClassTest {
18+
public static void main(String[] ar) {
19+
20+
}
21+
class innerL1 {
22+
void check1() {
23+
System.out.println("EXPECTED_INNERCLASS");
24+
}
25+
class innerL2 {
26+
void check23() {
27+
System.out.println("EXPECTED_INNER-INNER_CLASS");
28+
}
29+
}
30+
}
31+
}
32+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package b;
15+
16+
/**
17+
* Test class
18+
*/
19+
public class Sample {
20+
public static void main(String[] args) {
21+
System.out.println("Main Method");
22+
test();
23+
}
24+
public static void test() {
25+
System.out.println("Testing..");
26+
}
27+
public void testMethod() {
28+
System.out.println("Random");
29+
}
30+
public static void tes3() {
31+
System.out.println("Expected_Zero_Parameter");
32+
}
33+
public void tes2() {
34+
35+
}
36+
public static void tesComplex(java.lang.Object x, java.net.URL[] sx) {
37+
System.out.println("Expected_both_fully_qualified");
38+
}
39+
public void tes2(java.lang.Object x,java.lang.Object... args ) {
40+
System.out.println("Expected_VarArgs");
41+
}
42+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
/**
15+
* Test class
16+
*/
17+
class InnerClassTest {
18+
public static void main(String[] ar) {
19+
20+
}
21+
class innerL1 {
22+
void check() {
23+
System.out.println("EXPECTED_INNERCLASS");
24+
}
25+
class innerL2 {
26+
void check2() {
27+
System.out.println("EXPECTED_INNER-INNER_CLASS");
28+
}
29+
}
30+
}
31+
}
32+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package c;
15+
16+
/**
17+
* Test class
18+
*/
19+
public class Sample {
20+
public static void main(String[] args) {
21+
System.out.println("Main Method");
22+
test();
23+
}
24+
public static void test() {
25+
System.out.println("Testing..");
26+
}
27+
public void testMethod() {
28+
System.out.println("Random");
29+
}
30+
public static void tes3(int x, String v) {
31+
System.out.println("Expected_Multiple_Parameter");
32+
}
33+
public static void tes3(int x, String v, Sample s) {
34+
System.out.println("Expected_Multiple_Parameter_Three");
35+
}
36+
public void tes2() {
37+
38+
}
39+
public void testMethod(Object s,Object... sd) {
40+
System.out.println("Expected_oneNormal&oneVarArgs");
41+
}
42+
public void testMethod(Object... sd) {
43+
System.out.println("Expected_oneVarArgs");
44+
}
45+
46+
}

0 commit comments

Comments
 (0)