fix redefine may throw NullPointerException problem. close #1215

pull/1413/head
hengyunabc 5 years ago
parent 6ec3bdb3e3
commit 51842f7ff1

@ -113,7 +113,8 @@ public class RedefineCommand extends AnnotatedCommand {
List<ClassDefinition> definitions = new ArrayList<ClassDefinition>();
for (Class<?> clazz : inst.getAllLoadedClasses()) {
if (bytesMap.containsKey(clazz.getName())) {
if (hashCode != null && !Integer.toHexString(clazz.getClassLoader().hashCode()).equals(hashCode)) {
ClassLoader classLoader = clazz.getClassLoader();
if (classLoader != null && hashCode != null && !Integer.toHexString(classLoader.hashCode()).equals(hashCode)) {
continue;
}
definitions.add(new ClassDefinition(clazz, bytesMap.get(clazz.getName())));

Loading…
Cancel
Save