Support self-inclusive binary prefixes#740
Merged
Merged
Conversation
ONGOING-Z
pushed a commit
to SourceDive/jPOS
that referenced
this pull request
Jul 18, 2026
Follow-ups to jpos#740: - SelfInclusiveBinaryPrefixer.of(BinaryPrefixer) reuses the B/BB singletons and wraps any binary prefixer; maxLength() generalized to n-byte prefixes. - ISOBinaryFieldPackager selects the inclusive prefixer via instanceof rather than singleton identity, so any binary length prefix works, and throws ISOException on a non-binary prefix. - GenericPackagerParams.setGenericPackagerParams now declares throws ISOException, matching the packager-XML error convention; overriding implementations are unaffected (fewer checked exceptions). - Tests: inclusive="true" on an isofieldpackager with subfields (Visa field 126.18 shape, round-trip) and rejection on a non-binary-prefix field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Closes #739
Adds one- and two-byte self-inclusive binary prefixers and exposes them through
inclusive="true"on GenericPackager binary fields. The encoded length includes the prefix itself; unpacking subtracts it.Tests:
./gradlew test(Java 26.0.1-amzn, Gradle 9.5.1).