Conversation
Adds module-info.java declaring org.entur.netex.java.model, replacing the Automatic-Module-Name manifest entry. requires transitive is used for jakarta.xml.bind, java.xml and org.apache.commons.lang3 since their types leak into the public API (JAXBException, QName/XMLGregorianCalendar, OmitNullsToStringStyle extends ToStringStyle). The generated model packages (org.rutebanken.netex.model, net.opengis.gml._3, uk.org.siri.siri) use field-level JAXB access, so they're opened to jakarta.xml.bind, org.glassfish.jaxb.runtime and org.apache.commons.lang3 - verified by running with each opens target removed until `mvn clean test` passed cleanly on the module path (Surefire auto-detects module-info.java and runs on the module path). Also renames org.rutebanken.util to org.rutebanken.netex.util for consistency with the other org.rutebanken.netex.* packages. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
t2gran
marked this pull request as draft
September 21, 2026 11:00
|
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.



Summary
Turns
netex-java-modelinto a proper JPMS module by adding amodule-info.java(
org.entur.netex.java.model), replacing theAutomatic-Module-Namemanifestentry that was there before. Also renames
org.rutebanken.utiltoorg.rutebanken.netex.utilfor consistency with the otherorg.rutebanken.netex.*packages.This needs to land as 3.x — the package rename breaks anyone importing
org.rutebanken.util.*directly (the fourXmlAdapterclasses).What's in module-info.java
requires transitiveonjakarta.xml.bind,java.xml, andorg.apache.commons.lang3— their types leak into our public API(
JAXBException,QName/XMLGregorianCalendaronNeTExValidator, andOmitNullsToStringStyle extends ToStringStyle), so callers need readabilityto them too.
org.rutebanken.netex.model,net.opengis.gml._3,uk.org.siri.siri) areopensed tojakarta.xml.bind,org.glassfish.jaxb.runtime, andorg.apache.commons.lang3. XJC generatesfield-level JAXB access (
@XmlAccessorType(FIELD)) and the generatedtoString()usesReflectionToStringBuilder, both of which need reflectivefield access. All three targets were confirmed necessary by removing each
one and rerunning
mvn clean testuntil it broke — nothing here is a guess.mvn clean testis verifying themodule-info.java- no other automatictests/verification is needed.
Open questions for review
exports/opensbe narrowed further? Right now everythingcompiled from the schema is exported.
net.opengis.gml._3anduk.org.siri.sirihave to stay exported (model getters return those typesdirectly), but
org.rutebanken.netex(justOmitNullsToStringStyle) andorg.rutebanken.netex.util(theXmlAdapters) are only ever referencedfrom generated code in the same module — they may not need to be exported
at all, possibly just
opens ... to org.glassfish.jaxb.runtimefor theadapters so JAXB can still instantiate them reflectively.
PublicationDeliveryClientdoesn't look like it belongs in a modellibrary. It's a raw
HttpURLConnectionPOST client with no timeouts,auth, or retry handling, and it's the only place that needs
slf4jfor itsown sake (
NeTExValidatorusesslf4jregardless, so removing the clientdoesn't drop the dependency, just this one usage of it). Candidate for
removal in this same 3.x bump, or split into a separate module — needs a
decision before merge since it's a real API removal.
uk.org.siri.siria dependency at all? It's not us pulling insomething unrelated —
NeTEx_siri.xsdis part of NeTEx's own officialschema (bundled in the NeTEx repo we download from), and it's used by 7
DataObject*/subscription-related classes for a SIRI-based real-timequery/subscription API layer. Since XJC compiles transitively from
NeTEx_publication.xsd, this gets generated whether or not any givenconsumer uses it.
io.github.threeten-jaxb:threeten-jaxb-coreshould be inlined. ItsDurationXmlAdapteris ~8 lines wrappingDuration.parse/.toString().Not worth a dependency (and its module) for that — copy it into
org.rutebanken.netex.utilalongside the other adapters and drop thedependency.
None of the four items above are implemented in this PR — flagging them here
for discussion before deciding what else goes into the 3.x bump.