Program: 66126
Project: 66126
Buggy source:
/** 
 * Get the argument info list if the function has
 * @return the corresponding argument info in time functions.
 */
public List<IArgumentInfo> getArguments(){
  List<IArgumentInfo> arguments=new ArrayList<IArgumentInfo>();
  period1=new ArgumentInfo(IArgumentInfo.PERIOD_1,Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD1),false);
  period2=new ArgumentInfo(IArgumentInfo.PERIOD_2,Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD2_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD2),false);
  if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_MONTH)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_QUARTER)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_YEAR)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.MONTH_TO_DATE_LAST_YEAR)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.QUARTER_TO_DATE_LAST_YEAR)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_WEEK_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_MONTH_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_QUARTER_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_YEAR_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.CURRENT_PERIOD_FROM_N_PERIOD_AGO)) {
    this.period_type1.remove(IArgumentInfo.Period_Type.DAY);
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(period1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD2,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N2),false));
    ((ArgumentInfo)period2).setPeriodChoices(period_type2);
    arguments.add(period2);
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PERIOD_TO_DATE_FROM_N_PERIOD_AGO)) {
    this.period_type1.remove(IArgumentInfo.Period_Type.DAY);
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(period1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD2,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N2),false));
    ((ArgumentInfo)period2).setPeriodChoices(period_type2);
    arguments.add(period2);
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.TRAILING_N_PERIOD_FROM_N_PERIOD_AGO)) {
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),false));
    arguments.add(period1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD2,Message.getMessage(ResourceConstants.TIMEFUNCITON_N2_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N2),false));
    ((ArgumentInfo)period2).setPeriodChoices(period_type2);
    arguments.add(period2);
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.NEXT_N_PERIODS)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),false));
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(period1);
  }
  return arguments;
}

Fixed version (ground truth):
/** 
 * Get the argument info list if the function has
 * @return the corresponding argument info in time functions.
 */
public List<IArgumentInfo> getArguments(){
  List<IArgumentInfo> arguments=new ArrayList<IArgumentInfo>();
  period1=new ArgumentInfo(IArgumentInfo.PERIOD_1,Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD1),false);
  period2=new ArgumentInfo(IArgumentInfo.PERIOD_2,Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD2_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_PERIOD2),false);
  if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_MONTH)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_QUARTER)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_YEAR)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.MONTH_TO_DATE_LAST_YEAR)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.QUARTER_TO_DATE_LAST_YEAR)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_WEEK_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_MONTH_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_QUARTER_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PREVIOUS_YEAR_TO_DATE)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),true));
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.CURRENT_PERIOD_FROM_N_PERIOD_AGO)) {
    this.period_type1.remove(IArgumentInfo.Period_Type.DAY);
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(period1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD2,Message.getMessage(ResourceConstants.TIMEFUNCITON_N2_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N2),false));
    ((ArgumentInfo)period2).setPeriodChoices(period_type2);
    arguments.add(period2);
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.PERIOD_TO_DATE_FROM_N_PERIOD_AGO)) {
    this.period_type1.remove(IArgumentInfo.Period_Type.DAY);
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(period1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD2,Message.getMessage(ResourceConstants.TIMEFUNCITON_N2_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N2),false));
    ((ArgumentInfo)period2).setPeriodChoices(period_type2);
    arguments.add(period2);
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.TRAILING_N_PERIOD_FROM_N_PERIOD_AGO)) {
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),false));
    arguments.add(period1);
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD2,Message.getMessage(ResourceConstants.TIMEFUNCITON_N2_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N2),false));
    ((ArgumentInfo)period2).setPeriodChoices(period_type2);
    arguments.add(period2);
  }
 else   if (this.name.equals(IBuildInBaseTimeFunction.NEXT_N_PERIODS)) {
    arguments.add(new ArgumentInfo(IArgumentInfo.N_PERIOD1,Message.getMessage(ResourceConstants.TIMEFUNCITON_N1_DISPLAYNAME),Message.getMessage(ResourceConstants.TIMEFUNCITON_N1),false));
    ((ArgumentInfo)period1).setPeriodChoices(period_type1);
    arguments.add(period1);
  }
  return arguments;
}