Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Hollow Man <hollowman@hollowman.ml>
  • Loading branch information
HollowMan6 committed Aug 18, 2020
1 parent 578ff0a commit 4406d65
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -23,6 +23,7 @@
import com.taobao.arthas.core.command.model.ClassLoaderVO;
import com.taobao.arthas.core.shell.command.AnnotatedCommand;
import com.taobao.arthas.core.shell.command.CommandProcess;
import com.taobao.arthas.core.util.ClassUtils;
import com.taobao.arthas.core.util.ClassLoaderUtils;
import com.taobao.arthas.core.util.StringUtils;
import com.taobao.middleware.cli.annotations.Description;
Expand Down Expand Up @@ -167,6 +168,7 @@ public void loggers(CommandProcess process, String name) {
ClassLoader classLoader = clazz.getClassLoader();

if (hashCode == null && classLoaderClass != null) {
Instrumentation inst = process.session().getInstrumentation();
List<ClassLoader> matchedClassLoaders = ClassLoaderUtils.getClassLoaderByClassName(inst, classLoaderClass);
if (matchedClassLoaders.size() == 1) {
hashCode = Integer.toHexString(matchedClassLoaders.get(0).hashCode());
Expand Down

0 comments on commit 4406d65

Please sign in to comment.