Skip to content

[#261] Format digests with java.util.HexFormat instead of JAXB - #262

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:issue-261-hexformat
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:issue-261-hexformat

Conversation

@vharseko

Copy link
Copy Markdown
Member

openidm-script and openidm-maintenance use javax.xml.bind without declaring JAXB: ScriptRegistryService names inline scripts with DatatypeConverter.printHexBinary, and ChecksumFile formats checksums with HexBinaryAdapter.marshal. JAXB reaches them only through commons json-resource → api-descriptor, which OpenIdentityPlatform/commons#362 removes JAXB from.

Both calls now use HexFormat.of().withUpperCase(). The output keeps the upper case of the JAXB methods, so inline script names and the update checksums (including the checksum field of the update archive listing) do not change. These were the only uses of javax.xml.bind in the repository.

Tests

  • ChecksumFileTest.testGetCurrentDigestIsUpperCaseHex (new) and ScriptRegistryServiceTest.testInlineScriptNameIsSha256OfSourceAndType compare against literals computed with md5 and shasum. The script test used to compute its expected value with HexFormat itself, which after this change would only compare the code with itself. Both tests pass on the base code, and both fail if withUpperCase() is dropped.
  • With commons#362 simulated (managed exclusions of jaxb-api, jaxb-core and jaxb-impl on api-descriptor and json-web-token), the base fails to compile with package javax.xml.bind does not exist (ScriptRegistryService.java:39) and package javax.xml.bind.annotation.adapters does not exist (ChecksumFile.java:32). With this change both modules build and pass their tests (16 and 117) with and without the simulation.
  • The generated Import-Package of both bundles differs from the base only by the removed javax.xml.bind;version="[2.3,3)" and javax.xml.bind.annotation.adapters;version="[2.3,3)".

Fixes #261

…stead of JAXB

openidm-script and openidm-maintenance used javax.xml.bind
(DatatypeConverter.printHexBinary, HexBinaryAdapter.marshal) without
declaring JAXB; it came only transitively through commons
api-descriptor, which OpenIdentityPlatform/commons#362 drops. Both now
use HexFormat.of().withUpperCase(), so inline script names and update
checksums keep their upper-case form.

The tests pin both outputs with literals computed outside the JVM; the
script test previously derived its expected value with HexFormat itself.

Fixes OpenIdentityPlatform#261
@vharseko
vharseko requested a review from maximthomas October 18, 2026 10:50
@vharseko vharseko added dependencies Pull requests that update a dependency file java Pull requests that update Java code build Maven build configuration (POMs, plugins, build tooling) test Tests and test infrastructure (unit, e2e, smoke) labels Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Maven build configuration (POMs, plugins, build tooling) dependencies Pull requests that update a dependency file java Pull requests that update Java code test Tests and test infrastructure (unit, e2e, smoke)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openidm-script and openidm-maintenance compile against JAXB that only commons brings in

1 participant