/** * Returns events that have happened in between the SVN revision numbers of two different builds. * Note that this method does not necessarily return all events that are pertinent. For instance a * partilar event may have happend in a branch that we don't care about for the current upgrade. * So this method should really just be used as a fall-back in the case where we are * upgrading/reverting a build that was not instrumented to return the Upgrade Event IDs using * start-ds -F. * * @param from build from which events will be returned * @return List or IncompatibleVersionEvent objects */ public static List<VersionCompatibilityIssue> getEvents(BuildVersion from) { List<VersionCompatibilityIssue> issueList = new ArrayList<>(); for (VersionCompatibilityIssue evt : VERSION_COMPATIBILITY_ISSUES) { BuildVersion evtVer = evt.getVersion(); if (evtVer.compareTo(from) >= 0) { issueList.add(evt); } } Collections.sort(issueList, VERSION_COMPARATOR); return issueList; }
/** * Gets the list of all registered issues excluding the issues specified by <code>excludeIds * </code>. * * @param excludeIds collection of IDs representing issues that will not be returned in the list * @param current build version * @param neu build version * @return list of issues sorted by build version in which they appear */ public static List<VersionCompatibilityIssue> getEvents( Collection<Integer> excludeIds, BuildInformation current, BuildInformation neu) { if (excludeIds == null) { excludeIds = Collections.emptySet(); } List<VersionCompatibilityIssue> issueList = new ArrayList<>(); for (VersionCompatibilityIssue evt : VERSION_COMPATIBILITY_ISSUES) { if (!excludeIds.contains(evt.getCause().getId())) { BuildVersion currentVersion = new BuildVersion( current.getMajorVersion(), current.getMinorVersion(), current.getPointVersion(), current.getRevisionNumber()); // If the currentVersion is newer than the issue described, then there // is no problem. This can occur for instance when we discovered a // flag day too late (and we added the flag day description to the // code way after the revision). if (currentVersion.compareTo(evt.getVersion()) < 0) { issueList.add(evt); } } } Collections.sort(issueList, VERSION_COMPARATOR); return Collections.unmodifiableList(issueList); }
@Override public int compare(VersionCompatibilityIssue o1, VersionCompatibilityIssue o2) { return o1.getVersion().compareTo(o2.getVersion()); }