Merge "fix IllegalOutOfBoundsException"

main
Kurt Partridge 2012-06-25 22:52:36 -07:00 committed by Android (Google) Code Review
commit 3ec249c6d1
1 changed files with 3 additions and 0 deletions

View File

@ -184,6 +184,9 @@ public class StringUtils {
final char[] characters = string.toCharArray();
final int length = characters.length;
final int[] codePoints = new int[Character.codePointCount(characters, 0, length)];
if (length <= 0) {
return new int[0];
}
int codePoint = Character.codePointAt(characters, 0);
int dsti = 0;
for (int srci = Character.charCount(codePoint);