This commit is contained in:
Alexey Kudravtsev
2012-11-12 14:39:38 +04:00
parent 95ba49214e
commit 860707addf
3 changed files with 9 additions and 14 deletions

View File

@@ -187,7 +187,7 @@ public class DefaultChooseByNameItemProvider implements ChooseByNameItemProvider
private static boolean matchesQualifier(final Object element,
@NotNull final ChooseByNameBase base,
final List<Pair<String, MinusculeMatcher>> patternsAndMatchers) {
@NotNull List<Pair<String, MinusculeMatcher>> patternsAndMatchers) {
final String name = base.getModel().getFullName(element);
if (name == null) return false;
@@ -220,6 +220,7 @@ public class DefaultChooseByNameItemProvider implements ChooseByNameItemProvider
return true;
}
@NotNull
private static List<Pair<String, MinusculeMatcher>> getPatternsAndMatchers(String qualifierPattern, final ChooseByNameBase base) {
return ContainerUtil.map2List(split(qualifierPattern, base), new Function<String, Pair<String, MinusculeMatcher>>() {
@NotNull

View File

@@ -217,16 +217,8 @@ public class StringUtil extends StringUtilRt {
fromIndex = 0;
}
int max = sourceCount - 1;
for (int i = fromIndex; i <= max; i++) {
/* Look for first character. */
if (!charsEqualIgnoreCase(where.charAt(i), what)) {
while (++i <= max && !charsEqualIgnoreCase(where.charAt(i), what)) ;
}
/* Found first character, now look at the rest of v2 */
if (i <= max) {
for (int i = fromIndex; i < sourceCount; i++) {
if (charsEqualIgnoreCase(where.charAt(i), what)) {
return i;
}
}

View File

@@ -128,10 +128,12 @@ public class IOUtil {
public static boolean isAscii(final String str) {
for (int i = 0; i != str.length(); ++ i) {
final char c = str.charAt(i);
if (c < 0 || c >= 128) {
return false;
}
if (!isAscii(c)) return false;
}
return true;
}
public static boolean isAscii(char c) {
return c >= 0 && c < 128;
}
}