You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2016/02/15 20:05:13 UTC

svn commit: r1730597 - /maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java

Author: adangel
Date: Mon Feb 15 19:05:13 2016
New Revision: 1730597

URL: http://svn.apache.org/viewvc?rev=1730597&view=rev
Log:
[MPMD-178] use canonicalPaths to compare the directories

Modified:
    maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java

Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java?rev=1730597&r1=1730596&r2=1730597&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java Mon Feb 15 19:05:13 2016
@@ -384,12 +384,21 @@ public abstract class AbstractPmdReport
         boolean returnVal = false;
         for ( File excludeDir : excludeRootFiles )
         {
-            if ( sourceDirectoryToCheck.getAbsolutePath().startsWith( excludeDir.getAbsolutePath() ) )
+            try
             {
-                getLog().debug( "Directory " + sourceDirectoryToCheck.getAbsolutePath()
-                                    + " has been excluded as it matches excludeRoot " + excludeDir.getAbsolutePath() );
-                returnVal = true;
-                break;
+                if ( sourceDirectoryToCheck.getCanonicalPath().startsWith( excludeDir.getCanonicalPath() ) )
+                {
+                    getLog().debug( "Directory " + sourceDirectoryToCheck.getAbsolutePath()
+                                        + " has been excluded as it matches excludeRoot "
+                                        + excludeDir.getAbsolutePath() );
+                    returnVal = true;
+                    break;
+                }
+            }
+            catch ( IOException e )
+            {
+                getLog().warn( "Error while checking " + sourceDirectoryToCheck
+                               + " whether it should be excluded.", e );
             }
         }
         return returnVal;