Remove unused Utils method
MODIFY
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Utils.java
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Utils.java
@@ -75,17 +75,5 @@ public class Utils {
return type.getDeclaredMethods().filter(named(methodName)).getOnly();
}
- /** Returns the current stack trace with multiple entries on new lines. */
- public static String getStackTraceAsString() {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- StringBuilder stringBuilder = new StringBuilder();
- String lineSeparator = System.getProperty("line.separator");
- for (StackTraceElement element : stackTrace) {
- stringBuilder.append(element.toString());
- stringBuilder.append(lineSeparator);
- }
- return stringBuilder.toString();
- }
-
private Utils() {}
}

MODIFY
javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/UtilsTest.groovy
javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/UtilsTest.groovy
@@ -9,15 +9,6 @@ import spock.lang.Specification
class UtilsTest extends Specification {
- def "getStackTraceAsString() returns the stack trace as a single new line separated string"() {
- setup:
- def stackTrace = Utils.stackTraceAsString
-
- expect:
- stackTrace.contains('io.opentelemetry.javaagent.tooling.Utils')
- stackTrace.contains(System.getProperty("line.separator"))
- }
-
def "getResourceName() adds suffix and converts dots to slashes"() {
setup:
def result = Utils.getResourceName("com.example.Something")

Remove unused Utils method (#3324)