Author: hboutemy
Date: Mon Oct 22 09:57:10 2007
New Revision: 587152

URL: http://svn.apache.org/viewvc?rev=587152&view=rev
Log:
read XML file as UTF-8 (instead of platform encoding)

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

Modified: 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java?rev=587152&r1=587151&r2=587152&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
 (original)
+++ 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
 Mon Oct 22 09:57:10 2007
@@ -565,7 +565,7 @@
                 // so we have to fix it
                 ClassLoader checkstyleClassLoader = 
PackageNamesLoader.class.getClassLoader();
                 Thread.currentThread().setContextClassLoader( 
checkstyleClassLoader );
-                
+
 
                 String configFile = getConfigFile();
                 Properties overridingProperties = getOverridingProperties();
@@ -574,11 +574,11 @@
                 CheckstyleResults results;
 
                 moduleFactory = getModuleFactory();
-                
+
                 config = ConfigurationLoader.loadConfiguration( configFile,
                                                                 new 
PropertiesExpander( overridingProperties ) );
                 results = executeCheckstyle( config, moduleFactory );
-                
+
                 ResourceBundle bundle = getBundle( locale );
                 generateReportStatics();
                 generateMainReport( results, config, moduleFactory, bundle );
@@ -780,7 +780,7 @@
         }
 
         FilterSet filterSet = getSuppressions();
-        
+
         Checker checker = new Checker();
 
         // setup classloader, needed to avoid "Unable to get class information
@@ -1103,7 +1103,7 @@
         try
         {
             File suppressionsFile = locator.resolveLocation( 
suppressionsLocation, "checkstyle-suppressions.xml" );
-            
+
             if ( suppressionsFile == null )
             {
                 return null;

Modified: 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java?rev=587152&r1=587151&r2=587152&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
 Mon Oct 22 09:57:10 2007
@@ -28,8 +28,10 @@
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileReader;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
 
 /**
  * Perform a violation check against the last Checkstyle run to see if there 
are
@@ -102,7 +104,8 @@
             try
             {
                 XmlPullParser xpp = new MXParser();
-                FileReader freader = new FileReader( outputFile );
+                // TODO: use ReaderFactory.newXmlReader() when plexus-utils 
can be upgraded
+                Reader freader = new InputStreamReader( new FileInputStream( 
outputFile ), "UTF-8" );
                 BufferedReader breader = new BufferedReader( freader );
                 xpp.setInput( breader );
 


Reply via email to