Skip to content

Commit e5f5ecf

Browse files
committed
Add option to debug what is added to reflection
1 parent 8706055 commit e5f5ecf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

backends/backend-shared/src/main/java/com/github/xpenatan/gdx/teavm/backends/shared/config/plugin/TeaReflectionSupplier.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
public class TeaReflectionSupplier implements ReflectionSupplier {
1818

19+
public static boolean printDebugLogs = false;
20+
1921
private static ArrayList<String> clazzList = new ArrayList();
2022

2123
public static void addReflectionClass(Class<?> type) {
@@ -81,6 +83,9 @@ public Collection<String> getAccessibleFields(ReflectionContext context, String
8183
}
8284
}
8385
}
86+
if(printDebugLogs) {
87+
System.out.println("getAccessibleFields: " + className + " = " + fields);
88+
}
8489
return fields;
8590
}
8691

@@ -98,12 +103,19 @@ public Collection<MethodDescriptor> getAccessibleMethods(ReflectionContext conte
98103
methods.add(descriptor);
99104
}
100105
}
106+
if(printDebugLogs) {
107+
System.out.println("getAccessibleMethods: " + className + " = " + methods);
108+
}
101109
return methods;
102110
}
103111

104112
@Override
105113
public boolean isClassFoundByName(ReflectionContext context, String name) {
106-
return canHaveReflection(name);
114+
boolean b = canHaveReflection(name);
115+
if(printDebugLogs) {
116+
System.out.println("isClassFoundByName: " + name + " = " + b);
117+
}
118+
return b;
107119
}
108120

109121
private boolean canHaveReflection(String className) {

0 commit comments

Comments
 (0)