Skip to content

Commit

Permalink
fix sc command render fields problem. close alibaba#956
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc committed Dec 3, 2019
1 parent cc078bf commit 3892fb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static Element renderClassInfo(Class<?> clazz, boolean isPrintField, Inte
.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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ public static Element drawClassLoader(Class<?> clazz) {
}

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) {
Expand Down

0 comments on commit 3892fb1

Please sign in to comment.