fix sc command render fields problem. close #956

pull/966/head
hengyunabc 5 years ago
parent cc078bf5d6
commit 3892fb12c6

@ -56,7 +56,7 @@ public class ClassUtils {
.row(label("classLoaderHash").style(Decoration.bold.bold()), label(StringUtils.classLoaderHash(clazz)));
if (isPrintField) {
table.row(label("fields"), TypeRenderUtils.drawField(clazz, expand));
table.row(label("fields").style(Decoration.bold.bold()), TypeRenderUtils.drawField(clazz, expand));
}
return table;
}

@ -98,17 +98,17 @@ public class TypeRenderUtils {
}
public static Element drawField(Class<?> clazz, Integer expand) {
TableElement fieldsTable = new TableElement().leftCellPadding(0).rightCellPadding(0);
TableElement fieldsTable = new TableElement(1).leftCellPadding(0).rightCellPadding(0);
Field[] fields = clazz.getDeclaredFields();
if (fields == null || fields.length == 0) {
return fieldsTable;
}
for (Field field : fields) {
TableElement fieldTable = new TableElement().leftCellPadding(0).rightCellPadding(0);
fieldTable.row("modifier", StringUtils.modifier(field.getModifiers(), ','))
TableElement fieldTable = new TableElement().leftCellPadding(0).rightCellPadding(1);
fieldTable.row("name", field.getName())
.row("type", StringUtils.classname(field.getType()))
.row("name", field.getName());
.row("modifier", StringUtils.modifier(field.getModifiers(), ','));
Annotation[] annotations = field.getAnnotations();
if (annotations != null && annotations.length > 0) {

Loading…
Cancel
Save