Skip to content

Spike/stax serialisation - #647

Draft
davidalk wants to merge 15 commits into
finos:mainfrom
REGnosys:spike/stax-step0
Draft

davidalk wants to merge 15 commits into
finos:mainfrom
REGnosys:spike/stax-step0

Conversation

@davidalk

@davidalk davidalk commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
diagram

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 24, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: davidalk / name: David Al-Kanani (7d2cddc)

- Step 0: throwaway StAX boundary-proof spike test
- Step 1: introspection layer (RuneTypeIntrospector, TypeBinding, AttributeBinding)
- Step 2: scalar converter (StaxScalarConverter)
- Pin Woodstox as a direct dependency
davidalk added 5 commits June 24, 2026 21:45
StaxWriter covers all Section 1 serialization requirements:
- ELEMENT/ATTRIBUTE/VALUE representations with 2-space pretty-print
- Substitution group resolution (current + legacy V1/V2 config formats)
- VIRTUAL/unwrapped attribute support via writeChildAttributes helper
- Namespace-aware root attribute handling (xmlns, xsi:schemaLocation)
- Multi-cardinality lists written as repeated elements with no wrapper

11 new tests across StaxWriterTest, StaxWriterSubstitutionTest, and
StaxWriterVirtualTest; all pass alongside the existing suite (262 pass,
0 failures).
Add SubstitutionResolver as the read-side counterpart to the Jackson-era
RosettaXMLAnnotationIntrospector#findSubstitutionMap/SubstitutedMethodProperty,
built directly off RosettaXMLConfiguration. StaxReader routes elementRef
attributes through it to resolve substituted/polymorphic concrete types by
namespace-qualified match first, local-name fallback second.
@davidalk davidalk changed the title Spike/stax step0 Spike/stax serialisation Jul 1, 2026
davidalk added 9 commits July 2, 2026 00:15
Brings the branch up to main (5dbdb6f), 15 commits since the last merge.
Three conflicts, plus one non-conflicting compile break introduced by a new
file on main:

- pom.xml: kept main's jackson 2.18.8 alongside the branch's woodstox/stax2
  version properties (adjacent lines, no semantic clash).
- RosettaObjectMapperCreator: main's new platformIndependentPrettyPrinter
  (finos#675, Windows LF pinning) imported XmlMapper/DefaultXmlPrettyPrinter from
  jackson-dataformat-xml, which Step 6 removed from this module. Dropped the
  XmlMapper branch of that method — it was unreachable anyway, since forXML(...)
  returns a prebuilt StaxXmlObjectMapper and create() returns before reaching
  it, and StaxWriter already emits "\n" unconditionally. CSV/JSON branches kept.
- ClasspathTransformMapperFactoryTest: main renamed and rewrote
  TransformObjectMapperFactoryTest, colliding with the branch's two
  assertInstanceOf updates. Took main's shape with XmlMapper -> StaxXmlObjectMapper.
- TransformSerializationResolverTest: new on main, merged without conflict but
  asserted XmlMapper. Same swap.

XMLContentModelMatcher auto-merged cleanly: main's zero-width optional-content
fix (finos#659) lands in the shared matcher, so both ContentModelRouter (StAX) and
the surviving matcher tests pick it up with no routing regressions.

Also re-enables testBaseNamespaceSubstitutionDeserialisationWithTokenBufferParser,
added @disabled on main as a reproduction of finos#662 (substitution
group namespace lost inside a VIRTUAL wrapper). It passes on the StAX binder:
there is no TokenBuffer to discard the namespace, so the base Llama resolves by
exact namespace match regardless of nesting. This is the first independently
written, real-world-derived test validating the migration.

mvn clean install green: common 365 tests / 0 failures / 3 skipped,
serialization 65 / 0 / 1. Checkstyle clean. DSL 10.0.1 -> 10.3.0 and
jackson 2.17.1 -> 2.18.8 needed no binder changes.
… progress report

The issue-7 fixture (repeated unwrapped group nestedContainerSequence1, 1..*,
no wrapper element) was left @disabled by Step 4d on the grounds that fixing
the Jackson engine was out of scope. That reasoning went stale at Step 5: once
forXML(...) was repointed at the StAX binder, this test began exercising the
new engine, which Step 4d fixed on both the read and write side. Verified
passing, so the annotation and the now-unused Disabled import are removed.

XmlSerialisationTest is now 29 tests with 0 skipped; common is 365 / 0
failures / 2 skipped (both remaining ones in RosettaSerialisationTest, XML
unrelated). Checkstyle: 0 violations.

Adds a "Post-Section-1 — merge from main" section to the progress report
covering the four required edits (two of which git did not flag as conflicts),
why the XmlMapper pretty-printer branch was dropped rather than adapted, how
main's XMLContentModelMatcher fix reached the StAX engine for free via the
Step 4c reuse boundary, and finos#662 closing itself as the first externally
authored validation of the migration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant