aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-06-15 20:06:17 +0100
committerLuck <git@lucko.me>2021-06-15 20:06:17 +0100
commit70cf71602de11ff3e2fa8890d95c9f6fba811b9e (patch)
tree9ee7d5d927c9376337e48dabe79e57c7eaf9434e /spark-common/src/main/java/me
parenta9a639c6dd13e33e34082c69666147619c037474 (diff)
downloadspark-70cf71602de11ff3e2fa8890d95c9f6fba811b9e.tar.gz
spark-70cf71602de11ff3e2fa8890d95c9f6fba811b9e.tar.bz2
spark-70cf71602de11ff3e2fa8890d95c9f6fba811b9e.zip
Update ASM for full Java 16 support
Diffstat (limited to 'spark-common/src/main/java/me')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java9
1 files changed, 4 insertions, 5 deletions
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);