/** * Updates the deployment plan ResourceElement with the parsed DeploymentPlan. * * @param resource the plan resource to update * @param plan the deployment plan */ private void updatePlan(Resource resource, DeploymentPlan plan) { String name = plan.getName(); QName planQName = new QName(PLAN_NAMESPACE, name); QNameSymbol symbol = new QNameSymbol(planQName); boolean found = false; for (ResourceElement element : resource.getResourceElements()) { if (element.getSymbol().equals(symbol)) { element.setValue(plan); found = true; break; } } if (!found) { // this is a programming error if this happens as the indexer did not set the resource element properly throw new AssertionError("Deployment plan not found: " + name); } resource.setProcessed(true); }
Symbol candidateSymbol = new QNameSymbol(candidate.getName()); if (element.getSymbol().equals(candidateSymbol)) { element.setValue(candidate); found = true;