commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r922910 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
Date Sun, 14 Mar 2010 17:42:09 GMT
Author: ggregory
Date: Sun Mar 14 17:42:08 2010
New Revision: 922910

URL: http://svn.apache.org/viewvc?rev=922910&view=rev
Log:
Oops, experiment in progress. Back out last change.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java?rev=922910&r1=922909&r2=922910&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
Sun Mar 14 17:42:08 2010
@@ -83,39 +83,4 @@ public class CharSequenceUtils {
 	public static CharSequence subSequence(CharSequence cs, int start) {
 		return cs == null ? null : cs.subSequence(start, cs.length());
 	}
-
-	public static int indexOf(CharSequence cs, int ch, int startPos) {
-		int max = cs.length();
-
-		if (startPos < 0) {
-			startPos = 0;
-		} else if (startPos >= max) {
-			return StringUtils.INDEX_NOT_FOUND;
-		}
-
-		if (ch < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
-			for (int i = startPos; i < max; i++) {
-				if (cs.charAt(i) == ch) {
-					return i;
-				}
-			}
-			return StringUtils.INDEX_NOT_FOUND;
-		}
-
-		// supp chars
-		if (ch <= Character.MAX_CODE_POINT) {
-			char[] surrogates = Character.toChars(ch);
-			for (int i = startPos; i < max; i++) {
-				if (cs.charAt(i) == surrogates[0]) {
-					if (i + 1 == max) {
-						break;
-					}
-					if (cs.charAt(i + 1) == surrogates[1]) {
-						return i;
-					}
-				}
-			}
-		}
-		return StringUtils.INDEX_NOT_FOUND;
-	}
 }



Mime
View raw message