Program: 92292
Project: 92292
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<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].getLocation(),(i * pageSize) / 2);
    trcContexts[1]=new TmfContext(locations.getLocations()[1].getLocation(),(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));
  }
}