Program: 13223
Project: 13223
Buggy source:
/** 
 * Creates a new object in the object set. <p/> This method sets the   {@code _id} property to the assigned identifier for the object,and the  {@code _rev} property to the revised object version (For optimistic concurrency)
 * @param resourceName for multi-instance config, the factory pid to use
 * @param id the client-generated identifier to use, or {@code null} if server-generated identifier is requested.
 * @param obj    the contents of the object to create in the object set.
 * @throws NotFoundException           if the specified id could not be resolved.
 * @throws ForbiddenException          if access to the object or object set is forbidden.
 * @throws PreconditionFailedException if an object with the same ID already exists.
 * @throws BadRequestException         if the passed identifier is invalid
 */
public void create(ResourceName resourceName,String id,Map<String,Object> obj) throws ResourceException {
  logger.debug("String_Node_Str",new Object[]{resourceName.toString(),id,obj});
  if (id == null || id.length() == 0) {
    throw new BadRequestException("String_Node_Str");
  }
  ParsedId parsedId=new ParsedId(resourceName,id);
  try {
    Configuration config=null;
    if (parsedId.isFactoryConfig()) {
      String qualifiedFactoryPid=ConfigBootstrapHelper.qualifyPid(parsedId.factoryPid);
      if ("String_Node_Str".equalsIgnoreCase(qualifiedFactoryPid)) {
        throw new BadRequestException("String_Node_Str");
      }
      config=configAdmin.createFactoryConfiguration(qualifiedFactoryPid,null);
    }
 else {
      String qualifiedPid=ConfigBootstrapHelper.qualifyPid(parsedId.pid);
      config=configAdmin.getConfiguration(qualifiedPid,null);
    }
    if (config.getProperties() != null) {
      throw new PreconditionFailedException("String_Node_Str" + parsedId + "String_Node_Str");
    }
    Dictionary dict=configCrypto.encrypt(parsedId.getPidOrFactoryPid(),parsedId.instanceAlias,null,new JsonValue(obj));
    if (parsedId.isFactoryConfig()) {
      dict.put(JSONConfigInstaller.SERVICE_FACTORY_PID_ALIAS,parsedId.instanceAlias);
    }
    config.update(dict);
    logger.debug("String_Node_Str",parsedId.toString(),dict);
  }
 catch (  ResourceException ex) {
    throw ex;
  }
catch (  WaitForMetaData ex) {
    logger.info("String_Node_Str",parsedId.toString(),ex);
    throw new InternalServerErrorException("String_Node_Str" + parsedId.toString() + "String_Node_Str",ex);
  }
catch (  Exception ex) {
    logger.warn("String_Node_Str",parsedId.toString(),ex);
    throw new InternalServerErrorException("String_Node_Str" + parsedId.toString() + "String_Node_Str"+ ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * Creates a new object in the object set. <p/> This method sets the   {@code _id} property to the assigned identifier for the object,and the  {@code _rev} property to the revised object version (For optimistic concurrency)
 * @param resourceName for multi-instance config, the factory pid to use
 * @param id the client-generated identifier to use, or {@code null} if server-generated identifier is requested.
 * @param obj    the contents of the object to create in the object set.
 * @throws NotFoundException           if the specified id could not be resolved.
 * @throws ForbiddenException          if access to the object or object set is forbidden.
 * @throws PreconditionFailedException if an object with the same ID already exists.
 * @throws BadRequestException         if the passed identifier is invalid
 */
public void create(ResourceName resourceName,String id,Map<String,Object> obj) throws ResourceException {
  logger.debug("String_Node_Str",new Object[]{resourceName.toString(),id,obj});
  if (id == null || id.length() == 0) {
    throw new BadRequestException("String_Node_Str");
  }
  ParsedId parsedId=new ParsedId(resourceName,id);
  try {
    Configuration config=null;
    if (parsedId.isFactoryConfig()) {
      String qualifiedFactoryPid=ConfigBootstrapHelper.qualifyPid(parsedId.factoryPid);
      if ("String_Node_Str".equalsIgnoreCase(qualifiedFactoryPid)) {
        throw new BadRequestException("String_Node_Str");
      }
      config=configAdmin.createFactoryConfiguration(qualifiedFactoryPid,null);
    }
 else {
      String qualifiedPid=ConfigBootstrapHelper.qualifyPid(parsedId.pid);
      config=configAdmin.getConfiguration(qualifiedPid,null);
    }
    if (config.getProperties() != null) {
      throw new PreconditionFailedException("String_Node_Str" + parsedId + "String_Node_Str");
    }
    Dictionary dict=configCrypto.encrypt(parsedId.getPidOrFactoryPid(),parsedId.instanceAlias,null,new JsonValue(obj));
    if (parsedId.isFactoryConfig()) {
      dict.put(JSONConfigInstaller.SERVICE_FACTORY_PID_ALIAS,parsedId.instanceAlias);
    }
    config.update(dict);
    logger.debug("String_Node_Str",parsedId.toString(),dict);
  }
 catch (  ResourceException ex) {
    throw ex;
  }
catch (  JsonValueException ex) {
    logger.warn("String_Node_Str" + ex.getMessage(),resourceName.toString(),ex);
    throw new BadRequestException("String_Node_Str" + resourceName.toString() + "String_Node_Str"+ ex.getMessage(),ex);
  }
catch (  WaitForMetaData ex) {
    logger.info("String_Node_Str",parsedId.toString(),ex);
    throw new InternalServerErrorException("String_Node_Str" + parsedId.toString() + "String_Node_Str",ex);
  }
catch (  Exception ex) {
    logger.warn("String_Node_Str",parsedId.toString(),ex);
    throw new InternalServerErrorException("String_Node_Str" + parsedId.toString() + "String_Node_Str"+ ex.getMessage(),ex);
  }
}