Program: 110290
Project: 110290
Buggy source:
private void handleC1Command(int command){
  int window;
switch (command) {
case COMMAND_CW0:
case COMMAND_CW1:
case COMMAND_CW2:
case COMMAND_CW3:
case COMMAND_CW4:
case COMMAND_CW5:
case COMMAND_CW6:
case COMMAND_CW7:
    window=(command - COMMAND_CW0);
  if (currentWindow != window) {
    currentWindow=window;
    currentCueBuilder=cueBuilders[window];
  }
break;
case COMMAND_CLW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
  cueBuilders[NUM_WINDOWS - i].clear();
}
}
break;
case COMMAND_DSW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
cueBuilders[NUM_WINDOWS - i].setVisibility(true);
}
}
break;
case COMMAND_HDW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
cueBuilders[NUM_WINDOWS - i].setVisibility(false);
}
}
break;
case COMMAND_TGW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
CueBuilder cueBuilder=cueBuilders[NUM_WINDOWS - i];
cueBuilder.setVisibility(!cueBuilder.isVisible());
}
}
break;
case COMMAND_DLW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
cueBuilders[NUM_WINDOWS - i].reset();
}
}
break;
case COMMAND_DLY:
serviceBlockPacket.skipBits(8);
break;
case COMMAND_DLC:
break;
case COMMAND_RST:
resetCueBuilders();
break;
case COMMAND_SPA:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(16);
}
 else {
handleSetPenAttributes();
}
break;
case COMMAND_SPC:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(24);
}
 else {
handleSetPenColor();
}
break;
case COMMAND_SPL:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(16);
}
 else {
handleSetPenLocation();
}
break;
case COMMAND_SWA:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(32);
}
 else {
handleSetWindowAttributes();
}
break;
case COMMAND_DF0:
case COMMAND_DF1:
case COMMAND_DF2:
case COMMAND_DF3:
case COMMAND_DS4:
case COMMAND_DF5:
case COMMAND_DF6:
case COMMAND_DF7:
window=(command - COMMAND_DF0);
handleDefineWindow(window);
break;
default :
Log.w(TAG,"String_Node_Str" + command);
}
}

Fixed version (ground truth):
private void handleC1Command(int command){
  int window;
switch (command) {
case COMMAND_CW0:
case COMMAND_CW1:
case COMMAND_CW2:
case COMMAND_CW3:
case COMMAND_CW4:
case COMMAND_CW5:
case COMMAND_CW6:
case COMMAND_CW7:
    window=(command - COMMAND_CW0);
  if (currentWindow != window) {
    currentWindow=window;
    currentCueBuilder=cueBuilders[window];
  }
break;
case COMMAND_CLW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
  cueBuilders[NUM_WINDOWS - i].clear();
}
}
break;
case COMMAND_DSW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
cueBuilders[NUM_WINDOWS - i].setVisibility(true);
}
}
break;
case COMMAND_HDW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
cueBuilders[NUM_WINDOWS - i].setVisibility(false);
}
}
break;
case COMMAND_TGW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
CueBuilder cueBuilder=cueBuilders[NUM_WINDOWS - i];
cueBuilder.setVisibility(!cueBuilder.isVisible());
}
}
break;
case COMMAND_DLW:
for (int i=1; i <= NUM_WINDOWS; i++) {
if (serviceBlockPacket.readBit()) {
cueBuilders[NUM_WINDOWS - i].reset();
}
}
break;
case COMMAND_DLY:
serviceBlockPacket.skipBits(8);
break;
case COMMAND_DLC:
break;
case COMMAND_RST:
resetCueBuilders();
break;
case COMMAND_SPA:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(16);
}
 else {
handleSetPenAttributes();
}
break;
case COMMAND_SPC:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(24);
}
 else {
handleSetPenColor();
}
break;
case COMMAND_SPL:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(16);
}
 else {
handleSetPenLocation();
}
break;
case COMMAND_SWA:
if (!currentCueBuilder.isDefined()) {
serviceBlockPacket.skipBits(32);
}
 else {
handleSetWindowAttributes();
}
break;
case COMMAND_DF0:
case COMMAND_DF1:
case COMMAND_DF2:
case COMMAND_DF3:
case COMMAND_DS4:
case COMMAND_DF5:
case COMMAND_DF6:
case COMMAND_DF7:
window=(command - COMMAND_DF0);
handleDefineWindow(window);
if (currentWindow != window) {
currentWindow=window;
currentCueBuilder=cueBuilders[window];
}
break;
default :
Log.w(TAG,"String_Node_Str" + command);
}
}