Repository navigation
Preserve Java 8 buffer descriptors in persisted Map I/O - #616
Merged
Merged
Conversation
Use Buffer-typed cursor calls so modern source/target-8 compilation does not link Map header I/O against Java 9+ ByteBuffer methods. Include the global-state flip required by reopening, exposed by exercising the packaged artifact on Java 8. Extract the compatibility changes identified in #588 and add create/reopen/recover/reopen coverage. The Java-21-built baseline fails on Java 8; the corrected packaged JAR passes, as does full Java 21 verification.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The compatibility fix is focused, regression-tested, and has no unresolved issues.
Pull request overview
Preserves Java 8 compatibility for persisted Chronicle Maps built on modern JDKs.
Changes:
- Uses Java 8-compatible
Buffercursor descriptors. - Adds persistence lifecycle and recovery regression coverage.
File summaries
| File | Description |
|---|---|
src/test/java/net/openhft/chronicle/map/PersistedMapHeaderTest.java |
Tests creation, reopening, recovery, data retention, and cleanup. |
src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java |
Uses compatible persisted-header cursor operations. |
src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java |
Fixes buffer flipping when reopening persisted maps. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
peter-lawrey-admin
self-requested a review
September 8, 2026 07:54
peter-lawrey-admin
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Chronicle Map artifact compiled on a modern JDK with Java 8 source/target settings can link header cursor operations to Java 9+ covariant
ByteBuffermethods. On Java 8, creating a persisted Map then fails withNoSuchMethodError.Use
Buffer-typed cursor calls inChronicleMapBuilderand the global-state read inVanillaChronicleHash.initBeforeMapping(). Add a persistence regression that writes entries, reopens the Map, recovers it with exclusive access, and reopens it again while checking retained values and temporary-file deletion.This extracts the production compatibility work identified in #588. Actual Java 8 execution showed the builder-only changes were incomplete: creation succeeded, but reopening failed at the additional
ByteBuffer.flip()call. The extra cast fixes that same persistence path. Three files change; the POM and JUnit framework are unchanged.Validation:
ByteBuffer.position(int):ByteBufferinwriteHeader()ByteBuffer.flip():ByteBufferininitBeforeMapping()The runtime check verified that
ChronicleMapBuilderwas loaded from the requested packaged JAR. It did not usetarget/classesor rebuild Map on Java 8. Disassembly confirmsBuffer-returning cursor descriptors at all changed call sites.Full
mvn verify -Dsurefire.rerunFailingTestsCount=0on Java 21 passed: 1,317 tests, 82 existing skips. The baseline had 1,316 tests and the same skip count. The binary compatibility enforcer also passed.Reproduce the packaged-artifact check
With
JAVA_HOMEandPATHpointing to JDK 21 for Maven:Validated final JAR SHA-256:
ef49507dd461f8147ec512230b7cdeb56e6adadc045ab10c589eac83a723a739.Validation environment and dependency receipt
Linux x86_64; Maven 3.9.11; OpenJDK 21.0.12 and 8u502. Surefire 3.1.2, JUnit 4.13.2, Vintage 5.10.0. Failing-test reruns explicitly disabled with
-Dsurefire.rerunFailingTestsCount=0. Builds start fromdevelopat0c25269da8d12e3e1cd10c7f4c74ae35a017ab2c.Resolved Chronicle dependencies: Core 2026.6; Bytes 2026.4; Wire 2026.10-SNAPSHOT; Values 2026.2; Threads 2026.3; Algorithms 2026.2; Affinity 2026.2; Posix 2026.2; Test Framework 2026.2; JLBH 2026.2. Parent and third-party BOM: 2026.0. XStream: 1.4.21.
Mutable-input SHA-256:
The unchanged baseline also passed full
mvn verify: 1,316 tests, 82 existing skips. Windows/macOS and downstream projects were not run locally.