by default JavaMembers does cl.getFields() this will give all the public fields that that class has throughout its full hierarchy including the once from the interfaces, But if we go into private or protected we call getDeclaredFields() which are just the fields of that class and we walk over the super classes
there is even a comment in that code:
// walk up superclass chain and grab fields. No need to deal specially with
// interfaces, since they can't have fields
but that is really not correct, interfaces can have fields but only static constant fields,
So if we switch for some reason to use private or protected then suddenly it will not find any of our static constant fields of our classes (those are mostly in interfaces)
I created a patch in our fork:
Servoy@1dd717f
by default JavaMembers does cl.getFields() this will give all the public fields that that class has throughout its full hierarchy including the once from the interfaces, But if we go into private or protected we call getDeclaredFields() which are just the fields of that class and we walk over the super classes
there is even a comment in that code:
// walk up superclass chain and grab fields. No need to deal specially with
// interfaces, since they can't have fields
but that is really not correct, interfaces can have fields but only static constant fields,
So if we switch for some reason to use private or protected then suddenly it will not find any of our static constant fields of our classes (those are mostly in interfaces)
I created a patch in our fork:
Servoy@1dd717f