public static long getVersionNum(BugCollection collection, String val, boolean roundToLaterVersion) { if (val == null) { return -1; } Map<String, AppVersion> versions = new HashMap<>(); SortedMap<Long, AppVersion> timeStamps = new TreeMap<>(); for (Iterator<AppVersion> i = collection.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 = collection.getCurrentAppVersion(); versions.put(v.getReleaseName(), v); timeStamps.put(v.getTimestamp(), v); return getVersionNum(versions, timeStamps, val, roundToLaterVersion, v.getSequenceNumber()); }
for (Iterator<AppVersion> i = origCollection.appVersionIterator(); i.hasNext();) { AppVersion appVersion = i.next(); resultCollection.addAppVersion((AppVersion) appVersion.clone());
public static long getVersionNum(BugCollection collection, String val, boolean roundToLaterVersion) { if (val == null) { return -1; } Map<String, AppVersion> versions = new HashMap<String, AppVersion>(); SortedMap<Long, AppVersion> timeStamps = new TreeMap<Long, AppVersion>(); for (Iterator<AppVersion> i = collection.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 = collection.getCurrentAppVersion(); versions.put(v.getReleaseName(), v); timeStamps.put(v.getTimestamp(), v); return getVersionNum(versions, timeStamps, val, roundToLaterVersion, v.getSequenceNumber()); }
for (Iterator<AppVersion> i = origCollection.appVersionIterator(); i.hasNext();) { AppVersion appVersion = i.next(); resultCollection.addAppVersion((AppVersion) appVersion.clone());