Ignore static fields in wrapper class for AutoWrapper (#2401)

This commit is contained in:
Lukas Alt 2023-05-15 15:16:36 +02:00 committed by GitHub
parent a6903c2bb0
commit 339b2ef923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,6 +151,7 @@ public class AutoWrapper<T> implements EquivalentConverter<T> {
if (wrapperAccessors == null) {
wrapperAccessors = Arrays
.stream(wrapperClass.getDeclaredFields())
.filter(field -> !Modifier.isStatic(field.getModifiers()))
.map(Accessors::getFieldAccessor)
.toArray(FieldAccessor[]::new);
}