FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

Add new `PropertyAccessor` `SCALAR_CONSTRUCTOR`; `JsonAutoDetect.scalarConstructorVisibility` #124

Closed cowtowncoder closed 7 years ago

cowtowncoder commented 7 years ago

One ambiguous visibility case in Jackson 2.x is that of difference between "legacy" single-scalar constructor (mostly for String, but also for int, long, double, boolean) and all other Creators. Currently assumption is made that visibility constraint do not block these cases (to maximize access to many JDK types). However, this seems wrong, and will cause issues with Java 8 parameter names.

So, let's add separate accessor, visibility level. For default value let's choose NON_PRIVATE, to balance security issues (avoid finding private ones) with compatibility.