Cleanup package structure and add support for Java Platform Module System
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- build-system
Direzione di ricerca
Start with the NamespacePrefixMapper signatures in both SiriXml utility classes and review the dependency and package findings in the issue. Check .github/workflows/push.yml, jaxb-bindings.xml, and the compiler settings to understand the JDK 11 build. Done means the API/module-path decision is documented and the chosen JPMS approach is validated against the listed package and dependency constraints.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I took a quick look at what is needed to support JPMS (adding module-info.java) to this library. Below is the claude report.
Supporting JPMS has many benefits - not limited to these:
- Better performance (restrict reflection - code can be optimized)
- Future JDKs will be stricter
- Slim API surface help reducing context - helping humans as well as AI
- Multiple versions of the same lib can be used in one VM, supporting backwards compatibility
- Fine grained dependency graphs helps tooling (build in seconds, not minutes for OTP)
Cons:
- Maintaining the
module-info.java
Investigation: adding module-info.java (JPMS) to siri-java-model
Environment note first: couldn't do a full end-to-end build here — only JDK 25 is installed locally, and generating sources with JDK 25 hits a JDK/xjc regression (src-import.3.1 / xml:lang resolution failure) unrelated to this project; CI builds with JDK 11 (liberica, see .github/workflows/push.yml). Worked around this by inspecting the JAXB bindings, partial generated output for SIRI 2.0 (which did complete), and the resolved dependency jars directly.
Package inventory (what module-info.java would need to export)
Handwritten:
org.entur.siri,org.entur.siri.adapter,org.entur.siri.validatororg.entur.siri21.util,org.rutebanken.siri20.util
Generated (confirmed for 2.0, inferred for 2.1 from jaxb-bindings.xml — same pattern):
uk.org.siri.siri20/uk.org.siri.siri21uk.org.ifopt.siri20/uk.org.ifopt.siri21uk.org.acbs.siri20/uk.org.acbs.siri21eu.datex2.siri20.schema._2_0rc1._2_0/eu.datex2.siri21.schema._2_0rc1._2_0net.opengis.gml.siri— 2.1-only, generated from a GML schema binding not mentioned in CLAUDE.mdorg.w3._2001.xmlschema— sharedAdapter1/Adapter2classes for the dateTime/duration bindings; both 2.0 and 2.1 xjc runs generate into this same package/class names (harmless today since it's one jar/one module, just worth knowing)
The blocker: a hard split-package conflict
SiriXml.toXml(Siri, NamespacePrefixMapper, ...) in both util classes is public API typed against com.sun.xml.bind.marshaller.NamespacePrefixMapper, supplied by the compile-scope dependency com.googlecode.jaxb-namespaceprefixmapper-interfaces:JAXBNamespacePrefixMapper. That jar's classes live in:
com.sun.xml.bind.marshaller— the exact same package used by the real JAXB RI (com.sun.xml.bind:jaxb-core/jaxb-impl, currently test-scope here)com.sun.xml.internal.bind.marshallerorg.eclipse.persistence.oxm/.internal.oxm
It's a compile-time stub deliberately shaped to shadow whichever real JAXB runtime (Metro or EclipseLink MOXy) a consumer puts on the classpath — that trick only works on the classpath. On the module path, having this shim module and a real jaxb-impl/MOXy module present together is a guaranteed java.lang.module.FindException (two modules can never contain the same package, exported or not). Since this library's whole purpose is marshalling XML — which requires a real JAXB runtime at deploy time — any consumer trying to run this fully modularized alongside an actual JAXB implementation will hit this immediately.
This is the one finding that needs a decision before module-info.java is worth writing:
- keep the library usable (as today) mainly via the classpath/unnamed module, and add
module-info.javapurely for consumers who read this jar on the module path without also modularizing their JAXB runtime — narrow but non-breaking, or - break the
NamespacePrefixMapperAPI (replace it with a type this library owns, or drop the overload) so the module no longer needs that shim as a compile dependency — clean, but an API-breaking change.
Other things module-info.java needs to account for
- Reflection for JAXB (un)marshalling: generated classes use private fields; the JAXB runtime a consumer supplies (unknown module name, chosen by them) needs reflective field access. The practical answer is
open module ...(or opens-per-package) rather than plainexports, since we can't predict/opens ... toan implementation module we don't control. - Dependencies without a real module identity:
jackson-databind,jackson-core,jackson-module-jakarta-xmlbind-annotations,slf4j-api(2.0.7), andJAXBNamespacePrefixMapperall lackmodule-info.classandAutomatic-Module-Name— they'd resolve as automatic modules with filename-derived names (brittle, not guaranteed stable across versions). Onlyjakarta.xml.bind-apiandjackson-annotationsship real module descriptors. - Module naming: no existing
Automatic-Module-Nameis set today, so any current module-path consumer relies on the jar-filename-derived name (siri.java.model). Publishing amodule-info.javawith an explicit name (suggestorg.entur.siri) changes that name — a breaking change for any such consumer, worth a release note. - Compiler plugin:
maven-compiler-plugin3.8.0 with<source>/<target>11</target>supportsmodule-info.javafine, but since it's built with--release 11semantics missing, consider switching to<release>11</release>so building on newer JDKs doesn't accidentally leak newer JDK APIs — a good companion change, not required for JPMS itself.
Suggested next step
Given the split-package issue, decide the NamespacePrefixMapper question first since it determines whether this is a same-version additive change or needs a major version bump:
- draft
module-info.javaas anopen module, keeping the currentNamespacePrefixMapperAPI as-is, documenting the module-path caveat, or - first look at removing/replacing the
JAXBNamespacePrefixMapperdependency.
- Lingua principale
- XSLT
- Stelle
- 10
- Fork
- 6
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di entur/siri-java-model
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
entur/siri-java-model#32 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
entur/siri-java-model#29 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
entur/siri-java-model#28 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
entur/siri-java-model#1 ·
Tutte le issue di entur/siri-java-model
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aws-deadline/deadline-cloud-for-unreal-engine#406 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
activescott/gpu-poet#79 ·
I maintainer di solito rispondono entro 1 giorno