Program: 56542
Project: 56542
Buggy source:
@Test public void testChartData(){
  NBook book=NBooks.createBook("String_Node_Str");
  NSheet sheet=book.createSheet("String_Node_Str");
  NChart p1=sheet.addChart(NChart.NChartType.BAR,new NViewAnchor(6,10,22,33,800,600));
  NCategoryChartData chartData=(NCategoryChartData)p1.getData();
  Assert.assertEquals(0,chartData.getNumOfCategory());
  Assert.assertEquals(0,chartData.getNumOfSeries());
  Assert.assertEquals(null,chartData.getCategory(100));
  chartData.setCategoriesFormula("String_Node_Str");
  Assert.assertEquals(3,chartData.getNumOfCategory());
  Assert.assertEquals("String_Node_Str",chartData.getCategory(0));
  Assert.assertEquals("String_Node_Str",chartData.getCategory(1));
  Assert.assertEquals("String_Node_Str",chartData.getCategory(2));
  NSeries nseries1=chartData.addSeries();
  Assert.assertEquals(1,chartData.getNumOfSeries());
  Assert.assertEquals(null,nseries1.getName());
  nseries1.setFormula("String_Node_Str",null,null);
  Assert.assertEquals("String_Node_Str",nseries1.getName());
  Assert.assertTrue(nseries1.isFormulaParsingError());
  nseries1.setFormula("String_Node_Str",null,null);
  Assert.assertEquals("String_Node_Str",nseries1.getName());
  Assert.assertEquals(0,nseries1.getNumOfValue());
  Assert.assertEquals(0,nseries1.getNumOfYValue());
  Assert.assertFalse(nseries1.isFormulaParsingError());
  nseries1.setFormula("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertEquals(0,nseries1.getNumOfValue());
  Assert.assertEquals(0,nseries1.getNumOfYValue());
  Assert.assertTrue(nseries1.isFormulaParsingError());
  nseries1.setFormula("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertFalse(nseries1.isFormulaParsingError());
  Assert.assertEquals(3,nseries1.getNumOfValue());
  Assert.assertEquals(3,nseries1.getNumOfYValue());
  Assert.assertEquals(1D,nseries1.getValue(0));
  Assert.assertEquals(2D,nseries1.getValue(1));
  Assert.assertEquals(3D,nseries1.getValue(2));
  Assert.assertEquals(4D,nseries1.getYValue(0));
  Assert.assertEquals(5D,nseries1.getYValue(1));
  Assert.assertEquals(6D,nseries1.getYValue(2));
  NSeries nseries2=chartData.addSeries();
  Assert.assertEquals(2,chartData.getNumOfSeries());
  Assert.assertEquals(null,nseries2.getName());
  Assert.assertEquals(0,nseries2.getNumOfValue());
  nseries2.setFormula(null,"String_Node_Str",null);
  Assert.assertEquals(3,nseries2.getNumOfValue());
  Assert.assertEquals(4D,nseries2.getValue(0));
  Assert.assertEquals(5D,nseries2.getValue(1));
  Assert.assertEquals(6D,nseries2.getValue(2));
}

Fixed version (ground truth):
@Test public void testChartData(){
  NBook book=NBooks.createBook("String_Node_Str");
  NSheet sheet=book.createSheet("String_Node_Str");
  sheet.getCell(0,0).setStringValue("String_Node_Str");
  sheet.getCell(1,0).setStringValue("String_Node_Str");
  sheet.getCell(2,0).setStringValue("String_Node_Str");
  sheet.getCell(0,3).setStringValue("String_Node_Str");
  sheet.getCell(0,1).setNumberValue(1.0);
  sheet.getCell(1,1).setNumberValue(2.0);
  sheet.getCell(2,1).setNumberValue(3.0);
  sheet.getCell(0,2).setNumberValue(4.0);
  sheet.getCell(1,2).setNumberValue(5.0);
  sheet.getCell(2,2).setNumberValue(6.0);
  NChart p1=sheet.addChart(NChart.NChartType.BAR,new NViewAnchor(6,10,22,33,800,600));
  NCategoryChartData chartData=(NCategoryChartData)p1.getData();
  Assert.assertEquals(0,chartData.getNumOfCategory());
  Assert.assertEquals(0,chartData.getNumOfSeries());
  Assert.assertEquals(null,chartData.getCategory(100));
  chartData.setCategoriesFormula("String_Node_Str");
  Assert.assertEquals(3,chartData.getNumOfCategory());
  Assert.assertEquals("String_Node_Str",chartData.getCategory(0));
  Assert.assertEquals("String_Node_Str",chartData.getCategory(1));
  Assert.assertEquals("String_Node_Str",chartData.getCategory(2));
  NSeries nseries1=chartData.addSeries();
  Assert.assertEquals(1,chartData.getNumOfSeries());
  Assert.assertEquals(null,nseries1.getName());
  nseries1.setFormula("String_Node_Str",null,null);
  Assert.assertEquals("String_Node_Str",nseries1.getName());
  nseries1.setFormula("String_Node_Str",null,null);
  Assert.assertEquals("String_Node_Str",nseries1.getName());
  Assert.assertEquals(0,nseries1.getNumOfValue());
  Assert.assertEquals(0,nseries1.getNumOfYValue());
  Assert.assertFalse(nseries1.isFormulaParsingError());
  nseries1.setFormula("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertEquals(0,nseries1.getNumOfValue());
  Assert.assertEquals(0,nseries1.getNumOfYValue());
  nseries1.setFormula("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertFalse(nseries1.isFormulaParsingError());
  Assert.assertEquals(3,nseries1.getNumOfValue());
  Assert.assertEquals(3,nseries1.getNumOfYValue());
  Assert.assertEquals(1D,nseries1.getValue(0));
  Assert.assertEquals(2D,nseries1.getValue(1));
  Assert.assertEquals(3D,nseries1.getValue(2));
  Assert.assertEquals(4D,nseries1.getYValue(0));
  Assert.assertEquals(5D,nseries1.getYValue(1));
  Assert.assertEquals(6D,nseries1.getYValue(2));
  NSeries nseries2=chartData.addSeries();
  Assert.assertEquals(2,chartData.getNumOfSeries());
  Assert.assertEquals(null,nseries2.getName());
  Assert.assertEquals(0,nseries2.getNumOfValue());
  nseries2.setFormula(null,"String_Node_Str",null);
  Assert.assertEquals(3,nseries2.getNumOfValue());
  Assert.assertEquals(4D,nseries2.getValue(0));
  Assert.assertEquals(5D,nseries2.getValue(1));
  Assert.assertEquals(6D,nseries2.getValue(2));
}