Map<String, Resource> filterMap = new HashMap<String, Resource>();
for (Resource r2 : res) {
if (filterMap.containsKey(r2.getSymbolicName())) {
// we filter the list of available bundles. only the newest
// bundles are included
Resource r1 = filterMap.get(r2.getSymbolicName());
if (r2.getVersion().compareTo(r1.getVersion()) == 1) {
logger.debug("Bundle {} with version {} will be dropped", r1.getSymbolicName(), r1.getVersion());
logger.info("Adding {} with version {}", r2.getPresentationName(), r2.getVersion());
filterMap.put(r2.getSymbolicName(), r2);
}
} else {
logger.info("Adding {} with version {}", r2.getPresentationName(), r2.getVersion());