Skip to content

chore(api): InvalidatingNodeRegistry ensureOpen + negative test + NodeRegistry @since note (J2/J3/J4)#121

Merged
DemchaAV merged 1 commit into
developfrom
chore/senior-review-polish-j-track
Jun 1, 2026
Merged

chore(api): InvalidatingNodeRegistry ensureOpen + negative test + NodeRegistry @since note (J2/J3/J4)#121
DemchaAV merged 1 commit into
developfrom
chore/senior-review-polish-j-track

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

Three small carry-over items from the v1.6.7 senior review,
bundled into one PR because they share a topic (the I3 auto-
invalidating registry wrapper) and a CHANGELOG section.

J2 — Symmetric closed-session behaviour

InvalidatingNodeRegistry.register now calls ensureOpen()
before super.register(). Previously the two registration entry
points disagreed on what happens after session.close():

Path Before After
session.registerNodeDefinition(...) IllegalStateException unchanged — IllegalStateException
session.registry().register(...) silently mutates closed session IllegalStateException

ensureOpen() inside the constructor's default-definitions setup
is safe because the closed flag is field-initialised to false
before the constructor body runs.

J3 — Negative test

DocumentSessionTest.registryRegisterOnClosedSessionThrowsIllegalStateException
pins the new contract. Pairs with the existing positive cache-
invalidation test from I3 so the senior-bar "positive + negative"
pattern (cf PR-7.3)
is complete.

J4 — NodeRegistry @since note

Class-level Javadoc on NodeRegistry now explicitly calls out
the v1.6.7 non-final relaxation. The class became non-final in
v1.6.7 (Track I3) so DocumentSession could install the auto-
invalidating subclass; the change was already binary-compatible
(japicmp: semver PATCH). The Javadoc just makes the rationale
discoverable without reading the CHANGELOG.

Test plan

  • DocumentSessionTest now has 26 tests (25 prev + 1 new
    negative).
  • ./mvnw verify -pl . -P japicmp1058 tests, 0 failures.
  • japicmp vs v1.6.7 baseline: semver PATCH (compatible — no
    public signature changes; ensureOpen() is a behavioural
    strengthening on an existing public method).

…eRegistry @SInCE note (J2/J3/J4)

Three small carry-over items from the v1.6.7 senior review,
bundled into one PR because they share a topic (the I3
auto-invalidating registry wrapper) and a CHANGELOG section.

J2 — symmetric closed-session behaviour:
  InvalidatingNodeRegistry.register now calls ensureOpen() before
  super.register(). Previously the two registration entry points
  (session.registry().register and session.registerNodeDefinition)
  disagreed on what happens after session.close(): the dedicated
  method threw IllegalStateException, the registry().register
  path silently mutated and invalidated a closed-session cache.
  After J2 both throw the same exception type with the same
  message. ensureOpen() inside the constructor's default-
  definitions setup is safe because the `closed` flag is field-
  initialised to false before the constructor body runs.

J3 — negative test:
  DocumentSessionTest.registryRegisterOnClosedSessionThrowsIllegalStateException
  pins the new contract. Pairs with the existing positive cache-
  invalidation test from I3 so the senior-bar "positive + negative"
  pattern (cf PR-7.3) is complete.

J4 — NodeRegistry @SInCE note:
  Class-level Javadoc on NodeRegistry now explicitly calls out
  the v1.6.7 non-final relaxation. The class became non-final in
  v1.6.7 (Track I3) so DocumentSession could install the auto-
  invalidating subclass; the change was already binary-compatible
  (japicmp: semver PATCH). The Javadoc just makes the rationale
  discoverable without reading the CHANGELOG.

Test plan:
- DocumentSessionTest now has 26 tests (25 prev + 1 new negative).
- ./mvnw verify -pl . -P japicmp — 1058 tests, 0 failures.
  japicmp vs v1.6.7 baseline: semver PATCH (compatible — no public
  signature changes; ensureOpen() is a behavioural strengthening
  on an existing public method, well-known semver-PATCH territory).
@DemchaAV DemchaAV merged commit 31cacc7 into develop Jun 1, 2026
11 checks passed
@DemchaAV DemchaAV deleted the chore/senior-review-polish-j-track branch June 1, 2026 16:52
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