Skip to content

Conversation

@peter-lawrey
Copy link
Member

@peter-lawrey peter-lawrey commented Nov 8, 2025

This change lands a focused batch of new tests, a living log/backlog for continuing coverage work, clearer diagnostics when elastic growth fails, and minor documentation/Javadoc clean-ups. It also aligns the sonar profile with realistic JaCoCo gates and sets verify as the default goal there to make reports reproducible.

Why

  • Close high-value gaps in Mapped* and elastic/native paths without churning hot code.
  • Make failures actionable: when a buffer can’t resize, include the allocation site (when tracing is on) instead of a bare message.
  • Keep momentum: provide a lightweight, discoverable NEW_TESTS.md and TESTS_TODO.md so the next iteration knows what landed vs. what’s pending.
  • Stabilise CI by ratcheting coverage to what we can hit consistently today and enforcing verify.

What changed

New files

  • NEW_TESTS.md: brief, running log of tests added this pass (kept in step with TESTS_TODO.md).
  • TESTS_TODO.md: Bytes-specific backlog with commands, completed items, and next batches (safe-page defaults, OS.pageAlign consumers, etc.).

Tests added/extended

  • MappedFileTest.insideHonoursSafeLimitWhenPageSizeDiffers — validates MappedBytesStore#inside vs safeLimit() under enlarged page sizes.
  • MappedBytesTest.zeroOutRespectsCustomPageSize — ensures zeroOut clears all bytes when mapping page size > OS default.
  • TempDirectoryIntegrationTest — end-to-end IOTools.createTempDirectory under OS.getTarget() with cleanup.
  • ReferenceTracingLeakTest — intentional leak proves createdHere() is carried into diagnostics and surfaces via assertReferencesReleased().
  • DecoratedBufferOverflowExceptionTest — documents null-cause semantics (null ≡ no cause).
  • NativeBytesOverflowTest#overflowWithoutTracingKeepsCauseNull — when tracing is off, DBOE keeps cause == null.
  • Matrix/behavioural additions: BytesLifecycleTest, BytesCopyMatrixTest, UncheckedBytesBehaviourTest#uncheckedModeAllowsWritePastLimit.

Code & diagnostics

  • NativeBytes.newDBOE(..) now attaches the allocation stack (createdHere()) when available; falls back to a plain message if tracing is disabled. Improves triage without changing hot-path behaviour.
  • Perf log tweak in NativeBytes#resize: raise the “large allocation” signal to MiB granularity (less noise; clearer human output).

Docs

  • memory-management.adoc: explains how createdHere() feeds DecoratedBufferOverflowException (ties to CB-NF-O-006), and the safe fallback when tracing is disabled.
  • project-requirements.adoc: adds stable anchors ([[ID]]) for all CB IDs and a new CB-NF-MP-006 (dual-JDK matrix: legacy JDK 8 and latest/EA e.g. JDK 25).
  • architecture-overview.adoc: references CB-NF-MP-006.

Javadoc/style hygiene (no behavioural change)

  • Normalised Javadoc order and @Override placement across several classes (MappedBytesStore, StreamingOutputStream, UncheckedBytes*, SingleMappedFile, CommonMappedBytes, NoBytesStore, Unmapper, UnsafeText, etc.) to satisfy style/Checkstyle and keep docs crisp.

Build & quality gates

  • pom.xml (sonar profile):

    • Set defaultGoal to verify for predictable report generation.
    • JaCoCo gates set to line 0.70 / branch 0.62 (baseline from recent stable runs; we’ll ratchet up as the backlog lands).

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 8, 2025

@peter-lawrey peter-lawrey changed the title Adv/review2 Bytes test expansion, safer diagnostics, and doc anchors — with realistic JaCoCo gates Nov 9, 2025
@peter-lawrey peter-lawrey changed the base branch from develop to adv/license November 10, 2025 15:48
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.

2 participants