Skip to content

z_ui2_json2: replace 70-line skip_node workaround with WA2 (envelope … - #22

Open
alexey-arseniev wants to merge 5 commits into
mainfrom
fix/skip-node-wa2
Open

z_ui2_json2: replace 70-line skip_node workaround with WA2 (envelope …#22
alexey-arseniev wants to merge 5 commits into
mainfrom
fix/skip-node-wa2

Conversation

@alexey-arseniev

Copy link
Copy Markdown
Contributor

Wrap the writer in a temporary envelope object, call skip_node, then strip the {"name": prefix and trailing } via string arithmetic (off = strlen(name) + 4, len - 1).

  • locals_imp: read_json_to_string reduced from 70 lines to 15 using WA2
  • testclasses: add SKIP_NODE_NAMED_MEMBER test (WA2 + direct unnamed root)
  • faq.md: line-ending normalization (no content change)

skip_node( writer ) fails when the reader is positioned on a named node.
Workaround: wrap in a temporary envelope object, call skip_node, then
strip the {"name": prefix and trailing } via string arithmetic.

Replaces the previous 70-line manual tree-walker with 15 lines.
Adds unit test SKIP_NODE_NAMED_MEMBER covering named and unnamed nodes.
… null

Zero-value DECFLOAT16/DECFLOAT34 fields were falling through to the
final ELSE branch (serialize as string), which emitted null for initial
values. Add explicit WHEN branches matching typekind_decfloat16 and
typekind_decfloat34 — zero → '0', non-zero → CONDENSE'd string value.
Mirrors the existing FLOAT handling pattern. Adds unit test.
cl_abap_typedescr=>typekind_decfloat16/34 are not available on 7.31
(introduced in 7.40). Replace with local e_typekind-decfloat16/34
constants ('a'/'e') following the same pattern as utclong, int8, enum.
z_ui2_json2 targets 7.57+ so it can keep the class constants directly.
Expand feature 1.2 with an implementation evaluation targeting the next
patch level across all three classes (Z_UI2_JSON, /UI2/CL_JSON,
Z_UI2_JSON2): API shape, hook points in each parser, reuse of existing
skip/consume primitives, and performance analysis for both flag-unused
(hot path stays neutral) and flag-used cases. v1 scoped to object-member
traversal only. Records the performance-neutrality design rule.
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