maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [maven-checkstyle-plugin] eolivelli commented on a change in pull request #17: [MCHECKSTYLE-385] rework code to use a Violation.java class.
Date Thu, 12 Dec 2019 13:22:21 GMT
eolivelli commented on a change in pull request #17: [MCHECKSTYLE-385] rework code to use a
Violation.java class.
URL: https://github.com/apache/maven-checkstyle-plugin/pull/17#discussion_r357139125
 
 

 ##########
 File path: src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
 ##########
 @@ -605,70 +610,118 @@ private void checkDeprecatedParameterUsage( Object parameter, String
name, Strin
         }
     }
 
-    private int countViolations( XmlPullParser xpp )
+    private List<Violation> getViolations( XmlPullParser xpp )
         throws XmlPullParserException, IOException
     {
-        int count = 0;
-        int ignoreCount = 0;
-        List<RuleUtil.Matcher> ignores = violationIgnore == null ? Collections.<RuleUtil.Matcher>emptyList()
-                        : RuleUtil.parseMatchers( violationIgnore.split( "," ) );
+        List<Violation> violations = new ArrayList<>();
 
         String basedir = project.getBasedir().getAbsolutePath();
         String file = "";
+
         for ( int eventType = xpp.getEventType(); eventType != XmlPullParser.END_DOCUMENT;
eventType = xpp.next() )
         {
             if ( eventType != XmlPullParser.START_TAG )
             {
                 continue;
             }
-            else if ( "file".equals( xpp.getName() ) )
+
+            if ( "file".equals( xpp.getName() ) )
 
 Review comment:
   I also prefer the 'else if' approach
   +1 to @elharo suggestion

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message