aboutsummaryrefslogtreecommitdiff
path: root/spark-common
diff options
context:
space:
mode:
Diffstat (limited to 'spark-common')
-rw-r--r--spark-common/build.gradle2
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java9
2 files changed, 5 insertions, 6 deletions
diff --git a/spark-common/build.gradle b/spark-common/build.gradle
index f6b54f3..1926ccc 100644
--- a/spark-common/build.gradle
+++ b/spark-common/build.gradle
@@ -5,7 +5,7 @@ plugins {
dependencies {
api project(':spark-api')
implementation 'com.github.jvm-profiling-tools:async-profiler:v2.0'
- implementation 'org.ow2.asm:asm:7.1'
+ implementation 'org.ow2.asm:asm:9.1'
implementation 'com.google.protobuf:protobuf-javalite:3.15.6'
implementation 'com.squareup.okhttp3:okhttp:3.14.1'
implementation 'com.squareup.okio:okio:1.17.3'
diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java b/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java
index a35bf08..c03e7cb 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java
@@ -46,6 +46,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public final class MethodDisambiguator {
private final Map<String, ComputedClass> cache = new ConcurrentHashMap<>();
+ private final ClassFinder classFinder = new ClassFinder();
public Optional<MethodDescription> disambiguate(StackTraceNode element) {
String desc = element.getMethodDescription();
@@ -80,7 +81,7 @@ public final class MethodDisambiguator {
}
}
- private static ClassReader getClassReader(String className) throws IOException {
+ private ClassReader getClassReader(String className) throws IOException {
String resource = className.replace('.', '/') + ".class";
try (InputStream is = ClassLoader.getSystemResourceAsStream(resource)) {
@@ -89,15 +90,13 @@ public final class MethodDisambiguator {
}
}
- try {
- Class<?> clazz = Class.forName(className);
+ Class<?> clazz = this.classFinder.findClass(className);
+ if (clazz != null) {
try (InputStream is = clazz.getClassLoader().getResourceAsStream(resource)) {
if (is != null) {
return new ClassReader(is);
}
}
- } catch (ClassNotFoundException e) {
- // ignore
}
throw new IOException("Unable to get resource: " + className);