directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1801674 - /directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java
Date Wed, 12 Jul 2017 03:40:42 GMT
Author: elecharny
Date: Wed Jul 12 03:40:42 2017
New Revision: 1801674

URL: http://svn.apache.org/viewvc?rev=1801674&view=rev
Log:
Removed some sonar warnings

Modified:
    directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java?rev=1801674&r1=1801673&r2=1801674&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java
(original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java
Wed Jul 12 03:40:42 2017
@@ -341,14 +341,7 @@ public final class Chars
         {
             byte c = bytes[index];
 
-            if ( ( ( c | 0x7F ) != 0x7F ) || !ALPHA[c] )
-            {
-                return false;
-            }
-            else
-            {
-                return true;
-            }
+            return ( ( c | 0x7F ) == 0x7F ) && ALPHA[c];
         }
     }
 
@@ -372,14 +365,7 @@ public final class Chars
         {
             char c = chars[index];
 
-            if ( ( c > 127 ) || !ALPHA[c] )
-            {
-                return false;
-            }
-            else
-            {
-                return true;
-            }
+            return ( ( c | 0x007F ) == 0x007F ) && ALPHA[c];
         }
     }
 
@@ -410,14 +396,7 @@ public final class Chars
         {
             char c = string.charAt( index );
 
-            if ( ( c > 127 ) || !ALPHA[c] )
-            {
-                return false;
-            }
-            else
-            {
-                return true;
-            }
+            return ( ( c | 0x007F ) == 0x007F ) && ALPHA[c];
         }
     }
 
@@ -448,14 +427,7 @@ public final class Chars
         {
             char c = string.charAt( index );
 
-            if ( ( c > 127 ) || !ALPHA_LOWER_CASE[c] )
-            {
-                return false;
-            }
-            else
-            {
-                return true;
-            }
+            return ( ( c | 0x007F ) == 0x007F ) && ALPHA_LOWER_CASE[c];
         }
     }
 



Mime
View raw message