Skip to content

refactor(engine): give AtomicNodeTooLargeException its own message factory#359

Merged
DemchaAV merged 1 commit into
2.0-devfrom
refactor/atomic-too-large-factory
Jul 11, 2026
Merged

refactor(engine): give AtomicNodeTooLargeException its own message factory#359
DemchaAV merged 1 commit into
2.0-devfrom
refactor/atomic-too-large-factory

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

The "node too large for a full page" diagnostic was assembled by a private
LayoutCompiler.atomicTooLarge(path, outerHeight, pageHeight) helper. The message
belongs with the exception that carries it, and keeping it on LayoutCompiler blocks any
collaborator extracted out of the compiler from throwing the same exception (it can't reach
a private helper) — the first step of continuing the LayoutCompiler breakdown.

What

  • Added a static AtomicNodeTooLargeException.forNode(path, outerHeight, pageHeight) factory
    that builds the diagnostic (measurements only, no user document content).
  • The three throw sites in LayoutCompiler (compileSplittableLeaf ×2, admitAtomicBlock)
    now call AtomicNodeTooLargeException.forNode(...); the private atomicTooLarge helper is
    removed.

Tests

  • ./mvnw -f aggregator/pom.xml verify -pl :graph-compose-qa -am — full compile + javadoc
    gate + the qa visual/parity byte-identity suite (643): green. The exception type and message
    are unchanged, so the too-large regression tests (PageCapacityToleranceDemoTest,
    PaginationEdgeCaseTest) pass as before.

Byte-identical — same exception, same message string. The forNode factory is a new public
method on an already-public exception (an addition, not a break; japicmp is report-only for 2.0).

…ctory

The too-large diagnostic was built by a private LayoutCompiler.atomicTooLarge
helper. Move the message construction onto a static
AtomicNodeTooLargeException.forNode(path, outerHeight, pageHeight) factory so
the exception owns its own message, and have the three throw sites call it
directly. Byte-identical message; this also lets a future extracted collaborator
throw the same exception without reaching into LayoutCompiler.
@DemchaAV DemchaAV force-pushed the refactor/atomic-too-large-factory branch from 893583c to ab962b3 Compare July 11, 2026 00:54
@DemchaAV DemchaAV merged commit 0de20aa into 2.0-dev Jul 11, 2026
12 checks passed
@DemchaAV DemchaAV deleted the refactor/atomic-too-large-factory branch July 11, 2026 01:00
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