mirror of
https://gitee.com/arthas/arthas.git
synced 2024-11-30 03:07:37 +08:00
fix: inst#getAllLoadedClasses() may cause NullPointerException when search class(IBM jvm 1.7) (#1840)
This commit is contained in:
parent
dca9bc3149
commit
5f31bbff97
@ -31,6 +31,9 @@ public class SearchUtils {
|
||||
}
|
||||
final Set<Class<?>> matches = new HashSet<Class<?>>();
|
||||
for (Class<?> clazz : inst.getAllLoadedClasses()) {
|
||||
if (clazz == null) {
|
||||
continue;
|
||||
}
|
||||
if (classNameMatcher.matching(clazz.getName())) {
|
||||
matches.add(clazz);
|
||||
}
|
||||
@ -107,6 +110,9 @@ public class SearchUtils {
|
||||
public static Set<Class<?>> searchSubClass(Instrumentation inst, Set<Class<?>> classSet) {
|
||||
final Set<Class<?>> matches = new HashSet<Class<?>>();
|
||||
for (Class<?> clazz : inst.getAllLoadedClasses()) {
|
||||
if (clazz == null) {
|
||||
continue;
|
||||
}
|
||||
for (Class<?> superClass : classSet) {
|
||||
if (superClass.isAssignableFrom(clazz)) {
|
||||
matches.add(clazz);
|
||||
|
Loading…
Reference in New Issue
Block a user