Program: 45433
Project: 45433
Buggy source:
/** 
 * Uninstalls all of the modules waiting to be uninstalled if possible. Checks for the modules that can be uninstalled and removes them.
 */
public void uninstallAll(){
  Map<String,ModuleInfo> uninstall=new HashMap(this.uninstallManager.getModules());
  Iterator<Map.Entry<String,ModuleInfo>> it=uninstall.entrySet().iterator();
  Map<String,Module> installed=this.installedMananger.getModules();
  while (it.hasNext() == true) {
    Map.Entry<String,ModuleInfo> entry=it.next();
    String moduleName=entry.getKey();
    Module module=installed.get(moduleName);
    DeploymentQueryResult res=this.deployManager.canUndeploy(module);
    if (res.getResult() == false) {
      StringBuffer message=new StringBuffer("String_Node_Str" + module.getName() + "String_Node_Str");
      for (      String reason : res.getReasons()) {
        message.append(reason + "String_Node_Str");
      }
      logger.warning(message.toString());
      it.remove();
    }
  }
  Map<String,Set<ModuleInfo>> failures=new LinkedHashMap<String,Set<ModuleInfo>>();
  Map<String,ModuleInfo> checked=this.checkRequired(uninstall,failures);
  if (failures.isEmpty() == false) {
    StringBuffer failureMessage=new StringBuffer("String_Node_Str");
    for (    Map.Entry<String,Set<ModuleInfo>> e : failures.entrySet()) {
      failureMessage.append("String_Node_Str" + e.getKey() + "String_Node_Str");
      for (      ModuleInfo depend : e.getValue()) {
        failureMessage.append(depend.getName() + "String_Node_Str");
      }
      failureMessage.append("String_Node_Str");
    }
    logger.warning(failureMessage.toString());
  }
  Iterator<Map.Entry<String,ModuleInfo>> it2=checked.entrySet().iterator();
  while (it2.hasNext() == true) {
    Map.Entry<String,ModuleInfo> entry=it2.next();
    String moduleName=entry.getKey();
    Module module=installed.get(moduleName);
    try {
      this.deployManager.undeploy(module);
    }
 catch (    DeployerException excp) {
      logger.log(Level.WARNING,"String_Node_Str",excp);
    }
    this.installedMananger.remove(moduleName);
    this.uninstallManager.remove(moduleName);
  }
}

Fixed version (ground truth):
/** 
 * Uninstalls all of the modules waiting to be uninstalled if possible. Checks for the modules that can be uninstalled and removes them.
 */
public void uninstallAll(){
  Map<String,ModuleInfo> uninstall=new HashMap(this.uninstallManager.getModules());
  Iterator<Map.Entry<String,ModuleInfo>> it=uninstall.entrySet().iterator();
  Map<String,Module> installed=this.installedMananger.getModules();
  while (it.hasNext() == true) {
    Map.Entry<String,ModuleInfo> entry=it.next();
    String moduleName=entry.getKey();
    Module module=installed.get(moduleName);
    if (module == null) {
      logger.warning("String_Node_Str" + moduleName + "String_Node_Str"+ "String_Node_Str");
      it.remove();
      continue;
    }
    DeploymentQueryResult res=this.deployManager.canUndeploy(module);
    if (res.getResult() == false) {
      StringBuffer message=new StringBuffer("String_Node_Str" + module.getName() + "String_Node_Str");
      for (      String reason : res.getReasons()) {
        message.append(reason + "String_Node_Str");
      }
      logger.warning(message.toString());
      it.remove();
    }
  }
  Map<String,Set<ModuleInfo>> failures=new LinkedHashMap<String,Set<ModuleInfo>>();
  Map<String,ModuleInfo> checked=this.checkRequired(uninstall,failures);
  if (failures.isEmpty() == false) {
    StringBuffer failureMessage=new StringBuffer("String_Node_Str");
    for (    Map.Entry<String,Set<ModuleInfo>> e : failures.entrySet()) {
      failureMessage.append("String_Node_Str" + e.getKey() + "String_Node_Str");
      for (      ModuleInfo depend : e.getValue()) {
        failureMessage.append(depend.getName() + "String_Node_Str");
      }
      failureMessage.append("String_Node_Str");
    }
    logger.warning(failureMessage.toString());
  }
  Iterator<Map.Entry<String,ModuleInfo>> it2=checked.entrySet().iterator();
  while (it2.hasNext() == true) {
    Map.Entry<String,ModuleInfo> entry=it2.next();
    String moduleName=entry.getKey();
    Module module=installed.get(moduleName);
    try {
      this.deployManager.undeploy(module);
    }
 catch (    DeployerException excp) {
      logger.log(Level.WARNING,"String_Node_Str",excp);
    }
    this.installedMananger.remove(moduleName);
    this.uninstallManager.remove(moduleName);
  }
  this.uninstallManager.write();
}