commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [lang] Boolean comparisons in CharRange (closes #289)
Date Fri, 29 Sep 2017 15:06:05 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 1406f2a4f -> 7076b7408


Boolean comparisons in CharRange (closes #289)

Cleaned up comparisons to false to just use the boolean negation
operator (!).


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

Branch: refs/heads/master
Commit: 7076b7408f06bc8a277f58e7bb6c2ec3372d5d6f
Parents: 1406f2a
Author: Allon Mureinik <amureini@redhat.com>
Authored: Fri Sep 22 05:35:51 2017 +0300
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Fri Sep 29 17:05:31 2017 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/lang3/CharRange.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/7076b740/src/main/java/org/apache/commons/lang3/CharRange.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/CharRange.java b/src/main/java/org/apache/commons/lang3/CharRange.java
index b395306..6a416bb 100644
--- a/src/main/java/org/apache/commons/lang3/CharRange.java
+++ b/src/main/java/org/apache/commons/lang3/CharRange.java
@@ -206,7 +206,7 @@ final class CharRange implements Iterable<Character>, Serializable
{
         if (obj == this) {
             return true;
         }
-        if (obj instanceof CharRange == false) {
+        if (!(obj instanceof CharRange)) {
             return false;
         }
         final CharRange other = (CharRange) obj;
@@ -335,7 +335,7 @@ final class CharRange implements Iterable<Character>, Serializable
{
          */
         @Override
         public Character next() {
-            if (hasNext == false) {
+            if (!hasNext) {
                 throw new NoSuchElementException();
             }
             final char cur = current;


Mime
View raw message