});
Collections.reverse(appVersionList);
if (latestVersionInstead) {
ApplicationVersionDescription latestVersionDescription = appVersionList
.get(0);
return changeToVersion(d, latestVersionDescription);
}
ListIterator<ApplicationVersionDescription> versionIterator = appVersionList
.listIterator();
String curVersionLabel = d.getVersionLabel();
while (versionIterator.hasNext()) {
ApplicationVersionDescription versionDescription = versionIterator.next();
String versionLabel = versionDescription.getVersionLabel();
if (curVersionLabel.equals(versionLabel) && versionIterator.hasNext()) {
return changeToVersion(d, versionIterator.next());
}
}