Program: 13219
Project: 13219
Buggy source:
/** 
 * Gets an object from the object set by identifier. <p/> The object may contain metadata properties, including object identifier   {@code _id}, and object version   {@code _rev} to enable optimistic concurrency supported by OpenIDM.
 * @param resourceName the identifier of the resource to retrieve from the object set.
 * @return the requested object.
 * @throws NotFoundException   if the specified object could not be found.
 * @throws ForbiddenException  if access to the object is forbidden.
 * @throws BadRequestException if the passed identifier is invalid
 */
public Map<String,Object> read(ResourceName resourceName) throws ResourceException {
  logger.debug("String_Node_Str",resourceName.toString());
  Map<String,Object> result=null;
  try {
    if (resourceName.isEmpty()) {
      result=new HashMap<String,Object>();
      Configuration[] rawConfigs=configAdmin.listConfigurations(null);
      List configList=new ArrayList();
      if (null != rawConfigs) {
        for (        Configuration conf : rawConfigs) {
          Map<String,Object> configEntry=new LinkedHashMap<String,Object>();
          String alias=null;
          Dictionary properties=conf.getProperties();
          if (properties != null) {
            alias=(String)properties.get(JSONConfigInstaller.SERVICE_FACTORY_PID_ALIAS);
          }
          String pid=ConfigBootstrapHelper.unqualifyPid(conf.getPid());
          String factoryPid=ConfigBootstrapHelper.unqualifyPid(conf.getFactoryPid());
          String id=factoryPid != null && alias != null ? factoryPid + "String_Node_Str" + alias : pid;
          configEntry.put("String_Node_Str",id);
          configEntry.put("String_Node_Str",pid);
          configEntry.put("String_Node_Str",factoryPid);
          configList.add(configEntry);
        }
      }
      result.put("String_Node_Str",configList);
      logger.debug("String_Node_Str",configList.size());
    }
 else {
      Configuration config=findExistingConfiguration(new ParsedId(resourceName));
      if (config == null) {
        throw new NotFoundException("String_Node_Str" + resourceName.toString());
      }
      Dictionary props=config.getProperties();
      JSONEnhancedConfig enhancedConfig=new JSONEnhancedConfig();
      JsonValue value=enhancedConfig.getConfiguration(props,resourceName.toString(),false);
      result=value.asMap();
      logger.debug("String_Node_Str",resourceName);
    }
  }
 catch (  ResourceException ex) {
    throw ex;
  }
catch (  Exception ex) {
    logger.warn("String_Node_Str",resourceName,ex);
    throw new InternalServerErrorException("String_Node_Str" + resourceName + "String_Node_Str"+ ex.getMessage(),ex);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Gets an object from the object set by identifier. <p/> The object may contain metadata properties, including object identifier   {@code _id}, and object version   {@code _rev} to enable optimistic concurrency supported by OpenIDM.
 * @param resourceName the identifier of the resource to retrieve from the object set.
 * @return the requested object.
 * @throws NotFoundException   if the specified object could not be found.
 * @throws ForbiddenException  if access to the object is forbidden.
 * @throws BadRequestException if the passed identifier is invalid
 */
public JsonValue read(ResourceName resourceName) throws ResourceException {
  logger.debug("String_Node_Str",resourceName.toString());
  JsonValue result=null;
  try {
    if (resourceName.isEmpty()) {
      result=new JsonValue(new HashMap<String,Object>());
      Configuration[] rawConfigs=configAdmin.listConfigurations(null);
      List configList=new ArrayList();
      if (null != rawConfigs) {
        for (        Configuration conf : rawConfigs) {
          Map<String,Object> configEntry=new LinkedHashMap<String,Object>();
          String alias=null;
          Dictionary properties=conf.getProperties();
          if (properties != null) {
            alias=(String)properties.get(JSONConfigInstaller.SERVICE_FACTORY_PID_ALIAS);
          }
          String pid=ConfigBootstrapHelper.unqualifyPid(conf.getPid());
          String factoryPid=ConfigBootstrapHelper.unqualifyPid(conf.getFactoryPid());
          String id=factoryPid != null && alias != null ? factoryPid + "String_Node_Str" + alias : pid;
          configEntry.put("String_Node_Str",id);
          configEntry.put("String_Node_Str",pid);
          configEntry.put("String_Node_Str",factoryPid);
          configList.add(configEntry);
        }
      }
      result.put("String_Node_Str",configList);
      logger.debug("String_Node_Str",configList.size());
    }
 else {
      Configuration config=findExistingConfiguration(new ParsedId(resourceName));
      if (config == null) {
        throw new NotFoundException("String_Node_Str" + resourceName.toString());
      }
      Dictionary props=config.getProperties();
      JSONEnhancedConfig enhancedConfig=new JSONEnhancedConfig();
      result=enhancedConfig.getConfiguration(props,resourceName.toString(),false);
      logger.debug("String_Node_Str",resourceName);
    }
  }
 catch (  ResourceException ex) {
    throw ex;
  }
catch (  Exception ex) {
    logger.warn("String_Node_Str",resourceName,ex);
    throw new InternalServerErrorException("String_Node_Str" + resourceName + "String_Node_Str"+ ex.getMessage(),ex);
  }
  return result;
}