This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch fix/xpp3dom-value-null in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 3c95941c5d89ac0822c4993fc47de2855b092afe Author: Elliotte Rusty Harold <[email protected]> AuthorDate: Wed Jul 1 08:44:22 2026 -0400 Add failing test: Xpp3Dom default value should not be null --- .../java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java b/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java index d64e9c4..a0a6b56 100644 --- a/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java +++ b/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java @@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test; import static org.apache.maven.shared.utils.xml.Xpp3Dom.mergeXpp3Dom; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -42,6 +43,13 @@ public class Xpp3DomTest { return t1s1; } + @Test + public void defaultValueIsNotNull() { + // getValue() is annotated @NonNull but the one-arg constructor + // did not initialize value, violating the contract. + assertNotNull(new Xpp3Dom("test").getValue()); + } + @Test public void mergePrecedenceSelfClosed() throws XmlPullParserException { Xpp3Dom parentConfig = build("<configuration><items><item/></items></configuration>");
