return str1; int at = indexOfDifference(str1, str2); if (at == INDEX_NOT_FOUND) { return EMPTY;
return EMPTY; int smallestIndexOfDiff = indexOfDifference(strs); if (smallestIndexOfDiff == INDEX_NOT_FOUND) {
public static List<String> findKeys(SortedMap<String,?> map, String input) { LinkedList<String> result = new LinkedList<String>(); map = headMapInclusive(map, input); for (String last = last(map); last != null; last = last(map)) { if (input.startsWith(last)) { result.push(last); map = map.headMap(last); } else { // Find the longest common prefix. int p = StringUtils.indexOfDifference(input, last); if (p <= 0) { return result; } last = input.substring(0, p); map = headMapInclusive(map, last); } } return result; }
} else { int p = StringUtils.indexOfDifference(input, last); if (p <= 0) { return result;
return str1; int at = indexOfDifference(str1, str2); if (at == INDEX_NOT_FOUND) { return EMPTY;
return str1; int at = indexOfDifference(str1, str2); if (at == -1) { return EMPTY;
return str1; int at = indexOfDifference(str1, str2); if (at == -1) { return EMPTY;
return str1; int at = indexOfDifference(str1, str2); if (at == INDEX_NOT_FOUND) { return EMPTY;
return str1; int at = indexOfDifference(str1, str2); if (at == INDEX_NOT_FOUND) { return EMPTY;
return EMPTY; int smallestIndexOfDiff = indexOfDifference(strs); if (smallestIndexOfDiff == INDEX_NOT_FOUND) {
return EMPTY; int smallestIndexOfDiff = indexOfDifference(strs); if (smallestIndexOfDiff == INDEX_NOT_FOUND) {
return EMPTY; int smallestIndexOfDiff = indexOfDifference(strs); if (smallestIndexOfDiff == -1) {
return EMPTY; int smallestIndexOfDiff = indexOfDifference(strs); if (smallestIndexOfDiff == -1) {
return EMPTY; int smallestIndexOfDiff = indexOfDifference(strs); if (smallestIndexOfDiff == INDEX_NOT_FOUND) {
@Override public int compare(IBuild o1, IBuild o2) { String id1 = o1.getName(); String id2 = o2.getName(); int at = StringUtils.indexOfDifference(id1, id2); // no index means strings equal if (at == StringUtils.INDEX_NOT_FOUND) return 0; String rem0 = id1.substring(at); String rem1 = id2.substring(at); // means id2 is just longer, so id1 < id2, so return -1 if (StringUtils.isBlank(rem0)) return -1; // means id1 is just longer, so id1 > id2, so return 1 if (StringUtils.isBlank(rem1)) return 1; if (Integer.valueOf(rem0) < Integer.valueOf(rem1)) return -1; return 1; }
} else { int index = StringUtils.indexOfDifference(path, absoluteResource); if (index > 0 && path.charAt(index-1) != '/') { index = path.substring(0, index).lastIndexOf('/');
public static List<String> findKeys(SortedMap<String,?> map, String input) { LinkedList<String> result = new LinkedList<String>(); map = headMapInclusive(map, input); for (String last = last(map); last != null; last = last(map)) { if (input.startsWith(last)) { result.push(last); map = map.headMap(last); } else { // Find the longest common prefix. int p = StringUtils.indexOfDifference(input, last); if (p <= 0) { return result; } last = input.substring(0, p); map = headMapInclusive(map, last); } } return result; }
} else { int p = StringUtils.indexOfDifference(input, last); if (p <= 0) { return result;