Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,6 @@
"@type":"java.lang.Long",
"value":"9223372036854775807"
},
"inheritedStatic":{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Is this how it works in the actual script too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be. 🙂
The "actual script" comments might be confusing for some people. I'll think about how to resolve this and will try to add some more info in a follow-up PR.

"@type":"java.lang.Integer",
"value":10
},
"interfaceContainerFirst":{
"@type":"MyInterfaceContainerA",
"field":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static String classNameFromFile(File file) {

public static StaticFieldMap<Object> staticFieldMap(Class<?> clazz) {
StaticFieldMap<Object> staticFields = new StaticFieldMap<>();
for (Field field : getAllStaticFields(clazz)) {
for (Field field : getDeclaredStaticFields(clazz)) {
field.setAccessible(true);
try {
if (!field.getName().equals("$assertionsDisabled")) {
Expand All @@ -88,20 +88,13 @@ public static StaticFieldMap<Object> staticFieldMap(Class<?> clazz) {
return staticFields;
}

public static List<Field> getAllStaticFields(Class<?> clazz) {
public static List<Field> getDeclaredStaticFields(Class<?> clazz) {
List<Field> fields = new ArrayList<>();
if (clazz == null) {
return fields;
}
for (Field field : clazz.getDeclaredFields()) {
if ((field.getModifiers() & Modifier.STATIC) == Modifier.STATIC) {
fields.add(field);
}
}
fields.addAll(getAllStaticFields(clazz.getSuperclass()));
for (Class<?> interfaze : clazz.getInterfaces()) {
fields.addAll(getAllStaticFields(interfaze));
}
return fields;
}
}