Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using method name to find unqualified Stacktraces in Java Stack Trace #498

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* 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
*******************************************************************************/
/**
* Test class
*/
class InnerClassTest {
public static void main(String[] ar) {

}
class innerL1 {
void check() {
System.out.println("EXPECTED_INNERCLASS");
}
class innerL2 {
void check2() {
System.out.println("EXPECTED_INNER-INNER_CLASS");
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* 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
*******************************************************************************/
/**
* Test class
*/
class Node<E> {
E data;
Node<E> next;
Node(E data){};
}
public class SampleGenerics<E> {
private Node<E> head;
public E remove() {
System.out.print("EXPECTED_GENERICS");
return null;
}

}
40 changes: 40 additions & 0 deletions org.eclipse.jdt.debug.tests/testfiles/Ambiguity/a/Sample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*******************************************************************************
* 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
jukzi marked this conversation as resolved.
Show resolved Hide resolved
*******************************************************************************/
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");
}

}
39 changes: 39 additions & 0 deletions org.eclipse.jdt.debug.tests/testfiles/Ambiguity/b/Sample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* 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 b;

/**
* 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() {
System.out.println("Expected_Zero_Parameter");
}
public void tes2() {

}
public static void tesComplex(java.lang.Object x, java.net.URL[] sx) {
System.out.println("Expected_both_fully_qualified");
}
}
46 changes: 46 additions & 0 deletions org.eclipse.jdt.debug.tests/testfiles/Ambiguity/c/Sample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*******************************************************************************
* 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 c;

/**
* 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, String v) {
System.out.println("Expected_Multiple_Parameter");
}
public static void tes3(int x, String v, Sample s) {
System.out.println("Expected_Multiple_Parameter_Three");
}
public void tes2() {

}
public void testMethod(Object s,Object... sd) {
System.out.println("Expected_oneNormal&oneVarArgs");
}
public void testMethod(Object... sd) {
System.out.println("Expected_oneVarArgs");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.eclipse.jdt.debug.tests.console.ConsoleTerminateAllActionTests;
import org.eclipse.jdt.debug.tests.console.IOConsoleTests;
import org.eclipse.jdt.debug.tests.console.JavaDebugStackTraceConsoleTest;
import org.eclipse.jdt.debug.tests.console.JavaStackTraceAmbiguityTest;
import org.eclipse.jdt.debug.tests.console.JavaStackTraceConsoleTest;
import org.eclipse.jdt.debug.tests.core.AlternateStratumTests;
import org.eclipse.jdt.debug.tests.core.ArgumentTests;
Expand Down Expand Up @@ -273,6 +274,7 @@ public AutomatedSuite() {
addTest(new TestSuite(JavaDebugStackTraceConsoleTest.class));
addTest(new TestSuite(IOConsoleTests.class));
addTest(new TestSuite(ConsoleTerminateAllActionTests.class));
addTest(new TestSuite(JavaStackTraceAmbiguityTest.class));

//Core tests
addTest(new TestSuite(DebugEventTests.class));
Expand Down
Loading