Skip to content

Fix constructor safety and UTF-8 CSV error reporting - #187

Open
peter-lawrey wants to merge 1 commit into
developfrom
fix/pr176-safety-csv
Open

Fix constructor safety and UTF-8 CSV error reporting#187
peter-lawrey wants to merge 1 commit into
developfrom
fix/pr176-safety-csv

Conversation

@peter-lawrey

@peter-lawrey peter-lawrey commented Sep 11, 2026

Copy link
Copy Markdown
Member

JLBH construction currently terminates the host JVM when resource tracing is enabled, and CSV output can silently swallow storage failures through PrintWriter. Throw a catchable IllegalStateException from both constructor paths and write CSV with an explicit UTF-8 reporting encoder. Preserve valid Unicode probe names and propagate malformed input, write, flush and close failures as IOException, including failures while emitting a probe row.

CSV readers must decode UTF-8 explicitly. This preserves existing ASCII output and Unicode output on UTF-8-default systems; it deliberately removes platform-default encoding dependence. Failed output may be partial. Public signatures are preserved.

Update the existing lifecycle guide, constructor Javadocs and CSV requirement (FN-005) together. The lifecycle guide is the canonical property description. Add 14 regression cases covering property values/restoration through both constructors, exact bytes and round trips for ASCII/Latin-1/euro/supplementary Unicode names, malformed Unicode, and write/flush/close failures with destination closure.

Extracted from #176 onto develop b201544e3bbb3e2bc8b55bc57f585d4f2b91be8a, retaining current dependencies and JUnit Jupiter. The sampling-counter conversion, example edits, agent/TODO scaffolding, documentation migration and old quality profile are deferred; this patch makes no watchdog or sampling-performance claim.

Validation:

Clean full mvn verify Result
Java 8, 64-bit 44 passed, no failures/errors/skips
Java 25, 64-bit 44 passed, no failures/errors/skips
Java 21, 32-bit 44 passed, no failures/errors/skips

All 11 serializer cases also pass with Java 8's default charset set to ISO-8859-1. Separate actual-library JVM probes show that the baseline exits with code 255 for empty/true tracing, whereas the revised constructor rejects those settings and the host continues normally. The unchanged develop baseline passed its original 30 tests on Java 8.

Commands, with the appropriate JAVA_HOME and matching PATH:

mvn -o -nsu clean verify -Dsurefire.rerunFailingTestsCount=0 -l jlbh-verify.log
JAVA_TOOL_OPTIONS=-Dfile.encoding=ISO-8859-1 mvn -o -nsu test \
  -Dtest=JLBHResultSerializerTest -l serializer-latin1-default.log
mvn -o -nsu help:effective-pom -Doutput=effective-pom.xml

The inherited Checkstyle 3.3.0 plugin / Checkstyle 9.3 configuration and license/Javadoc checks pass. Checkstyle uses google_checks.xml and chronicle-quality-rules 1.23ea6, including test sources; its warning-level diagnostics remain subject to the existing parent failure threshold. This is not a warning-free style audit or validation of #176's separate quality profile.

Fresh platform CI is required before merge. The historical Linux failure on #176 (TeamCity build 1237958) remains unclassified because the log endpoint requires authentication; it is not evidence against this extraction or attributed to a particular old change.

Fresh CI on c715fd95477e49e4dc748d552836b257c5877c0d, checked on 11 September 2026: one failed, 12 queued. Pull Requests Linux build 1353486 failed; its log download returns HTTP 401, so its cause remains unclassified. Windows and Mac are still queued. Hold the merge until this failure is diagnosed and the required platform checks complete; the local matrix does not replace that evidence.

Shared snapshot repository repair - 12 September 2026

188 owns the obsolete snapshot URL correction on develop. Both this PR's Pull Requests Linux build 1353486 and unchanged-develop build 1351468 fail resolving the same BOM from the old URL.

A disposable composition of this exact head with the one-line shared correction passes full Java 8 clean verify: 44 tests, zero failures/errors/skips/retries, from an initially empty isolated Maven repository and empty user settings. The shared repair alone passes all 30 baseline tests. This PR's branch is unchanged; incorporate the focused repair after it lands and complete normal CI/review.

Resource tracing must not terminate an embedding JVM, and CSV output must preserve Unicode names and report storage failures. Throw IllegalStateException on construction and propagate IOException through UTF-8 output, including row writes and cleanup.

Add 14 regression cases. Full clean verification passes all 44 tests on Java 8, Java 25 and 32-bit Java 21. Refs #176 and CSV requirement FN-005.
@peter-lawrey peter-lawrey self-assigned this Sep 11, 2026
peter-lawrey-admin pushed a commit that referenced this pull request Sep 13, 2026
The shared POM still points at the obsolete OSSRH snapshot endpoint, so a
clean build cannot resolve chronicle-bom:2026.0-SNAPSHOT.

Use the current Central snapshot repository. Clean Java 8 verification
passes all 30 baseline tests and all 44 tests with the #187 composition.

Related to #187.
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