Program: 134939
Project: 134939
Buggy source:
/** 
 * Build a Filter object All the parameters are String objects.  Before building the object, the value of each parameter is checked This method is too long (and boring) for my taste but it is very easy
 * @param field The filed parameter fo Filter
 * @param lethal The isLethal parameter of Filter
 * @param not The applyAsNOT parameter of Filter
 * @param min The minimum parameter of Filter
 * @param minType The type of minimum
 * @param max The max parameter of Filter
 * @param maxType The type of max
 * @param exact The exact parameter of Filter
 * @param exactType The type of exact
 * @param wildChar The regularExpression parameter of Filter
 * @return The Filter object built or null if an error occurred decoding the parameters
 * @throws Exception in case of error building the filter
 */
public static Filter buildFilter(String field,String lethal,String not,String min,String minType,String max,String maxType,String exact,String exactType,String wildChar) throws Exception {
  Filter f=null;
  if (field != null) {
    field=field.trim();
  }
  if (lethal != null) {
    lethal=lethal.trim();
  }
  if (not != null) {
    not=not.trim();
  }
  if (min != null) {
    min=min.trim();
  }
  if (minType != null) {
    minType=minType.trim();
  }
  if (max != null) {
    max=max.trim();
  }
  if (maxType != null) {
    maxType=maxType.trim();
  }
  if (exact != null) {
    exact=exact.trim();
  }
  if (exactType != null) {
    exactType=exactType.trim();
  }
  if (wildChar != null) {
    wildChar=wildChar.trim();
  }
  int fieldInt;
  if (field == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  fieldInt=Integer.parseInt(field);
  int temp;
  if (lethal == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  temp=Integer.parseInt(lethal);
  boolean isLethal=(temp == 1);
  if (not == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  temp=Integer.parseInt(not);
  boolean notPolicy=(temp == 1);
  if (wildChar != null && (min != null || max != null || exact != null)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (exact != null && (min != null || max != null)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (exact != null && exactType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (min != null && minType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (max != null && maxType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (minType != null && maxType != null) {
    if (minType.compareTo(maxType) != 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  if (wildChar != null) {
    f=new Filter(fieldInt,isLethal,wildChar,notPolicy);
    return f;
  }
  if (exact != null) {
    if (exactType.compareTo("String_Node_Str") == 0) {
      Integer integer;
      try {
        integer=new Integer(exact);
      }
 catch (      NumberFormatException e) {
        throw new IllegalArgumentException("String_Node_Str" + exact);
      }
      f=new Filter(fieldInt,isLethal,integer,notPolicy);
    }
 else     if (exactType.compareTo("String_Node_Str") == 0) {
      Date date=null;
      try {
        date=new Date(Long.parseLong(exact));
      }
 catch (      NumberFormatException e) {
        throw new IllegalArgumentException("String_Node_Str" + exact);
      }
      f=new Filter(fieldInt,isLethal,date,notPolicy);
    }
 else     if (exactType.compareTo("String_Node_Str") == 0) {
      f=new Filter(fieldInt,isLethal,(Object)exact,notPolicy);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + exactType);
    }
    return f;
  }
  if (minType == null) {
    minType=maxType;
  }
  if (minType.compareTo("String_Node_Str") == 0) {
    f=new Filter(fieldInt,isLethal,min,max,notPolicy);
  }
 else   if (minType.compareTo("String_Node_Str") == 0) {
    Date minDate=null;
    Date maxDate=null;
    try {
      if (min != null) {
        minDate=new Date(Long.parseLong(min));
      }
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + min);
    }
    try {
      if (max != null) {
        maxDate=new Date(Long.parseLong(max));
      }
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + max);
    }
    f=new Filter(fieldInt,isLethal,minDate,maxDate,notPolicy);
  }
 else   if (minType.compareTo("String_Node_Str") == 0) {
    Integer minInt=null;
    Integer maxInt=null;
    if (min == null) {
      throw new IllegalArgumentException("String_Node_Str" + min);
    }
    if (max == null) {
      throw new IllegalArgumentException("String_Node_Str" + min);
    }
    try {
      minInt=new Integer(min);
      maxInt=new Integer(max);
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + min + "String_Node_Str"+ max);
    }
    f=new Filter(fieldInt,isLethal,minInt,maxInt,notPolicy);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return f;
}

Fixed version (ground truth):
/** 
 * Build a Filter object All the parameters are String objects.  Before building the object, the value of each parameter is checked This method is too long (and boring) for my taste but it is very easy
 * @param field The filed parameter fo Filter
 * @param lethal The isLethal parameter of Filter
 * @param not The applyAsNOT parameter of Filter
 * @param min The minimum parameter of Filter
 * @param minType The type of minimum
 * @param max The max parameter of Filter
 * @param maxType The type of max
 * @param exact The exact parameter of Filter
 * @param exactType The type of exact
 * @param wildChar The regularExpression parameter of Filter
 * @return The Filter object built or null if an error occurred decoding the parameters
 * @throws Exception in case of error building the filter
 */
public static Filter buildFilter(String field,String lethal,String not,String min,String minType,String max,String maxType,String exact,String exactType,String wildChar) throws Exception {
  Filter f=null;
  if (field != null) {
    field=field.trim();
  }
  if (lethal != null) {
    lethal=lethal.trim();
  }
  if (not != null) {
    not=not.trim();
  }
  if (min != null) {
    min=min.trim();
  }
  if (minType != null) {
    minType=minType.trim();
  }
  if (max != null) {
    max=max.trim();
  }
  if (maxType != null) {
    maxType=maxType.trim();
  }
  if (exact != null) {
    exact=exact.trim();
  }
  if (exactType != null) {
    exactType=exactType.trim();
  }
  if (wildChar != null) {
    wildChar=wildChar.trim();
  }
  int fieldInt;
  if (field == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  fieldInt=Integer.parseInt(field);
  int temp;
  if (lethal == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  temp=Integer.parseInt(lethal);
  boolean isLethal=(temp == 1);
  if (not == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  temp=Integer.parseInt(not);
  boolean notPolicy=(temp == 1);
  if (wildChar != null && (min != null || max != null || exact != null)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (wildChar == null && min == null && max == null && exact == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (exact != null && (min != null || max != null)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (exact != null && exactType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (min != null && minType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (max != null && maxType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (minType != null && maxType != null) {
    if (minType.compareTo(maxType) != 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  if (wildChar != null) {
    f=new Filter(fieldInt,isLethal,wildChar,notPolicy);
    return f;
  }
  if (exact != null) {
    if (exactType.compareTo("String_Node_Str") == 0) {
      Integer integer;
      try {
        integer=new Integer(exact);
      }
 catch (      NumberFormatException e) {
        throw new IllegalArgumentException("String_Node_Str" + exact);
      }
      f=new Filter(fieldInt,isLethal,integer,notPolicy);
    }
 else     if (exactType.compareTo("String_Node_Str") == 0) {
      Date date=null;
      try {
        date=new Date(Long.parseLong(exact));
      }
 catch (      NumberFormatException e) {
        throw new IllegalArgumentException("String_Node_Str" + exact);
      }
      f=new Filter(fieldInt,isLethal,date,notPolicy);
    }
 else     if (exactType.compareTo("String_Node_Str") == 0) {
      f=new Filter(fieldInt,isLethal,(Object)exact,notPolicy);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + exactType);
    }
    return f;
  }
  if (minType == null) {
    minType=maxType;
  }
 else {
    maxType=minType;
  }
  if (minType.compareTo("String_Node_Str") == 0) {
    f=new Filter(fieldInt,isLethal,min,max,notPolicy);
  }
 else   if (minType.compareTo("String_Node_Str") == 0) {
    Date minDate=null;
    Date maxDate=null;
    try {
      if (min != null) {
        minDate=new Date(Long.parseLong(min));
      }
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + min);
    }
    try {
      if (max != null) {
        maxDate=new Date(Long.parseLong(max));
      }
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + max);
    }
    f=new Filter(fieldInt,isLethal,minDate,maxDate,notPolicy);
  }
 else   if (minType.compareTo("String_Node_Str") == 0) {
    Integer minInt=null;
    Integer maxInt=null;
    try {
      if (min != null) {
        minInt=new Integer(min);
      }
      if (max != null) {
        maxInt=new Integer(max);
      }
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + min + "String_Node_Str"+ max);
    }
    f=new Filter(fieldInt,isLethal,minInt,maxInt,notPolicy);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return f;
}