commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [lang] If statement can be simplified
Date Tue, 05 May 2015 17:03:50 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 1cb5573ad -> e2ec4f2fd


If statement can be simplified


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/e2ec4f2f
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/e2ec4f2f
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/e2ec4f2f

Branch: refs/heads/master
Commit: e2ec4f2fdb2bb8d97f64a33e9ac288d52854a530
Parents: 1cb5573
Author: Benedikt Ritter <britter@apache.org>
Authored: Tue May 5 19:03:19 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Tue May 5 19:03:19 2015 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/e2ec4f2f/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
index 103b040..26b475f 100644
--- a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
@@ -2841,10 +2841,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable,
Build
      */
     @Override
     public boolean equals(final Object obj) {
-        if (obj instanceof StrBuilder) {
-            return equals((StrBuilder) obj);
-        }
-        return false;
+        return obj instanceof StrBuilder && equals((StrBuilder) obj);
     }
 
     /**


Mime
View raw message