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: dev-unsubscr...@hc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org