elharo opened a new pull request, #508:
URL: https://github.com/apache/maven-ear-plugin/pull/508

   ## Summary
   
   Replaces 8 nearly identical `initializeRootElement*` methods 
(`initializeRootElementOneDotFour` through `initializeRootElementEleven`) with 
a single parameterized `initializeRootElement(Writer, JavaEEVersion)` method.
   
   ## Changes
   
   - **ApplicationXmlWriter.java**: Removed 8 duplicate methods and replaced 
them with one method that maps the JavaEE version to the appropriate XML 
namespace using the version index comparison:
     - **1.4**: `http://java.sun.com/xml/ns/j2ee`
     - **5, 6**: `http://java.sun.com/xml/ns/javaee`
     - **7, 8**: `http://xmlns.jcp.org/xml/ns/javaee`
     - **9+**: `https://jakarta.ee/xml/ns/jakartaee`
   
   - The schema filename and `version` attribute are derived from 
`version.getVersion()`, with `.` replaced by `_` (e.g., `1.4` becomes 
`application_1_4.xsd`).
   
   ## Impact
   
   - **-89 lines** (271 → 182 lines)
   - No behavioral change -- all generated XML remains identical
   - Adding support for JavaEE/JakartaEE 12+ requires only adding the constant 
to `JavaEEVersion` -- no changes to this writer
   - **1.3** remains handled separately since it uses a DOCTYPE declaration 
instead of namespaces


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to