maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1062358 - in /maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin: announcement/AnnouncementMojo.java jira/AbstractJiraDownloader.java jira/JiraMojo.java jira/JiraXML.java
Date Sun, 23 Jan 2011 10:15:09 GMT
Author: dennisl
Date: Sun Jan 23 10:15:09 2011
New Revision: 1062358

URL: http://svn.apache.org/viewvc?rev=1062358&view=rev
Log:
[MCHANGES-144] Add configuration if the encoding of JIRA xml file is not UTF-8

o Revert r1054263, as Hervé's solution in r1054373 solves the problem.

Modified:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraXML.java

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java?rev=1062358&r1=1062357&r2=1062358&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
Sun Jan 23 10:15:09 2011
@@ -277,15 +277,6 @@ public class AnnouncementMojo
     private File jiraXML;
 
     /**
-     * The encoding used in the JIRA XML file. You only need to change this if
-     * your JIRA server is returning responses in an encoding other than UTF-8.
-     *
-     * @parameter default-value="UTF-8" expression="${changes.jiraXmlEncoding}"
-     * @since 2.4
-     */
-    private String jiraXmlEncoding;
-
-    /**
      * The maximum number of issues to fetch from JIRA.
      * <p>
      * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was
@@ -620,8 +611,6 @@ public class AnnouncementMojo
 
         jiraDownloader.setJiraPassword( jiraPassword );
 
-        jiraDownloader.setJiraXmlEncoding( jiraXmlEncoding );
-
         jiraDownloader.setWebUser( webUser );
 
         jiraDownloader.setWebPassword( webPassword );

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java?rev=1062358&r1=1062357&r2=1062358&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
Sun Jan 23 10:15:09 2011
@@ -108,8 +108,6 @@ public abstract class AbstractJiraDownlo
     protected Map typeMap = new HashMap();
     /** The pattern used to parse dates from the JIRA xml file. */
     private String jiraDatePattern;
-    /** The encoding used to read the JIRA XML file. */
-    private String jiraXmlEncoding;
 
     /**
      * Creates a filter given the parameters and some defaults.
@@ -706,7 +704,7 @@ public abstract class AbstractJiraDownlo
     public List getIssueList() {
         if ( output.isFile() )
         {
-            JiraXML jira = new JiraXML( output, jiraXmlEncoding, log, jiraDatePattern );
+            JiraXML jira = new JiraXML( output, log, jiraDatePattern );
             return jira.getIssueList();
         }
         else {
@@ -720,11 +718,6 @@ public abstract class AbstractJiraDownlo
         this.jiraDatePattern = jiraDatePattern;
     }
 
-    public void setJiraXmlEncoding( String jiraXmlEncoding )
-    {
-        this.jiraXmlEncoding = jiraXmlEncoding;
-    }
-
     /**
      * Set the output file for the log.
      *

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java?rev=1062358&r1=1062357&r2=1062358&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
Sun Jan 23 10:15:09 2011
@@ -138,15 +138,6 @@ public class JiraMojo
     private String jiraUser;
 
     /**
-     * The encoding used in the JIRA XML file. You only need to change this if
-     * your JIRA server is returning responses in an encoding other than UTF-8.
-     *
-     * @parameter default-value="UTF-8" expression="${changes.jiraXmlEncoding}"
-     * @since 2.4
-     */
-    private String jiraXmlEncoding;
-
-    /**
      * Path to the JIRA XML file, which will be parsed.
      *
      * @parameter expression="${project.build.directory}/jira-results.xml"
@@ -406,8 +397,6 @@ public class JiraMojo
 
         issueDownloader.setJiraPassword( jiraPassword );
 
-        issueDownloader.setJiraXmlEncoding( jiraXmlEncoding );
-
         issueDownloader.setTypeIds( typeIds );
 
         issueDownloader.setWebUser( webUser );

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraXML.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraXML.java?rev=1062358&r1=1062357&r2=1062358&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraXML.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraXML.java
Sun Jan 23 10:15:09 2011
@@ -20,8 +20,6 @@ package org.apache.maven.plugin.jira;
  */
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -34,7 +32,6 @@ import javax.xml.parsers.SAXParserFactor
 import org.apache.maven.plugin.issues.Issue;
 import org.apache.maven.plugin.logging.Log;
 import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
@@ -62,7 +59,7 @@ public class JiraXML
 
     private SimpleDateFormat sdf = null;
 
-    public JiraXML( File xmlPath, String encoding, Log log, String datePattern )
+    public JiraXML( File xmlPath, Log log, String datePattern )
     {
         this.log = log;
         this.datePattern = datePattern;
@@ -78,7 +75,6 @@ public class JiraXML
         }
 
         SAXParserFactory factory = SAXParserFactory.newInstance();
-        FileInputStream fis = null;
 
         issueList = new ArrayList();
 
@@ -86,33 +82,12 @@ public class JiraXML
         {
             SAXParser saxParser = factory.newSAXParser();
 
-            fis = new FileInputStream( xmlPath );
-            InputSource inputSource = new InputSource( fis );
-            if ( encoding != null )
-            {
-                inputSource.setEncoding( encoding );
-            }
-
-            saxParser.parse( inputSource, this );
+            saxParser.parse( xmlPath, this );
         }
         catch ( Throwable t )
         {
             t.printStackTrace();
         }
-        finally
-        {
-            if ( fis != null )
-            {
-                try
-                {
-                    fis.close();
-                }
-                catch ( IOException e )
-                {
-                    // Ignore
-                }
-            }
-        }
     }
 
     public void startElement( String namespaceURI, String sName, String qName, Attributes
attrs )



Mime
View raw message