Program: 125725
Project: 125725
Buggy source:
/** 
 * DOC Zqin Comment method "format".
 * @param input the object that was formated.
 * @param style the style of formated, it should be 0, 1, 99999.
 * @return the formated object.
 */
public static Object format(Object input,int style){
  try {
    if (checkInput(input)) {
      DecimalFormat format=null;
      BigDecimal zero=new BigDecimal(0);
      BigDecimal temp=new BigDecimal(input.toString());
      BigDecimal min=new BigDecimal(10E-5);
      BigDecimal max=new BigDecimal(9999 * 10E-5);
      boolean isUseScientific=false;
switch (style) {
case 0:
        if (temp.compareTo(min) == -1 && temp.compareTo(zero) == 1) {
          isUseScientific=true;
        }
 else         if (temp.compareTo(max) == 1 && temp.compareTo(new BigDecimal(1)) == -1) {
          input=max.toString();
        }
      format=(DecimalFormat)DecimalFormat.getPercentInstance(Locale.ENGLISH);
    format.applyPattern("String_Node_Str");
  break;
case 1:
min=new BigDecimal(10E-3);
if (temp.compareTo(min) == -1 && temp.compareTo(zero) == 1) {
isUseScientific=true;
}
format=(DecimalFormat)DecimalFormat.getNumberInstance(Locale.ENGLISH);
format.applyPattern("String_Node_Str");
break;
default :
format=(DecimalFormat)DecimalFormat.getInstance(Locale.getDefault());
return format.parse(input.toString());
}
if (isUseScientific) {
format.applyPattern("String_Node_Str");
}
return format.format(new Double(input.toString()));
}
 else {
return input;
}
}
 catch (Exception e) {
return input;
}
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "format".
 * @param input the object that was formated.
 * @param style the style of formated, it should be 0, 1,2,99999.
 * @return the formated object.
 */
public static Object format(Object input,int style){
  try {
    if (checkInput(input)) {
      DecimalFormat format=null;
      BigDecimal zero=new BigDecimal(0);
      BigDecimal temp=new BigDecimal(input.toString());
      BigDecimal min=new BigDecimal(10E-5);
      BigDecimal max=new BigDecimal(9999 * 10E-5);
      boolean isUseScientific=false;
switch (style) {
case PERCENT:
        if (temp.compareTo(min) == -1 && temp.compareTo(zero) == 1) {
          isUseScientific=true;
        }
 else         if (temp.compareTo(max) == 1 && temp.compareTo(new BigDecimal(1)) == -1) {
          input=max.toString();
        }
      format=(DecimalFormat)DecimalFormat.getPercentInstance(Locale.ENGLISH);
    format.applyPattern("String_Node_Str");
  break;
case INT_NUMBER:
min=new BigDecimal(10E-3);
if (temp.compareTo(min) == -1 && temp.compareTo(zero) == 1) {
isUseScientific=true;
}
format=(DecimalFormat)DecimalFormat.getNumberInstance(Locale.ENGLISH);
format.applyPattern("String_Node_Str");
break;
case DOUBLE_NUMBER:
min=new BigDecimal(10E-3);
if (temp.compareTo(min) == -1 && temp.compareTo(zero) == 1) {
isUseScientific=true;
}
format=(DecimalFormat)DecimalFormat.getNumberInstance(Locale.ENGLISH);
format.applyPattern("String_Node_Str");
break;
default :
format=(DecimalFormat)DecimalFormat.getInstance(Locale.getDefault());
return format.parse(input.toString());
}
if (isUseScientific) {
format.applyPattern("String_Node_Str");
}
return format.format(new Double(input.toString()));
}
 else {
return input;
}
}
 catch (Exception e) {
return input;
}
}