sm support classloader hash. #767

pull/808/head
zhangjin 6 years ago committed by hengyunabc
parent a2d27f91d4
commit d630ba9a6f

@ -99,7 +99,7 @@ public class SearchMethodCommand extends AnnotatedCommand {
}
if (isDetail) {
process.write(RenderUtil.render(renderConstructor(constructor), process.width()) + "\n");
process.write(RenderUtil.render(renderConstructor(constructor, clazz), process.width()) + "\n");
} else {
String line = format("%s %s%n", clazz.getName(), methodNameWithDescriptor);
process.write(line);
@ -114,7 +114,7 @@ public class SearchMethodCommand extends AnnotatedCommand {
}
if (isDetail) {
process.write(RenderUtil.render(renderMethod(method), process.width()) + "\n");
process.write(RenderUtil.render(renderMethod(method, clazz), process.width()) + "\n");
} else {
String line = format("%s %s%n", clazz.getName(), methodNameWithDescriptor);
process.write(line);
@ -135,7 +135,7 @@ public class SearchMethodCommand extends AnnotatedCommand {
return isRegEx ? new RegexMatcher(methodPattern) : new WildcardMatcher(methodPattern);
}
private Element renderMethod(Method method) {
private Element renderMethod(Method method, Class<?> clazz) {
TableElement table = new TableElement().leftCellPadding(1).rightCellPadding(1);
table.row(label("declaring-class").style(bold.bold()), label(method.getDeclaringClass().getName()))
@ -144,11 +144,12 @@ public class SearchMethodCommand extends AnnotatedCommand {
.row(label("annotation").style(bold.bold()), label(TypeRenderUtils.drawAnnotation(method)))
.row(label("parameters").style(bold.bold()), label(TypeRenderUtils.drawParameters(method)))
.row(label("return").style(bold.bold()), label(TypeRenderUtils.drawReturn(method)))
.row(label("exceptions").style(bold.bold()), label(TypeRenderUtils.drawExceptions(method)));
.row(label("exceptions").style(bold.bold()), label(TypeRenderUtils.drawExceptions(method)))
.row(label("classLoaderHash").style(bold.bold()), label(StringUtils.classLoaderHash(clazz)));
return table;
}
private Element renderConstructor(Constructor<?> constructor) {
private Element renderConstructor(Constructor<?> constructor, Class<?> clazz) {
TableElement table = new TableElement().leftCellPadding(1).rightCellPadding(1);
table.row(label("declaring-class").style(bold.bold()), label(constructor.getDeclaringClass().getName()))
@ -156,7 +157,8 @@ public class SearchMethodCommand extends AnnotatedCommand {
.row(label("modifier").style(bold.bold()), label(StringUtils.modifier(constructor.getModifiers(), ',')))
.row(label("annotation").style(bold.bold()), label(TypeRenderUtils.drawAnnotation(constructor.getDeclaredAnnotations())))
.row(label("parameters").style(bold.bold()), label(TypeRenderUtils.drawParameters(constructor)))
.row(label("exceptions").style(bold.bold()), label(TypeRenderUtils.drawExceptions(constructor)));
.row(label("exceptions").style(bold.bold()), label(TypeRenderUtils.drawExceptions(constructor)))
.row(label("classLoaderHash").style(bold.bold()), label(StringUtils.classLoaderHash(clazz)));
return table;
}

Loading…
Cancel
Save