Program: 76408
Project: 76408
Buggy source:
/** 
 * Convert report parameter from string into object. Need to be pointed out is it return a Double object when the value type is Float.
 * @param reportParameterValue report parameter value in string.
 * @param parameterValueType report parameter type.
 * @return parameter value object.
 */
public Object parse(String reportParameterValue,int parameterValueType){
  Object parameterValueObj=null;
  if (reportParameterValue != null && locale != null) {
switch (parameterValueType) {
case IScalarParameterDefn.TYPE_STRING:
{
        StringFormatter sf=new StringFormatter(ULocale.forLocale(locale));
        if (format != null) {
          sf.applyPattern(format);
        }
        try {
          parameterValueObj=sf.parser(reportParameterValue);
        }
 catch (        ParseException e) {
          parameterValueObj=reportParameterValue;
        }
        break;
      }
case IScalarParameterDefn.TYPE_DATE_TIME:
{
      DateFormatter df=new DateFormatter(ULocale.forLocale(locale));
      if (format != null) {
        df.applyPattern(format);
      }
      try {
        parameterValueObj=df.parse(reportParameterValue);
      }
 catch (      ParseException e) {
        df.applyPattern("String_Node_Str");
        try {
          parameterValueObj=df.parse(reportParameterValue);
        }
 catch (        ParseException ex) {
          df.applyPattern("String_Node_Str");
          try {
            parameterValueObj=df.parse(reportParameterValue);
          }
 catch (          ParseException exx) {
            parameterValueObj=null;
          }
        }
      }
      break;
    }
case IScalarParameterDefn.TYPE_FLOAT:
{
    NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
    if (format != null) {
      nf.applyPattern(format);
    }
    try {
      Number num=nf.parse(reportParameterValue);
      if (num != null) {
        parameterValueObj=new Double(num.toString());
      }
    }
 catch (    ParseException e) {
      nf.applyPattern("String_Node_Str");
      try {
        Number num=nf.parse(reportParameterValue);
        if (num != null) {
          parameterValueObj=new Double(num.toString());
        }
      }
 catch (      ParseException ex) {
        parameterValueObj=null;
      }
    }
    break;
  }
case IScalarParameterDefn.TYPE_DECIMAL:
{
  NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
  if (format != null) {
    nf.applyPattern(format);
  }
  try {
    Number num=nf.parse(reportParameterValue);
    if (num != null) {
      parameterValueObj=new BigDecimal(num.toString());
    }
  }
 catch (  ParseException e) {
    nf.applyPattern("String_Node_Str");
    try {
      Number num=nf.parse(reportParameterValue);
      if (num != null) {
        parameterValueObj=new BigDecimal(num.toString());
      }
    }
 catch (    ParseException ex) {
      parameterValueObj=null;
    }
  }
  break;
}
case IScalarParameterDefn.TYPE_BOOLEAN:
{
parameterValueObj=Boolean.valueOf(reportParameterValue);
break;
}
case IScalarParameterDefn.TYPE_INTEGER:
{
NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
if (format != null) {
nf.applyPattern(format);
}
try {
Number num=nf.parse(reportParameterValue);
if (num != null) {
  parameterValueObj=new Integer(num.intValue());
}
}
 catch (ParseException ex) {
nf.applyPattern("String_Node_Str");
try {
  Number num=nf.parse(reportParameterValue);
  if (num != null) {
    parameterValueObj=new Integer(num.intValue());
  }
}
 catch (ParseException pex) {
  try {
    parameterValueObj=new Integer(reportParameterValue);
  }
 catch (  NumberFormatException nfe) {
    parameterValueObj=null;
  }
}
}
}
}
}
return parameterValueObj;
}

Fixed version (ground truth):
/** 
 * Convert report parameter from string into object. Need to be pointed out is it return a Double object when the value type is Float.
 * @param reportParameterValue report parameter value in string.
 * @param parameterValueType report parameter type.
 * @return parameter value object.
 */
public Object parse(String reportParameterValue,int parameterValueType){
  Object parameterValueObj=null;
  if (reportParameterValue != null && locale != null) {
switch (parameterValueType) {
case IScalarParameterDefn.TYPE_STRING:
{
        StringFormatter sf=new StringFormatter(ULocale.forLocale(locale));
        if (format != null) {
          sf.applyPattern(format);
        }
        try {
          parameterValueObj=sf.parser(reportParameterValue);
        }
 catch (        ParseException e) {
          parameterValueObj=reportParameterValue;
        }
        break;
      }
case IScalarParameterDefn.TYPE_DATE_TIME:
{
      DateFormatter df=new DateFormatter(ULocale.forLocale(locale));
      if (format != null) {
        df.applyPattern(format);
      }
      try {
        parameterValueObj=df.parse(reportParameterValue);
      }
 catch (      ParseException e) {
        df.applyPattern("String_Node_Str");
        try {
          parameterValueObj=df.parse(reportParameterValue);
        }
 catch (        ParseException ex) {
          df.applyPattern("String_Node_Str");
          try {
            parameterValueObj=df.parse(reportParameterValue);
          }
 catch (          ParseException exx) {
            parameterValueObj=null;
          }
        }
      }
      break;
    }
case IScalarParameterDefn.TYPE_FLOAT:
{
    NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
    if (format != null) {
      nf.applyPattern(format);
    }
    try {
      Number num=nf.parse(reportParameterValue);
      if (num != null) {
        parameterValueObj=new Double(num.toString());
      }
    }
 catch (    ParseException e) {
      nf.applyPattern("String_Node_Str");
      try {
        Number num=nf.parse(reportParameterValue);
        if (num != null) {
          parameterValueObj=new Double(num.toString());
        }
      }
 catch (      ParseException ex) {
        parameterValueObj=null;
      }
    }
    break;
  }
case IScalarParameterDefn.TYPE_DECIMAL:
{
  NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
  if (format != null) {
    nf.applyPattern(format);
  }
  try {
    Number num=nf.parse(reportParameterValue);
    if (num != null) {
      parameterValueObj=new BigDecimal(num.toString());
    }
  }
 catch (  ParseException e) {
    nf.applyPattern("String_Node_Str");
    try {
      Number num=nf.parse(reportParameterValue);
      if (num != null) {
        parameterValueObj=new BigDecimal(num.toString());
      }
    }
 catch (    ParseException ex) {
      parameterValueObj=null;
    }
  }
  break;
}
case IScalarParameterDefn.TYPE_BOOLEAN:
{
parameterValueObj=Boolean.valueOf(reportParameterValue);
break;
}
case IScalarParameterDefn.TYPE_DATE:
{
parameterValueObj=java.sql.Date.valueOf(reportParameterValue);
break;
}
case IScalarParameterDefn.TYPE_TIME:
{
parameterValueObj=java.sql.Time.valueOf(reportParameterValue);
break;
}
case IScalarParameterDefn.TYPE_INTEGER:
{
NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
if (format != null) {
nf.applyPattern(format);
}
try {
Number num=nf.parse(reportParameterValue);
if (num != null) {
parameterValueObj=new Integer(num.intValue());
}
}
 catch (ParseException ex) {
nf.applyPattern("String_Node_Str");
try {
Number num=nf.parse(reportParameterValue);
if (num != null) {
parameterValueObj=new Integer(num.intValue());
}
}
 catch (ParseException pex) {
try {
parameterValueObj=new Integer(reportParameterValue);
}
 catch (NumberFormatException nfe) {
parameterValueObj=null;
}
}
}
}
}
}
return parameterValueObj;
}