Program: 198790
Project: 198790
Buggy source:
/** 
 * Sets all the parameters for displaying this week. The only required parameter is the week number. Other parameters have a default value and will only update if a new value is included, except for focus month, which will always default to no focus month if no value is passed in. See  {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
 * @param params A map of the new parameters, see{@link #VIEW_PARAMS_HEIGHT}
 */
void setMonthParams(HashMap<String,Integer> params){
  if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
    throw new InvalidParameterException("String_Node_Str");
  }
  setTag(params);
  if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
    mRowHeight=params.get(VIEW_PARAMS_HEIGHT);
    if (mRowHeight < MIN_HEIGHT) {
      mRowHeight=MIN_HEIGHT;
    }
  }
  if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
    mSelectedDay=params.get(VIEW_PARAMS_SELECTED_DAY);
  }
  mMonth=params.get(VIEW_PARAMS_MONTH);
  mYear=params.get(VIEW_PARAMS_YEAR);
  final Time today=new Time(Time.getCurrentTimezone());
  today.setToNow();
  mHasToday=false;
  mToday=-1;
  mCalendar.set(Calendar.MONTH,mMonth);
  mCalendar.set(Calendar.YEAR,mYear);
  mCalendar.set(Calendar.DAY_OF_MONTH,1);
  mDayOfWeekStart=mCalendar.get(Calendar.DAY_OF_WEEK);
  if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
    mWeekStart=params.get(VIEW_PARAMS_WEEK_START);
  }
 else {
    mWeekStart=mCalendar.getFirstDayOfWeek();
  }
  if (params.containsKey(VIEW_PARAMS_ENABLEDDAYRANGE_START)) {
    mEnabledDayStart=params.get(VIEW_PARAMS_ENABLEDDAYRANGE_START);
  }
  if (params.containsKey(VIEW_PARAMS_ENABLEDDAYRANGE_END)) {
    mEnabledDayEnd=params.get(VIEW_PARAMS_ENABLEDDAYRANGE_END);
  }
  mNumCells=getDaysInMonth(mMonth,mYear);
  for (int i=0; i < mNumCells; i++) {
    final int day=i + 1;
    if (sameDay(day,today)) {
      mHasToday=true;
      mToday=day;
    }
  }
  mNumRows=calculateNumRows();
  mTouchHelper.invalidateRoot();
}

Fixed version (ground truth):
/** 
 * Sets all the parameters for displaying this week. Parameters have a default value and will only update if a new value is included, except for focus month, which will always default to no focus month if no value is passed in. The only required parameter is the week start.
 * @param selectedDay the selected day.
 * @param month the month.
 * @param year the year.
 * @param weekStart which day the week should start on. {@link Time#SUNDAY} through{@link Time#SATURDAY}.
 * @param enabledDayStart the first enabled day.
 * @param enabledDayEnd the last enabled day.
 */
void setMonthParams(int selectedDay,int month,int year,int weekStart,int enabledDayStart,int enabledDayEnd){
  if (mRowHeight < MIN_HEIGHT) {
    mRowHeight=MIN_HEIGHT;
  }
  if (isValidDay(selectedDay)) {
    mSelectedDay=selectedDay;
  }
  if (month >= Calendar.JANUARY && month <= Calendar.DECEMBER) {
    mMonth=month;
  }
  mYear=year;
  final Time today=new Time(Time.getCurrentTimezone());
  today.setToNow();
  mHasToday=false;
  mToday=-1;
  mCalendar.set(Calendar.MONTH,mMonth);
  mCalendar.set(Calendar.YEAR,mYear);
  mCalendar.set(Calendar.DAY_OF_MONTH,1);
  mDayOfWeekStart=mCalendar.get(Calendar.DAY_OF_WEEK);
  if (isValidDay(weekStart)) {
    mWeekStart=weekStart;
  }
 else {
    mWeekStart=mCalendar.getFirstDayOfWeek();
  }
  if (enabledDayStart > 0 && enabledDayEnd < 32) {
    mEnabledDayStart=enabledDayStart;
  }
  if (enabledDayEnd > 0 && enabledDayEnd < 32 && enabledDayEnd >= enabledDayStart) {
    mEnabledDayEnd=enabledDayEnd;
  }
  mNumCells=getDaysInMonth(mMonth,mYear);
  for (int i=0; i < mNumCells; i++) {
    final int day=i + 1;
    if (sameDay(day,today)) {
      mHasToday=true;
      mToday=day;
    }
  }
  mNumRows=calculateNumRows();
  mTouchHelper.invalidateRoot();
}