[FIXED JENKINS-18902] Exclude lower bound of range from changes

This commit is contained in:
Daniel Beck committed 2014-06-28 20:26:32 +02:00
1 parent c826a01441
commit 25acdd8850
13 files changed
+39 -7

No files matched your search

+14
View File
@@ -540,6 +540,20 @@ public class Functions {
return map.subMap(Integer.parseInt(to),Integer.parseInt(from)-1);
}
/**
* Creates a sub map by using the given range (upper end inclusive).
*/
@Restricted(NoExternalUse.class)
public static <V> SortedMap<Integer,V> filterExcludingFrom(SortedMap<Integer,V> map, String from, String to) {
if(from==null && to==null) return map;
if(to==null)
return map.headMap(Integer.parseInt(from));
if(from==null)
return map.tailMap(Integer.parseInt(to));
return map.subMap(Integer.parseInt(to),Integer.parseInt(from));
}
private static final SimpleFormatter formatter = new SimpleFormatter();
/**