Program: 11134
Project: 11134
Buggy source:
public void testTrackBacks(){
  for (  ClinicalRequest dc : visitor.getClinicalRequests()) {
    int expectedNumbers[]={0,0,0,0};
switch (((ValueSetRef)dc.getCodes()).getName()) {
case "String_Node_Str":
      expectedNumbers=new int[]{19,6,19,37};
    break;
case "String_Node_Str":
  expectedNumbers=new int[]{19,47,19,77};
break;
case "String_Node_Str":
expectedNumbers=new int[]{22,5,22,58};
break;
case "String_Node_Str":
expectedNumbers=new int[]{25,5,25,51};
break;
case "String_Node_Str":
expectedNumbers=new int[]{49,13,49,61};
break;
default :
fail("String_Node_Str" + dc);
}
assertThat(dc.getTrackerId(),notNullValue());
TrackBack tb=dc.getTrackbacks().iterator().next();
assertThat(tb.getLibrary(),is(of.createVersionedIdentifier().withId("String_Node_Str").withVersion("String_Node_Str")));
assertThat(tb.getStartLine(),is(expectedNumbers[0]));
assertThat(tb.getStartChar(),is(expectedNumbers[1]));
assertThat(tb.getEndLine(),is(expectedNumbers[2]));
assertThat(tb.getEndChar(),is(expectedNumbers[3]));
}
for (ValueSetDef vs : library.getValueSets().getDef()) {
int expectedNumbers[]={0,0,0,0};
switch (((Literal)((FunctionRef)vs.getValueSet()).getOperand().get(0)).getValue()) {
case "String_Node_Str":
expectedNumbers=new int[]{7,1,7,83};
break;
case "String_Node_Str":
expectedNumbers=new int[]{8,1,8,83};
break;
case "String_Node_Str":
expectedNumbers=new int[]{9,1,9,85};
break;
case "String_Node_Str":
expectedNumbers=new int[]{10,1,10,88};
break;
case "String_Node_Str":
expectedNumbers=new int[]{11,1,11,92};
break;
default :
fail("String_Node_Str" + vs);
}
assertThat(vs.getTrackerId(),notNullValue());
assertThat(vs.getTrackbacks().size(),is(1));
TrackBack tb=vs.getTrackbacks().iterator().next();
assertThat(tb.getLibrary(),is(of.createVersionedIdentifier().withId("String_Node_Str").withVersion("String_Node_Str")));
assertThat(tb.getStartLine(),is(expectedNumbers[0]));
assertThat(tb.getStartChar(),is(expectedNumbers[1]));
assertThat(tb.getEndLine(),is(expectedNumbers[2]));
assertThat(tb.getEndChar(),is(expectedNumbers[3]));
}
for (ExpressionDef ls : library.getStatements().getDef()) {
int expectedNumbers[]={0,0,0,0};
switch (ls.getName()) {
case "String_Node_Str":
expectedNumbers=new int[]{15,1,16,85};
break;
case "String_Node_Str":
expectedNumbers=new int[]{18,1,19,78};
break;
case "String_Node_Str":
expectedNumbers=new int[]{21,1,22,58};
break;
case "String_Node_Str":
expectedNumbers=new int[]{24,1,28,56};
break;
case "String_Node_Str":
expectedNumbers=new int[]{30,1,31,96};
break;
case "String_Node_Str":
expectedNumbers=new int[]{33,1,34,123};
break;
case "String_Node_Str":
expectedNumbers=new int[]{36,1,37,29};
break;
case "String_Node_Str":
expectedNumbers=new int[]{39,1,40,40};
break;
case "String_Node_Str":
expectedNumbers=new int[]{42,1,43,8};
break;
case "String_Node_Str":
expectedNumbers=new int[]{45,1,46,23};
break;
case "String_Node_Str":
expectedNumbers=new int[]{48,1,49,137};
break;
default :
fail("String_Node_Str" + ls.getName());
}
assertThat(ls.getTrackerId(),notNullValue());
assertThat(ls.getTrackbacks().size(),is(1));
TrackBack tb=ls.getTrackbacks().iterator().next();
assertThat(tb.getLibrary(),is(of.createVersionedIdentifier().withId("String_Node_Str").withVersion("String_Node_Str")));
assertThat(tb.getStartLine(),is(expectedNumbers[0]));
assertThat(tb.getStartChar(),is(expectedNumbers[1]));
assertThat(tb.getEndLine(),is(expectedNumbers[2]));
assertThat(tb.getEndChar(),is(expectedNumbers[3]));
}
}

Fixed version (ground truth):
@Test(enabled=false) public void testTrackBacks(){
  for (  ClinicalRequest dc : visitor.getClinicalRequests()) {
    int expectedNumbers[]={0,0,0,0};
switch (((ValueSetRef)dc.getCodes()).getName()) {
case "String_Node_Str":
      expectedNumbers=new int[]{19,6,19,37};
    break;
case "String_Node_Str":
  expectedNumbers=new int[]{19,47,19,77};
break;
case "String_Node_Str":
expectedNumbers=new int[]{22,5,22,58};
break;
case "String_Node_Str":
expectedNumbers=new int[]{25,5,25,51};
break;
case "String_Node_Str":
expectedNumbers=new int[]{49,13,49,61};
break;
default :
fail("String_Node_Str" + dc);
}
assertThat(dc.getTrackerId(),notNullValue());
TrackBack tb=dc.getTrackbacks().iterator().next();
assertThat(tb.getLibrary(),is(of.createVersionedIdentifier().withId("String_Node_Str").withVersion("String_Node_Str")));
assertThat(tb.getStartLine(),is(expectedNumbers[0]));
assertThat(tb.getStartChar(),is(expectedNumbers[1]));
assertThat(tb.getEndLine(),is(expectedNumbers[2]));
assertThat(tb.getEndChar(),is(expectedNumbers[3]));
}
for (ValueSetDef vs : library.getValueSets().getDef()) {
int expectedNumbers[]={0,0,0,0};
switch (((Literal)((FunctionRef)vs.getValueSet()).getOperand().get(0)).getValue()) {
case "String_Node_Str":
expectedNumbers=new int[]{7,1,7,83};
break;
case "String_Node_Str":
expectedNumbers=new int[]{8,1,8,83};
break;
case "String_Node_Str":
expectedNumbers=new int[]{9,1,9,85};
break;
case "String_Node_Str":
expectedNumbers=new int[]{10,1,10,88};
break;
case "String_Node_Str":
expectedNumbers=new int[]{11,1,11,92};
break;
default :
fail("String_Node_Str" + vs);
}
assertThat(vs.getTrackerId(),notNullValue());
assertThat(vs.getTrackbacks().size(),is(1));
TrackBack tb=vs.getTrackbacks().iterator().next();
assertThat(tb.getLibrary(),is(of.createVersionedIdentifier().withId("String_Node_Str").withVersion("String_Node_Str")));
assertThat(tb.getStartLine(),is(expectedNumbers[0]));
assertThat(tb.getStartChar(),is(expectedNumbers[1]));
assertThat(tb.getEndLine(),is(expectedNumbers[2]));
assertThat(tb.getEndChar(),is(expectedNumbers[3]));
}
for (ExpressionDef ls : library.getStatements().getDef()) {
int expectedNumbers[]={0,0,0,0};
switch (ls.getName()) {
case "String_Node_Str":
expectedNumbers=new int[]{15,1,16,85};
break;
case "String_Node_Str":
expectedNumbers=new int[]{18,1,19,78};
break;
case "String_Node_Str":
expectedNumbers=new int[]{21,1,22,58};
break;
case "String_Node_Str":
expectedNumbers=new int[]{24,1,28,56};
break;
case "String_Node_Str":
expectedNumbers=new int[]{30,1,31,96};
break;
case "String_Node_Str":
expectedNumbers=new int[]{33,1,34,123};
break;
case "String_Node_Str":
expectedNumbers=new int[]{36,1,37,29};
break;
case "String_Node_Str":
expectedNumbers=new int[]{39,1,40,40};
break;
case "String_Node_Str":
expectedNumbers=new int[]{42,1,43,8};
break;
case "String_Node_Str":
expectedNumbers=new int[]{45,1,46,23};
break;
case "String_Node_Str":
expectedNumbers=new int[]{48,1,49,137};
break;
default :
fail("String_Node_Str" + ls.getName());
}
assertThat(ls.getTrackerId(),notNullValue());
assertThat(ls.getTrackbacks().size(),is(1));
TrackBack tb=ls.getTrackbacks().iterator().next();
assertThat(tb.getLibrary(),is(of.createVersionedIdentifier().withId("String_Node_Str").withVersion("String_Node_Str")));
assertThat(tb.getStartLine(),is(expectedNumbers[0]));
assertThat(tb.getStartChar(),is(expectedNumbers[1]));
assertThat(tb.getEndLine(),is(expectedNumbers[2]));
assertThat(tb.getEndChar(),is(expectedNumbers[3]));
}
}