Author: rfscholte
Date: Fri Jan 13 23:56:46 2012
New Revision: 1231408

URL: http://svn.apache.org/viewvc?rev=1231408&view=rev
Log:
Fix MCHECKSTYLE-170: Test errors and failures on Windows

Modified:
    
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java

Modified: 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java?rev=1231408&r1=1231407&r2=1231408&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java
 (original)
+++ 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java
 Fri Jan 13 23:56:46 2012
@@ -24,6 +24,7 @@ import com.puppycrawl.tools.checkstyle.a
 import com.puppycrawl.tools.checkstyle.api.AutomaticBean;
 import com.puppycrawl.tools.checkstyle.api.Configuration;
 import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
+
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
@@ -122,10 +123,12 @@ public class CheckstyleReportListener
     /** {@inheritDoc} */
     public void fileStarted( AuditEvent event )
     {
+        final String fileName = StringUtils.replace( event.getFileName(), 
"\\", "/" );
+
         for ( File sourceDirectory : sourceDirectories )
         {
-            String sourceDirectoryPath = sourceDirectory.getPath();
-            String fileName = StringUtils.replace( event.getFileName(), "\\", 
"/" );
+            String sourceDirectoryPath = StringUtils.replace( 
sourceDirectory.getPath(), "\\", "/" );
+            
             if ( fileName.startsWith( sourceDirectoryPath + "/" ) )
             {
                 currentFile = StringUtils.substring( fileName, 
sourceDirectoryPath.length() + 1 );


Reply via email to