Skip to content

Commit fca73eb

Browse files
committed
Don't exclude static local classes
1 parent b82c767 commit fca73eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gson/src/main/java/com/google/gson/internal/Excluder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ private boolean excludeClassChecks(Class<?> clazz) {
199199
return true;
200200
}
201201

202-
if (isAnonymousOrLocal(clazz)) {
202+
// Permit static local classes, such as Records (Java 16 feature)
203+
if (!isStatic(clazz) && isAnonymousOrLocal(clazz)) {
203204
return true;
204205
}
205206

0 commit comments

Comments
 (0)