maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1055177 - in /maven/plugins/trunk/maven-changes-plugin/src/main: java/org/apache/maven/plugin/issues/ java/org/apache/maven/plugin/jira/ java/org/apache/maven/plugin/trac/ resources/
Date Tue, 04 Jan 2011 20:49:04 GMT
Author: dennisl
Date: Tue Jan  4 20:49:03 2011
New Revision: 1055177

URL: http://svn.apache.org/viewvc?rev=1055177&view=rev
Log:
o Use the Locale object when formating dates, instead of using manual formatting patterns
stored in resource bundles.

Modified:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.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/trac/TracMojo.java
    maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report.properties
    maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_de.properties
    maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_fr.properties
    maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_sv.properties

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java?rev=1055177&r1=1055176&r2=1055177&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java
Tue Jan  4 20:49:03 2011
@@ -22,9 +22,10 @@ package org.apache.maven.plugin.issues;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.reporting.MavenReportException;
 
+import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.List;
-import java.util.MissingResourceException;
+import java.util.Locale;
 import java.util.ResourceBundle;
 
 /**
@@ -64,13 +65,13 @@ public class IssuesReportGenerator
         sinkEndReport( sink );
     }
 
-    public void doGenerateReport( ResourceBundle bundle, Sink sink, List issueList )
+    public void doGenerateReport( ResourceBundle bundle, Sink sink, List issueList, Locale
locale )
     {
         sinkBeginReport( sink, bundle );
 
         constructHeaderRow( sink, issueList, bundle );
 
-        constructDetailRows( sink, issueList, bundle );
+        constructDetailRows( sink, issueList, bundle, locale );
 
         sinkEndReport( sink );
     }
@@ -155,7 +156,7 @@ public class IssuesReportGenerator
         sink.tableRow_();
     }
 
-    private void constructDetailRows( Sink sink, List issueList, ResourceBundle bundle )
+    private void constructDetailRows( Sink sink, List issueList, ResourceBundle bundle, Locale
locale )
     {
         if ( issueList == null )
         {
@@ -164,15 +165,8 @@ public class IssuesReportGenerator
 
         for ( int idx = 0; idx < issueList.size(); idx++ )
         {
-            SimpleDateFormat sdf;
-            try
-            {
-                sdf = new SimpleDateFormat( bundle.getString( "report.issues.dateformat"
) );
-            }
-            catch ( MissingResourceException mre )
-            {
-                sdf = new SimpleDateFormat();
-            }
+            // Use a DateFormat based on the the Locale
+            DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
 
             Issue issue = (Issue) issueList.get( idx );
 
@@ -191,7 +185,7 @@ public class IssuesReportGenerator
                         break;
 
                     case IssuesReportHelper.COLUMN_CREATED:
-                        sinkCell( sink, sdf.format( issue.getCreated() ) );
+                        sinkCell( sink, df.format( issue.getCreated() ) );
                         break;
 
                     case IssuesReportHelper.COLUMN_FIX_VERSION:
@@ -239,7 +233,7 @@ public class IssuesReportGenerator
                         break;
 
                     case IssuesReportHelper.COLUMN_UPDATED:
-                        sinkCell( sink, sdf.format( issue.getUpdated() ) );
+                        sinkCell( sink, df.format( issue.getUpdated() ) );
                         break;
 
                     case IssuesReportHelper.COLUMN_VERSION:

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=1055177&r1=1055176&r2=1055177&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
Tue Jan  4 20:49:03 2011
@@ -302,7 +302,7 @@ public class JiraMojo
                     getLog().info( "The JIRA Report will contain issues only for the current
version." );
                 }
 
-                report.doGenerateReport( getBundle( locale ), getSink(), issueList );
+                report.doGenerateReport( getBundle( locale ), getSink(), issueList, locale
);
             }
             else
             {

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java?rev=1055177&r1=1055176&r2=1055177&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
Tue Jan  4 20:49:03 2011
@@ -144,7 +144,7 @@ public class TracMojo
             {
                 try
                 {
-                    report.doGenerateReport( getBundle( locale ), getSink(), issueList );
+                    report.doGenerateReport( getBundle( locale ), getSink(), issueList, locale
);
                 }
                 catch ( Exception e )
                 {

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report.properties?rev=1055177&r1=1055176&r2=1055177&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report.properties (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report.properties Tue
Jan  4 20:49:03 2011
@@ -20,7 +20,6 @@ report.issues.description=Report on tick
 report.issues.error=An error occured that made it impossible to generate this report. \
   Please check the console for information on what might be the cause of this.
 report.issues.header=Trac Tickets
-report.issues.dateformat=dd MMM yy
 report.issues.label.assignee=Owner
 report.issues.label.component=Component
 report.issues.label.created=Created

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_de.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_de.properties?rev=1055177&r1=1055176&r2=1055177&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_de.properties
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_de.properties
Tue Jan  4 20:49:03 2011
@@ -20,7 +20,6 @@ report.issues.description=Bericht \u00FC
 report.issues.error=Es ist ein Fehler aufgetreten, der die Generierung dieses Berichts verhinderte.
\
   Bitte kontrollieren Sie die Konsolenausgabe im Hinblick auf Informationen \u00FCber die
Ursache.
 report.issues.header=Trac-Tickets
-report.issues.dateformat=dd MMM yy
 report.issues.label.assignee=Besitzer
 report.issues.label.component=Komponente
 report.issues.label.created=Erstellt

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_fr.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_fr.properties?rev=1055177&r1=1055176&r2=1055177&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_fr.properties
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_fr.properties
Tue Jan  4 20:49:03 2011
@@ -20,7 +20,6 @@ report.issues.description=Rapport des ti
 report.issues.error=Une erreur est survenue, ce qui ne permet pas de g\u00E9n\u00E9rer le
rapport. \
   Merci de v\u00E9rifier les traces dans la console pour conna\u00EEtre la cause de l'erreur.
 report.issues.header=Tickets Trac
-report.issues.dateformat=dd MMM yy
 report.issues.label.assignee=Propri\u00E9taire
 report.issues.label.component=Composant
 report.issues.label.created=Cr\u00E9e

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_sv.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_sv.properties?rev=1055177&r1=1055176&r2=1055177&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_sv.properties
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/trac-report_sv.properties
Tue Jan  4 20:49:03 2011
@@ -20,7 +20,6 @@ report.issues.description=Rapport \u00f6
 report.issues.error=Ett fel intr\u00e4ffade som gjorde det om\u00f6jligt att skapa denna
rapport. \
   V\u00e4nligen kontrollera kommandoraden f\u00f6r information om vad som kan ha orsakat
detta.
 report.issues.header=Trac-rapport
-report.issues.dateformat=yyyy-MM-dd
 report.issues.label.assignee=\u00c4gare
 report.issues.label.component=Komponent
 report.issues.label.created=Skapad



Mime
View raw message