[ 
https://issues.apache.org/jira/browse/MPMD-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956778#comment-17956778
 ] 

ASF GitHub Bot commented on MPMD-412:
-------------------------------------

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


##########
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:
   maybe we should not skip exception and find root cause
   by the way all tests pass on CI, I also didn't have a problems locally





> Tests are inobviously broken due to overly broad catch clauses
> --------------------------------------------------------------
>
>                 Key: MPMD-412
>                 URL: https://issues.apache.org/jira/browse/MPMD-412
>             Project: Maven PMD Plugin (Moved to GitHub Issues)
>          Issue Type: Bug
>            Reporter: Elliotte Rusty Harold
>            Priority: Blocker
>
> See https://github.com/apache/maven-pmd-plugin/pull/178
> We're catching java.lang.Exception and thus often missing that the wrong 
> exception is being caught, and that the test is in fact failing. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to