nus-yam/ex-repair huggingface dataset:
Program: 66258
Project: 66258
Buggy source:
/** 
 * Returns default values of specified series object.
 * @param runtimeSeries specified series object.
 * @return
 */
public static Series getSeriesDefault(Series runtimeSeries){
  if (runtimeSeries instanceof BarSeries) {
    return DefaultValueProvider.defBarSeries();
  }
 else   if (runtimeSeries instanceof BubbleSeries) {
    return DefaultValueProvider.defBubbleSeries();
  }
 else   if (runtimeSeries instanceof ScatterSeries) {
    return DefaultValueProvider.defScatterSeries();
  }
 else   if (runtimeSeries instanceof DifferenceSeries) {
    return DefaultValueProvider.defDifferenceSeries();
  }
 else   if (runtimeSeries instanceof AreaSeries) {
    return DefaultValueProvider.defAreaSeries();
  }
 else   if (runtimeSeries instanceof LineSeries) {
    return DefaultValueProvider.defLineSeries();
  }
 else   if (runtimeSeries instanceof GanttSeries) {
    return DefaultValueProvider.defGanttSeries();
  }
 else   if (runtimeSeries instanceof DialSeries) {
    return DefaultValueProvider.defDialSeries();
  }
 else   if (runtimeSeries instanceof PieSeries) {
    return DefaultValueProvider.defPieSeries();
  }
 else   if (runtimeSeries instanceof StockSeries) {
    return DefaultValueProvider.defStockSeries();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns default values of specified series object.
 * @param runtimeSeries specified series object.
 * @return
 */
public static Series getSeriesDefault(Series runtimeSeries){
  if (runtimeSeries instanceof BarSeries) {
    return DefaultValueProvider.defBarSeries();
  }
 else   if (runtimeSeries instanceof BubbleSeries) {
    return DefaultValueProvider.defBubbleSeries();
  }
 else   if (runtimeSeries instanceof ScatterSeries) {
    return DefaultValueProvider.defScatterSeries();
  }
 else   if (runtimeSeries instanceof DifferenceSeries) {
    return DefaultValueProvider.defDifferenceSeries();
  }
 else   if (runtimeSeries instanceof AreaSeries) {
    return DefaultValueProvider.defAreaSeries();
  }
 else   if (runtimeSeries instanceof LineSeries) {
    return DefaultValueProvider.defLineSeries();
  }
 else   if (runtimeSeries instanceof GanttSeries) {
    return DefaultValueProvider.defGanttSeries();
  }
 else   if (runtimeSeries instanceof DialSeries) {
    return DefaultValueProvider.defDialSeries();
  }
 else   if (runtimeSeries instanceof PieSeries) {
    return DefaultValueProvider.defPieSeries();
  }
 else   if (runtimeSeries instanceof StockSeries) {
    return DefaultValueProvider.defStockSeries();
  }
 else   if (ChartDynamicExtension.isExtended(runtimeSeries)) {
    return (Series)new ChartExtensionValueUpdater().getDefault(ComponentPackage.eINSTANCE.getSeries(),"String_Node_Str",runtimeSeries);
  }
  return null;
}
Program: 66260
Project: 66260
Buggy source:
/** 
 * Prepare all default styles for various StyledComponent.
 * @param model
 * @param externalProcessor
 */
public final void prepareStyles(Chart model,IStyleProcessor externalProcessor){
  boolean updatedModel=false;
  if (externalProcessor != null) {
    updatedModel=externalProcessor.updateChart(model,null);
  }
  if (!updatedModel) {
    chartValueUpdater.update(model,null);
  }
  boolean needInheritingStyles=true;
  if (externalProcessor != null) {
    externalProcessor.processStyle(model);
    needInheritingStyles=externalProcessor.needInheritingStyles();
  }
  if (needInheritingStyles) {
    updateWithInhertingtyles(model,externalProcessor);
  }
}

Fixed version (ground truth):
/** 
 * Prepare all default styles for various StyledComponent.
 * @param model
 * @param externalProcessor
 */
public final void prepareStyles(Chart model,IStyleProcessor externalProcessor){
  prepareStyles(model,externalProcessor,null);
}
Program: 66263
Project: 66263
Buggy source:
/** 
 * Number -> Boolean 0 		-> false others 	-> true String -> Boolean "true" 	-> true (ignore case) "false" -> false (ignore case) other string will throw an exception Date -> Boolean throw exception
 * @param source
 * @return
 * @throws BirtException
 */
public static Boolean toBoolean(Object source) throws BirtException {
  if (source == null)   return Boolean.FALSE;
  if (source instanceof Boolean) {
    return (Boolean)source;
  }
 else   if (source instanceof Number) {
    if (((Number)source).doubleValue() == 0)     return Boolean.FALSE;
    return Boolean.TRUE;
  }
 else   if (source instanceof String) {
    if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.TRUE;
 else     if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.FALSE;
 else {
      try {
        if (Double.parseDouble((String)source) == 0)         return Boolean.FALSE;
 else         return Boolean.TRUE;
      }
 catch (      NumberFormatException e) {
        throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
      }
    }
  }
 else {
    throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
  }
}

Fixed version (ground truth):
/** 
 * Number -> Boolean 0 		-> false others 	-> true String -> Boolean "true" 	-> true (ignore case) "false" -> false (ignore case) other string will throw an exception Date -> Boolean throw exception
 * @param source
 * @return
 * @throws BirtException
 */
public static Boolean toBoolean(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Boolean) {
    return (Boolean)source;
  }
 else   if (source instanceof Number) {
    if (((Number)source).doubleValue() == 0)     return Boolean.FALSE;
    return Boolean.TRUE;
  }
 else   if (source instanceof String) {
    if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.TRUE;
 else     if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.FALSE;
 else {
      try {
        if (Double.parseDouble((String)source) == 0)         return Boolean.FALSE;
 else         return Boolean.TRUE;
      }
 catch (      NumberFormatException e) {
        throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
      }
    }
  }
 else {
    throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
  }
}
Program: 66266
Project: 66266
Buggy source:
public IResultMetaData getResultMetaData() throws DataException {
  RDLoad rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),getEngineContext(),new QueryResultInfo(realBasedQueryID,null,-1));
  return rdLoad.loadResultMetaData();
}

Fixed version (ground truth):
public IResultMetaData getResultMetaData() throws DataException {
  RDLoad rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),getEngineContext(),new QueryResultInfo(realBasedQueryID,null,-1));
  if (rdLoad.isEmptyQueryResultID(realBasedQueryID)) {
    return new ResultMetaData(new ResultClass(new ArrayList()));
  }
  return rdLoad.loadResultMetaData();
}
Program: 66267
Project: 66267
Buggy source:
private void doSaveBasic() throws DataException {
  if (needsSaveToDoc() == false)   return;
  if (isBasicSaved == false) {
    isBasicSaved=true;
    this.getRdSave().saveResultIterator(this.odiResult,this.idInfo.getGroupLevel(),this.idInfo.getSubQueryInfo());
  }
}

Fixed version (ground truth):
private void doSaveBasic() throws DataException {
  if (needsSaveToDoc() == false || skipSaveEmpty)   return;
  if (isBasicSaved == false) {
    isBasicSaved=true;
    this.getRdSave().saveResultIterator(this.odiResult,this.idInfo.getGroupLevel(),this.idInfo.getSubQueryInfo());
  }
}
Program: 66268
Project: 66268
Buggy source:
/** 
 * @throws DataException
 */
private void doSave(Map valueMap,boolean finish) throws DataException {
  if (needsSaveToDoc() == false)   return;
  doSaveBasic();
  if (finish == false)   this.rdSave.saveExprValue(odiResult.getCurrentResultIndex(),valueMap);
 else {
    this.rdSave.saveFinish(odiResult.getRowCount() - 1);
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void doSave(Map valueMap,boolean finish) throws DataException {
  if (needsSaveToDoc() == false || skipSaveEmpty)   return;
  doSaveBasic();
  if (finish == false)   this.rdSave.saveExprValue(odiResult.getCurrentResultIndex(),valueMap);
 else {
    this.rdSave.saveFinish(odiResult.getRowCount() - 1);
  }
}
Program: 66269
Project: 66269
Buggy source:
/** 
 * @param context
 * @param queryDefn
 * @param odiResult
 * @param idInfo
 */
RDSaveHelper(DataEngineContext context,IBaseQueryDefinition queryDefn,org.eclipse.birt.data.engine.odi.IResultIterator odiResult,IDInfo idInfo){
  this.context=context;
  this.queryDefn=queryDefn;
  this.odiResult=odiResult;
  this.idInfo=idInfo;
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryDefn
 * @param odiResult
 * @param idInfo
 */
RDSaveHelper(DataEngineContext context,IBaseQueryDefinition queryDefn,org.eclipse.birt.data.engine.odi.IResultIterator odiResult,IDInfo idInfo){
  this.context=context;
  this.queryDefn=queryDefn;
  this.odiResult=odiResult;
  this.idInfo=idInfo;
  try {
    if (odiResult.getRowCount() == 0 && resultService.getQueryDefn().getParentQuery() != null) {
      if (resultService.getSession().getEngineContext().getMode() == DataEngineContext.MODE_GENERATION) {
        resultService.getSession().getEmptyNestedResultSetID().add(resultService.getQueryResults().getID());
        resultService.getSession().updateNestedEmptyQueryID(resultService.getQueryResults().getID());
      }
      skipSaveEmpty=true;
    }
  }
 catch (  DataException e) {
  }
}
Program: 66270
Project: 66270
Buggy source:
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  int writeSize=bytes.length;
  if (writeSize > BLOCK_SIZE) {
    writeSize=BLOCK_SIZE;
  }
  file.seek(blockId * BLOCK_SIZE);
  file.write(bytes,0,writeSize);
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
}

Fixed version (ground truth):
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  int writeSize=bytes.length;
  if (writeSize > BLOCK_SIZE) {
    writeSize=BLOCK_SIZE;
  }
  file.seek((long)blockId * BLOCK_SIZE);
  file.write(bytes,0,writeSize);
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
}
Program: 66271
Project: 66271
Buggy source:
public void readBlock(int blockId,byte[] bytes) throws IOException {
  input.refresh();
  input.seek(blockId * BLOCK_SIZE);
  input.read(bytes);
}

Fixed version (ground truth):
public void readBlock(int blockId,byte[] bytes) throws IOException {
  input.refresh();
  input.seek((long)blockId * BLOCK_SIZE);
  input.read(bytes);
}
Program: 66272
Project: 66272
Buggy source:
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
  output.seek(blockId * BLOCK_SIZE);
  output.write(bytes);
  output.flush();
}

Fixed version (ground truth):
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
  output.seek((long)blockId * BLOCK_SIZE);
  output.write(bytes);
  output.flush();
}
Program: 66273
Project: 66273
Buggy source:
public void readBlock(int blockId,byte[] bytes) throws IOException {
  input.refresh();
  input.seek(blockId * BLOCK_SIZE);
  input.read(bytes);
}

Fixed version (ground truth):
public void readBlock(int blockId,byte[] bytes) throws IOException {
  input.refresh();
  input.seek((long)blockId * BLOCK_SIZE);
  input.read(bytes);
}
Program: 66274
Project: 66274
Buggy source:
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
  output.seek(blockId * BLOCK_SIZE);
  output.write(bytes);
  output.flush();
}

Fixed version (ground truth):
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
  output.seek((long)blockId * BLOCK_SIZE);
  output.write(bytes);
  output.flush();
}
Program: 66275
Project: 66275
Buggy source:
private void assertEqualComputedMeasure(IComputedMeasureDefinition md1,IComputedMeasureDefinition md2) throws DataException {
  assertEqualMeasure(md1,md2);
  assertEquals(md1.getType(),md2.getType());
  assertEqualExpr(md1.getExpression(),md2.getExpression());
}

Fixed version (ground truth):
private void assertEqualComputedMeasure(IComputedMeasureDefinition md1,IComputedMeasureDefinition md2) throws DataException {
  assertEqualMeasure(md1,md2);
  assertEquals(md1.getDataType(),md2.getDataType());
  assertEqualExpr(md1.getExpression(),md2.getExpression());
}
Program: 66277
Project: 66277
Buggy source:
private void updateAxisTitleLocationNLabelSize(final OneAxis axPV,final int iYTitleLocation,double dYAxisTitleThickness,double dWTotal,double dX,double dX1,double dX2){
  if (axPV.isShowLabels() && axPV.getScale().isCategoryScale()) {
    AutoScale.AxisLabelInfo ali=axPV.getScale().getAxisLabelInfo();
    if (axPV.getLabelPosition() == IConstants.LEFT) {
      double labelThickness=dX - getTickSize() - ((iYTitleLocation == LEFT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX - 1 - getTickSize()- labelThickness- dYAxisTitleThickness : dX2 + 1 - dYAxisTitleThickness);
    }
 else     if (axPV.getLabelPosition() == IConstants.RIGHT) {
      double labelThickness=dWTotal - dX - getTickSize()- ((iYTitleLocation == RIGHT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX + 1 + labelThickness);
    }
  }
 else {
    axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX2 + 1 - dYAxisTitleThickness);
  }
}

Fixed version (ground truth):
private void updateAxisTitleLocationNLabelSize(final OneAxis axPV,final int iYTitleLocation,double dYAxisTitleThickness,double dWTotal,double dX,double dX1,double dX2){
  if (axPV.isShowLabels() && axPV.getScale().isCategoryScale()) {
    AutoScale.AxisLabelInfo ali=axPV.getScale().getAxisLabelInfo();
    if (axPV.getLabelPosition() == IConstants.LEFT) {
      double labelThickness=dX - dX1 - getTickSize()- ((iYTitleLocation == LEFT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX - 1 - getTickSize()- labelThickness- dYAxisTitleThickness : dX2 + 1 - dYAxisTitleThickness);
    }
 else     if (axPV.getLabelPosition() == IConstants.RIGHT) {
      double labelThickness=dX2 - dX - getTickSize()- ((iYTitleLocation == RIGHT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX + 1 + labelThickness);
    }
  }
 else {
    axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX2 + 1 - dYAxisTitleThickness);
  }
}
Program: 66278
Project: 66278
Buggy source:
public void readBlock(int blockId,byte[] bytes) throws IOException {
  input.refresh();
  input.seek(blockId * BLOCK_SIZE);
  input.read(bytes);
}

Fixed version (ground truth):
public void readBlock(int blockId,byte[] bytes) throws IOException {
  input.refresh();
  input.seek((long)blockId * BLOCK_SIZE);
  input.read(bytes);
}
Program: 66279
Project: 66279
Buggy source:
public IResultIterator getSecondaryIterator(String subQueryName,Scriptable scope) throws DataException {
  String parentQueryResultsID=null;
  if (this.subQueryName == null) {
    parentQueryResultsID=queryResultID;
  }
 else {
    parentQueryResultsID=queryResultID + "String_Node_Str" + this.subQueryName+ "String_Node_Str"+ this.subQueryIndex;
  }
  QueryResults queryResults=null;
  try {
    queryResults=new QueryResults(tempDir,context,queryResultID,parentQueryResultsID,this.getResultMetaData(),subQueryName,this.exprResultSet.getCurrentIndex(),this.queryResults,null);
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  try {
    ResultIterator ri=(ResultIterator)queryResults.getResultIterator();
    ri.setSubQueryName(subQueryName);
    return ri;
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
public IResultIterator getSecondaryIterator(String subQueryName,Scriptable scope) throws DataException {
  String queryResultsID=null;
  String baseQueryResultsID=null;
  int rootIdIdex=queryResultID.indexOf("String_Node_Str");
  if (rootIdIdex > -1)   baseQueryResultsID=queryResultID.substring(0,rootIdIdex);
 else   baseQueryResultsID=queryResultID;
  if (this.subQueryName == null) {
    queryResultsID=queryResultID;
  }
 else {
    queryResultsID=queryResultID + "String_Node_Str" + this.subQueryName+ "String_Node_Str"+ this.subQueryIndex;
  }
  QueryResults queryResults=null;
  try {
    queryResults=new QueryResults(tempDir,context,baseQueryResultsID,queryResultsID,this.getResultMetaData(),subQueryName,this.exprResultSet.getCurrentIndex(),this.queryResults,null);
  }
 catch (  Exception e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  try {
    ResultIterator ri=(ResultIterator)queryResults.getResultIterator();
    ri.setSubQueryName(subQueryName);
    return ri;
  }
 catch (  BirtException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
}
Program: 66280
Project: 66280
Buggy source:
public void setBinding(ComputedColumnHandle binding){
  this.binding=binding;
  if (this.binding != null)   setAggregate(this.binding.getAggregateFunction() != null && !this.binding.getAggregateFunction().equals("String_Node_Str"));
  if (this.binding != null) {
    setTimePeriod(this.binding.getTimeDimension() != null && this.binding.getTimeDimension().getExpression() != null);
  }
}

Fixed version (ground truth):
public void setBinding(ComputedColumnHandle binding){
  this.binding=binding;
  if (this.binding != null)   setAggregate(this.binding.getAggregateFunction() != null && !this.binding.getAggregateFunction().equals("String_Node_Str"));
  if (this.binding != null) {
    setTimePeriod(this.binding.getTimeDimension() != null && !this.binding.getTimeDimension().equals("String_Node_Str"));
  }
}
Program: 66283
Project: 66283
Buggy source:
private String getFirstUseDimensonDisplayName(){
  CrosstabReportItemHandle crosstab=getCrosstabReportItemHandle();
  int count=crosstab.getDimensionCount(ICrosstabConstants.COLUMN_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    DimensionViewHandle viewHandle=crosstab.getDimension(ICrosstabConstants.COLUMN_AXIS_TYPE,i);
    if (isAvaliableTimeDimension(viewHandle.getCubeDimension())) {
      return ExpressionUtil.createJSDimensionExpression(viewHandle.getCubeDimension().getName(),null);
    }
  }
  count=crosstab.getDimensionCount(ICrosstabConstants.ROW_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    DimensionViewHandle viewHandle=crosstab.getDimension(ICrosstabConstants.ROW_AXIS_TYPE,i);
    if (isAvaliableTimeDimension(viewHandle.getCubeDimension())) {
      return ExpressionUtil.createJSDimensionExpression(viewHandle.getCubeDimension().getName(),null);
    }
  }
  return null;
}

Fixed version (ground truth):
private String getFirstUseDimensonDisplayName(){
  CrosstabReportItemHandle crosstab=getCrosstabReportItemHandle();
  int count=crosstab.getDimensionCount(ICrosstabConstants.COLUMN_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    DimensionViewHandle viewHandle=crosstab.getDimension(ICrosstabConstants.COLUMN_AXIS_TYPE,i);
    if (isAvaliableTimeDimension(viewHandle.getCubeDimension())) {
      return viewHandle.getCubeDimension().getName();
    }
  }
  count=crosstab.getDimensionCount(ICrosstabConstants.ROW_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    DimensionViewHandle viewHandle=crosstab.getDimension(ICrosstabConstants.ROW_AXIS_TYPE,i);
    if (isAvaliableTimeDimension(viewHandle.getCubeDimension())) {
      return viewHandle.getCubeDimension().getName();
    }
  }
  return null;
}
Program: 66284
Project: 66284
Buggy source:
private String[] getTimeDimensions(){
  List<String> strs=new ArrayList<String>();
  CrosstabReportItemHandle crosstab=getCrosstabReportItemHandle();
  CubeHandle cube=crosstab.getCube();
  List list=cube.getPropertyHandle(ICubeModel.DIMENSIONS_PROP).getContents();
  for (int i=0; i < list.size(); i++) {
    DimensionHandle dimension=(DimensionHandle)list.get(i);
    if (isAvaliableTimeDimension(dimension)) {
      strs.add(ExpressionUtil.createJSDimensionExpression(dimension.getName(),null));
    }
  }
  return strs.toArray(new String[strs.size()]);
}

Fixed version (ground truth):
private String[] getTimeDimensions(){
  List<String> strs=new ArrayList<String>();
  CrosstabReportItemHandle crosstab=getCrosstabReportItemHandle();
  CubeHandle cube=crosstab.getCube();
  List list=cube.getPropertyHandle(ICubeModel.DIMENSIONS_PROP).getContents();
  for (int i=0; i < list.size(); i++) {
    DimensionHandle dimension=(DimensionHandle)list.get(i);
    if (isAvaliableTimeDimension(dimension)) {
      strs.add(dimension.getName());
    }
  }
  return strs.toArray(new String[strs.size()]);
}
Program: 66285
Project: 66285
Buggy source:
private void initTimeDimension(){
  String[] strs=getTimeDimensions();
  timeDimension.setItems(strs);
  if (getBinding() == null) {
    String str=getFirstUseDimensonDisplayName();
    if (str != null && str.length() > 0) {
      int itemIndex=getItemIndex(strs,str);
      if (itemIndex >= 0) {
        timeDimension.select(itemIndex);
      }
 else {
        timeDimension.select(0);
      }
    }
 else {
      timeDimension.select(0);
    }
  }
 else {
    ExpressionHandle value=getBinding().getTimeDimension();
    value.getExpression();
    String stringValue=value == null || value.getExpression() == null ? "String_Node_Str" : ((Expression)value.getValue()).getStringExpression();
    int itemIndex=getItemIndex(strs,stringValue);
    timeDimension.select(itemIndex);
  }
}

Fixed version (ground truth):
private void initTimeDimension(){
  String[] strs=getTimeDimensions();
  timeDimension.setItems(strs);
  if (getBinding() == null) {
    String str=getFirstUseDimensonDisplayName();
    if (str != null && str.length() > 0) {
      int itemIndex=getItemIndex(strs,str);
      if (itemIndex >= 0) {
        timeDimension.select(itemIndex);
      }
 else {
        timeDimension.select(0);
      }
    }
 else {
      timeDimension.select(0);
    }
  }
 else {
    String value=getBinding().getTimeDimension();
    int itemIndex=getItemIndex(strs,value);
    timeDimension.select(itemIndex);
  }
}
Program: 66287
Project: 66287
Buggy source:
private String getTimeDimsionName(){
  String dimensionName=timeDimension.getText();
  Set<IDimLevel> sets;
  try {
    sets=ExpressionUtil.getReferencedDimLevel(dimensionName);
  }
 catch (  CoreException e) {
    return null;
  }
  Iterator<IDimLevel> iter=sets.iterator();
  if (iter.hasNext()) {
    return iter.next().getDimensionName();
  }
  return null;
}

Fixed version (ground truth):
private String getTimeDimsionName(){
  String dimensionName=timeDimension.getText();
  return dimensionName;
}
Program: 66288
Project: 66288
Buggy source:
/** 
 * Sets the value in extended property. If the property with specified name is not found, insert one property.
 * @param cm
 * @param propertyName
 * @param propertyValue
 * @return the property with set value
 * @since 2.5.1
 */
public static ExtendedProperty setExtendedProperty(Chart cm,String propertyName,String propertyValue){
  ExtendedProperty oldValue=getExtendedProperty(cm,propertyName);
  if (oldValue == null) {
    ExtendedProperty extendedProperty=AttributeFactoryImpl.init().createExtendedProperty();
    extendedProperty.setName(propertyName);
    extendedProperty.setValue(propertyValue);
    cm.getExtendedProperties().add(extendedProperty);
    return extendedProperty;
  }
  oldValue.setValue(propertyValue);
  return oldValue;
}

Fixed version (ground truth):
/** 
 * Sets the value in extended property. If the property with specified name is not found, insert one property.
 * @param cm
 * @param propertyName
 * @param propertyValue
 * @return the property with set value
 * @since 2.5.1
 */
public static ExtendedProperty setExtendedProperty(Chart cm,String propertyName,String propertyValue){
  ExtendedProperty oldValue=getExtendedProperty(cm,propertyName);
  if (oldValue == null) {
    ExtendedProperty extendedProperty=AttributeFactoryImpl.init().createExtendedProperty();
    extendedProperty.eAdapters().addAll(cm.eAdapters());
    extendedProperty.setName(propertyName);
    extendedProperty.setValue(propertyValue);
    cm.getExtendedProperties().add(extendedProperty);
    return extendedProperty;
  }
  oldValue.setValue(propertyValue);
  return oldValue;
}
Program: 66289
Project: 66289
Buggy source:
private int getColorByComboDefaultIndex(){
  return getChart().getLegend().isSetItemType() ? (LiteralHelper.legendItemTypeSet.getSafeNameIndex(getChart().getLegend().getItemType().getName()) + 1) : 0;
}

Fixed version (ground truth):
protected int getColorByComboDefaultIndex(){
  return getChart().getLegend().isSetItemType() ? (LiteralHelper.legendItemTypeSet.getSafeNameIndex(getChart().getLegend().getItemType().getName()) + 1) : 0;
}
Program: 66290
Project: 66290
Buggy source:
private void createButtonGroup(Composite parent){
  Composite cmp=new Composite(parent,SWT.NONE);
{
    cmp.setLayout(new GridLayout(6,false));
    GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan=2;
    gridData.grabExcessVerticalSpace=true;
    gridData.verticalAlignment=SWT.END;
    cmp.setLayoutData(gridData);
  }
  popup=new SeriesPaletteSheet(Messages.getString("String_Node_Str"),getContext(),getCategorySeriesDefinition(),getValueSeriesDefinitions(),isGroupedSeries(),FillChooserComposite.ENABLE_GRADIENT | FillChooserComposite.ENABLE_IMAGE | FillChooserComposite.ENABLE_POSITIVE_NEGATIVE);
  Button btnSeriesPals=createToggleButton(cmp,BUTTON_PALETTE,Messages.getString("String_Node_Str"),popup);
  btnSeriesPals.addSelectionListener(this);
}

Fixed version (ground truth):
protected void createButtonGroup(Composite parent){
  Composite cmp=new Composite(parent,SWT.NONE);
{
    cmp.setLayout(new GridLayout(6,false));
    GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan=2;
    gridData.grabExcessVerticalSpace=true;
    gridData.verticalAlignment=SWT.END;
    cmp.setLayoutData(gridData);
  }
  popup=new SeriesPaletteSheet(Messages.getString("String_Node_Str"),getContext(),getCategorySeriesDefinition(),getValueSeriesDefinitions(),isGroupedSeries(),FillChooserComposite.ENABLE_GRADIENT | FillChooserComposite.ENABLE_IMAGE | FillChooserComposite.ENABLE_POSITIVE_NEGATIVE);
  Button btnSeriesPals=createToggleButton(cmp,BUTTON_PALETTE,Messages.getString("String_Node_Str"),popup);
  btnSeriesPals.addSelectionListener(this);
}
Program: 66291
Project: 66291
Buggy source:
private static void loadComputedMeasures(DataInputStream dis,ICubeQueryDefinition qd) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IComputedMeasureDefinition md=loadComputedMeasure(dis);
    IMeasureDefinition md1=qd.createComputedMeasure(md.getName(),md.getType(),md.getExpression());
    md1.setAggrFunction(md.getAggrFunction());
  }
}

Fixed version (ground truth):
private static void loadComputedMeasures(DataInputStream dis,ICubeQueryDefinition qd) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IComputedMeasureDefinition md=loadComputedMeasure(dis);
    IMeasureDefinition md1=qd.createComputedMeasure(md.getName(),md.getDataType(),md.getExpression());
    md1.setAggrFunction(md.getAggrFunction());
  }
}
Program: 66292
Project: 66292
Buggy source:
private static void saveComputedMeasure(DataOutputStream dos,IComputedMeasureDefinition m) throws DataException, IOException {
  if (m == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  saveMeasure(dos,m);
  IOUtil.writeInt(dos,m.getType());
  ExprUtil.saveBaseExpr(dos,m.getExpression());
}

Fixed version (ground truth):
private static void saveComputedMeasure(DataOutputStream dos,IComputedMeasureDefinition m) throws DataException, IOException {
  if (m == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  saveMeasure(dos,m);
  IOUtil.writeInt(dos,m.getDataType());
  ExprUtil.saveBaseExpr(dos,m.getExpression());
}
Program: 66293
Project: 66293
Buggy source:
/** 
 * @param scope
 * @param computedColumns
 * @throws DataException
 */
public ComputedMeasureHelper(Scriptable scope,ScriptContext cx,List computedColumns) throws DataException {
  this.exprMap=new HashMap();
  this.scope=scope;
  this.cx=cx;
  this.measureInfos=new MeasureInfo[computedColumns.size()];
  for (int i=0; i < measureInfos.length; i++) {
    ComputedMeasureDefinition ccd=((ComputedMeasureDefinition)computedColumns.get(i));
    this.measureInfos[i]=new MeasureInfo(ccd.getName(),ccd.getType());
    this.exprMap.put(ccd.getName(),ccd.getExpression());
  }
  this.populator=new FacttableMeasureJSObjectPopulator(scope,this.exprMap,this.cx);
  this.populator.doInit();
}

Fixed version (ground truth):
/** 
 * @param scope
 * @param computedColumns
 * @throws DataException
 */
public ComputedMeasureHelper(Scriptable scope,ScriptContext cx,List computedColumns) throws DataException {
  this.exprMap=new HashMap();
  this.scope=scope;
  this.cx=cx;
  this.measureInfos=new MeasureInfo[computedColumns.size()];
  for (int i=0; i < measureInfos.length; i++) {
    ComputedMeasureDefinition ccd=((ComputedMeasureDefinition)computedColumns.get(i));
    this.measureInfos[i]=new MeasureInfo(ccd.getName(),ccd.getDataType());
    this.exprMap.put(ccd.getName(),ccd.getExpression());
  }
  this.populator=new FacttableMeasureJSObjectPopulator(scope,this.exprMap,this.cx);
  this.populator.doInit();
}
Program: 66294
Project: 66294
Buggy source:
private ITimeFunction adaptTimeFunction(ComputedColumnHandle handle) throws DataException, BirtException {
  if (handle.getCalculationType() == null || handle.getCalculationType().trim().length() == 0)   return null;
  TimeFunction timeFunction=new TimeFunction();
  Object referenceDate=null;
  if (DesignChoiceConstants.REFERENCE_DATE_TYPE_TODAY.equals(handle.getReferenceDateType())) {
    referenceDate=ScriptEvalUtil.evalExpr(new ScriptExpression("String_Node_Str"),this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
 else   if (handle.getReferenceDateType().equals(DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE)) {
    IBaseExpression sciptExpr=this.adaptExpression((Expression)(handle.getReferenceDateValue().getExpression()));
    referenceDate=ScriptEvalUtil.evalExpr(sciptExpr,this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  timeFunction.setReferenceDate(new ReferenceDate(DataTypeUtil.toDate(referenceDate)));
  timeFunction.setTimeDimension(handle.getTimeDimension());
  timeFunction.setBaseTimePeriod(populateBaseTimePeriod(handle));
  timeFunction.setRelativeTimePeriod(populateRelativeTimePeriod(handle));
  return timeFunction;
}

Fixed version (ground truth):
private ITimeFunction adaptTimeFunction(ComputedColumnHandle handle) throws DataException, BirtException {
  if (handle.getCalculationType() == null || handle.getCalculationType().trim().length() == 0)   return null;
  TimeFunction timeFunction=new TimeFunction();
  Object referenceDate=null;
  if (DesignChoiceConstants.REFERENCE_DATE_TYPE_TODAY.equals(handle.getReferenceDateType())) {
    referenceDate=ScriptEvalUtil.evalExpr(new ScriptExpression("String_Node_Str"),this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
 else   if (DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE.equals(handle.getReferenceDateType())) {
    IBaseExpression sciptExpr=this.adaptExpression((Expression)(handle.getReferenceDateValue().getValue()));
    referenceDate=ScriptEvalUtil.evalExpr(sciptExpr,this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  timeFunction.setReferenceDate(new ReferenceDate(DataTypeUtil.toDate(referenceDate)));
  timeFunction.setTimeDimension(handle.getTimeDimension());
  timeFunction.setBaseTimePeriod(populateBaseTimePeriod(handle));
  timeFunction.setRelativeTimePeriod(populateRelativeTimePeriod(handle));
  return timeFunction;
}
Program: 66295
Project: 66295
Buggy source:
/** 
 * Prepare all default styles for various StyledComponent.
 * @param model
 * @param externalProcessor
 */
public final void prepareStyles(Chart model,IStyleProcessor externalProcessor){
  boolean updatedModel=false;
  if (externalProcessor != null) {
    updatedModel=externalProcessor.updateChart(model,null);
  }
  if (!updatedModel) {
    chartValueUpdater.update(model,null);
  }
  if (externalProcessor != null) {
    externalProcessor.processStyle(model);
  }
  Stack<StyledComponent> token=new Stack<StyledComponent>();
  token.push(StyledComponent.CHART_ALL_LITERAL);
  prepareComponent(model,token,model,externalProcessor);
  token.clear();
}

Fixed version (ground truth):
/** 
 * Prepare all default styles for various StyledComponent.
 * @param model
 * @param externalProcessor
 */
public final void prepareStyles(Chart model,IStyleProcessor externalProcessor){
  boolean updatedModel=false;
  if (externalProcessor != null) {
    updatedModel=externalProcessor.updateChart(model,null);
  }
  if (!updatedModel) {
    chartValueUpdater.update(model,null);
  }
  boolean needInheritingStyles=true;
  if (externalProcessor != null) {
    externalProcessor.processStyle(model);
    needInheritingStyles=externalProcessor.needInheritingStyles();
  }
  if (needInheritingStyles) {
    updateWithInhertingtyles(model,externalProcessor);
  }
}
Program: 66298
Project: 66298
Buggy source:
/** 
 * @param url
 * @return
 * @throws ChartException
 */
final Image loadImage(URL url) throws ChartException {
  String sUrl=url.toString();
  Image img=htCache.get(sUrl);
  if (img != null) {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
  }
 else {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
    img=(new ImageIcon(url)).getImage();
    try {
      final MediaTracker tracker=new MediaTracker(p);
      tracker.addImage(img,0);
      tracker.waitForAll();
      if ((tracker.statusAll(true) & MediaTracker.ERRORED) != 0) {
        StringBuffer sb=new StringBuffer();
        Object[] oa=tracker.getErrorsAny();
        sb.append('[');
        for (int i=0; i < oa.length; i++) {
          sb.append(oa[i]);
          if (i < oa.length - 1) {
            sb.append("String_Node_Str");
          }
        }
        sb.append(']');
        throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,"String_Node_Str",new Object[]{sb.toString()},Messages.getResourceBundle(idsSWING.getULocale()));
      }
    }
 catch (    InterruptedException ex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,ex);
    }
    htCache.put(sUrl,img);
  }
  return img;
}

Fixed version (ground truth):
/** 
 * @param url
 * @return
 * @throws ChartException
 */
final Image loadImage(URL url) throws ChartException {
  String sUrl=url.toString();
  Image img=htCache.get(sUrl);
  if (img != null) {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
  }
 else {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
    try {
      img=ImageIO.read(url);
      final MediaTracker tracker=new MediaTracker(p);
      tracker.addImage(img,0);
      tracker.waitForAll();
      if ((tracker.statusAll(true) & MediaTracker.ERRORED) != 0) {
        StringBuffer sb=new StringBuffer();
        Object[] oa=tracker.getErrorsAny();
        sb.append('[');
        for (int i=0; i < oa.length; i++) {
          sb.append(oa[i]);
          if (i < oa.length - 1) {
            sb.append("String_Node_Str");
          }
        }
        sb.append(']');
        throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,"String_Node_Str",new Object[]{sb.toString()},Messages.getResourceBundle(idsSWING.getULocale()));
      }
    }
 catch (    InterruptedException ex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,ex);
    }
catch (    IOException e) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,e);
    }
    htCache.put(sUrl,img);
  }
  return img;
}
Program: 66299
Project: 66299
Buggy source:
public void setBinding(ComputedColumnHandle binding){
  this.binding=binding;
  if (this.binding != null)   setAggregate(this.binding.getAggregateFunction() != null && !this.binding.getAggregateFunction().equals("String_Node_Str"));
}

Fixed version (ground truth):
public void setBinding(ComputedColumnHandle binding){
  this.binding=binding;
  if (this.binding != null)   setAggregate(this.binding.getAggregateFunction() != null && !this.binding.getAggregateFunction().equals("String_Node_Str"));
  if (this.binding != null) {
    setTimePeriod(this.binding.getTimeDimension() != null && this.binding.getTimeDimension().getExpression() != null);
  }
}
Program: 66300
Project: 66300
Buggy source:
private void insertToBTree() throws DataException {
  try {
    List<Integer> rowIDList=new ArrayList<Integer>();
    KeyRowID keyRowID=(KeyRowID)sortedKeyRowID.pop();
    boolean isFirst=true;
    Object lastKey=null;
    while (keyRowID != null) {
      if (isFirst) {
        lastKey=keyRowID.key;
        rowIDList.add((Integer)keyRowID.rowID);
        isFirst=false;
      }
 else       if (equals(lastKey,keyRowID.key)) {
        rowIDList.add((Integer)keyRowID.rowID);
      }
 else {
        btree.insert(lastKey,rowIDList.toArray(new Integer[0]));
        lastKey=keyRowID.key;
        rowIDList.clear();
        rowIDList.add((Integer)keyRowID.rowID);
      }
      keyRowID=(KeyRowID)sortedKeyRowID.pop();
    }
    if (rowIDList.size() > 0) {
      btree.insert(lastKey,rowIDList.toArray(new Integer[0]));
    }
    sortedKeyRowID.close();
    sortedKeyRowID=null;
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
private void insertToBTree() throws DataException {
  try {
    List<Integer> rowIDList=new ArrayList<Integer>();
    KeyRowID keyRowID=(KeyRowID)sortedKeyRowID.pop();
    boolean isFirst=true;
    Object lastKey=null;
    while (keyRowID != null) {
      if (isFirst) {
        lastKey=keyRowID.key;
        rowIDList.add((Integer)keyRowID.rowID);
        isFirst=false;
      }
 else       if (equals(lastKey,keyRowID.key) && rowIDList.size() < 1000) {
        rowIDList.add((Integer)keyRowID.rowID);
      }
 else {
        btree.insert(lastKey,rowIDList.toArray(new Integer[0]));
        lastKey=keyRowID.key;
        rowIDList.clear();
        rowIDList.add((Integer)keyRowID.rowID);
      }
      keyRowID=(KeyRowID)sortedKeyRowID.pop();
    }
    if (rowIDList.size() > 0) {
      btree.insert(lastKey,rowIDList.toArray(new Integer[0]));
    }
    sortedKeyRowID.close();
    sortedKeyRowID=null;
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 66302
Project: 66302
Buggy source:
private Set<Integer> getLess(Object key,boolean includeKey) throws DataException {
  try {
    key=DataTypeUtil.convert(key,this.keyDataType);
  }
 catch (  BirtException e1) {
    throw DataException.wrap(e1);
  }
  BTreeCursor bCursor=btree.createCursor();
  Set<Integer> result=new HashSet<Integer>();
  try {
    while (bCursor.next()) {
      int cr=((Comparable)bCursor.getKey()).compareTo(key);
      if (cr < 0 || (cr == 0 && includeKey))       result.addAll(bCursor.getValues());
 else       return result;
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
  return result;
}

Fixed version (ground truth):
private Set<Integer> getLess(Object key,boolean includeKey) throws DataException {
  try {
    key=DataTypeUtil.convert(key,this.keyDataType);
  }
 catch (  BirtException e1) {
    throw DataException.wrap(e1);
  }
  BTreeCursor bCursor=btree.createCursor();
  Set<Integer> result=new HashSet<Integer>();
  try {
    while (bCursor.next()) {
      int cr=0;
      if (bCursor.getKey() == null) {
        cr=-1;
      }
 else {
        cr=((Comparable)bCursor.getKey()).compareTo(key);
      }
      if (cr < 0 || (cr == 0 && includeKey))       result.addAll(bCursor.getValues());
 else       return result;
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
  return result;
}
Program: 66303
Project: 66303
Buggy source:
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
  output.seek(blockId * BLOCK_SIZE);
  output.write(bytes);
  output.flush();
}

Fixed version (ground truth):
public void writeBlock(int blockId,byte[] bytes) throws IOException {
  if (blockId >= totalBlock) {
    totalBlock=blockId + 1;
  }
  output.seek((long)blockId * BLOCK_SIZE);
  output.write(bytes);
  output.flush();
}
Program: 66304
Project: 66304
Buggy source:
private Set<Integer> getGreater(Object key,boolean includeKey) throws DataException {
  try {
    key=DataTypeUtil.convert(key,this.keyDataType);
  }
 catch (  BirtException e1) {
    throw DataException.wrap(e1);
  }
  BTreeCursor bCursor=btree.createCursor();
  Set<Integer> result=new HashSet<Integer>();
  try {
    if (!bCursor.first())     return result;
    if (((Comparable)bCursor.getKey()).compareTo(key) > 0) {
      bCursor.beforeFirst();
    }
 else {
      bCursor.moveTo(key);
      int cr=((Comparable)bCursor.getKey()).compareTo(key);
      if ((includeKey && cr == 0) || cr > 0) {
        result.addAll(bCursor.getValues());
      }
    }
    while (bCursor.next()) {
      result.addAll(bCursor.getValues());
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
  return result;
}

Fixed version (ground truth):
private Set<Integer> getGreater(Object key,boolean includeKey) throws DataException {
  try {
    key=DataTypeUtil.convert(key,this.keyDataType);
  }
 catch (  BirtException e1) {
    throw DataException.wrap(e1);
  }
  BTreeCursor bCursor=btree.createCursor();
  Set<Integer> result=new HashSet<Integer>();
  try {
    if (!bCursor.first())     return result;
    if (bCursor.getKey() != null && ((Comparable)bCursor.getKey()).compareTo(key) > 0) {
      bCursor.beforeFirst();
    }
 else {
      bCursor.moveTo(key);
      int cr=((Comparable)bCursor.getKey()).compareTo(key);
      if ((includeKey && cr == 0) || cr > 0) {
        result.addAll(bCursor.getValues());
      }
    }
    while (bCursor.next()) {
      result.addAll(bCursor.getValues());
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
  return result;
}
Program: 66309
Project: 66309
Buggy source:
public void close() throws IOException {
  view.closeEntry(this);
  super.close();
}

Fixed version (ground truth):
public void close() throws IOException {
  view.closeEntry(this);
  doClose();
}
Program: 66313
Project: 66313
Buggy source:
protected void startHeaderFooterContainer(int headerHeight,int headerWidth){
  headerWidth+=215;
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeTableWidth(headerWidth);
  writeAttrTag("String_Node_Str","String_Node_Str");
  writeTableLayout();
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeAttrTag("String_Node_Str",headerHeight);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeCellWidth(headerWidth);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
protected void startHeaderFooterContainer(int headerHeight,int headerWidth,boolean writeColumns){
  headerWidth+=215;
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeTableWidth(headerWidth);
  writeAttrTag("String_Node_Str","String_Node_Str");
  writeTableLayout();
  writer.closeTag("String_Node_Str");
  if (writeColumns) {
    writeColumn(new int[]{headerWidth});
  }
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeAttrTag("String_Node_Str",headerHeight);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeCellWidth(headerWidth);
  writer.closeTag("String_Node_Str");
}
Program: 66314
Project: 66314
Buggy source:
/** 
 * Updates chart element Fill.
 * @param name name chart element type.
 * @param eObj chart element object.
 * @param eRefObj reference chart element object.
 * @param eDefObj default chart element object.
 * @generated
 */
public void updateFill(String name,EObject eParentObj,Fill eObj,Fill eRefObj,Fill eDefObj){
  if (eObj == null) {
    if (eRefObj != null) {
      eObj=eRefObj.copyInstance();
      ChartElementUtil.setEObjectAttribute(eParentObj,name,eObj,false);
    }
 else     if (eDefObj != null) {
      eObj=eDefObj.copyInstance();
      ChartElementUtil.setEObjectAttribute(eParentObj,name,eObj,false);
      return;
    }
  }
  if (eObj == null || (eRefObj == null && eDefObj == null)) {
    return;
  }
  if (eObj instanceof EmbeddedImage) {
    updateEmbeddedImage(name,eParentObj,(EmbeddedImage)eObj,(EmbeddedImage)eRefObj,eDefObj instanceof EmbeddedImage ? (EmbeddedImage)eDefObj : null);
  }
 else   if (eObj instanceof PatternImage) {
    updatePatternImage(name,eParentObj,(PatternImage)eObj,(PatternImage)eRefObj,eDefObj instanceof PatternImage ? (PatternImage)eDefObj : null);
  }
 else   if (eObj instanceof ColorDefinition) {
    updateColorDefinition(name,eParentObj,(ColorDefinition)eObj,(ColorDefinition)eRefObj,eDefObj instanceof ColorDefinition ? (ColorDefinition)eDefObj : null);
  }
 else   if (eObj instanceof Gradient) {
    updateGradient(name,eParentObj,(Gradient)eObj,(Gradient)eRefObj,eDefObj instanceof Gradient ? (Gradient)eDefObj : null);
  }
 else   if (eObj instanceof Image) {
    updateImage(name,eParentObj,(Image)eObj,(Image)eRefObj,eDefObj instanceof Image ? (Image)eDefObj : null);
  }
 else   if (eObj instanceof MultipleFill) {
    updateMultipleFill(name,eParentObj,(MultipleFill)eObj,(MultipleFill)eRefObj,eDefObj instanceof MultipleFill ? (MultipleFill)eDefObj : null);
  }
 else {
    updateFillImpl(name,eParentObj,eObj,eRefObj,eDefObj);
  }
}

Fixed version (ground truth):
/** 
 * Updates chart element Fill.
 * @param name name chart element type.
 * @param eObj chart element object.
 * @param eRefObj reference chart element object.
 * @param eDefObj default chart element object.
 * @generated
 */
public void updateFill(String name,EObject eParentObj,Fill eObj,Fill eRefObj,Fill eDefObj){
  if (eObj != null || (eRefObj == null && eDefObj == null)) {
    return;
  }
 else {
    updateFillImpl(name,eParentObj,eObj,eRefObj,eDefObj);
  }
}