Program: 117241
Project: 117241
Buggy source:
/** 
 * Creates an   {@link com.att.research.xacml.api.Attribute} from the value associated with the field with the given <code>fieldName</code>.
 * @param resultSet the {@link java.sql.ResultSet} containing the current row from the database
 * @param fieldName the <code>String</code> name of the field containing the attribute value
 * @param pipRequestAttribute the {@link com.att.research.xacml.api.pip.PIPRequest} for the <code>Attribute</code> to create
 * @return a new <code>Attribute</code> with the value of the given <code>fieldName</code>.
 */
protected Attribute getAttributeFromResultSet(ResultSet resultSet,String fieldName,PIPRequest pipRequestAttribute){
  AttributeValue<?> attributeValue=null;
  Identifier identifierDataType=pipRequestAttribute.getDataTypeId();
  try {
    DataType<?> dataType=dataTypeFactory.getDataType(identifierDataType);
    if (dataType == null) {
      this.logger.warn("String_Node_Str" + pipRequestAttribute.getDataTypeId().stringValue());
      return null;
    }
    if (identifierDataType.equals(XACML3.ID_DATATYPE_BOOLEAN)) {
      attributeValue=dataType.createAttributeValue(resultSet.getBoolean(fieldName));
    }
 else     if (identifierDataType.equals(XACML3.ID_DATATYPE_DATE) || identifierDataType.equals(XACML3.ID_DATATYPE_DATETIME)) {
      attributeValue=dataType.createAttributeValue(resultSet.getDate(fieldName));
    }
 else     if (identifierDataType.equals(XACML3.ID_DATATYPE_DOUBLE)) {
      attributeValue=dataType.createAttributeValue(resultSet.getDouble(fieldName));
    }
 else     if (identifierDataType.equals(XACML3.ID_DATATYPE_INTEGER)) {
      attributeValue=dataType.createAttributeValue(resultSet.getInt(fieldName));
    }
 else {
      String stringValue=resultSet.getString(fieldName);
      if (stringValue != null) {
        attributeValue=dataType.createAttributeValue(stringValue);
      }
    }
  }
 catch (  Exception ex) {
    this.logger.error("String_Node_Str" + fieldName + "String_Node_Str"+ identifierDataType.stringValue()+ "String_Node_Str"+ ex.toString(),ex);
    return null;
  }
  String issuer=this.defaultIssuer;
  if (pipRequestAttribute.getIssuer() != null) {
    issuer=pipRequestAttribute.getIssuer();
  }
  return new StdAttribute(pipRequestAttribute.getCategory(),pipRequestAttribute.getAttributeId(),attributeValue,issuer,false);
}

Fixed version (ground truth):
/** 
 * Creates an   {@link com.att.research.xacml.api.Attribute} from the value associated with the field with the given <code>fieldName</code>.
 * @param resultSet the {@link java.sql.ResultSet} containing the current row from the database
 * @param fieldName the <code>String</code> name of the field containing the attribute value
 * @param pipRequestAttribute the {@link com.att.research.xacml.api.pip.PIPRequest} for the <code>Attribute</code> to create
 * @return a new <code>Attribute</code> with the value of the given <code>fieldName</code>.
 */
protected Attribute getAttributeFromResultSet(ResultSet resultSet,String fieldName,PIPRequest pipRequestAttribute){
  AttributeValue<?> attributeValue=null;
  Identifier identifierDataType=pipRequestAttribute.getDataTypeId();
  try {
    DataType<?> dataType=dataTypeFactory.getDataType(identifierDataType);
    if (dataType == null) {
      this.logger.warn("String_Node_Str" + pipRequestAttribute.getDataTypeId().stringValue());
      return null;
    }
    int columnIndex=-1;
    try {
      columnIndex=resultSet.findColumn(fieldName);
    }
 catch (    Exception e) {
      try {
        columnIndex=Integer.parseInt(fieldName);
      }
 catch (      Exception e1) {
        logger.error("String_Node_Str" + fieldName);
      }
    }
    if (this.logger.isDebugEnabled()) {
      this.logger.debug("String_Node_Str" + fieldName + "String_Node_Str"+ columnIndex);
    }
    if (identifierDataType.equals(XACML3.ID_DATATYPE_BOOLEAN)) {
      attributeValue=dataType.createAttributeValue(resultSet.getBoolean(columnIndex));
    }
 else     if (identifierDataType.equals(XACML3.ID_DATATYPE_DATE) || identifierDataType.equals(XACML3.ID_DATATYPE_DATETIME)) {
      attributeValue=dataType.createAttributeValue(resultSet.getDate(columnIndex));
    }
 else     if (identifierDataType.equals(XACML3.ID_DATATYPE_DOUBLE)) {
      attributeValue=dataType.createAttributeValue(resultSet.getDouble(columnIndex));
    }
 else     if (identifierDataType.equals(XACML3.ID_DATATYPE_INTEGER)) {
      attributeValue=dataType.createAttributeValue(resultSet.getInt(columnIndex));
    }
 else {
      String stringValue=resultSet.getString(columnIndex);
      if (stringValue != null) {
        attributeValue=dataType.createAttributeValue(stringValue);
      }
    }
  }
 catch (  Exception ex) {
    this.logger.error("String_Node_Str" + fieldName + "String_Node_Str"+ identifierDataType.stringValue()+ "String_Node_Str"+ ex.toString(),ex);
    return null;
  }
  String issuer=this.defaultIssuer;
  if (pipRequestAttribute.getIssuer() != null) {
    issuer=pipRequestAttribute.getIssuer();
  }
  return new StdAttribute(pipRequestAttribute.getCategory(),pipRequestAttribute.getAttributeId(),attributeValue,issuer,false);
}