commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject [05/14] [lang] LANG-1300: fixed formatting on CharSequenceUtils.java
Date Fri, 17 Mar 2017 11:05:42 GMT
LANG-1300: fixed formatting on CharSequenceUtils.java


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

Branch: refs/heads/master
Commit: a8f41ec97d139f5d0d7cf161e8484f2bb809facc
Parents: c7c424f
Author: MarkDacek <mark.dacek@richmond.edu>
Authored: Mon Mar 6 18:44:25 2017 -0500
Committer: MarkDacek <mark.dacek@richmond.edu>
Committed: Mon Mar 6 18:44:25 2017 -0500

----------------------------------------------------------------------
 .../apache/commons/lang3/CharSequenceUtils.java | 45 ++++++++++----------
 1 file changed, 22 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/a8f41ec9/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
index 6d1403b..1d97e55 100644
--- a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
+++ b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
@@ -75,23 +75,22 @@ public class CharSequenceUtils {
         if (start < 0) {
             start = 0;
         }
-        if(searchChar < Character.MIN_SUPPLEMENTARY_CODE_POINT){
-        	for (int i = start; i < sz; i++) {
-        		if (cs.charAt(i) == searchChar) {
-        			return i;
-        		}
-        	}
+        if (searchChar < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
+            for (int i = start; i < sz; i++) {
+                if (cs.charAt(i) == searchChar) {
+                    return i;
+                }
+            }
         }
-        
-        //supplementary characters
-        if(searchChar <= Character.MAX_CODE_POINT){
-        	char[] chars = Character.toChars(searchChar);
-        	for(int i = start; i < sz; i++){
-        		if(cs.charAt(i) == chars[0]){
-        			if(i+1 == sz){
+        //supplementary characters (LANG1300)
+        if (searchChar <= Character.MAX_CODE_POINT) {
+            char[] chars = Character.toChars(searchChar);
+        	for (int i = start; i < sz; i++) {
+        		if (cs.charAt(i) == chars[0]) {
+        			if (i + 1 == sz) {
         				break;
         			}
-        			if(cs.charAt(i+1) == chars[1]){
+        			if (cs.charAt(i + 1) == chars[1]) {
         				return i;
         			}
         		}
@@ -141,23 +140,23 @@ public class CharSequenceUtils {
         if (start >= sz) {
             start = sz - 1;
         }
-        if(searchChar < Character.MIN_SUPPLEMENTARY_CODE_POINT){
+        if (searchChar < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
             for (int i = start; i >= 0; --i) {
                 if (cs.charAt(i) == searchChar) {
                     return i;
                 }
             }
         }
-        
-        if(searchChar <= Character.MAX_CODE_POINT){
+        //supplementary characters (LANG1300)
+        if (searchChar <= Character.MAX_CODE_POINT) {
             char[] chars = Character.toChars(searchChar);
-            for(int i = start; i >= 0; --i){
-            	if(cs.charAt(i) == chars[0]){
-            		if(i + 1 == cs.length()){
-            			break;
+            for (int i = start; i >= 0; --i) {
+                if (cs.charAt(i) == chars[0]) {
+            	    if (i + 1 == cs.length()) {
+            		    break;
             		}
-            		if(cs.charAt(i+1) == chars[1]){
-            			return i;
+            		if (cs.charAt(i + 1) == chars[1]) {
+            		    return i;
             		}
             	}
             }


Mime
View raw message