garydgregory commented on PR #571:
URL:
https://github.com/apache/httpcomponents-client/pull/571#issuecomment-2306993341
Hello @massdosage
FWIW, `Paths.get("mozilla", "public-suffix-list.txt").toString()` would be
better here but not really needed unless `Path`s where used in the test. The
`"/"` does not matter in Java on or off Windows, Java normalizes the path for
the platform.
The test set up is also problematic because it leaks a file handle. We
should be using a try-with-resource here:
```java
// Create a matcher using a custom crafted public suffix list file
try (InputStream in = classLoader.getResourceAsStream(SOURCE_FILE)) {
Assertions.assertNotNull(in);
final List<PublicSuffixList> lists =
PublicSuffixListParser.INSTANCE.parseByType(new InputStreamReader(in,
StandardCharsets.UTF_8));
matcher = new PublicSuffixMatcher(lists);
}
```
I fixed the above resource leak in git master.
The issue remains with the odd test failure on my end though :-(
--
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]