Program: 80245
Project: 80245
Buggy source:
private void deployModuleFromModJson(JsonObject modJSON,String depName,ModuleIdentifier modID,JsonObject config,int instances,File modDir,File currentModDir,List<URL> moduleClasspath,File modRoot,boolean ha,final Handler<AsyncResult<String>> doneHandler){
  ModuleFields fields=new ModuleFields(modJSON);
  String main=fields.getMain();
  if (main == null) {
    throw new PlatformManagerException("String_Node_Str" + modID + "String_Node_Str");
  }
  boolean worker=fields.isWorker();
  boolean multiThreaded=fields.isMultiThreaded();
  if (multiThreaded && !worker) {
    throw new PlatformManagerException("String_Node_Str");
  }
  boolean preserveCwd=fields.isPreserveCurrentWorkingDirectory();
  File modDirToUse=preserveCwd ? currentModDir : modDir;
  ModuleReference mr=moduleRefs.get(modID.toString());
  if (mr == null) {
    boolean res=fields.isResident();
    mr=new ModuleReference(this,modID.toString(),new ModuleClassLoader(modID.toString(),platformClassLoader,moduleClasspath.toArray(new URL[moduleClasspath.size()])),res);
    ModuleReference prev=moduleRefs.putIfAbsent(modID.toString(),mr);
    if (prev != null) {
      mr=prev;
    }
  }
  ModuleIdentifier enclosingModID=getEnclosingModID();
  if (enclosingModID != null) {
    ModuleReference parentRef=moduleRefs.get(enclosingModID.toString());
    mr.mcl.addReference(parentRef);
    parentRef.incRef();
  }
  String includes=fields.getIncludes();
  if (includes != null) {
    loadIncludedModules(modRoot,modDir,mr,includes);
  }
  final boolean autoRedeploy=fields.isAutoRedeploy();
  doDeploy(depName,autoRedeploy,worker,multiThreaded,main,modID,config,moduleClasspath.toArray(new URL[moduleClasspath.size()]),instances,modDirToUse,mr,modRoot,ha,new Handler<AsyncResult<String>>(){
    @Override public void handle(    AsyncResult<String> res){
      if (res.succeeded()) {
        String deploymentID=res.result();
        if (deploymentID != null && autoRedeploy) {
          redeployer.moduleDeployed(deployments.get(deploymentID));
        }
      }
      if (doneHandler != null) {
        doneHandler.handle(res);
      }
 else       if (res.failed()) {
        log.error("String_Node_Str",res.cause());
      }
    }
  }
);
}

Fixed version (ground truth):
private void deployModuleFromModJson(JsonObject modJSON,String depName,ModuleIdentifier modID,JsonObject config,int instances,File modDir,File currentModDir,List<URL> moduleClasspath,File modRoot,boolean ha,final Handler<AsyncResult<String>> doneHandler){
  ModuleFields fields=new ModuleFields(modJSON);
  String main=fields.getMain();
  if (main == null) {
    throw new PlatformManagerException("String_Node_Str" + modID + "String_Node_Str");
  }
  boolean worker=fields.isWorker();
  boolean multiThreaded=fields.isMultiThreaded();
  if (multiThreaded && !worker) {
    throw new PlatformManagerException("String_Node_Str");
  }
  boolean preserveCwd=fields.isPreserveCurrentWorkingDirectory();
  File modDirToUse=preserveCwd ? currentModDir : modDir;
  ModuleReference mr=moduleRefs.get(modID.toString());
  if (mr == null) {
    boolean res=fields.isResident();
    mr=new ModuleReference(this,modID.toString(),new ModuleClassLoader(modID.toString(),platformClassLoader,moduleClasspath.toArray(new URL[moduleClasspath.size()])),res);
    ModuleReference prev=moduleRefs.putIfAbsent(modID.toString(),mr);
    if (prev != null) {
      mr=prev;
    }
  }
  ModuleIdentifier enclosingModID=getEnclosingModID();
  if (enclosingModID != null) {
    ModuleReference parentRef=moduleRefs.get(enclosingModID.toString());
    if (mr.mcl.addReference(parentRef)) {
      parentRef.incRef();
    }
  }
  String includes=fields.getIncludes();
  if (includes != null) {
    loadIncludedModules(modRoot,modDir,mr,includes);
  }
  final boolean autoRedeploy=fields.isAutoRedeploy();
  doDeploy(depName,autoRedeploy,worker,multiThreaded,main,modID,config,moduleClasspath.toArray(new URL[moduleClasspath.size()]),instances,modDirToUse,mr,modRoot,ha,new Handler<AsyncResult<String>>(){
    @Override public void handle(    AsyncResult<String> res){
      if (res.succeeded()) {
        String deploymentID=res.result();
        if (deploymentID != null && autoRedeploy) {
          redeployer.moduleDeployed(deployments.get(deploymentID));
        }
      }
      if (doneHandler != null) {
        doneHandler.handle(res);
      }
 else       if (res.failed()) {
        log.error("String_Node_Str",res.cause());
      }
    }
  }
);
}