am 32c8704c: Merge "Remove an unused function (A8)" into jb-mr1-dev

* commit '32c8704c21e069ccdc092cd0d732360b4ee08f92':
  Remove an unused function (A8)
main
Jean Chalard 2012-09-14 03:22:05 -07:00 committed by Android Git Automerger
commit 8092d2a4db
2 changed files with 0 additions and 28 deletions

View File

@ -124,23 +124,6 @@ public final class StringUtils {
return true; return true;
} }
/**
* Returns true if cs contains any upper case characters.
*
* @param cs the CharSequence to check
* @return {@code true} if cs contains any upper case characters, {@code false} otherwise.
*/
public static boolean hasUpperCase(final CharSequence cs) {
final int length = cs.length();
for (int i = 0, cp = 0; i < length; i += Character.charCount(cp)) {
cp = Character.codePointAt(cs, i);
if (Character.isUpperCase(cp)) {
return true;
}
}
return false;
}
/** /**
* Remove duplicates from an array of strings. * Remove duplicates from an array of strings.
* *

View File

@ -90,17 +90,6 @@ public class StringUtilsTests extends AndroidTestCase {
StringUtils.removeFromCsvIfExists("key", "key1,key,key3,key,key5")); StringUtils.removeFromCsvIfExists("key", "key1,key,key3,key,key5"));
} }
public void testHasUpperCase() {
assertTrue("single upper-case string", StringUtils.hasUpperCase("String"));
assertTrue("multi upper-case string", StringUtils.hasUpperCase("stRInG"));
assertTrue("all upper-case string", StringUtils.hasUpperCase("STRING"));
assertTrue("upper-case string with non-letters", StringUtils.hasUpperCase("He's"));
assertFalse("empty string", StringUtils.hasUpperCase(""));
assertFalse("lower-case string", StringUtils.hasUpperCase("string"));
assertFalse("lower-case string with non-letters", StringUtils.hasUpperCase("he's"));
}
private void onePathForCaps(final CharSequence cs, final int expectedResult, final int mask) { private void onePathForCaps(final CharSequence cs, final int expectedResult, final int mask) {
int oneTimeResult = expectedResult & mask; int oneTimeResult = expectedResult & mask;
assertEquals("After >" + cs + "<", oneTimeResult, StringUtils.getCapsMode(cs, mask)); assertEquals("After >" + cs + "<", oneTimeResult, StringUtils.getCapsMode(cs, mask));