Skip to content

Conversation

@peter-lawrey
Copy link
Member

No description provided.

Root cause: License check failed due to missing headers.
Fix: Applied com.mycila:license-maven-plugin format using project header.
Impact:
- Build passes license check and verify.
- No behavioural changes; headers only.
Moves test.dat into target dir via OS.getTarget() to avoid repo-root artifacts.
Verified with mvn verify.
Root cause: Surefire consumed `` while JaCoCo publishes to `` by default, so tests ran without the agent under -P sonar.
Fix: Point Surefire at `` and also publish JaCoCo agent args to `` in the sonar profile (prepare-agent bound to initialize). Combine both in Surefire argLine for robustness.
Impact: Sonar runs with the JaCoCo javaagent attached. Coverage checks may still fail if thresholds are unmet, but code coverage is now detected by tests using Jvm.isCodeCoverage().
…nd mapped-bytes boundary

- ByteStringReaderWriterTest exercises read/skip and write/append paths
- CanonicalPathUtilTest verifies interned canonical path behaviour
- MappedBytesBoundaryTest writes across a chunk boundary and validates content

Build: revert global surefire argLine to  and bind JaCoCo prepare-agent to initialize in sonar profile to avoid default build breakage.
- Add BytesUtilTest covering equality helpers, alignment, newline combination, and file helpers
- Add ReferenceTypesTest for TextIntReference and BinaryLongReference round-trips and ops
- Add BytesInternalParsingTest to exercise parseBoolean/parseUtf8 in internal parsing
- Keep HexDumpBytes and mapped boundary tests added earlier

build(sonar): ensure surefire passes -Djvm.coverage=true under sonar to satisfy perf-sensitive tests
Root cause: global Surefire argLine omitted ${jvm.requiredArgs}, leading to JPMS access warnings/failures under JDK 11+. JaCoCo’s agent publishes its JVM args via ${argLine}.\n\nFix: set global Surefire \n- <argLine>${argLine} ${jvm.requiredArgs}</argLine>\nSonar profile already uses\n- <argLine>${argLine} ${jvm.requiredArgs} -Djvm.coverage=true</argLine>\n\nImpact: tests run with the JaCoCo agent and required module flags on modern JDKs. Verified default and sonar builds on Java 21 and 25. This prevents JPMS illegal-access issues and ensures coverage is collected consistently.
Add UTF-8 append/parse coverage for BytesInternal, covering RandomDataOutput offsets, explicit UTF flags and stop-char boundaries. Extend HexDumpBytes tests to assert fromText parsing and narrow numberWrap formatting. Assert CommonMappedBytes read-only flag blocks writes by mapping files read only. mvn -q verify -P sonar passes on Java 21, 17 and 25.
- Catch Exception instead of Throwable in ByteBuffers and NativeBytesStore static initializers (S1181)
- Replace string concatenation with StringBuilder in NativeBytesStoreTest (S1643)
- Use parameter in MappedBytesEdgeTest constructor to avoid unused parameter warning (S1172)
- Verified targeted tests pass.
- Extract assignments out of field.set(...) expressions in array/collection/map setters
- Improves readability and satisfies Sonar rule S1121 without changing behaviour.
- Verified targeted tests.
…S3776)

- Extract stop-bit decoding into a small static helper and holder class inside the interface
- Keeps behaviour identical while lowering complexity in the method body
- Verified targeted tests
- Initialise bytesStore field to BytesStore.empty() and add non-null check inline in super(...) expression
- Keeps semantics and satisfies Sonar nullability rule across constructors
- Verified targeted tests
- Add @SuppressWarnings("java:S1452") to factory methods that must use wildcard return types due to runtime-selected backing stores (Bytes.allocateElastic* and BytesStore.wrap/follow/from)
- Avoids API breakage while satisfying Sonar rule guidance. All tests pass locally.
- BytesMarshaller: add ALLOW_PRIVATE_FIELD_ACCESS flag and centralize Jvm.setAccessible in a suppressed helper with justification
- When flag is false, only marshal publicly accessible fields to avoid accessibility bypasses
- Keeps existing default behaviour while offering a compliant mode
…e (S1181)

- BinaryBytesMethodWriterInvocationHandler: roll back and rethrow on Exception, preserve Error
- HexDumpBytes, BytesMarshallable toString: return message on Exception, rethrow Error
- BinaryIntReference, UncheckedLongReference, BinaryLongReference, BinaryLongArrayReference: narrow to Exception in toString; rethrow Error
- BytesInternal: handle MethodHandle.invoke Throwable locally; narrow outer catch to Exception
- Keep surefire argLine = ${argLine} ${jvm.requiredArgs} for both global and sonar runs
- In sonar profile, set forkCount=1 and reuseForks=true to improve agent flush reliability
- Context: JaCoCo agent args land in ${argLine}; multi-fork runs on some JDKs/LAFs did not emit target/jacoco.exec, causing report/check to skip and coverage to read as zero. A single fork is more reliable across Java 11/17/21/25.

Verify: mvn -q verify (default) and mvn -q -P sonar verify on JDK>=11
…; Sonar surefire reuseForks=false to improve JaCoCo exec flush
…0.60); centralise in top-level properties and remove duplicate profile overrides
- ASCII-only sources: replace raw non-ASCII (e.g., £, €, ó, bullets) with Unicode escapes across tests
- HexDumpBytesTest: write unique file under OS.getTarget() and clean up
- Relax time-based assertions for slow CI in MappedUniqueTimeProviderTest and DistributedUniqueTimeProviderTest
- Remove unused field from MappedBytesEdgeTest constructor state
- Update ByteStoreTest, ByteStringParserTest, ISO88591CharsTest, UnicodeToStringTest, WriteLimitTest, StringsTest, BytesTest, BinaryIntArrayReferenceTest accordingly
- S1172 (unused parameter): use Parameterized display name param in MappedBytesEdgeTest via Objects.requireNonNull(name)
- S5826 (JUnit5 BeforeEach suggestion): retain JUnit4 @before in MappedFileTest with @SuppressWarnings(java:S5826) justification
- S1117 (variable shadowing): rename local variables in AbstractBytesTest to avoid hiding fields

Note: Kept ISO-8859-1 literals (e.g., £, ·, ó) in test sources as per project policy; non-ISO characters (e.g., €) remain escaped.
…restore correctness)

- Replace separate Exception/Error catches with single catch(Throwable)
- Ensures buffers are not corrupted when proxied interfaces throw non-Exception Throwables
- HexDump: merge formatting/wrap/zero-length into HexDumpBytesLayoutTest; remove three separate classes
- BytesInternal IO/Copy: merge into BytesInternalIOCopyTest; remove two separate classes
- UTF-8 parsing: consolidate boundary/limit/null cases into Utf8ParsingBoundaryTest; remove two separate classes

No behavioural changes; uses existing assertions and helpers.
…ite8bit boundary, extra readUtf8Limited boundary, VanillaBytes capacity/zeroOut, and method-writer rollback test
- Remove SortPom from default build and delete opt-in profile
- Keep builds deterministic; developers can run 'mvn sortpom:sort' when desired

Impact: avoids unintended POM reformatting during CI/local verify.
# Conflicts:
#	src/main/java/net/openhft/chronicle/bytes/Bytes.java
#	src/main/java/net/openhft/chronicle/bytes/BytesStore.java
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 2, 2025

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