Program: 8471
Project: 8471
Buggy source:
/** 
 * Currently this function will handle these data types: <ul> <li>1. Primitive data type: int, boolean, double, float, long</li> <li>2. Object data type: String, Integer, Double, Float, Long</li> <li>3. Array of primitive data type: int[], boolean[], double[], float[], long[]</li> <li>4. Array of object data type: String[], Integer[], Boolean[], Double[], Float[], Long[]</li> <li>5. User defined data type.</li> <li>6. Array of user defined data type.</li> </ul>
 * @param userObj this object is used by the function to extract the object info, such as class name, objects declarations, object data structure...
 * @param fields the array contains the list of name in the specify data structure
 * @param excelRowData the raw data read from the excel sheet to be extracted and filled up the object before return the full object to the caller.
 * @return Object which can be cast into a user defined type to get access to its fields
 */
protected Object prepareObject(Object userObj,Field[] fields,List<String> excelRowData) throws IllegalAccessException, ExcelDataProviderException {
  logger.entering(new Object[]{userObj,fields,excelRowData});
  Object objectToReturn=createObjectToUse(userObj);
  int index=0;
  for (  Field eachField : fields) {
    Class<?> eachFieldType=eachField.getType();
    if (eachFieldType.isInterface()) {
      throw new IllegalArgumentException(eachField.getName() + "String_Node_Str");
    }
    String data=excelRowData.get(index++);
    if (StringUtils.isEmpty(data)) {
      continue;
    }
    eachField.setAccessible(true);
    boolean isArray=eachFieldType.isArray();
    DataMemberInformation memberInfo=new DataMemberInformation(eachField,userObj,objectToReturn,data);
    if (isArray) {
      try {
        setValueForArrayType(memberInfo);
      }
 catch (      ArrayIndexOutOfBoundsException|IllegalArgumentException|InstantiationException e) {
        throw new ExcelDataProviderException(e.getMessage(),e);
      }
    }
 else {
      try {
        setValueForNonArrayType(memberInfo);
      }
 catch (      InstantiationException|IllegalArgumentException|InvocationTargetException|NoSuchMethodException|SecurityException e) {
        throw new ExcelDataProviderException(e.getMessage(),e);
      }
    }
  }
  logger.exiting(objectToReturn);
  return objectToReturn;
}

Fixed version (ground truth):
/** 
 * Currently this function will handle these data types: <ul> <li>1. Primitive data type: int, boolean, double, float, long</li> <li>2. Object data type: String, Integer, Double, Float, Long</li> <li>3. Array of primitive data type: int[], boolean[], double[], float[], long[]</li> <li>4. Array of object data type: String[], Integer[], Boolean[], Double[], Float[], Long[]</li> <li>5. User defined data type.</li> <li>6. Array of user defined data type.</li> </ul>
 * @param userObj this object is used by the function to extract the object info, such as class name, objects declarations, object data structure...
 * @param fields the array contains the list of name in the specify data structure
 * @param excelRowData the raw data read from the excel sheet to be extracted and filled up the object before return the full object to the caller.
 * @return Object which can be cast into a user defined type to get access to its fields
 */
protected Object prepareObject(Object userObj,Field[] fields,List<String> excelRowData) throws IllegalAccessException, ExcelDataProviderException {
  logger.entering(new Object[]{userObj,fields,excelRowData});
  Object objectToReturn=createObjectToUse(userObj);
  int index=0;
  for (  Field eachField : fields) {
    String data=excelRowData.get(index++);
    if (StringUtils.isEmpty(data)) {
      continue;
    }
    Class<?> eachFieldType=eachField.getType();
    if (eachFieldType.isInterface()) {
      throw new IllegalArgumentException(eachField.getName() + "String_Node_Str");
    }
    eachField.setAccessible(true);
    boolean isArray=eachFieldType.isArray();
    DataMemberInformation memberInfo=new DataMemberInformation(eachField,userObj,objectToReturn,data);
    if (isArray) {
      try {
        setValueForArrayType(memberInfo);
      }
 catch (      ArrayIndexOutOfBoundsException|IllegalArgumentException|InstantiationException e) {
        throw new ExcelDataProviderException(e.getMessage(),e);
      }
    }
 else {
      try {
        setValueForNonArrayType(memberInfo);
      }
 catch (      InstantiationException|IllegalArgumentException|InvocationTargetException|NoSuchMethodException|SecurityException e) {
        throw new ExcelDataProviderException(e.getMessage(),e);
      }
    }
  }
  logger.exiting(objectToReturn);
  return objectToReturn;
}