You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2007/07/08 16:00:47 UTC

svn commit: r554369 - in /maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira: AbstractJiraDownloader.java JiraMojo.java JiraXML.java

Author: dennisl
Date: Sun Jul  8 07:00:47 2007
New Revision: 554369

URL: http://svn.apache.org/viewvc?view=rev&rev=554369
Log:
o Improve JavaDoc and logging.

Modified:
    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/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?view=diff&rev=554369&r1=554368&r2=554369
==============================================================================
--- 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 Jul  8 07:00:47 2007
@@ -96,6 +96,7 @@
      */
     private String createFilter()
     {
+        // If the user has defined a filter - use that
         if ( ( this.filter != null ) && ( this.filter.length() > 0 ) )
         {
             if ( this.filter.charAt( 0 ) == '&' )
@@ -140,9 +141,9 @@
             }
         }
 
+        // get the Resolution Ids
         if ( resolutionIds != null )
         {
-            // get the Resolution Ids
             String[] resos = resolutionIds.split( "," );
 
             for ( int i = 0; i < resos.length; i++ )
@@ -156,7 +157,7 @@
             }
         }
 
-        // add all components
+        // add components
         if ( component != null )
         {
             String[] components = component.split( "," );
@@ -236,6 +237,7 @@
                         fullURL += "&fixfor=" + getFixFor();
                     }
 
+                    // @todo We can get a double && here if createFilter starts with an &
                     fullURL += "&" + createFilter();
 
                     fullURL += ( "&tempMax=" + nbEntriesMax + "&reset=true&decorator=none" );
@@ -281,7 +283,7 @@
 
         if ( pos >= 0 )
         {
-            // url
+            // project id
             id = url.substring( url.lastIndexOf( "=" ) + 1 );
         }
 
@@ -481,7 +483,7 @@
         {
             GetMethod gm = new GetMethod( link );
 
-            getLog().info( "Downloading " + link );
+            getLog().info( "Downloading from JIRA at: " + link );
 
             gm.setFollowRedirects( true );
 
@@ -526,10 +528,10 @@
 
                 pw.close();
 
-                getLog().info( "Downloading successful" );
+                getLog().info( "Downloading from JIRA was successful" );
             }
             else {
-                getLog().warn( "Downloading failed. Received: [" + gm.getStatusCode() + "]" );
+                getLog().warn( "Downloading from JIRA failed. Received: [" + gm.getStatusCode() + "]" );
             }
         }
         catch ( HttpException e )
@@ -540,7 +542,7 @@
             }
             else
             {
-                getLog().error( "Error downloading issues from JIRA url :  " + e.getLocalizedMessage() );
+                getLog().error( "Error downloading issues from JIRA url: " + e.getLocalizedMessage() );
 
             }
         }
@@ -548,7 +550,7 @@
         {
             if ( getLog().isDebugEnabled() )
             {
-                getLog().error( "Error downloading issues from JIRA :", e );
+                getLog().error( "Error downloading issues from JIRA:", e );
             }
             else
             {

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?view=diff&rev=554369&r1=554368&r2=554369
==============================================================================
--- 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 Jul  8 07:00:47 2007
@@ -40,7 +40,7 @@
     extends AbstractMavenReport
 {
     /**
-     * Output Directory of the report.
+     * Output directory where the report will be placed.
      * 
      * @parameter expression="${project.reporting.outputDirectory}"
      * @required
@@ -49,7 +49,7 @@
     private String outputDirectory;
 
     /**
-     * Path of the JIRA XML file to be parsed.
+     * Path to the JIRA XML file, which will be parsed.
      * 
      * @parameter expression="${project.build.directory}/jira-results.xml "
      * @required
@@ -93,42 +93,45 @@
     private int maxEntries;
 
     /**
-     * Defines the filter parameters to restrict the result issues from JIRA.
-     * The filter parameters property must use the same format of url parameters from the JIRA search.
+     * Defines the filter parameters to restrict which issues are retrieved
+     * from JIRA. The filter parameter must use the same format of url
+     * parameters that is used in a JIRA search.
      *
      * @parameter default-value=""
      */
     private String filter;
 
     /**
-     * Sets the status(es) of the project you want to limit your report to.
-     * Valid statuses are: Open, In Progress, Reopened, Resolved and Closed. Multiple values can be separated by commas.
+     * Sets the status(es) that you want to limit your report to include.
+     * Valid statuses are: Open, In Progress, Reopened, Resolved and Closed.
+     * Multiple values can be separated by commas.
      *
      * @parameter default-value=""
      */
     private String statusIds;
 
     /**
-     * Sets the resolution(s) of the project you want to limit your report to.
-     * Valid statuses are: Unresolved, Fixed, Won't Fix, Duplicate, Incomplete, Cannot Reproduce.
-     * Multiple values can be separated by commas.
+     * Sets the resolution(s) that you want to limit your report to include.
+     * Valid statuses are: Unresolved, Fixed, Won't Fix, Duplicate, Incomplete,
+     * Cannot Reproduce. Multiple values can be separated by commas.
      *
      * @parameter default-value=""
      */
     private String resolutionIds;
 
     /**
-     * Sets the priority(s) of the project you want to limit your report to.
-     * Valid statuses are: Blocker, Critical, Major, Minor, Trivial. Multiple values can be separated by commas.
+     * Sets the priority(s) that you want to limit your report to include.
+     * Valid statuses are: Blocker, Critical, Major, Minor, Trivial. Multiple
+     * values can be separated by commas.
      *
      * @parameter default-value=""
      */
     private String priorityIds;
 
     /**
-     * Sets the component(s) of the project you want to limit your report to.
+     * Sets the component(s) that you want to limit your report to include.
      * Multiple components can be separated by commas (such as 10011,10012).
-     * Default-value -  empty, meaning all components.
+     * If this is set to empty - that means all components.
      *
      * @parameter default-value=""
      */
@@ -175,7 +178,7 @@
     {
         JiraDownloader jiraDownloader = new JiraDownloader();
 
-        setJiraDownloaderParameter( jiraDownloader );
+        setJiraDownloaderParameters( jiraDownloader );
 
         JiraReportGenerator report;
 
@@ -237,7 +240,7 @@
         return ResourceBundle.getBundle( "jira-report", locale, this.getClass().getClassLoader() );
     }
 
-    private void setJiraDownloaderParameter( JiraDownloader jira )
+    private void setJiraDownloaderParameters( JiraDownloader jira )
     {
         jira.setLog( getLog() );
 
@@ -272,21 +275,21 @@
     {
         if ( project.getIssueManagement() == null )
         {
-            getLog().error( "No Issue Management set. JIRA Report will not be generated." );
+            getLog().error( "No Issue Management set. No JIRA Report will be generated." );
 
             return false;
         }
         else if ( ( project.getIssueManagement().getUrl() == null )
             || ( project.getIssueManagement().getUrl().trim().equals( "" ) ) )
         {
-            getLog().error( "No URL set in Issue Management. JIRA Report will not be generated." );
+            getLog().error( "No URL set in Issue Management. No JIRA Report will be generated." );
 
             return false;
         }
         else if ( ( project.getIssueManagement().getSystem() != null )
             && !( project.getIssueManagement().getSystem().equalsIgnoreCase( "jira" ) ) )
         {
-            getLog().error( "JIRA Report only supports JIRA.  JIRA Report will not be generated." );
+            getLog().error( "The JIRA Report only supports JIRA.  No JIRA Report will be generated." );
 
             return false;
         }

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?view=diff&rev=554369&r1=554368&r2=554369
==============================================================================
--- 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 Jul  8 07:00:47 2007
@@ -31,7 +31,9 @@
 import org.xml.sax.helpers.DefaultHandler;
 
 /**
- * XML parser for <code>JiraIssue</code>s.
+ * XML parser for <code>JiraIssue</code>s. This works on an XML file downloaded
+ * from JIRA and creates a List of issues that is exposed to the user of the
+ * class.
  *
  * @version $Id$
  */