Program: 8813
Project: 8813
Buggy source:
/** 
 * Returns the parameter as an array of Strings. If the parameter is a scalar value its string value is returned as a single element array. If the parameter is an array, the elements are converted to String objects and returned as an array. If the parameter is a collection, the collection elements are converted to String objects and returned as an array. Otherwise (if the property is <code>null</code>) a provided default value is returned.
 * @param propValue The object to convert.
 * @param defaultArray The default array to return.
 */
public static String[] toStringArray(Object propValue,String[] defaultArray){
  if (propValue == null) {
    return defaultArray;
  }
 else   if (propValue instanceof String) {
    return new String[]{(String)propValue};
  }
 else   if (propValue instanceof String[]) {
    return (String[])propValue;
  }
 else   if (propValue.getClass().isArray()) {
    Object[] valueArray=(Object[])propValue;
    List<String> values=new ArrayList<String>(valueArray.length);
    for (    Object value : valueArray) {
      if (value != null) {
        values.add(value.toString());
      }
    }
    return values.toArray(new String[values.size()]);
  }
 else   if (propValue instanceof Collection<?>) {
    Collection<?> valueCollection=(Collection<?>)propValue;
    List<String> valueList=new ArrayList<String>(valueCollection.size());
    for (    Object value : valueCollection) {
      if (value != null) {
        valueList.add(value.toString());
      }
    }
    return valueList.toArray(new String[valueList.size()]);
  }
  return defaultArray;
}

Fixed version (ground truth):
/** 
 * Returns the parameter as an array of Strings. If the parameter is a scalar value its string value is returned as a single element array. If the parameter is an array, the elements are converted to String objects and returned as an array. If the parameter is a collection, the collection elements are converted to String objects and returned as an array. Otherwise (if the property is   {@code null}) a provided default value is returned.
 * @param propValue The object to convert.
 * @param defaultArray The default array to return.
 */
public static String[] toStringArray(Object propValue,String[] defaultArray){
  if (propValue == null) {
    return defaultArray;
  }
 else   if (propValue instanceof String) {
    return new String[]{(String)propValue};
  }
 else   if (propValue instanceof String[]) {
    return (String[])propValue;
  }
 else   if (propValue.getClass().isArray()) {
    Object[] valueArray=(Object[])propValue;
    List<String> values=new ArrayList<String>(valueArray.length);
    for (    Object value : valueArray) {
      if (value != null) {
        values.add(value.toString());
      }
    }
    return values.toArray(new String[values.size()]);
  }
 else   if (propValue instanceof Collection<?>) {
    Collection<?> valueCollection=(Collection<?>)propValue;
    List<String> valueList=new ArrayList<String>(valueCollection.size());
    for (    Object value : valueCollection) {
      if (value != null) {
        valueList.add(value.toString());
      }
    }
    return valueList.toArray(new String[valueList.size()]);
  }
  return defaultArray;
}