Program: 134793
Project: 134793
Buggy source:
/** 
 * @see com.cosylab.acs.maci.Manager#getCollocatedComponent(int,com.cosylab.acs.maci.ComponentSpec,boolean,URI)
 */
public ComponentInfo getCollocatedComponent(int id,ComponentSpec componentSpec,boolean markAsDefault,URI targetComponentURI) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx {
  try {
    if (componentSpec == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getName() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getType() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getCode() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getContainer() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getName().length() == 0) {
      AcsJBadParameterEx ex=new AcsJBadParameterEx();
      ex.setParameter("String_Node_Str");
      ex.setParameterValue("String_Node_Str");
      ex.setReason("String_Node_Str");
      throw ex;
    }
    if (targetComponentURI == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (!componentSpec.getContainer().equals(ComponentSpec.COMPSPEC_ANY)) {
      AcsJBadParameterEx ex=new AcsJBadParameterEx();
      ex.setParameter("String_Node_Str");
      ex.setParameterValue("String_Node_Str");
      ex.setReason("String_Node_Str");
      throw ex;
    }
  }
 catch (  AcsJNullPointerEx e) {
    AcsJInvalidComponentSpecEx ex=new AcsJInvalidComponentSpecEx(e);
    throw ex;
  }
catch (  AcsJBadParameterEx e) {
    AcsJInvalidComponentSpecEx ex=new AcsJInvalidComponentSpecEx(e);
    throw ex;
  }
  securityCheck(id,AccessRights.NONE);
  String name=extractName(targetComponentURI);
  int h=0;
  ComponentInfo targetComponentInfo=null;
synchronized (components) {
    h=components.first();
    while (h != 0) {
      ComponentInfo componentInfo=(ComponentInfo)components.get(h);
      if (componentInfo.getName().equals(name)) {
        targetComponentInfo=componentInfo;
        break;
      }
      h=components.next(h);
    }
  }
  if (targetComponentInfo == null) {
    DAOProxy componentsDAO=getComponentsDAOProxy();
    if (componentsDAO != null) {
      String containerName=readStringCharacteristics(componentsDAO,name + "String_Node_Str",true);
      if (containerName != null)       componentSpec.setContainer(containerName);
    }
  }
 else   componentSpec.setContainer(targetComponentInfo.getContainerName());
  if (componentSpec.getContainer().equals(ComponentSpec.COMPSPEC_ANY)) {
    AcsJIncompleteComponentSpecEx ex=new AcsJIncompleteComponentSpecEx();
    ex.setCURL(name);
    ex.setContainerName(componentSpec.getContainer());
    throw ex;
  }
  ComponentInfo componentInfo=null;
  try {
    componentInfo=internalRequestDynamicComponent(id,componentSpec);
  }
 catch (  AcsJSyncLockFailedEx e) {
    AcsJCannotGetComponentEx ex=new AcsJCannotGetComponentEx();
    ex.setCURL(name);
    ex.setReason("String_Node_Str");
    throw ex;
  }
  if (componentInfo != null && markAsDefault) {
synchronized (defaultComponents) {
      executeCommand(new DefaultComponentCommandPut(componentInfo.getType(),componentInfo));
    }
    logger.log(Level.INFO,"String_Node_Str" + componentInfo.getName() + "String_Node_Str"+ componentInfo.getType()+ "String_Node_Str");
  }
  if (componentInfo == null) {
    AcsJCannotGetComponentEx ex=new AcsJCannotGetComponentEx();
    ex.setCURL(name);
    throw ex;
  }
  return componentInfo;
}

Fixed version (ground truth):
/** 
 * @see com.cosylab.acs.maci.Manager#getCollocatedComponent(int,com.cosylab.acs.maci.ComponentSpec,boolean,URI)
 */
public ComponentInfo getCollocatedComponent(int id,ComponentSpec componentSpec,boolean markAsDefault,URI targetComponentURI) throws AcsJCannotGetComponentEx, AcsJNoPermissionEx, AcsJIncompleteComponentSpecEx, AcsJInvalidComponentSpecEx, AcsJComponentSpecIncompatibleWithActiveComponentEx {
  try {
    if (componentSpec == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getName() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getType() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getCode() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getContainer() == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (componentSpec.getName().length() == 0) {
      AcsJBadParameterEx ex=new AcsJBadParameterEx();
      ex.setParameter("String_Node_Str");
      ex.setParameterValue("String_Node_Str");
      ex.setReason("String_Node_Str");
      throw ex;
    }
    if (targetComponentURI == null) {
      AcsJNullPointerEx ex=new AcsJNullPointerEx();
      ex.setVariable("String_Node_Str");
      throw ex;
    }
    if (!componentSpec.getContainer().equals(ComponentSpec.COMPSPEC_ANY)) {
      AcsJBadParameterEx ex=new AcsJBadParameterEx();
      ex.setParameter("String_Node_Str");
      ex.setParameterValue(componentSpec.getContainer());
      ex.setReason("String_Node_Str");
      throw ex;
    }
  }
 catch (  AcsJNullPointerEx e) {
    AcsJInvalidComponentSpecEx ex=new AcsJInvalidComponentSpecEx(e);
    throw ex;
  }
catch (  AcsJBadParameterEx e) {
    AcsJInvalidComponentSpecEx ex=new AcsJInvalidComponentSpecEx(e);
    throw ex;
  }
  securityCheck(id,AccessRights.NONE);
  String name=extractName(targetComponentURI);
  int h=0;
  ComponentInfo targetComponentInfo=null;
synchronized (components) {
    h=components.first();
    while (h != 0) {
      ComponentInfo componentInfo=(ComponentInfo)components.get(h);
      if (componentInfo.getName().equals(name)) {
        targetComponentInfo=componentInfo;
        break;
      }
      h=components.next(h);
    }
  }
  if (targetComponentInfo == null) {
    DAOProxy componentsDAO=getComponentsDAOProxy();
    if (componentsDAO != null) {
      String containerName=readStringCharacteristics(componentsDAO,name + "String_Node_Str",true);
      if (containerName != null)       componentSpec.setContainer(containerName);
    }
  }
 else   componentSpec.setContainer(targetComponentInfo.getContainerName());
  if (componentSpec.getContainer().equals(ComponentSpec.COMPSPEC_ANY)) {
    AcsJIncompleteComponentSpecEx ex=new AcsJIncompleteComponentSpecEx();
    ex.setCURL(name);
    ex.setContainerName(componentSpec.getContainer());
    throw ex;
  }
  ComponentInfo componentInfo=null;
  try {
    componentInfo=internalRequestDynamicComponent(id,componentSpec);
  }
 catch (  AcsJSyncLockFailedEx e) {
    AcsJCannotGetComponentEx ex=new AcsJCannotGetComponentEx();
    ex.setCURL(name);
    ex.setReason("String_Node_Str");
    throw ex;
  }
  if (componentInfo != null && markAsDefault) {
synchronized (defaultComponents) {
      executeCommand(new DefaultComponentCommandPut(componentInfo.getType(),componentInfo));
    }
    logger.log(Level.INFO,"String_Node_Str" + componentInfo.getName() + "String_Node_Str"+ componentInfo.getType()+ "String_Node_Str");
  }
  if (componentInfo == null) {
    AcsJCannotGetComponentEx ex=new AcsJCannotGetComponentEx();
    ex.setCURL(name);
    throw ex;
  }
  return componentInfo;
}