You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PropertyFetchingImpl#getPropertyViaFieldAccess first looks for the field with Class#getField where it will not find the field because internally it calls Class#privateGetDeclaredFields(publicOnly: true). This method does however try to handle if the field is on a superclass
// Direct superclass, recursively
if (!isInterface()) {
Class<?> c = getSuperclass();
if (c != null) {
if ((res = c.getField0(name)) != null) {
return res;
}
}
}
The PropertyFetchingImpl then uses Class#getDeclaredField to access private fields via setAccessible. The problem is, although that method does call Class#privateGetDeclaredFields(publicOnly: false), it does not have any handling to look for the field on the superclass.
As such, Spring for GraphQL can resolve fields like so (without any public getters)
public class MyClass {
private final ImmutableList<Id> ids;
}
but not fields like so (without any public getters)
public abstract class MyAbstractClass {
private final ImmutableList<Id> ids;
}
The text was updated successfully, but these errors were encountered:
PropertyFetchingImpl#getPropertyViaFieldAccess
first looks for the field withClass#getField
where it will not find the field because internally it callsClass#privateGetDeclaredFields(publicOnly: true)
. This method does however try to handle if the field is on a superclassThe PropertyFetchingImpl then uses
Class#getDeclaredField
to access private fields via setAccessible. The problem is, although that method does callClass#privateGetDeclaredFields(publicOnly: false)
, it does not have any handling to look for the field on the superclass.As such, Spring for GraphQL can resolve fields like so (without any public getters)
but not fields like so (without any public getters)
The text was updated successfully, but these errors were encountered: