maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject maven git commit: Avoid implicit conversions of int to long
Date Sun, 18 Dec 2016 10:56:07 GMT
Repository: maven
Updated Branches:
  refs/heads/master 06580630a -> 4f4690cb9


Avoid implicit conversions of int to long

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/4f4690cb
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/4f4690cb
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/4f4690cb

Branch: refs/heads/master
Commit: 4f4690cb9ab2ed6e7ad421c28c05c27994e57800
Parents: 0658063
Author: Michael Osipov <michaelo@apache.org>
Authored: Sun Dec 18 11:56:00 2016 +0100
Committer: Michael Osipov <michaelo@apache.org>
Committed: Sun Dec 18 11:56:00 2016 +0100

----------------------------------------------------------------------
 .../maven/cli/transfer/AbstractMavenTransferListener.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/4f4690cb/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
index 2286510..37c932d 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java
@@ -23,6 +23,8 @@ import java.io.PrintStream;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
 import java.util.Locale;
+
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.Validate;
 import org.eclipse.aether.transfer.AbstractTransferListener;
 import org.eclipse.aether.transfer.TransferCancelledException;
@@ -112,7 +114,7 @@ public abstract class AbstractMavenTransferListener
 
             public static ScaleUnit getScaleUnit( long size )
             {
-                Validate.isTrue( size >= 0, "File size cannot be negative: %s", size );
+                Validate.isTrue( size >= 0L, "File size cannot be negative: %s", size
);
 
                 if ( size >= GIGABYTE.bytes() )
                 {
@@ -154,7 +156,7 @@ public abstract class AbstractMavenTransferListener
 
         public String format( long size, ScaleUnit unit, boolean omitSymbol )
         {
-            Validate.isTrue( size >= 0, "File size cannot be negative: %s", size );
+            Validate.isTrue( size >= 0L, "File size cannot be negative: %s", size );
 
             if ( unit == null )
             {
@@ -166,7 +168,7 @@ public abstract class AbstractMavenTransferListener
 
             if ( omitSymbol )
             {
-                scaledSymbol = "";
+                scaledSymbol = StringUtils.EMPTY;
             }
 
             if ( unit == ScaleUnit.BYTE )
@@ -190,7 +192,7 @@ public abstract class AbstractMavenTransferListener
             Validate.isTrue( size >= 0L && progressedSize <= size || size <
0L,
                 "Progressed file size cannot be bigger than size: %s > %s", progressedSize,
size );
 
-            if ( size >= 0 && progressedSize != size )
+            if ( size >= 0L && progressedSize != size )
             {
                 ScaleUnit unit = ScaleUnit.getScaleUnit( size );
                 String formattedProgressedSize = format( progressedSize, unit, true );


Mime
View raw message