milo-encoding-xml depends on jakarta.xml.bind-api and jaxb-runtime, but its JAXB usage is limited to DatatypeConverter calls in OpcUaXmlEncoder and OpcUaXmlDecoder. XML reading and writing use DOM and StAX, with no JAXB marshalling or annotated model classes.
Replacing these conversion calls with JDK functionality and small internal helpers would remove the JAXB dependency chain.
Proposed change
Remove the dependencies in two steps:
- Remove
jaxb-runtime. The JAXB API includes a default DatatypeConverterImpl, so the conversion calls appear to work without a separate runtime provider. Verify this with the runtime absent from the test classpath.
- Replace
DatatypeConverter with internal conversion helpers and remove jakarta.xml.bind-api.
Most replacements can use JDK functionality:
- Integer and boolean conversions with XML lexical validation.
- Floating-point conversions with support for
INF, -INF, and NaN.
java.util.Base64 with appropriate whitespace and padding handling.
javax.xml.datatype.DatatypeFactory for date/time parsing, which JAXB already uses internally.
Compatibility and verification
Preserve valid OPC UA XML representations and existing decoding-error handling. Cover XML whitespace, numeric boundaries, floating-point special values, Base64, and date/time offsets and fractional seconds.
Review malformed-input behavior explicitly. The existing JAXB implementation accepts some invalid integer forms and can silently overflow or narrow values. Replacements should follow OPC UA/XML Schema requirements, with intentional behavior changes documented and tested.
Verify that the XML encoding tests pass without JAXB or its transitive dependencies on the classpath.
milo-encoding-xmldepends onjakarta.xml.bind-apiandjaxb-runtime, but its JAXB usage is limited toDatatypeConvertercalls inOpcUaXmlEncoderandOpcUaXmlDecoder. XML reading and writing use DOM and StAX, with no JAXB marshalling or annotated model classes.Replacing these conversion calls with JDK functionality and small internal helpers would remove the JAXB dependency chain.
Proposed change
Remove the dependencies in two steps:
jaxb-runtime. The JAXB API includes a defaultDatatypeConverterImpl, so the conversion calls appear to work without a separate runtime provider. Verify this with the runtime absent from the test classpath.DatatypeConverterwith internal conversion helpers and removejakarta.xml.bind-api.Most replacements can use JDK functionality:
INF,-INF, andNaN.java.util.Base64with appropriate whitespace and padding handling.javax.xml.datatype.DatatypeFactoryfor date/time parsing, which JAXB already uses internally.Compatibility and verification
Preserve valid OPC UA XML representations and existing decoding-error handling. Cover XML whitespace, numeric boundaries, floating-point special values, Base64, and date/time offsets and fractional seconds.
Review malformed-input behavior explicitly. The existing JAXB implementation accepts some invalid integer forms and can silently overflow or narrow values. Replacements should follow OPC UA/XML Schema requirements, with intentional behavior changes documented and tested.
Verify that the XML encoding tests pass without JAXB or its transitive dependencies on the classpath.