// Install the unresolved resources into the cloned environment
List<Resource> unresolved = new ArrayList<Resource>();
Environment envclone = env.cloneEnvironment();
for (Requirement req : reqs) {
Resource res = req.getResource();
if (env.getResource(res.getIdentity()) == null) {
envclone.addResource(res);
unresolved.add(res);
}
}
// Find the resources in the cloned environment
List<Resource> resources = new ArrayList<Resource>();
Set<Requirement> unstatisfied = new HashSet<Requirement>(reqs);
Map<Requirement, Resource> mapping = new HashMap<Requirement, Resource>();
findResources(envclone, unresolved, mapping, unstatisfied, resources);
// Remove abstract resources
Iterator<Resource> itres = resources.iterator();
while (itres.hasNext()) {
Resource res = itres.next();
if (isAbstract(res)) {
itres.remove();
}
}