commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1669791 - in /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable: MutableBoolean.java MutableByte.java MutableDouble.java MutableFloat.java MutableInt.java MutableLong.java MutableShort.java
Date Sat, 28 Mar 2015 15:22:59 GMT
Author: britter
Date: Sat Mar 28 15:22:59 2015
New Revision: 1669791

URL: http://svn.apache.org/r1669791
Log:
PMD: Useless parentheses.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableByte.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableDouble.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableLong.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableShort.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
Sat Mar 28 15:22:59 2015
@@ -19,6 +19,8 @@ package org.apache.commons.lang3.mutable
 
 import java.io.Serializable;
 
+import org.apache.commons.lang3.BooleanUtils;
+
 /**
  * A mutable <code>boolean</code> wrapper.
  * <p>
@@ -196,8 +198,7 @@ public class MutableBoolean implements M
      */
     @Override
     public int compareTo(final MutableBoolean other) {
-        final boolean anotherVal = other.value;
-        return value == anotherVal ? 0 : (value ? 1 : -1);
+        return BooleanUtils.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableByte.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableByte.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableByte.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableByte.java
Sat Mar 28 15:22:59 2015
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.lang3.mutable;
 
+import org.apache.commons.lang3.math.NumberUtils;
+
 /**
  * A mutable <code>byte</code> wrapper.
  * <p>
@@ -268,8 +270,7 @@ public class MutableByte extends Number
      */
     @Override
     public int compareTo(final MutableByte other) {
-        final byte anotherVal = other.value;
-        return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
+        return NumberUtils.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableDouble.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableDouble.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableDouble.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableDouble.java
Sat Mar 28 15:22:59 2015
@@ -297,8 +297,7 @@ public class MutableDouble extends Numbe
      */
     @Override
     public int compareTo(final MutableDouble other) {
-        final double anotherVal = other.value;
-        return Double.compare(value, anotherVal);
+        return Double.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java
Sat Mar 28 15:22:59 2015
@@ -298,8 +298,7 @@ public class MutableFloat extends Number
      */
     @Override
     public int compareTo(final MutableFloat other) {
-        final float anotherVal = other.value;
-        return Float.compare(value, anotherVal);
+        return Float.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableInt.java
Sat Mar 28 15:22:59 2015
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.lang3.mutable;
 
+import org.apache.commons.lang3.math.NumberUtils;
+
 /**
  * A mutable <code>int</code> wrapper.
  * <p>
@@ -258,8 +260,7 @@ public class MutableInt extends Number i
      */
     @Override
     public int compareTo(final MutableInt other) {
-        final int anotherVal = other.value;
-        return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
+        return NumberUtils.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableLong.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableLong.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableLong.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableLong.java
Sat Mar 28 15:22:59 2015
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.lang3.mutable;
 
+import org.apache.commons.lang3.math.NumberUtils;
+
 /**
  * A mutable <code>long</code> wrapper.
  * <p>
@@ -258,8 +260,7 @@ public class MutableLong extends Number
      */
     @Override
     public int compareTo(final MutableLong other) {
-        final long anotherVal = other.value;
-        return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
+        return NumberUtils.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableShort.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableShort.java?rev=1669791&r1=1669790&r2=1669791&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableShort.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableShort.java
Sat Mar 28 15:22:59 2015
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.lang3.mutable;
 
+import org.apache.commons.lang3.math.NumberUtils;
+
 /**
  * A mutable <code>short</code> wrapper.
  * <p>
@@ -268,8 +270,7 @@ public class MutableShort extends Number
      */
     @Override
     public int compareTo(final MutableShort other) {
-        final short anotherVal = other.value;
-        return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
+        return NumberUtils.compare(this.value, other.value);
     }
 
     //-----------------------------------------------------------------------



Mime
View raw message