elharo opened a new pull request, #389:
URL: https://github.com/apache/maven-shared-utils/pull/389
`Xpp3Dom.getValue()` is annotated `@NonNull` (line 141) but can return
`null` when the instance was created via `new Xpp3Dom(name)` (the `value` field
is never initialized in the one-arg constructor).
**Fix:**
- `getValue()` now returns `""` when the internal `value` field is null,
upholding the `@NonNull` contract
- Added package-private `isValueSet()` method so `Xpp3DomWriter` can
distinguish between "value was explicitly set to empty string" and "value was
never set" — preserving the existing serialization behavior (elements with
unset values serialize as self-closing tags)
The builder at `Xpp3DomBuilder.java:201` already worked around this with
`element.setValue(""); // null in xpp3dom, but we don't do that around here`.
Fixes https://github.com/apache/maven-shared-utils/issues/388
--
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]