gnodet commented on code in PR #2222:
URL: https://github.com/apache/maven-resolver/pull/2222#discussion_r4793083588
##########
maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java:
##########
@@ -131,10 +131,9 @@ public DependencyGraphParser() {
* Parse the given graph definition.
*/
public DependencyNode parseLiteral(String dependencyGraph) throws
IOException {
- BufferedReader reader = new BufferedReader(new
StringReader(dependencyGraph));
- DependencyNode node = parse(reader);
Review Comment:
**Nit (optional):**
Close exception handling changed from suppressing all exceptions to
propagating them when parse succeeds. The old try-finally suppressed all
IOExceptions from close(), even after successful parse(). Try-with-resources
now propagates close() exceptions when parse() succeeds, losing the parse
result. While more correct per Java best practices, this breaks backward
compatibility.
**Failure scenario:** URL resource opens, parse() succeeds and returns a
valid DependencyNode, but InputStreamReader.close() or InputStream.close()
throws IOException → old code returns the node and suppresses the exception,
new code throws IOException and caller loses the parse result.
**Fix:** Document this behavior change in the commit message and release
notes.
--
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]