Program: 145325
Project: 145325
Buggy source:
public void keyPressed(int code){
switch (code) {
case Canvas.KEY_NUM1:
    question1.setLabel("String_Node_Str");
  question1.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
setText("String_Node_Str",currentX,currentY);
selectedindex[currentX][currentY]=1;
checkdatefield();
break;
case Canvas.KEY_NUM2:
question2.setLabel("String_Node_Str");
question2.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
setText("String_Node_Str",currentX,currentY);
selectedindex[currentX][currentY]=2;
checkdatefield();
break;
case Canvas.KEY_NUM3:
question3.setLabel("String_Node_Str");
question3.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
setText("String_Node_Str",currentX,currentY);
selectedindex[currentX][currentY]=3;
checkdatefield();
break;
case Canvas.KEY_NUM4:
isDatefield=true;
question4.setLabel("String_Node_Str");
question4.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
Calendar calendar=Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.MONTH,calendar.get(Calendar.MONTH) - 6);
calendar.set(Calendar.YEAR,calendar.get(Calendar.YEAR));
calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH));
datefield.setDate(calendar.getTime());
setText("String_Node_Str",currentX,currentY);
selectedindex[currentX][currentY]=4;
recorddate[currentX][currentY]=calendar.getTime().getTime();
break;
}
}

Fixed version (ground truth):
public void keyPressed(int code){
switch (code) {
case Canvas.KEY_NUM1:
    question1.setLabel("String_Node_Str");
  question1.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
setText("String_Node_Str",currentX,currentY);
selectedindex[currentY][currentX]=1;
checkdatefield();
break;
case Canvas.KEY_NUM2:
question2.setLabel("String_Node_Str");
question2.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
setText("String_Node_Str",currentX,currentY);
selectedindex[currentY][currentX]=2;
checkdatefield();
break;
case Canvas.KEY_NUM3:
question3.setLabel("String_Node_Str");
question3.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
setText("String_Node_Str",currentX,currentY);
selectedindex[currentY][currentX]=3;
checkdatefield();
break;
case Canvas.KEY_NUM4:
isDatefield=true;
question4.setLabel("String_Node_Str");
question4.setText("String_Node_Str");
question1.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question2.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question3.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM));
question4.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
Calendar calendar=Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.MONTH,calendar.get(Calendar.MONTH) - 6);
calendar.set(Calendar.YEAR,calendar.get(Calendar.YEAR));
calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH));
datefield.setDate(calendar.getTime());
setText("String_Node_Str",currentX,currentY);
selectedindex[currentY][currentX]=4;
recorddate[currentY][currentX]=calendar.getTime().getTime();
break;
}
}