System.out.println("Installing feature " + feature.getName() + " " + feature.getVersion());
}
for (Feature dependency : feature.getDependencies()) {
VersionRange range = FeatureImpl.DEFAULT_VERSION.equals(dependency.getVersion())
? VersionRange.ANY_VERSION : new VersionRange(dependency.getVersion(), true, true);
Feature fi = null;
for (Feature f : installed.keySet()) {
if (f.getName().equals(dependency.getName())) {
Version v = VersionTable.getVersion(f.getVersion());
if (range.contains(v)) {
if (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0) {
fi = f;
}
}
}
}
if (fi == null) {
Map<String, Feature> avail = getFeatures().get(dependency.getName());
if (avail != null) {
for (Feature f : avail.values()) {
Version v = VersionTable.getVersion(f.getVersion());
if (range.contains(v)) {
if (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0) {
fi = f;
}
}
}
}