Program: 133534
Project: 133534
Buggy source:
/** 
 * Checks that when the same resource is double-clicked in the Resources View, the same editor or plot is opened. In the case of   {@code IPlot}s, the plot should be re-used, although it should be drawn a second time.
 */
@Test public void checkReuse(){
  openNewEditor();
  ICEResource resource;
  ICEResource firstResource;
  vizServiceFactory=new BasicVizServiceFactory();
  FakeCSVVizService csvVizService=new FakeCSVVizService();
  vizServiceFactory.register(csvVizService);
  page.setVizService(vizServiceFactory);
  assertFalse(csvVizService.createWasCalled.getAndSet(false));
  assertFalse(csvVizService.createCompleted.getAndSet(false));
  resource=createVizResource(new File("String_Node_Str"));
  resources.add(resource);
  doubleClickResource(resource);
  assertTrue(csvVizService.createWasCalled.getAndSet(false));
  assertTrue(csvVizService.createCompleted.getAndSet(false));
  assertEquals(1,csvVizService.plots.get(0).getDrawCount());
  firstResource=resource;
  resource=createVizResource(new File("String_Node_Str"));
  resources.add(resource);
  doubleClickResource(resource);
  assertTrue(csvVizService.createWasCalled.getAndSet(false));
  assertTrue(csvVizService.createCompleted.getAndSet(false));
  assertEquals(1,csvVizService.plots.get(1).getDrawCount());
  doubleClickResource(firstResource);
  assertFalse(csvVizService.createWasCalled.getAndSet(false));
  assertFalse(csvVizService.createCompleted.getAndSet(false));
  assertEquals(2,csvVizService.plots.get(0).getDrawCount());
  closeEditor();
  return;
}

Fixed version (ground truth):
/** 
 * Checks that when the same resource is double-clicked in the Resources View, the same editor or plot is opened. In the case of   {@code IPlot}s, the plot should be re-used, although it should be drawn a second time.
 */
@Test public void checkReuse(){
  openNewEditor();
  ICEResource resource;
  ICEResource firstResource;
  vizServiceFactory=new BasicVizServiceFactory();
  FakeCSVVizService csvVizService=new FakeCSVVizService(){
    @Override public IPlot createPlot(    URI file) throws Exception {
      FakePlot plot=(FakePlot)super.createPlot(file);
      plot.addDependentSeries("String_Node_Str",new CSVSeries(null));
      return plot;
    }
  }
;
  vizServiceFactory.register(csvVizService);
  page.setVizService(vizServiceFactory);
  assertFalse(csvVizService.createWasCalled.getAndSet(false));
  assertFalse(csvVizService.createCompleted.getAndSet(false));
  resource=createVizResource(new File("String_Node_Str"));
  resources.add(resource);
  doubleClickResource(resource);
  assertTrue(csvVizService.createWasCalled.getAndSet(false));
  assertTrue(csvVizService.createCompleted.getAndSet(false));
  assertEquals(1,csvVizService.plots.get(0).getDrawCount());
  firstResource=resource;
  resource=createVizResource(new File("String_Node_Str"));
  resources.add(resource);
  doubleClickResource(resource);
  assertTrue(csvVizService.createWasCalled.getAndSet(false));
  assertTrue(csvVizService.createCompleted.getAndSet(false));
  assertEquals(1,csvVizService.plots.get(1).getDrawCount());
  doubleClickResource(firstResource);
  assertFalse(csvVizService.createWasCalled.getAndSet(false));
  assertFalse(csvVizService.createCompleted.getAndSet(false));
  assertEquals(2,csvVizService.plots.get(0).getDrawCount());
  closeEditor();
  return;
}