Program: 92315
Project: 92315
Buggy source:
public void testTmfTraceIndexing() throws Exception {
  assertEquals("String_Node_Str",BLOCK_SIZE,fExperiment.getCacheSize());
  assertEquals("String_Node_Str",NB_EVENTS,fExperiment.getNbEvents());
  assertEquals("String_Node_Str",1,fExperiment.getTimeRange().getStartTime().getValue());
  assertEquals("String_Node_Str",NB_EVENTS,fExperiment.getTimeRange().getEndTime().getValue());
  assertEquals("String_Node_Str",1,fExperiment.getStartTime().getValue());
  assertEquals("String_Node_Str",NB_EVENTS,fExperiment.getEndTime().getValue());
  List<TmfCheckpoint> checkpoints=fExperiment.getIndexer().getCheckpoints();
  int pageSize=fExperiment.getCacheSize();
  assertTrue("String_Node_Str",checkpoints != null);
  assertEquals("String_Node_Str",NB_EVENTS / BLOCK_SIZE,checkpoints.size());
  for (int i=0; i < checkpoints.size(); i++) {
    TmfCheckpoint checkpoint=checkpoints.get(i);
    TmfExperimentLocation expLocation=(TmfExperimentLocation)checkpoint.getLocation();
    TmfLocationArray locations=expLocation.getLocation();
    ITmfContext[] trcContexts=new ITmfContext[2];
    trcContexts[0]=new TmfContext(locations.getLocations()[0],(i * pageSize) / 2);
    trcContexts[1]=new TmfContext(locations.getLocations()[1],(i * pageSize) / 2);
    TmfExperimentContext expContext=new TmfExperimentContext(trcContexts);
    expContext.getEvents()[0]=fTestTraces[0].getNext(fTestTraces[0].seekEvent((i * pageSize) / 2));
    expContext.getEvents()[1]=fTestTraces[1].getNext(fTestTraces[1].seekEvent((i * pageSize) / 2));
    ITmfEvent event=fExperiment.parseEvent(expContext);
    assertTrue(expContext.getRank() == i * pageSize);
    assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(),false) == 0));
  }
}

Fixed version (ground truth):
public void testTmfTraceIndexing() throws Exception {
  assertEquals("String_Node_Str",BLOCK_SIZE,fExperiment.getCacheSize());
  assertEquals("String_Node_Str",NB_EVENTS,fExperiment.getNbEvents());
  assertEquals("String_Node_Str",1,fExperiment.getTimeRange().getStartTime().getValue());
  assertEquals("String_Node_Str",NB_EVENTS,fExperiment.getTimeRange().getEndTime().getValue());
  assertEquals("String_Node_Str",1,fExperiment.getStartTime().getValue());
  assertEquals("String_Node_Str",NB_EVENTS,fExperiment.getEndTime().getValue());
  List<ITmfCheckpoint> checkpoints=fExperiment.getIndexer().getCheckpoints();
  int pageSize=fExperiment.getCacheSize();
  assertTrue("String_Node_Str",checkpoints != null);
  assertEquals("String_Node_Str",NB_EVENTS / BLOCK_SIZE,checkpoints.size());
  for (int i=0; i < checkpoints.size(); i++) {
    ITmfCheckpoint checkpoint=checkpoints.get(i);
    TmfExperimentLocation expLocation=(TmfExperimentLocation)checkpoint.getLocation();
    TmfLocationArray locations=expLocation.getLocation();
    ITmfContext[] trcContexts=new ITmfContext[2];
    trcContexts[0]=new TmfContext(locations.getLocations()[0],(i * pageSize) / 2);
    trcContexts[1]=new TmfContext(locations.getLocations()[1],(i * pageSize) / 2);
    TmfExperimentContext expContext=new TmfExperimentContext(trcContexts);
    expContext.getEvents()[0]=fTestTraces[0].getNext(fTestTraces[0].seekEvent((i * pageSize) / 2));
    expContext.getEvents()[1]=fTestTraces[1].getNext(fTestTraces[1].seekEvent((i * pageSize) / 2));
    ITmfEvent event=fExperiment.parseEvent(expContext);
    assertTrue(expContext.getRank() == i * pageSize);
    assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(),false) == 0));
  }
}