You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2008/07/19 19:37:18 UTC

svn commit: r678189 - /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java

Author: hboutemy
Date: Sat Jul 19 10:37:18 2008
New Revision: 678189

URL: http://svn.apache.org/viewvc?rev=678189&view=rev
Log:
o files under 1KB are displayed in KB instead of B ("0.50 KB" instead of "512.00 Bytes")
o display GB/MB/KB instead of (french) Go/Mo/Ko (no L10N yet)

Modified:
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java?rev=678189&r1=678188&r2=678189&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java Sat Jul 19 10:37:18 2008
@@ -36,6 +36,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -84,7 +85,7 @@
     /** Used to format file length values */
     private static final DecimalFormat FILE_LENGTH_DECIMAL_FORMAT = new FileDecimalFormat();
 
-    private static final HashSet JAR_SUBTYPE = new HashSet();
+    private static final Set JAR_SUBTYPE = new HashSet();
 
     private final Locale locale;
 
@@ -1303,7 +1304,7 @@
     }
 
     /**
-     * Formats file length with the associated unity (Go, Mo, Ko, octets) and using the pattern
+     * Formats file length with the associated unit (GB, MB, KB) and using the pattern
      * <code>########.00</code> by default.
      */
     static class FileDecimalFormat extends DecimalFormat
@@ -1315,7 +1316,7 @@
          */
         public FileDecimalFormat()
         {
-            super( "########.00" );
+            super( "#,###.00" );
         }
 
         /** {@inheritDoc} */
@@ -1324,26 +1325,19 @@
             if ( fs > 1024 * 1024 * 1024 )
             {
                 result = super.format( (float) fs / ( 1024 * 1024 * 1024 ), result, fieldPosition );
-                result.append( " Go" );
+                result.append( " GB" );
                 return result;
             }
 
             if ( fs > 1024 * 1024 )
             {
                 result = super.format( (float) fs / ( 1024 * 1024 ), result, fieldPosition );
-                result.append( " Mo" );
+                result.append( " MB" );
                 return result;
             }
 
-            if ( fs > 1024 )
-            {
-                result = super.format( (float) fs / ( 1024 ), result, fieldPosition );
-                result.append( " Ko" );
-                return result;
-            }
-
-            result = super.format( fs, result, fieldPosition );
-            result.append( " octets" );
+            result = super.format( (float) fs / ( 1024 ), result, fieldPosition );
+            result.append( " KB" );
             return result;
         }
     }