Ignore non public members for base java classes#177
Ignore non public members for base java classes#177EugenCepoi merged 3 commits intoowlike:masterfrom
Conversation
…ifiers set on the visibility filter
| } | ||
| } | ||
|
|
||
| return isVisible(member.getModifiers()); |
There was a problem hiding this comment.
You forgot to include what I mentioned in the other PR, you want to leverage the same filter as isVisible. Otherwise this will include all fields/methods that are public. Some might be static, transient, etc, these shouldn't be included.
There was a problem hiding this comment.
This code is slightly different from the other PR. The main difference being the ! in front of Modifiers.isPublic. In this PR, any non-public field in a base class is excluded. Otherwise, we perform the additional call to isVisible (line 81)
The previous PR was automatically including all public fields in base classes without considering the additional filters. I can see how this might not be the clearest code however. I will modify the PR to be a bit more clear
There was a problem hiding this comment.
Oops my bad! Thanks for the explanation.
|
I added a second commit which should hopefully make everything a little more clear |
This change causes genson to ignore non-public members for classes in java/javax packages. Public members are still checked for other modifiers specified by the filter. This should fix the reflection issues specified in #173
An alternative fix is provided in #178