Program: 31672
Project: 31672
Buggy source:
private double[] convertDataMapToDoubleArray(Map<String,Object> dataMap){
  double[] data=new double[this.columnNumIndexMapping.size()];
  for (  Entry<Integer,Integer> entry : this.columnNumIndexMapping.entrySet()) {
    double value=0d;
    Integer columnNum=entry.getKey();
    String columnName=this.numNameMapping.get(columnNum);
    Object obj=dataMap.get(columnName);
    if (this.categoricalColumnNameNames.containsKey(columnNum)) {
      double indexValue=-1d;
      int categoricalSize=categoricalColumnNameNames.get(columnNum).size();
      if (obj == null) {
        indexValue=categoricalSize;
      }
 else {
        Integer intIndex=columnCategoryIndexMapping.get(columnNum).get(obj.toString());
        if (intIndex == null || intIndex < 0 || intIndex >= categoricalSize) {
          intIndex=categoricalSize;
        }
        indexValue=intIndex;
      }
      value=indexValue;
    }
 else {
      if (obj == null || ((obj instanceof String) && ((String)obj).length() == 0)) {
        value=this.numericalMeanMapping.get(columnNum) == null ? 0d : this.numericalMeanMapping.get(columnNum);
      }
 else {
        if (obj instanceof Number) {
          value=((Number)obj).doubleValue();
        }
 else {
          try {
            value=Double.parseDouble(obj.toString());
          }
 catch (          NumberFormatException e) {
            value=this.numericalMeanMapping.get(columnNum) == null ? 0d : this.numericalMeanMapping.get(columnNum);
          }
        }
      }
      if (Double.isNaN(value)) {
        value=this.numericalMeanMapping.get(columnNum) == null ? 0d : this.numericalMeanMapping.get(columnNum);
      }
    }
    Integer index=entry.getValue();
    if (index != null && index < data.length) {
      data[index]=value;
    }
  }
  return data;
}

Fixed version (ground truth):
private double[] convertDataMapToDoubleArray(Map<String,Object> dataMap){
  double[] data=new double[this.columnNumIndexMapping.size()];
  for (  Entry<Integer,Integer> entry : this.columnNumIndexMapping.entrySet()) {
    double value=0d;
    Integer columnNum=entry.getKey();
    String columnName=this.numNameMapping.get(columnNum);
    Object obj=dataMap.get(columnName);
    if (this.categoricalColumnNameNames.containsKey(columnNum)) {
      double indexValue=-1d;
      int categoricalSize=categoricalColumnNameNames.get(columnNum).size();
      if (obj == null) {
        indexValue=categoricalSize;
      }
 else {
        Map<String,Integer> categoryIndexMap=columnCategoryIndexMapping.get(columnNum);
        Integer intIndex=categoryIndexMap.get(obj.toString());
        if (intIndex == null || intIndex < 0 || intIndex >= categoricalSize) {
          intIndex=categoryIndexMap.get(CommonUtils.trimTag(obj.toString()));
          if (intIndex == null || intIndex < 0 || intIndex >= categoricalSize) {
            intIndex=categoricalSize;
          }
        }
        indexValue=intIndex;
      }
      value=indexValue;
    }
 else {
      if (obj == null || ((obj instanceof String) && ((String)obj).length() == 0)) {
        value=this.numericalMeanMapping.get(columnNum) == null ? 0d : this.numericalMeanMapping.get(columnNum);
      }
 else {
        if (obj instanceof Number) {
          value=((Number)obj).doubleValue();
        }
 else {
          try {
            value=Double.parseDouble(obj.toString());
          }
 catch (          NumberFormatException e) {
            value=this.numericalMeanMapping.get(columnNum) == null ? 0d : this.numericalMeanMapping.get(columnNum);
          }
        }
      }
      if (Double.isNaN(value)) {
        value=this.numericalMeanMapping.get(columnNum) == null ? 0d : this.numericalMeanMapping.get(columnNum);
      }
    }
    Integer index=entry.getValue();
    if (index != null && index < data.length) {
      data[index]=value;
    }
  }
  return data;
}