Skip to content

Problems with jackson and java's strong encapsulation #213

Answered by cowtowncoder
jpdbd asked this question in Q&A
Discussion options

You must be logged in to vote

@jpdbd it's just that Jackson never explicitly forces this access, so it definitely sounds more like it was due to Bean introspection. Either way, it'd be great to have a reproduction and see what exactly is going on. There's a good chance this could be handled in better way by Jackson, but likely requires targeted changes -- there's no general solution.

Except... there are 2 settings you could try changing:

  • MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS, if disabled, will not try to force access so this particular failure wouldn't show. But it is quite possible other things could not work (where access forcing is needed)
  • MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS, if disabled, will pre…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@cowtowncoder
Comment options

@jpdbd
Comment options

@cowtowncoder
Comment options

Answer selected by jpdbd
@jpdbd
Comment options

@cowtowncoder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants