Program: 78435
Project: 78435
Buggy source:
private void updateCalendar(int monthNumber) throws ParseException {
  SimpleDateFormat date=new SimpleDateFormat("String_Node_Str");
  String strDate="String_Node_Str" + labelDateMonthYear.getText();
  Date currentDate=date.parse(strDate);
  SimpleDateFormat dateDayNumber=new SimpleDateFormat("String_Node_Str");
  dateDayNumber.setLenient(false);
  String stringDayNumber=dateDayNumber.format(currentDate);
  int dayNumber=Integer.parseInt(stringDayNumber);
  int i;
  int ie;
  int ne=0;
  int cc=NDAYWEEK;
  labelEmpty=new JLabel[NEMPTYLABEL];
switch (dayNumber) {
case 1:
    ne=0;
  break;
case 2:
ne=1;
break;
case 3:
ne=2;
break;
case 4:
ne=3;
break;
case 5:
ne=4;
break;
case 6:
ne=5;
break;
case 7:
ne=6;
break;
}
for (ie=0; ie < ne; ie++) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
i=0;
int nd;
switch (monthNumber) {
case 4:
case 6:
case 9:
case 11:
nd=30;
break;
case 2:
if (isLeap(currentDate)) {
nd=29;
}
 else {
nd=28;
}
break;
default :
nd=31;
break;
}
for (i=0; i < nd; i++) {
panelGridCalendar.add(buttonDay[i]);
cc++;
}
while (cc < NCALENDARCELLS) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
if ((calendarState.equals(CalendarState.ADDING)) || (calendarState.equals(CalendarState.REMOVING))) {
enableDisableDateButtonAssignment();
}
for (i=0; i < NDAYMONTH; i++) {
if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
buttonDay[i].setBackground(new Color(204,230,255));
}
String strCurrentDate=date.format(new Date());
String dateButton;
int nDay=Integer.parseInt(buttonDay[i].getText());
if (nDay < 10) {
dateButton="String_Node_Str" + buttonDay[i].getText() + "String_Node_Str"+ labelDateMonthYear.getText();
}
 else {
dateButton=buttonDay[i].getText() + "String_Node_Str" + labelDateMonthYear.getText();
}
if (dateButton.equals(strCurrentDate)) {
buttonDay[i].setForeground(new Color(255,0,0));
}
 else {
buttonDay[i].setForeground(new Color(0,0,0));
}
}
showAssignmentOnCalendar(email);
}

Fixed version (ground truth):
private void updateCalendar(int monthNumber) throws ParseException {
  SimpleDateFormat date=new SimpleDateFormat("String_Node_Str");
  String strDate="String_Node_Str" + labelDateMonthYear.getText();
  Date currentDate=date.parse(strDate);
  SimpleDateFormat dateDayNumber=new SimpleDateFormat("String_Node_Str");
  dateDayNumber.setLenient(false);
  String stringDayNumber=dateDayNumber.format(currentDate);
  int dayNumber=Integer.parseInt(stringDayNumber);
  int i;
  int ie;
  int ne=0;
  int cc=NDAYWEEK;
  labelEmpty=new JLabel[NEMPTYLABEL];
switch (dayNumber) {
case 1:
    ne=0;
  break;
case 2:
ne=1;
break;
case 3:
ne=2;
break;
case 4:
ne=3;
break;
case 5:
ne=4;
break;
case 6:
ne=5;
break;
case 7:
ne=6;
break;
}
for (ie=0; ie < ne; ie++) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
i=0;
int nd;
switch (monthNumber) {
case 4:
case 6:
case 9:
case 11:
nd=30;
break;
case 2:
if (isLeap(currentDate)) {
nd=29;
}
 else {
nd=28;
}
break;
default :
nd=31;
break;
}
for (i=0; i < nd; i++) {
panelGridCalendar.add(buttonDay[i]);
cc++;
}
while (cc < NCALENDARCELLS) {
labelEmpty[ie]=new JLabel();
panelGridCalendar.add(labelEmpty[ie]);
cc++;
}
if ((calendarState.equals(CalendarState.ADDING)) || (calendarState.equals(CalendarState.REMOVING))) {
enableDisableDateButtonAssignment();
}
for (i=0; i < NDAYMONTH; i++) {
if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
buttonDay[i].setBackground(new Color(204,230,255));
}
String strCurrentDate=date.format(new Date());
String dateButton;
int nDay=Integer.parseInt(buttonDay[i].getText());
if (nDay < 10) {
dateButton="String_Node_Str" + buttonDay[i].getText() + "String_Node_Str"+ labelDateMonthYear.getText();
}
 else {
dateButton=buttonDay[i].getText() + "String_Node_Str" + labelDateMonthYear.getText();
}
if (dateButton.equals(strCurrentDate)) {
buttonDay[i].setForeground(new Color(255,0,0));
}
 else {
buttonDay[i].setForeground(new Color(0,0,0));
}
}
if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
showAssignmentOnCalendar(email);
}
}