hutiefang76 opened a new issue, #4433:
URL: https://github.com/apache/hertzbeat/issues/4433
## Is there an existing issue for this?
- [x] I searched existing issues and pull requests.
## Current Behavior
XmlUtil.fromXml(String, TypeReference<T>) returns early when the XML string
is nonempty. Valid generic XML input therefore never reaches Jackson; null
input instead reaches the parser and can throw.
## Expected Behavior
Correct the inverted empty-input guard. Add map, list, nested generic,
null/empty/malformed input and Class-overload control tests. This repairs a
public utility; no current production caller of this overload was found.
## Steps To Reproduce
Call XmlUtil.fromXml("<root><name>hertzbeat</name></root>", new
TypeReference<Map<String,String>>() {}). Expected a map containing
name=hertzbeat; actual null. Calling the overload with a null String also fails
to follow its null-return contract.
## Environment
master at 40f5aac47e332f5240cc1a58ba7d201b4f456d2a. macOS, JDK 26 targeting
Java 25.
## Debug logs
JDK 26 targeting Java 25: XmlUtilTest, 5 tests passed using Maven verify
with default checkstyle/enforcer. The original implementation produced 3
failures and 1 error. Coverage reporting was skipped because no JaCoCo
execution file was produced.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]