pzygielo commented on code in PR #226:
URL: https://github.com/apache/maven-pmd-plugin/pull/226#discussion_r2134618260


##########
src/test/java/org/apache/maven/plugins/pmd/stubs/CustomConfigurationMavenProjectStub.java:
##########
@@ -40,35 +41,26 @@ public class CustomConfigurationMavenProjectStub extends 
PmdProjectStub {
 
     private List<ReportPlugin> reportPlugins = new ArrayList<>();
 
-    public CustomConfigurationMavenProjectStub() {
+    public CustomConfigurationMavenProjectStub() throws IOException, 
XmlPullParserException {
         MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
 
-        try (InputStream is = new FileInputStream(new File(getBasedir() + "/" 
+ getPOM()))) {
-            model = pomReader.read(is);
-            setModel(model);
-        } catch (Exception e) {
-        }
+        InputStream in = new FileInputStream(getBasedir() + "/" + getPOM());

Review Comment:
   If I auto-close this renamed `in` here, with try-with-resources, no test 
fails on me:
   ```
   Tests run: 50, Failures: 0, Errors: 0, Skipped: 0
   ```
   How to see the failure _when the `pomReader` closes the inputstream_? In 
which test? When `pomReader` does that?



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to