if (commandLine.trimToVersionAsString != null) {
Map<String, AppVersion> versions = new HashMap<String, AppVersion>();
SortedMap<Long, AppVersion> timeStamps = new TreeMap<Long, AppVersion>();
for (Iterator<AppVersion> i = origCollection.appVersionIterator(); i.hasNext();) {
AppVersion v = i.next();
versions.put(v.getReleaseName(), v);
timeStamps.put(v.getTimestamp(), v);
}
// add current version to the maps
AppVersion v = resultCollection.getCurrentAppVersion();
versions.put(v.getReleaseName(), v);
timeStamps.put(v.getTimestamp(), v);
trimToVersion = edu.umd.cs.findbugs.workflow.Filter.FilterCommandLine.getVersionNum(versions, timeStamps,
commandLine.trimToVersionAsString, true, v.getSequenceNumber());
if (trimToVersion < origCollection.getSequenceNumber()) {
String name = resultCollection.getAppVersionFromSequenceNumber(trimToVersion).getReleaseName();
long timestamp = resultCollection.getAppVersionFromSequenceNumber(trimToVersion).getTimestamp();
resultCollection.setReleaseName(name);
resultCollection.setTimestamp(timestamp);