This is an automated email from the ASF dual-hosted git repository.

adangel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 1b2dbbc4b3d77725c79428f5c2cf9bb6f4be965c
Author: Andreas Dangel <adan...@apache.org>
AuthorDate: Wed Jan 10 18:50:37 2018 +0100

    Fix PMD, remove unnecessary suppress warnings
---
 .../apache/maven/plugins/pmd/AbstractPmdReport.java    | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java 
b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
index ec2b056..af11911 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
@@ -274,7 +274,6 @@ public abstract class AbstractPmdReport
             else
             {
                 // Not yet generated - check if the report is on its way
-                @SuppressWarnings( "unchecked" )
                 List<ReportPlugin> reportPlugins = project.getReportPlugins();
                 for ( ReportPlugin plugin : reportPlugins )
                 {
@@ -347,18 +346,15 @@ public abstract class AbstractPmdReport
         {
             testSourceRoots = project.getTestCompileSourceRoots();
         }
-        if ( includeTests )
+        if ( includeTests && testSourceRoots != null )
         {
-            if ( testSourceRoots != null )
+            for ( String root : testSourceRoots )
             {
-                for ( String root : testSourceRoots )
+                File sroot = new File( root );
+                if ( sroot.exists() )
                 {
-                    File sroot = new File( root );
-                    if ( sroot.exists() )
-                    {
-                        String testXref = constructXRefLocation( true );
-                        directories.add( new PmdFileInfo( project, sroot, 
testXref ) );
-                    }
+                    String testXref = constructXRefLocation( true );
+                    directories.add( new PmdFileInfo( project, sroot, testXref 
) );
                 }
             }
         }
@@ -366,7 +362,6 @@ public abstract class AbstractPmdReport
         {
             for ( MavenProject localProject : reactorProjects )
             {
-                @SuppressWarnings( "unchecked" )
                 List<String> localCompileSourceRoots = 
localProject.getCompileSourceRoots();
                 for ( String root : localCompileSourceRoots )
                 {
@@ -379,7 +374,6 @@ public abstract class AbstractPmdReport
                 }
                 if ( includeTests )
                 {
-                    @SuppressWarnings( "unchecked" )
                     List<String> localTestCompileSourceRoots = 
localProject.getTestCompileSourceRoots();
                     for ( String root : localTestCompileSourceRoots )
                     {

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <commits@maven.apache.org>.

Reply via email to