Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package plexus-xml4 for openSUSE:Factory checked in at 2026-11-16 09:08:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/plexus-xml4 (Old) and /work/SRC/openSUSE:Factory/.plexus-xml4.new.1251 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plexus-xml4" Mon Nov 16 09:08:37 2026 rev:3 rq:1397616 version:4.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/plexus-xml4/plexus-xml4.changes 2026-02-09 19:31:04.165500966 +0100 +++ /work/SRC/openSUSE:Factory/.plexus-xml4.new.1251/plexus-xml4.changes 2026-11-16 09:14:17.806454819 +0100 @@ -1,0 +2,33 @@ +Sat Nov 14 17:05:14 UTC 2026 - Fridrich Strba <[email protected]> + +- Update to version 4.2.1 + * Bug Fixes + + Fix ArrayIndexOutOfBoundsException for surrogate pair in + comment at buffer boundary + * Documentation updates + + Drop the Source Xref menu item + + Stop pinning a version in the README snippet + * Build + + Draft the version the labels imply, not always a patch + * Dependency updates + + Bump release-drafter/release-drafter from 7.7.0 to 7.10.0 + + Bump mavenXmlVersion from 4.0.0-rc-6 to 4.0.0-rc-7 +- Changes of 4.2.0 + * New features and improvements + + Establish an automatic module name + + Build the DOM with a local pull builder instead of Maven's + deprecated XmlNodeBuilder + * Documentation updates + + Rewrite README with usage, status and version guidance + * Maintenance + + Set the next development version to 4.2.0-SNAPSHOT + + Build against maven-xml 4.0.0-rc-6 + + Remove deprecated XmlNode references + * Build + + Update parent to plexus 27 + * Dependency updates + + Depend on maven-api-xml at compile and maven-xml at runtime + + Bump org.codehaus.plexus:plexus from 25 to 26 + + Bump release-drafter/release-drafter from 6 to 7.7.0 + +------------------------------------------------------------------- Old: ---- plexus-xml-4.1.1.tar.gz New: ---- plexus-xml-4.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plexus-xml4.spec ++++++ --- /var/tmp/diff_new_pack.nWNZtX/_old 2026-11-16 09:14:18.638489702 +0100 +++ /var/tmp/diff_new_pack.nWNZtX/_new 2026-11-16 09:14:18.640489785 +0100 @@ -19,7 +19,7 @@ %global base_name plexus-xml %global version_suffix 4 Name: %{base_name}%{version_suffix} -Version: 4.1.1 +Version: 4.2.1 Release: 0 Summary: Plexus XML Utilities License: Apache-2.0 ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.nWNZtX/_old 2026-11-16 09:14:18.667490917 +0100 +++ /var/tmp/diff_new_pack.nWNZtX/_new 2026-11-16 09:14:18.670491043 +0100 @@ -1,6 +1,6 @@ -mtime: 1770648099 -commit: d506080ab663312dc2054d7314765cbe98df5ef3db8bd859688cdfe6b2208137 -url: https://src.opensuse.org/java-packages/plexus-xml4.git -revision: d506080ab663312dc2054d7314765cbe98df5ef3db8bd859688cdfe6b2208137 +mtime: 1794676780 +commit: 6e60fe3cb6bcc528a439960b5edb841743cfa32706c74ba8ef585dd495ec7806 +url: https://src.opensuse.org/java-packages/plexus-xml4 +revision: 6e60fe3cb6bcc528a439960b5edb841743cfa32706c74ba8ef585dd495ec7806 projectscmsync: https://src.opensuse.org/java-packages/_ObsPrj ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-11-14 18:19:40.000000000 +0100 @@ -0,0 +1 @@ +.osc ++++++ plexus-xml-4.1.1.tar.gz -> plexus-xml-4.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/.github/release-drafter-3.x.yml new/plexus-xml-plexus-xml-4.2.1/.github/release-drafter-3.x.yml --- old/plexus-xml-plexus-xml-4.1.1/.github/release-drafter-3.x.yml 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/.github/release-drafter-3.x.yml 2026-11-14 15:25:33.000000000 +0100 @@ -1,5 +1,10 @@ _extends: .github:.github/release-drafter.yml -tag-template: plexus-xml-$NEXT_PATCH_VERSION + +# tag-prefix is what lets the drafter parse the version out of the last tag. +# Without it the drafter reads what it can from the tag string, and plexus-i18n +# once drafted 18.0.1 by finding the 18 in its own name. +tag-prefix: plexus-xml- +tag-template: plexus-xml-$RESOLVED_VERSION version-template: 3.$MINOR.$PATCH commitish: 3.x filter-by-commitish: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/.github/release-drafter-master.yml new/plexus-xml-plexus-xml-4.2.1/.github/release-drafter-master.yml --- old/plexus-xml-plexus-xml-4.1.1/.github/release-drafter-master.yml 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/.github/release-drafter-master.yml 2026-11-14 15:25:33.000000000 +0100 @@ -1,5 +1,10 @@ _extends: .github:.github/release-drafter.yml -tag-template: plexus-xml-$NEXT_PATCH_VERSION + +# tag-prefix is what lets the drafter parse the version out of the last tag. +# Without it the drafter reads what it can from the tag string, and plexus-i18n +# once drafted 18.0.1 by finding the 18 in its own name. +tag-prefix: plexus-xml- +tag-template: plexus-xml-$RESOLVED_VERSION version-template: 4.$MINOR.$PATCH commitish: master filter-by-commitish: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/.github/workflows/maven.yml new/plexus-xml-plexus-xml-4.2.1/.github/workflows/maven.yml --- old/plexus-xml-plexus-xml-4.1.1/.github/workflows/maven.yml 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/.github/workflows/maven.yml 2026-11-14 15:25:33.000000000 +0100 @@ -17,7 +17,7 @@ name: GitHub CI -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: build: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/.github/workflows/release-drafter.yml new/plexus-xml-plexus-xml-4.2.1/.github/workflows/release-drafter.yml --- old/plexus-xml-plexus-xml-4.1.1/.github/workflows/release-drafter.yml 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/.github/workflows/release-drafter.yml 2026-11-14 15:25:33.000000000 +0100 @@ -7,7 +7,7 @@ update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v6 + - uses: release-drafter/[email protected] with: config-name: 'release-drafter-master.yml' # located in .github/ in default branch env: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/README.md new/plexus-xml-plexus-xml-4.2.1/README.md --- old/plexus-xml-plexus-xml-4.1.1/README.md 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/README.md 2026-11-14 15:25:33.000000000 +0100 @@ -1,25 +1,55 @@ -Plexus-Xml -========== +# Plexus XML -[](https://github.com/codehaus-plexus/plexus-xml/actions) -[](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) -[](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) +[](https://central.sonatype.com/artifact/org.codehaus.plexus/plexus-xml) +[](https://github.com/codehaus-plexus/plexus-xml/actions) [](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/plexus/plexus-xml/README.md) -This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) that: +The XML classes — `Xpp3Dom`, `Xpp3DomBuilder`, `Xpp3DomWriter` and the XML pull parser — that used to live in +`plexus-utils`, in the packages `org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`. -1. have been extracted from [`plexus-utils`](https://github.com/codehaus-plexus/plexus-utils/) 4:\ - this step is released as `plexus-xml` 3, maintained in [3.x branch](tree/3.x)\ - [](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml), - -2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-rc-2/api/maven-api-xml)/[`maven-xml`](https://github.com/apache/maven/tree/maven-4.0.0-rc-2/maven-xml):\ - this is the `master` branch from which `plexus-xml` 4 is released\ - Version 4.x requires Java 17 (like Maven 4) - [](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) +## Status -For publishing [the site](https://codehaus-plexus.github.io/plexus-xml/) do the following: +Maintained. **Two lines exist and they are not interchangeable** — pick deliberately: +| Line | Requires | Works under | Use when | +|-------|-------------|---------------------|-----------------------------------------------------------| +| `3.x` | Java 8 | Maven 3 and Maven 4 | You split from `plexus-utils` 4 and want the same classes | +| `4.x` | **Java 17** | **Maven 4 only** | You are building for Maven 4 | + +`3.x` is the straight extraction from `plexus-utils` 4 — same classes, same packages — and is maintained on +the [`3.x` branch](https://github.com/codehaus-plexus/plexus-xml/tree/3.x). + +`4.x` is rebuilt on Maven 4's [`maven-xml-api`](https://maven.apache.org/ref/4-LATEST/api/maven-api-xml/) +and works only under Maven 4. + +If you are here because upgrading `plexus-utils` 3 → 4 gave you a `NoClassDefFoundError` on `Xpp3Dom`, +you want **`3.x`**. + +## Using it + +```xml +<dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-xml</artifactId> +</dependency> ``` -mvn -Preporting verify site site:stage scm-publish:publish-scm -``` +Check the badge above for the current version, and read the table before taking it. + +## Requirements + +Java 17 for `4.x`. Java 8 for `3.x`. + +## Documentation + +- [Project site](https://codehaus-plexus.github.io/plexus-xml/) +- [Javadoc](https://javadoc.io/doc/org.codehaus.plexus/plexus-xml) +- [Release notes](https://github.com/codehaus-plexus/plexus-xml/releases) + +## Contributing + +See [CONTRIBUTING.md](https://github.com/codehaus-plexus/.github/blob/master/CONTRIBUTING.md). In short: +`mvn verify` builds, and run `mvn spotless:apply` before pushing or CI will fail on formatting. + +Please report security vulnerabilities privately — see +[SECURITY.md](https://github.com/codehaus-plexus/.github/blob/master/SECURITY.md), not a public issue. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/pom.xml new/plexus-xml-plexus-xml-4.2.1/pom.xml --- old/plexus-xml-plexus-xml-4.1.1/pom.xml 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/pom.xml 2026-11-14 15:25:33.000000000 +0100 @@ -20,11 +20,11 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus</artifactId> - <version>25</version> + <version>27</version> </parent> <artifactId>plexus-xml</artifactId> - <version>4.1.1</version> + <version>4.2.1</version> <name>Plexus XML Utilities</name> <description>A collection of various utility classes to ease working with XML.</description> @@ -41,7 +41,7 @@ <scm> <connection>scm:git:https://github.com/codehaus-plexus/plexus-xml.git</connection> <developerConnection>${project.scm.connection}</developerConnection> - <tag>plexus-xml-4.1.1</tag> + <tag>plexus-xml-4.2.1</tag> <url>https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/</url> </scm> <issueManagement> @@ -58,20 +58,22 @@ <properties> <javaVersion>17</javaVersion> <jmhVersion>1.37</jmhVersion> - <project.build.outputTimestamp>2026-01-25T22:28:14Z</project.build.outputTimestamp> + <mavenXmlVersion>4.0.0-rc-7</mavenXmlVersion> + <project.build.outputTimestamp>2026-11-14T14:25:12Z</project.build.outputTimestamp> </properties> <dependencies> <dependency> <groupId>org.apache.maven</groupId> + <artifactId>maven-api-xml</artifactId> + <version>${mavenXmlVersion}</version> + </dependency> + <!-- XmlService resolves its implementation through ServiceLoader; nothing here compiles against it. --> + <dependency> + <groupId>org.apache.maven</groupId> <artifactId>maven-xml</artifactId> - <version>4.0.0-rc-5</version> - <exclusions> - <exclusion> - <groupId>org.eclipse.sisu</groupId> - <artifactId>org.eclipse.sisu.plexus</artifactId> - </exclusion> - </exclusions> + <version>${mavenXmlVersion}</version> + <scope>runtime</scope> </dependency> <dependency> <groupId>org.openjdk.jmh</groupId> @@ -119,6 +121,17 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifestEntries> + <Automatic-Module-Name>org.codehaus.plexus.util.xml</Automatic-Module-Name> + </manifestEntries> + </archive> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <!-- required to ensure the test classes are used, not surefire's plexus-utils --> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/XmlNodePullBuilder.java new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/XmlNodePullBuilder.java --- old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/XmlNodePullBuilder.java 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/XmlNodePullBuilder.java 2026-11-14 15:25:33.000000000 +0100 @@ -0,0 +1,112 @@ +package org.codehaus.plexus.util.xml; + +/* + * Copyright The Codehaus Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.api.xml.XmlNode; +import org.codehaus.plexus.util.xml.pull.MXParser; +import org.codehaus.plexus.util.xml.pull.XmlPullParser; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Builds an {@link XmlNode} from the {@link XmlPullParser} in this artifact. + * <p> + * This is a port of {@code org.apache.maven.internal.xml.XmlNodeBuilder} from Apache Maven, which is deprecated + * there and which reaches back into this artifact for its parser. {@link org.apache.maven.api.xml.XmlService} is + * the supported replacement for reading a {@code Reader} or {@code InputStream}, but it parses through StAX and + * exposes neither an {@link XmlPullParser} overload nor a trim flag, so it cannot serve + * {@link Xpp3DomBuilder#build(XmlPullParser, boolean, Xpp3DomBuilder.InputLocationBuilder)} or the + * {@code trim == false} callers. + * <p> + * All methods attempt to fully parse the XML. The caller is responsible for closing {@code InputStream} and + * {@code Reader} arguments. + */ +final class XmlNodePullBuilder { + + private XmlNodePullBuilder() {} + + static XmlNode build(InputStream is, String encoding, boolean trim) throws XmlPullParserException, IOException { + XmlPullParser parser = new MXParser(); + parser.setInput(is, encoding); + return build(parser, trim, null); + } + + static XmlNode build(Reader reader, boolean trim, Xpp3DomBuilder.InputLocationBuilder locationBuilder) + throws XmlPullParserException, IOException { + XmlPullParser parser = new MXParser(); + parser.setInput(reader); + return build(parser, trim, locationBuilder); + } + + static XmlNode build(XmlPullParser parser, boolean trim, Xpp3DomBuilder.InputLocationBuilder locationBuilder) + throws XmlPullParserException, IOException { + boolean spacePreserve = false; + String name = null; + String value = null; + Object location = null; + Map<String, String> attrs = null; + List<XmlNode> children = null; + int eventType = parser.getEventType(); + boolean emptyTag = false; + while (eventType != XmlPullParser.END_DOCUMENT) { + if (eventType == XmlPullParser.START_TAG) { + emptyTag = parser.isEmptyElementTag(); + if (name == null) { + name = parser.getName(); + location = locationBuilder != null ? locationBuilder.toInputLocation(parser) : null; + int attributesSize = parser.getAttributeCount(); + if (attributesSize > 0) { + attrs = new HashMap<>(); + for (int i = 0; i < attributesSize; i++) { + String aname = parser.getAttributeName(i); + String avalue = parser.getAttributeValue(i); + attrs.put(aname, avalue); + spacePreserve = spacePreserve || ("xml:space".equals(aname) && "preserve".equals(avalue)); + } + } + } else { + if (children == null) { + children = new ArrayList<>(); + } + children.add(build(parser, trim, locationBuilder)); + } + } else if (eventType == XmlPullParser.TEXT) { + String text = parser.getText(); + if (trim && !spacePreserve) { + text = text.trim(); + } + value = value != null ? value + text : text; + } else if (eventType == XmlPullParser.END_TAG) { + return XmlNode.newInstance( + name, + children == null ? (value != null ? value : emptyTag ? null : "") : null, + attrs, + children, + location); + } + eventType = parser.next(); + } + throw new IllegalStateException("End of document found before returning to 0 depth"); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java --- old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java 2026-11-14 15:25:33.000000000 +0100 @@ -24,7 +24,7 @@ import java.util.Map; import org.apache.maven.api.xml.XmlNode; -import org.apache.maven.internal.xml.XmlNodeImpl; +import org.apache.maven.api.xml.XmlService; import org.codehaus.plexus.util.xml.pull.XmlSerializer; /** @@ -33,26 +33,26 @@ public class Xpp3Dom implements Serializable { private static final String[] EMPTY_STRING_ARRAY = new String[0]; - public static final String CHILDREN_COMBINATION_MODE_ATTRIBUTE = XmlNode.CHILDREN_COMBINATION_MODE_ATTRIBUTE; + public static final String CHILDREN_COMBINATION_MODE_ATTRIBUTE = XmlService.CHILDREN_COMBINATION_MODE_ATTRIBUTE; - public static final String CHILDREN_COMBINATION_MERGE = XmlNode.CHILDREN_COMBINATION_MERGE; + public static final String CHILDREN_COMBINATION_MERGE = XmlService.CHILDREN_COMBINATION_MERGE; - public static final String CHILDREN_COMBINATION_APPEND = XmlNode.CHILDREN_COMBINATION_APPEND; + public static final String CHILDREN_COMBINATION_APPEND = XmlService.CHILDREN_COMBINATION_APPEND; /** * This default mode for combining children DOMs during merge means that where element names match, the process will * try to merge the element data, rather than putting the dominant and recessive elements (which share the same * element name) as siblings in the resulting DOM. */ - public static final String DEFAULT_CHILDREN_COMBINATION_MODE = XmlNode.DEFAULT_CHILDREN_COMBINATION_MODE; + public static final String DEFAULT_CHILDREN_COMBINATION_MODE = XmlService.DEFAULT_CHILDREN_COMBINATION_MODE; - public static final String SELF_COMBINATION_MODE_ATTRIBUTE = XmlNode.SELF_COMBINATION_MODE_ATTRIBUTE; + public static final String SELF_COMBINATION_MODE_ATTRIBUTE = XmlService.SELF_COMBINATION_MODE_ATTRIBUTE; - public static final String SELF_COMBINATION_OVERRIDE = XmlNode.SELF_COMBINATION_OVERRIDE; + public static final String SELF_COMBINATION_OVERRIDE = XmlService.SELF_COMBINATION_OVERRIDE; - public static final String SELF_COMBINATION_MERGE = XmlNode.SELF_COMBINATION_MERGE; + public static final String SELF_COMBINATION_MERGE = XmlService.SELF_COMBINATION_MERGE; - public static final String SELF_COMBINATION_REMOVE = XmlNode.SELF_COMBINATION_REMOVE; + public static final String SELF_COMBINATION_REMOVE = XmlService.SELF_COMBINATION_REMOVE; /** * This default mode for combining a DOM node during merge means that where element names match, the process will @@ -60,17 +60,17 @@ * dominant one. This means that wherever the dominant element doesn't provide the value or a particular attribute, * that value or attribute will be set from the recessive DOM node. */ - public static final String DEFAULT_SELF_COMBINATION_MODE = XmlNode.DEFAULT_SELF_COMBINATION_MODE; + public static final String DEFAULT_SELF_COMBINATION_MODE = XmlService.DEFAULT_SELF_COMBINATION_MODE; - public static final String ID_COMBINATION_MODE_ATTRIBUTE = XmlNode.ID_COMBINATION_MODE_ATTRIBUTE; + public static final String ID_COMBINATION_MODE_ATTRIBUTE = XmlService.ID_COMBINATION_MODE_ATTRIBUTE; - public static final String KEYS_COMBINATION_MODE_ATTRIBUTE = XmlNode.KEYS_COMBINATION_MODE_ATTRIBUTE; + public static final String KEYS_COMBINATION_MODE_ATTRIBUTE = XmlService.KEYS_COMBINATION_MODE_ATTRIBUTE; private ChildrenTracking childrenTracking; private XmlNode dom; public Xpp3Dom(String name) { - this.dom = new XmlNodeImpl(name); + this.dom = XmlNode.newBuilder().name(name).build(); } /** @@ -79,7 +79,7 @@ * @param name The name of the Dom. */ public Xpp3Dom(String name, Object inputLocation) { - this.dom = new XmlNodeImpl(name, null, null, null, inputLocation); + this.dom = XmlNode.newBuilder().name(name).inputLocation(inputLocation).build(); } /** @@ -96,7 +96,8 @@ * @param name The name of the Dom. */ public Xpp3Dom(Xpp3Dom src, String name) { - this.dom = new XmlNodeImpl(src.dom, name); + this.dom = XmlNode.newInstance( + name, src.dom.value(), src.dom.attributes(), src.dom.children(), src.dom.inputLocation()); } public Xpp3Dom(XmlNode dom) { @@ -122,7 +123,7 @@ // ---------------------------------------------------------------------- public String getName() { - return dom.getName(); + return dom.name(); } // ---------------------------------------------------------------------- @@ -130,11 +131,11 @@ // ---------------------------------------------------------------------- public String getValue() { - return dom.getValue(); + return dom.value(); } public void setValue(String value) { - update(new XmlNodeImpl(dom.getName(), value, dom.getAttributes(), dom.getChildren(), dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), value, dom.attributes(), dom.children(), dom.inputLocation())); } // ---------------------------------------------------------------------- @@ -142,11 +143,11 @@ // ---------------------------------------------------------------------- public String[] getAttributeNames() { - return dom.getAttributes().keySet().toArray(EMPTY_STRING_ARRAY); + return dom.attributes().keySet().toArray(EMPTY_STRING_ARRAY); } public String getAttribute(String name) { - return dom.getAttribute(name); + return dom.attribute(name); } /** @@ -157,11 +158,10 @@ */ public boolean removeAttribute(String name) { if (name != null && !name.isEmpty()) { - Map<String, String> attrs = new HashMap<>(dom.getAttributes()); + Map<String, String> attrs = new HashMap<>(dom.attributes()); boolean ret = attrs.remove(name) != null; if (ret) { - update(new XmlNodeImpl( - dom.getName(), dom.getValue(), attrs, dom.getChildren(), dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), dom.value(), attrs, dom.children(), dom.inputLocation())); } return ret; } @@ -181,9 +181,9 @@ if (null == name) { throw new NullPointerException("Attribute name can not be null"); } - Map<String, String> attrs = new HashMap<>(dom.getAttributes()); + Map<String, String> attrs = new HashMap<>(dom.attributes()); attrs.put(name, value); - update(new XmlNodeImpl(dom.getName(), dom.getValue(), attrs, dom.getChildren(), dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), dom.value(), attrs, dom.children(), dom.inputLocation())); } // ---------------------------------------------------------------------- @@ -191,46 +191,46 @@ // ---------------------------------------------------------------------- public Xpp3Dom getChild(int i) { - return new Xpp3Dom(dom.getChildren().get(i), this); + return new Xpp3Dom(dom.children().get(i), this); } public Xpp3Dom getChild(String name) { - XmlNode child = dom.getChild(name); + XmlNode child = dom.child(name); return child != null ? new Xpp3Dom(child, this) : null; } public void addChild(Xpp3Dom xpp3Dom) { - List<XmlNode> children = new ArrayList<>(dom.getChildren()); + List<XmlNode> children = new ArrayList<>(dom.children()); children.add(xpp3Dom.dom); xpp3Dom.childrenTracking = this::replace; - update(new XmlNodeImpl(dom.getName(), dom.getValue(), dom.getAttributes(), children, dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), dom.value(), dom.attributes(), children, dom.inputLocation())); } public Xpp3Dom[] getChildren() { - return dom.getChildren().stream().map(d -> new Xpp3Dom(d, this)).toArray(Xpp3Dom[]::new); + return dom.children().stream().map(d -> new Xpp3Dom(d, this)).toArray(Xpp3Dom[]::new); } public Xpp3Dom[] getChildren(String name) { - return dom.getChildren().stream() - .filter(c -> c.getName().equals(name)) + return dom.children().stream() + .filter(c -> c.name().equals(name)) .map(d -> new Xpp3Dom(d, this)) .toArray(Xpp3Dom[]::new); } public int getChildCount() { - return dom.getChildren().size(); + return dom.children().size(); } public void removeChild(int i) { - List<XmlNode> children = new ArrayList<>(dom.getChildren()); + List<XmlNode> children = new ArrayList<>(dom.children()); children.remove(i); - update(new XmlNodeImpl(dom.getName(), dom.getValue(), dom.getAttributes(), children, dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), dom.value(), dom.attributes(), children, dom.inputLocation())); } public void removeChild(Xpp3Dom child) { - List<XmlNode> children = new ArrayList<>(dom.getChildren()); + List<XmlNode> children = new ArrayList<>(dom.children()); children.remove(child.dom); - update(new XmlNodeImpl(dom.getName(), dom.getValue(), dom.getAttributes(), children, dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), dom.value(), dom.attributes(), children, dom.inputLocation())); } // ---------------------------------------------------------------------- @@ -252,7 +252,7 @@ * @return input location */ public Object getInputLocation() { - return dom.getInputLocation(); + return dom.inputLocation(); } /** @@ -260,7 +260,7 @@ * @param inputLocation input location to set */ public void setInputLocation(Object inputLocation) { - update(new XmlNodeImpl(dom.getName(), dom.getValue(), dom.getAttributes(), dom.getChildren(), inputLocation)); + update(XmlNode.newInstance(dom.name(), dom.value(), dom.attributes(), dom.children(), inputLocation)); } // ---------------------------------------------------------------------- @@ -319,7 +319,7 @@ if (recessive == null) { return; } - dominant.dom = dominant.dom.merge(recessive.dom, childMergeOverride); + dominant.dom = XmlService.merge(dominant.dom, recessive.dom, childMergeOverride); } /** @@ -407,9 +407,9 @@ } private boolean replace(Object prevChild, Object newChild) { - List<XmlNode> children = new ArrayList<>(dom.getChildren()); + List<XmlNode> children = new ArrayList<>(dom.children()); children.replaceAll(d -> d == prevChild ? (XmlNode) newChild : d); - update(new XmlNodeImpl(dom.getName(), dom.getValue(), dom.getAttributes(), children, dom.getInputLocation())); + update(XmlNode.newInstance(dom.name(), dom.value(), dom.attributes(), children, dom.inputLocation())); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3DomBuilder.java new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3DomBuilder.java --- old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3DomBuilder.java 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3DomBuilder.java 2026-11-14 15:25:33.000000000 +0100 @@ -20,7 +20,6 @@ import java.io.InputStream; import java.io.Reader; -import org.apache.maven.internal.xml.XmlNodeBuilder; import org.codehaus.plexus.util.xml.pull.XmlPullParser; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; @@ -49,7 +48,7 @@ public static Xpp3Dom build(InputStream is, String encoding, boolean trim) throws XmlPullParserException, IOException { try (InputStream closeMe = is) { - return new Xpp3Dom(XmlNodeBuilder.build(is, encoding, trim)); + return new Xpp3Dom(XmlNodePullBuilder.build(is, encoding, trim)); } } @@ -63,8 +62,7 @@ public static Xpp3Dom build(Reader reader, boolean trim, InputLocationBuilder locationBuilder) throws XmlPullParserException, IOException { try (Reader closeMe = reader) { - return new Xpp3Dom(XmlNodeBuilder.build( - reader, trim, locationBuilder != null ? locationBuilder::toInputLocation : null)); + return new Xpp3Dom(XmlNodePullBuilder.build(reader, trim, locationBuilder)); } } @@ -81,8 +79,7 @@ */ public static Xpp3Dom build(XmlPullParser parser, boolean trim, InputLocationBuilder locationBuilder) throws XmlPullParserException, IOException { - return new Xpp3Dom( - XmlNodeBuilder.build(parser, trim, locationBuilder != null ? locationBuilder::toInputLocation : null)); + return new Xpp3Dom(XmlNodePullBuilder.build(parser, trim, locationBuilder)); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java --- old/plexus-xml-plexus-xml-4.1.1/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java 2026-11-14 15:25:33.000000000 +0100 @@ -2445,6 +2445,7 @@ if (pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = cch; if (cch2 != 0) { + if (pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = cch2; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/site/site.xml new/plexus-xml-plexus-xml-4.2.1/src/site/site.xml --- old/plexus-xml-plexus-xml-4.1.1/src/site/site.xml 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/site/site.xml 2026-11-14 15:25:33.000000000 +0100 @@ -29,7 +29,6 @@ <menu name="Overview"> <item name="Introduction" href="index.html"/> <item name="JavaDocs" href="apidocs/index.html"/> - <item name="Source Xref" href="xref/index.html"/> <!--item name="FAQ" href="faq.html"/--> </menu> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java new/plexus-xml-plexus-xml-4.2.1/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java --- old/plexus-xml-plexus-xml-4.1.1/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java 2026-11-14 15:25:33.000000000 +0100 @@ -23,7 +23,6 @@ import java.util.Map; import org.apache.maven.api.xml.XmlNode; -import org.apache.maven.internal.xml.XmlNodeImpl; import org.codehaus.plexus.util.xml.pull.XmlPullParser; import org.junit.jupiter.api.Test; @@ -227,7 +226,7 @@ attributes.put(null, "nullKey"); List<XmlNode> childList = new ArrayList<>(); childList.add(null); - Xpp3Dom dom2 = new Xpp3Dom(new XmlNodeImpl(dom.getName(), null, attributes, childList, null)); + Xpp3Dom dom2 = new Xpp3Dom(XmlNode.newInstance(dom.getName(), null, attributes, childList, null)); assertNotEquals(dom, dom2); assertNotEquals(dom2, dom); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-xml-plexus-xml-4.1.1/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java new/plexus-xml-plexus-xml-4.2.1/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java --- old/plexus-xml-plexus-xml-4.1.1/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java 2026-01-25 23:28:19.000000000 +0100 +++ new/plexus-xml-plexus-xml-4.2.1/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java 2026-11-14 15:25:33.000000000 +0100 @@ -49,6 +49,29 @@ * @throws java.lang.Exception if any. */ @Test + void commentSurrogatePairAtBufferBoundary() throws Exception { + MXParser parser = new MXParser(); + java.lang.reflect.Field pcField = MXParser.class.getDeclaredField("pc"); + pcField.setAccessible(true); + int pcLength = ((char[]) pcField.get(parser)).length; + + // The leading CR switches the parser to its parsed-content buffer, which then holds the + // normalised LF plus pcLength - 2 characters; the surrogate pair needs the last two slots. + StringBuilder comment = new StringBuilder("\r"); + for (int i = 0; i < pcLength - 2; i++) { + comment.append('a'); + } + comment.append("\uD83D\uDE00"); + + parser.setInput(new StringReader("<root><!--" + comment + "--></root>")); + + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals(XmlPullParser.COMMENT, parser.nextToken()); + assertEquals("\n" + comment.substring(1), parser.getText()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + } + + @Test void hexadecimalEntities() throws Exception { MXParser parser = new MXParser(); ++++++ plexus-xml4-build.xml ++++++ --- /var/tmp/diff_new_pack.nWNZtX/_old 2026-11-16 09:14:18.876499680 +0100 +++ /var/tmp/diff_new_pack.nWNZtX/_new 2026-11-16 09:14:18.879499806 +0100 @@ -8,7 +8,7 @@ <property name="project.groupId" value="org.codehaus.plexus"/> <property name="project.artifactId" value="plexus-xml"/> - <property name="project.version" value="4.1.1"/> + <property name="project.version" value="4.2.1"/> <property name="compiler.release" value="8"/> <property name="compiler.source" value="1.${compiler.release}"/> @@ -106,7 +106,14 @@ compress="true" index="false" basedir="${build.outputDir}" - excludes="**/package.html"/> + excludes="**/package.html"> + <manifest> + <attribute name="Automatic-Module-Name" value="org.codehaus.plexus.util.xml"/> + <attribute name="JavaPackages-ArtifactId" value="${project.artifactId}"/> + <attribute name="JavaPackages-GroupId" value="${project.groupId}"/> + <attribute name="JavaPackages-Version" value="${project.version}"/> + </manifest> + </jar> </target> <!-- ====================================================================== -->
