You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add missing rationale to JSTEP-2 default changes #107
(My Codex-generated content for my personal use-only :))) )
Proposed rationale text for JSTEP-2 default changes (re: #107)
This is a ready-to-apply editorial spec. Every rationale below is traced to the maintainers' own words in the linked source (issue / PR / source file). It is structured so the edits can be delegated mechanically.
Target: the JSTEP-2 wiki page. ⚠️ JSTEP-2 is a GitHub wiki page (jackson-future-ideas.wiki.git), not a normal repo file — it does not accept pull requests. Application path is either (a) a collaborator edits the wiki directly with the text below, or (b) a maintainer applies it from this comment. Do not open a PR against the wiki.
Confidence legend
Tag
Meaning
Executor action
✅ CONFIRMED
Grounded in maintainer's own words / verified from source
Apply the rationale text as-is
🔧 CORRECTION
Doc is factually wrong, verified against source code
Replace the existing line
⚠️VERIFY-FIRST
Direction/why is right, but one stated detail needs a source check before final wording
Confirm the noted point, then apply
⛔ BLOCKED
No source located
Do not author a rationale yet
Ground rules for whoever applies these
No fabrication. Every rationale must trace to the linked source. If a claim isn't in the source, drop it — do not embellish.
Use exact names, including post-rename ones: EnumFeature.READ_ENUMS_USING_TO_STRING / WRITE_ENUMS_USING_TO_STRING, DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS / WRITE_DURATIONS_AS_TIMESTAMPS.
Do not invent restore/migration APIs. The only restore mechanisms documented and verified are: per-feature enable/disable/configure(...), JsonMapper.builderWithJackson2Defaults() (already in the doc's "Using Jackson 2.x defaults" section), and MapperBuilder.configureForJackson2() (named in #5065). Do not reference any other named preset.
Scope of this issue = rationale, not migration. Keep additions to why the default changed. The doc already has a restore section.
Insert each rationale as a sub-bullet under the existing feature line, matching the doc's current bullet style.
1. Factual correction (source-verified) — must fix
Current doc:* `USE_FAST_DOUBLE_WRITER`: enabled by default in 3.0 (see core#1231)
This is wrong. Verified from source: jackson-core 3.xtools/jackson/core/StreamWriteFeature.java declares USE_FAST_DOUBLE_WRITER(false) → disabled by default in 3.0. In 2.x it was also disabled, so this is not a changed default at all.
Source:core#1231: "Due to findings on lack of improvements for writing (equivalent or better code in JDK 21) … default for StreamWriteFeature.USE_FAST_DOUBLE_WRITER will NOT be changed — it remains disabled. Users on JDK 17 can then enable it."
Replace line with:
USE_FAST_DOUBLE_WRITER: default UNCHANGED — remains disabled in 3.0. The writer-side flip was considered and rejected: on JDK 19+ the JVM's own Double.toString() already uses an equivalent-or-better Schubfach implementation, so enabling it by default gives no benefit; it stays opt-in for JDK 17 users (see core#1231).
Rationale: the 1,000 limit sat above the depth at which adversarial/fuzzing input triggers a raw JVM StackOverflowError, so the guard failed at the one case it exists to catch. No user reported 1,000 as too restrictive, so lowering it has no known compatibility cost. 500 stays far above any real document while staying below the native-stack-overflow zone (the issue notes anything above ~100 would likely suffice; 500 chosen conservatively).
Rationale: these faster FP/number parsers shipped opt-in in 2.14 specifically to de-risk them. After 1+ year in production with no reported correctness issues they are considered proven rather than experimental, so 3.0 (a major boundary where default flips are acceptable) enables them for faster number parsing out of the box, accepting only a small residual edge-case risk.
✅ TokenStreamFactory.Feature → INTERN_PROPERTY_NAMES (on → off) — core#378
Rationale: in 2.x, property names were String.intern()ed so databind could match them via fast == identity checks. That burdens the JVM interned-string pool for high-cardinality name sets, and is pure cost for streaming-only use (no databinding). 3.0's FieldNameMatcher / nextFieldName(...) path removes the old byte→String→property dual lookup without interning, after which databind is typically 10–20% faster anyway — so interning was disabled as a now-redundant optimization, in exchange for more predictable memory behavior at scale.
ℹ️ Trivial fix while here: line ~72 has an unclosed parenthesis — (see [core#378](…) is missing its closing ).
Rationale: with the 2.x true default, a property not annotated with @JsonView is still emitted while a view is active, so @JsonView behaved as an opt-out marker — the opposite of the allow-list model most users intend, and the opposite of Spring's long-standing false default. false makes @JsonView an explicit allow-list. Trade-off: the view-processing pathway can no longer be skipped when no view is active — a maintainer-measured ~2% serialization overhead, judged negligible.
Rationale: setAccessible(true) used to skip a per-call JVM access check, so this force-overrode accessibility even on already-public members as a micro-optimization. With member access moving to MethodHandles that yields no measurable benefit, while still adding reflective surface that can trip JPMS illegal-access / SecurityManager restrictions.
Status note: keep under "potential" — per #5074 the prerequisite #5046"got reverted -- this task only makes sense if and when that change gets re-merged", and it was queued "for possible change in 3.1". Not shipped in 3.0.0.
Rationale: producers and consumers of JSON evolve independently; a strict default turns routine, backward-compatible schema growth (a server adds a field) into runtime failures — a violation of the robustness principle for a data-binding library, and out of step with peers (e.g. JAXB) that default to lenient / "open content". false adopts that model; teams wanting strict validation opt in (FAIL_ON_UNKNOWN_PROPERTIES or @JsonIgnoreProperties(ignoreUnknown=false)). A DoS concern was evaluated and dismissed — unknown values are skipped, not materialized.
✅ READ_ENUMS_USING_TO_STRING → EnumFeature.READ_ENUMS_USING_TO_STRING (false → true) — databind#4566 *(this is the exact gap raised in [#4566 comment](github.com/FasterXML/jackson-databind/pull/4566#…
Rationale: 2.x mapped enums via Enum.name(), which is final and cannot be overridden — so any custom JSON form (kebab-case, display label, legacy value) forced @JsonValue, a custom serializer, or per-constant @JsonProperty. Enum.toString() defaults to name()but is overridable, so defaulting to it gives every enum a natural, annotation-free hook for its wire format. Requested by multiple users (see maintainer comment on #4566). For "vanilla" enums where toString() == name() the change is invisible.
Breaking note: any enum that overrides toString() to something ≠ name() silently changes its JSON representation on 2.x→3.0.
Rationale: with the 2.x false default, readValue() silently stops after the first well-formed value and ignores any remaining input — even malformed garbage or an accidentally concatenated second document. true fails fast on unexpected trailing content instead of silently truncating; enabling it during 3.0 development surfaced a real, otherwise-invisible Protobuf-backend regression. Trade-off: intentional partial/streaming reads must opt out (maintainer considered restricting the check to readValue() calls whose input source is not a JsonParser).
Rationale: flipped to true to stay symmetric with its READ_ENUMS_USING_TO_STRING counterpart — same underlying reason (toString() is overridable where name() is not). See the READ rationale above.
Rationale: in 2.x, serializing a POJO with no visible properties threw InvalidDefinitionException instead of producing the one unambiguous representation, {} — surprising users and causing hard-to-diagnose downstream failures (e.g. under Spring MVC the failed conversion silently fell through to the next HttpMessageConverter). An empty bean is a valid, unambiguous shape, not an exceptional condition (cf. Effective Java Item 69), so false emits {}; re-enable for the old fail-fast safety net.
✅ FAIL_ON_ORDER_MAP_BY_INCOMPARABLE_KEY (true → false) — databind#4781 / #4773(direction verified from SerializationFeature.java: 2.19 Javadoc "will default false in Jackson 3 and later"; 3.x "disabled by default")
Rationale: enabling ORDER_MAP_ENTRIES_BY_KEYS sorts entries via a TreeMap, which throws ClassCastException when a key type is not Comparable (#4773). The feature (added in 2.19) defaulted to true to preserve that throw-on-incomparable-key behavior. 3.0 flips to false: a caller who turned on key ordering almost always wants best-effort deterministic output, not a hard crash from one incomparable key — so per the feature's own contract Jackson "will not throw … instead simply return the original map" (falls back to original iteration order). Trade-off: loses a diagnostic signal for incomparable keys.
Rationale: numeric timestamps were the 2.x default for efficiency, but that optimized for the wrong thing — per the issues, "most users expect Strings, and most frameworks seem to change the default."false serializes dates/durations as ISO-8601 Strings by default, aligning with ecosystem convention. Trade-off: larger, marginally slower-to-process payloads than compact numeric form.
Rationale: this controls the numeric interpretation of java.time.Month. 2.x defaulted to zero-based (0 = January) for backwards-compat, which disagrees with ISO-8601, Month.getValue(), and normal calendar convention; 3.0 defaults to true (1 = January). Note: this affects numeric representations only — Jackson's default enum serialization is by name(), so an unconfigured mapper emits "JANUARY" (not a number) in both versions. MapperBuilder.configureForJackson2() was updated to set this back to false for 2.x-compat callers.
(The MonthSerializer/MonthDeserializer section already carries an adequate description; optionally cross-link it to ONE_BASED_MONTHS above.)
✅ DECODE_/ENCODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODING (false → true) — CBOR#582, landed via CBOR#591
Rationale: CBOR encodes negative bignums with tag 3 (RFC 8949 §3.4.3), whose byte-string content n denotes the value -1 − n. Jackson's legacy encoding omitted the -1 offset, so negative bignums were off-by-one relative to any spec-compliant CBOR implementation. Enabling standard encoding by default (read + write) makes 3.0 interoperable with RFC 8949 toolchains.
Rationale (verify exact 2.x token mapping against CBORParser before finalizing): CBOR "undefined" (simple value 23) was surfaced as a JSON null in 2.x, indistinguishable from a real CBOR null. true surfaces it as a distinct embedded object, preserving the wire-level distinction.
Rationale (verify exact 2.x token mapping against CBORParser before finalizing): generic CBOR simple values (major type 7, other than false/true/null/undefined) were surfaced as an integer token in 2.x — not null. true surfaces them as a distinct simple-value object so they are recognizable as simple values rather than ordinary integers.
✅ XmlWriteFeature group (all false → true) — verified from XmlWriteFeature.java Javadoc + XML#725
Shared rationale: 2.x XML write defaults produced naive, JAXB-agnostic output that XML-Schema-conforming tooling (JAXB, XSD validators) could not correctly interpret. 3.0 flips these to true so default output is standards-conforming:
WRITE_NULLS_AS_XSI_NIL → marks nulls with the standard xsi:nil attribute instead of an ambiguous bare empty element.
AUTO_DETECT_XSI_TYPE → emits xsi:type for polymorphic type identifiers (otherwise hard to express via XML namespaces).
UNWRAP_ROOT_OBJECT_NODE → a single-entry ObjectNode uses that entry's key as the root element name instead of a generic wrapper.
3. Blocked / out of scope — do NOT write rationale yet
Item
Doc location
Why blocked
⛔ UTC rendering +00 → Z
"Changes to Date/Time defaults" (line ~172)
No source issue cited in the doc and none located. Find the originating issue/PR (likely in the java-time→databind merge, around [#5066](github.com/FasterXML/jackson-databind/…/[#… before authoring a rationale.
Separate module, still proposed. Author from kotlin#870 only if #107's scope includes the Kotlin module.
4. Already adequate — no change needed
ALLOW_FINAL_FIELDS_AS_MUTATORS, USE_GETTERS_AS_SETTERS, SORT_PROPERTIES_ALPHABETICALLY, FAIL_ON_NULL_FOR_PRIMITIVES, and the DecimalNode trailing-zeros note already carry sufficient rationale in the doc.
Checklist for the executor
Apply the 1 correction in §1 (USE_FAST_DOUBLE_WRITER, source-verified).
Add the ✅ rationale sub-bullets in §2 verbatim.
For the 2 ⚠️ CBOR items, confirm the 2.x token mapping against CBORParser, then apply.
Fix the unclosed paren on the INTERN_PROPERTY_NAMES line.
Leave §3 items untouched (or open follow-ups to source them).
Activity
JooHyukKim commentedon Aug 8, 2026
(My Codex-generated content for my personal use-only :))) )
Proposed rationale text for JSTEP-2 default changes (re: #107)
This is a ready-to-apply editorial spec. Every rationale below is traced to the maintainers' own words in the linked source (issue / PR / source file). It is structured so the edits can be delegated mechanically.
Target: the JSTEP-2 wiki page.⚠️ JSTEP-2 is a GitHub wiki page (
jackson-future-ideas.wiki.git), not a normal repo file — it does not accept pull requests. Application path is either (a) a collaborator edits the wiki directly with the text below, or (b) a maintainer applies it from this comment. Do not open a PR against the wiki.Confidence legend
Ground rules for whoever applies these
EnumFeature.READ_ENUMS_USING_TO_STRING/WRITE_ENUMS_USING_TO_STRING,DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS/WRITE_DURATIONS_AS_TIMESTAMPS.enable/disable/configure(...),JsonMapper.builderWithJackson2Defaults()(already in the doc's "Using Jackson 2.x defaults" section), andMapperBuilder.configureForJackson2()(named in #5065). Do not reference any other named preset.1. Factual correction (source-verified) — must fix
🔧
StreamWriteFeature→USE_FAST_DOUBLE_WRITER(line ~68)* `USE_FAST_DOUBLE_WRITER`: enabled by default in 3.0 (see core#1231)3.xtools/jackson/core/StreamWriteFeature.javadeclaresUSE_FAST_DOUBLE_WRITER(false)→ disabled by default in 3.0. In 2.x it was also disabled, so this is not a changed default at all.StreamWriteFeature.USE_FAST_DOUBLE_WRITERwill NOT be changed — it remainsdisabled. Users on JDK 17 can then enable it."2. Missing / weak rationale — add the text below
jackson-core✅
StreamReadConstraints/StreamWriteConstraints→DEFAULT_MAX_DEPTH(1000 → 500) — core#1233✅
StreamReadFeature→USE_FAST_DOUBLE_PARSER,USE_FAST_BIG_NUMBER_PARSER(off → on) — core#1231✅
TokenStreamFactory.Feature→INTERN_PROPERTY_NAMES(on → off) — core#378jackson-databind—MapperFeature✅
DEFAULT_VIEW_INCLUSION(true → false) — databind#1484✅
OVERRIDE_PUBLIC_ACCESS_MODIFIERS(already under "Changes, potential" — enrich rationale + keep placement) — databind#5074jackson-databind—DeserializationFeature✅
FAIL_ON_UNKNOWN_PROPERTIES(true → false) — databind#493✅
READ_ENUMS_USING_TO_STRING→EnumFeature.READ_ENUMS_USING_TO_STRING(false → true) — databind#4566 *(this is the exact gap raised in [#4566 comment](github.com/FasterXML/jackson-databind/pull/4566#…✅
FAIL_ON_TRAILING_TOKENS(false → true) — databind#3406jackson-databind—SerializationFeature✅
WRITE_ENUMS_USING_TO_STRING→EnumFeature.WRITE_ENUMS_USING_TO_STRING(false → true) — databind#4567✅
FAIL_ON_EMPTY_BEANS(true → false) — databind#3070✅
FAIL_ON_ORDER_MAP_BY_INCOMPARABLE_KEY(true → false) — databind#4781 / #4773 (direction verified fromSerializationFeature.java: 2.19 Javadoc "will default false in Jackson 3 and later"; 3.x "disabled by default")✅
WRITE_DATES_AS_TIMESTAMPS/WRITE_DURATIONS_AS_TIMESTAMPS→DateTimeFeature.*(true → false) — databind#4845 / #4846jackson-databind—DateTimeFeature✅
ONE_BASED_MONTHS(false → true) — databind#5065(The
MonthSerializer/MonthDeserializersection already carries an adequate description; optionally cross-link it toONE_BASED_MONTHSabove.)CBOR —
jackson-dataformats-binary✅
DECODE_/ENCODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODING(false → true) — CBOR#582, landed via CBOR#591READ_UNDEFINED_AS_EMBEDDED_OBJECT(false → true) — CBOR#591READ_SIMPLE_VALUE_AS_EMBEDDED_OBJECT(false → true) — CBOR#591XML —
jackson-dataformat-xml✅
XmlWriteFeaturegroup (all false → true) — verified fromXmlWriteFeature.javaJavadoc + XML#7253. Blocked / out of scope — do NOT write rationale yet
+00→Zjava-time→databindmerge, around [#5066](github.com/FasterXML/jackson-databind/…/[#… before authoring a rationale.SingletonSupport,StrictNullChecks)4. Already adequate — no change needed
ALLOW_FINAL_FIELDS_AS_MUTATORS,USE_GETTERS_AS_SETTERS,SORT_PROPERTIES_ALPHABETICALLY,FAIL_ON_NULL_FOR_PRIMITIVES, and theDecimalNodetrailing-zeros note already carry sufficient rationale in the doc.Checklist for the executor
USE_FAST_DOUBLE_WRITER, source-verified).CBORParser, then apply.INTERN_PROPERTY_NAMESline.JooHyukKim commentedon Aug 9, 2026
CLOSED
Fixed via https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-2/_compare/02bcd4a13788c9996e96e9b501e54cebc18fa533...03433c053c67fae54f205a0f5aa1ad30e8ae1405
Leaving commit reference since PR is not supported for Wiki's.
cc. @cowtowncoder @Karl255
cowtowncoder commentedon Aug 9, 2026
Thank you for doing this, @JooHyukKim !