Small but significant proposed change to detection of `getxxx()` (vs `getXxx()`), Bean naming convention

13 views
Skip to first unread message

Tatu Saloranta

unread,
May 19, 2020, 7:29:55 PM5/19/20
to jackson-user, jacks...@googlegroups.com
So, a bug was reported as:

https://github.com/FasterXML/jackson-databind/issues/2729

which is related to problems in Jackson scala module 2.10 handling
auto-detection, and uncovering what seems like a small but significant
deviation from Bean Naming: Jackson not requiring that the first
character following "get" and "set" prefix is upper-case, to
auto-detect getter/setter.

So: Jackson will detect accessors like

public int getxxx() { ... }
public void set_value(int x) { .... }

which are probably not compatible with Bean Naming as originally defined.

My first thought was that this is more a feature than bug, since I
suspect there are users expecting this behavior.
As such, a change should be by adding a new `MapperFeature` to allow
opt-in, defaulting to using old logic for 2.x (but change in 3.0)

But then I remembered that there is already
`MapperFeature.USE_STD_BEAN_NAMING` that could be used here too.

WDYT? I seem to be oscillating between two states here, and wanted to
hear how others feel about proposed change.

-+ Tatu +-
Reply all
Reply to author
Forward
0 new messages