nus-yam/ex-repair huggingface dataset:
Program: 69042
Project: 69042
Buggy source:
/** 
 * Returns value of aggregate function parameters.
 * @param orthSD
 * @param baseSD
 * @param orthQuery
 * @since 2.5
 */
public static String[] getAggFunParameters(SeriesDefinition orthSD,SeriesDefinition baseSD,Query orthQuery){
  if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
    SeriesGrouping grouping=orthSD.getGrouping();
    if (grouping != null && grouping.isEnabled()) {
      if (orthQuery != null && orthQuery.getGrouping() != null) {
        return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
      }
      return grouping.getAggregateParameters().toArray(new String[0]);
    }
    return baseSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
 else {
    if (orthQuery != null && orthQuery.getGrouping() != null) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return orthSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
}

Fixed version (ground truth):
/** 
 * Returns value of aggregate function parameters.
 * @param orthSD
 * @param baseSD
 * @param orthQuery
 * @since 2.5
 */
public static String[] getAggFunParameters(SeriesDefinition orthSD,SeriesDefinition baseSD,Query orthQuery){
  if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
    SeriesGrouping grouping=orthSD.getGrouping();
    if (grouping != null && grouping.isEnabled()) {
      if (orthQuery != null && orthQuery.getGrouping() != null) {
        return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
      }
      return grouping.getAggregateParameters().toArray(new String[0]);
    }
    return baseSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
 else {
    if (orthQuery != null && orthQuery.getGrouping() != null && orthQuery.getGrouping().isEnabled()) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return orthSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
}
Program: 69043
Project: 69043
Buggy source:
private String generateCallBackMethodName(String funcName){
  return "String_Node_Str" + funcName + "String_Node_Str"+ ScriptHandler.BASE_VALUE+ "String_Node_Str"+ ScriptHandler.ORTHOGONAL_VALUE+ "String_Node_Str"+ ScriptHandler.SERIES_VALUE+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_TEXT+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_VALUE+ "String_Node_Str"+ IActionRenderer.AXIS_LABEL+ "String_Node_Str";
}

Fixed version (ground truth):
private String generateCallBackMethodName(String funcName){
  return "String_Node_Str" + funcName + "String_Node_Str"+ ScriptHandler.BASE_VALUE+ "String_Node_Str"+ ScriptHandler.ORTHOGONAL_VALUE+ "String_Node_Str"+ ScriptHandler.SERIES_VALUE+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_TEXT+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_VALUE+ "String_Node_Str"+ IActionRenderer.AXIS_LABEL+ "String_Node_Str"+ ScriptHandler.ID+ "String_Node_Str"+ ScriptHandler.COMP_LIST+ "String_Node_Str"+ ScriptHandler.LABEL_LIST+ "String_Node_Str";
}
Program: 69044
Project: 69044
Buggy source:
private void doEdit(Object structureOrHandle){
  FilterConditionBuilder dlg=new FilterConditionBuilder(((DataSetEditor)getContainer()).getShell(),this.getTitle(structureOrHandle),this.getTitle(structureOrHandle));
  dlg.setDataSetHandle((DataSetHandle)getContainer().getModel());
  dlg.setBindingParams(getParamBindingHandleArray());
  dlg.setInput(structureOrHandle);
  if (dlg.open() == Window.OK) {
    update(structureOrHandle);
  }
}

Fixed version (ground truth):
private void doEdit(Object structureOrHandle){
  FilterConditionBuilder dlg=new FilterConditionBuilder(((DataSetEditor)getContainer()).getShell(),this.getTitle(structureOrHandle),this.getTitle(structureOrHandle));
  dlg.setDataSetHandle((DataSetHandle)getContainer().getModel(),new DataSetExpressionProvider((DataSetHandle)getContainer().getModel()));
  dlg.setBindingParams(getParamBindingHandleArray());
  dlg.setInput(structureOrHandle);
  if (dlg.open() == Window.OK) {
    update(structureOrHandle);
  }
}
Program: 69045
Project: 69045
Buggy source:
private BaseFont createBaseFont(String physicalFont){
  BaseFont font=(BaseFont)fonts.get(physicalFont);
  if (font == null) {
    font=fontManager.createFont(physicalFont,fontStyle);
    fonts.put(physicalFont,font);
  }
  return font;
}

Fixed version (ground truth):
private BaseFont createBaseFont(String physicalFont){
  BaseFont font=(BaseFont)fonts.get(physicalFont);
  if (font == null) {
    if (fonts.keySet().contains(physicalFont)) {
      return null;
    }
    font=fontManager.createFont(physicalFont,fontStyle);
    fonts.put(physicalFont,font);
  }
  return font;
}
Program: 69046
Project: 69046
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  ODAProviderFactory.initeTheFactory(new ODABaseProviderFactory());
  BundleFactory.setBundleFactory(new PlatformBundleFactory());
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  ODAProviderFactory.initeTheFactory(new ODABaseProviderFactory());
  OdaExtensionLoaderFactory.initeFactory(new OdaBaseExtensionLoaderFactory());
  BundleFactory.setBundleFactory(new PlatformBundleFactory());
}
Program: 69047
Project: 69047
Buggy source:
private void doEdit(Object structureOrHandle){
  FilterConditionBuilder dlg=new FilterConditionBuilder(((DataSetEditor)getContainer()).getShell(),this.getTitle(structureOrHandle),this.getTitle(structureOrHandle));
  dlg.setDataSetHandle((DataSetHandle)getContainer().getModel());
  dlg.setBindingParams(getParamBindingHandleArray());
  if (dlg.open() == Window.OK) {
    update(structureOrHandle);
  }
}

Fixed version (ground truth):
private void doEdit(Object structureOrHandle){
  FilterConditionBuilder dlg=new FilterConditionBuilder(((DataSetEditor)getContainer()).getShell(),this.getTitle(structureOrHandle),this.getTitle(structureOrHandle));
  dlg.setDataSetHandle((DataSetHandle)getContainer().getModel());
  dlg.setBindingParams(getParamBindingHandleArray());
  dlg.setInput(structureOrHandle);
  if (dlg.open() == Window.OK) {
    update(structureOrHandle);
  }
}
Program: 69048
Project: 69048
Buggy source:
private void linkToSalarParameterChanged(){
  String paramName=Utility.findIndex(linkToSalarParameter.getItems(),linkToSalarParameter.getText()) == 0 ? null : linkToSalarParameter.getText();
  if (paramName == null) {
    enableComposite(defaultValueComposite,linkToSalarParameter.isEnabled());
    defaultValue.setText(defaultValueString);
  }
 else {
    if (defaultValue.isEnabled())     defaultValueString=defaultValue.getText();
    structureHandle.setDefaultValue("String_Node_Str");
    enableComposite(defaultValueComposite,false);
    defaultValue.setText(NONE_DEFAULT_VALUE);
  }
}

Fixed version (ground truth):
private void linkToSalarParameterChanged(){
  String paramName=Utility.findIndex(linkToSalarParameter.getItems(),linkToSalarParameter.getText()) == 0 ? null : linkToSalarParameter.getText();
  if (paramName == null) {
    enableComposite(defaultValueComposite,linkToSalarParameter.isEnabled());
    defaultValue.setText(NONE_DEFAULT_VALUE.equals(defaultValueString) ? "String_Node_Str" : defaultValueString);
  }
 else {
    if (defaultValue.isEnabled())     defaultValueString=defaultValue.getText();
    structureHandle.setDefaultValue("String_Node_Str");
    enableComposite(defaultValueComposite,false);
    defaultValue.setText(NONE_DEFAULT_VALUE);
  }
}
Program: 69049
Project: 69049
Buggy source:
/** 
 */
private void moveTo(int rowIndex) throws BirtException {
  if (resultIterator == null) {
    if (queryResults == null)     return;
    resultIterator=queryResults.getResultIterator();
  }
  if (resultIterator == null) {
    return;
  }
  resultIterator.moveTo(rowIndex);
  value=resultIterator.getValue(boundColumnName);
  this.visitedValues.add(value);
}

Fixed version (ground truth):
/** 
 */
private void moveTo(int rowIndex) throws BirtException {
  if (resultIterator == null) {
    if (queryResults == null)     return;
    resultIterator=queryResults.getResultIterator();
  }
  if (resultIterator == null || resultIterator.isEmpty()) {
    return;
  }
  resultIterator.moveTo(rowIndex);
  value=resultIterator.getValue(boundColumnName);
  this.visitedValues.add(value);
}
Program: 69051
Project: 69051
Buggy source:
public void initialize() throws BirtException {
  if (content == null) {
    this.maxAvaWidth=width;
    return;
  }
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  calculateSpecifiedHeight(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
    if (specifiedWidth > 0) {
      setContentWidth(specifiedWidth);
    }
 else {
      if (parent != null) {
        this.width=parent.getMaxAvaWidth();
      }
    }
    this.maxAvaWidth=width;
  }
 else {
    buildProperties(content,context);
    if (specifiedWidth > 0) {
      setContentWidth(specifiedWidth);
    }
    if (specifiedHeight > 0) {
      setContentHeight(specifiedHeight);
    }
 else {
      if (parent != null) {
        setAllocatedWidth(parent.getMaxAvaWidth());
      }
    }
    maxAvaWidth=getContentWidth();
  }
  textAlign=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  this.bookmark=content.getBookmark();
  this.action=content.getHyperlinkAction();
  parent.add(this);
}

Fixed version (ground truth):
public void initialize() throws BirtException {
  if (content == null) {
    this.maxAvaWidth=width;
    return;
  }
  IStyle style=content.getStyle();
  calculateSpecifiedWidth(content);
  calculateSpecifiedHeight(content);
  if (style == null || style.isEmpty()) {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
    if (specifiedWidth > 0) {
      setContentWidth(specifiedWidth);
    }
 else {
      if (parent != null) {
        this.width=parent.getMaxAvaWidth();
      }
    }
    this.maxAvaWidth=width;
  }
 else {
    buildProperties(content,context);
    if (specifiedHeight > 0) {
      setContentHeight(specifiedHeight);
    }
    if (specifiedWidth > 0) {
      setContentWidth(specifiedWidth);
    }
 else {
      if (parent != null) {
        setAllocatedWidth(parent.getMaxAvaWidth());
      }
    }
    maxAvaWidth=getContentWidth();
  }
  textAlign=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  this.bookmark=content.getBookmark();
  this.action=content.getHyperlinkAction();
  parent.add(this);
}
Program: 69052
Project: 69052
Buggy source:
public void setAggregation(Query query,SeriesDefinition sd){
  this.query=query;
  this.fSeriesDefi=sd;
  fGrouping=null;
  if (sd.getGrouping() != null && sd.getGrouping().isEnabled()) {
    fGrouping=sd.getGrouping().copyInstance();
  }
  if (query.getGrouping() != null && query.getGrouping().isEnabled()) {
    fGrouping=query.getGrouping().copyInstance();
  }
  if (fGrouping == null) {
    fGrouping=SeriesGroupingImpl.create();
  }
}

Fixed version (ground truth):
public void setAggregation(Query query,SeriesDefinition sd){
  this.query=query;
  this.fSeriesDefi=sd;
  fGrouping=null;
  if (sd != null && sd.getGrouping() != null && sd.getGrouping().isEnabled()) {
    fGrouping=sd.getGrouping().copyInstance();
  }
  if (query.getGrouping() != null && query.getGrouping().isEnabled()) {
    fGrouping=query.getGrouping().copyInstance();
  }
  if (fGrouping == null) {
    fGrouping=SeriesGroupingImpl.create();
  }
}
Program: 69054
Project: 69054
Buggy source:
/** 
 * @param scope
 * @param cx
 * @param iParamBind
 * @return
 * @throws DataException
 */
private Object evaluateInputParameterValue(Scriptable scope,Context cx,IInputParameterBinding iParamBind) throws DataException {
  Object evaluateResult=null;
  Scriptable evaluateScope=scope;
  try {
    evaluateResult=ExprEvaluateUtil.evaluateRawExpression2(iParamBind.getExpr(),this.outerScope == null ? evaluateScope : this.outerScope,context);
  }
 catch (  BirtException e) {
    DataException dataEx=new DataException(ResourceConstants.UNEXPECTED_ERROR,e);
    if (logger != null)     logger.logp(Level.FINE,PreparedOdaDSQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw dataEx;
  }
  return evaluateResult;
}

Fixed version (ground truth):
/** 
 * @param scope
 * @param cx
 * @param iParamBind
 * @return
 * @throws DataException
 */
private Object evaluateInputParameterValue(Scriptable scope,Context cx,IInputParameterBinding iParamBind) throws DataException {
  Object evaluateResult=null;
  try {
    if (iParamBind.getExpr() instanceof IScriptExpression) {
      ScriptContext evalContext=this.outerScope == null ? context : context.newContext(this.outerScope);
      ICompiledScript compiledScript=evalContext.compile("String_Node_Str",null,0,((IScriptExpression)iParamBind.getExpr()).getText());
      evaluateResult=evalContext.evaluate(compiledScript);
    }
  }
 catch (  BirtException e) {
    DataException dataEx=new DataException(ResourceConstants.UNEXPECTED_ERROR,e);
    if (logger != null)     logger.logp(Level.FINE,PreparedOdaDSQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw dataEx;
  }
  return evaluateResult;
}
Program: 69057
Project: 69057
Buggy source:
/** 
 * @param queryResults
 * @param queryScope
 * @throws BirtException 
 */
private ResultIterator(QueryResults queryResults,ExprManager exprManager,Scriptable queryScope,Scriptable parentScope) throws BirtException {
  this.queryResults=queryResults;
  this.exprManager=exprManager;
  this.queryScope=queryScope;
  this.jsDummyRowObject=new JSDummyRowObject(exprManager,queryScope,parentScope,session.getEngineContext().getScriptContext());
  queryScope.put("String_Node_Str",queryScope,jsDummyRowObject);
  this.getRdSaveUtil().doSaveStart();
  exprValueMap=new HashMap();
  Map exprMap=getBindingMap(exprManager.getBindingExprs());
  Iterator it=exprMap.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Entry)it.next();
    String exprName=(String)entry.getKey();
    IBaseExpression baseExpr=(IBaseExpression)entry.getValue();
    Object exprValue=ExprEvaluateUtil.evaluateRawExpression(baseExpr,queryScope,session.getEngineContext().getScriptContext());
    exprValueMap.put(exprName,exprValue);
  }
  this.getRdSaveUtil().doSaveExpr(exprValueMap);
  if (needCache()) {
    try {
      createCacheOutputStream();
      saveMetaData();
      IOUtil.writeInt(this.rowOutputStream,1);
      cacheRow();
    }
 catch (    IOException e) {
      throw new DataException(ResourceConstants.CREATE_CACHE_TEMPFILE_ERROR);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param queryResults
 * @param queryScope
 * @throws BirtException 
 */
private ResultIterator(QueryResults queryResults,ExprManager exprManager,Scriptable queryScope,Scriptable parentScope) throws BirtException {
  this.queryResults=queryResults;
  this.exprManager=exprManager;
  this.queryScope=queryScope;
  this.jsDummyRowObject=new JSDummyRowObject(exprManager,queryScope,parentScope,session.getEngineContext().getScriptContext());
  queryScope.put("String_Node_Str",queryScope,jsDummyRowObject);
  this.getRdSaveUtil().doSaveStart();
  exprValueMap=new HashMap();
  Map exprMap=getBindingMap(exprManager.getBindingExprs());
  Iterator it=exprMap.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Entry)it.next();
    String exprName=(String)entry.getKey();
    IBaseExpression baseExpr=(IBaseExpression)entry.getValue();
    Object exprValue=ExprEvaluateUtil.evaluateRawExpression(baseExpr,queryScope,session.getEngineContext().getScriptContext());
    IBinding binding=exprManager.getBinding(exprName);
    if (binding.getDataType() != baseExpr.getDataType())     exprValue=DataTypeUtil.convert(exprValue,binding.getDataType());
    exprValueMap.put(exprName,exprValue);
  }
  this.getRdSaveUtil().doSaveExpr(exprValueMap);
  if (needCache()) {
    try {
      createCacheOutputStream();
      saveMetaData();
      IOUtil.writeInt(this.rowOutputStream,1);
      cacheRow();
    }
 catch (    IOException e) {
      throw new DataException(ResourceConstants.CREATE_CACHE_TEMPFILE_ERROR);
    }
  }
}
Program: 69059
Project: 69059
Buggy source:
/** 
 * create joint data set
 * @return
 * @throws SemanticException
 */
private DataSetHandle createJointDataSet() throws SemanticException {
  String dataSetName="String_Node_Str";
  if (nameEditor != null)   dataSetName=nameEditor.getText();
  JointDataSetHandle dsHandle=Utility.newJointDataSet(dataSetName);
  if (leftDataSetName.equals(rightDataSetName))   dsHandle.addDataSet(leftDataSetName);
 else {
    dsHandle.addDataSet(leftDataSetName);
    dsHandle.addDataSet(rightDataSetName);
  }
  setParameters(dsHandle);
  propertyHandle=dsHandle.getPropertyHandle(JointDataSet.JOIN_CONDITONS_PROP);
  propertyHandle.addItem(createJoinCondition());
  return dsHandle;
}

Fixed version (ground truth):
/** 
 * create joint data set
 * @return
 * @throws SemanticException
 */
private DataSetHandle createJointDataSet() throws SemanticException {
  String dataSetName="String_Node_Str";
  if (nameEditor != null)   dataSetName=nameEditor.getText();
  JointDataSetHandle dsHandle=Utility.newJointDataSet(dataSetName);
  if (leftDataSetName.equals(rightDataSetName))   dsHandle.addDataSet(leftDataSetName);
 else {
    dsHandle.addDataSet(leftDataSetName);
    dsHandle.addDataSet(rightDataSetName);
  }
  setParameters(dsHandle);
  propertyHandle=dsHandle.getPropertyHandle(JointDataSet.JOIN_CONDITONS_PROP);
  propertyHandle.addItem(createJoinCondition());
  addColumnHints(dsHandle);
  return dsHandle;
}
Program: 69060
Project: 69060
Buggy source:
/** 
 * @return
 * @throws SemanticException
 */
private boolean modifyJointCondition() throws SemanticException {
  JointDataSetHandle handle=null;
  if (leftDataSetName == null || rightDataSetName == null)   return false;
  if (propertyPageContainer instanceof DataSetEditor) {
    handle=(JointDataSetHandle)((DataSetEditor)propertyPageContainer).getModel();
    List datasetName=handle.getDataSetNames();
    for (int i=0; i < datasetName.size(); i++) {
      try {
        handle.removeDataSet((String)datasetName.get(i));
      }
 catch (      SemanticException e) {
      }
    }
    if (leftDataSetName.equals(rightDataSetName))     handle.addDataSet(leftDataSetName);
 else {
      handle.addDataSet(leftDataSetName);
      handle.addDataSet(rightDataSetName);
    }
    setParameters(handle);
  }
  if (propertyHandle != null) {
    JoinCondition condition=createJoinCondition();
    propertyHandle.removeItem(0);
    propertyHandle.addItem(condition);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws SemanticException
 */
private boolean modifyJointCondition() throws SemanticException {
  JointDataSetHandle handle=null;
  if (leftDataSetName == null || rightDataSetName == null)   return false;
  if (propertyPageContainer instanceof DataSetEditor) {
    handle=(JointDataSetHandle)((DataSetEditor)propertyPageContainer).getModel();
    List datasetName=handle.getDataSetNames();
    for (int i=0; i < datasetName.size(); i++) {
      try {
        handle.removeDataSet((String)datasetName.get(i));
      }
 catch (      SemanticException e) {
      }
    }
    if (leftDataSetName.equals(rightDataSetName))     handle.addDataSet(leftDataSetName);
 else {
      handle.addDataSet(leftDataSetName);
      handle.addDataSet(rightDataSetName);
    }
    setParameters(handle);
  }
  addColumnHints(handle);
  if (propertyHandle != null) {
    JoinCondition condition=createJoinCondition();
    propertyHandle.removeItem(0);
    propertyHandle.addItem(condition);
    return true;
  }
 else   return false;
}
Program: 69062
Project: 69062
Buggy source:
private void outputImageSource(ArrayImageSource imageSource){
  int originalWidth=imageSource.getWidth();
  int originalHeight=imageSource.getHeight();
  try {
    ByteArrayOutputStream byteOut=new ByteArrayOutputStream();
    DeflaterOutputStream deflateOut=new DeflaterOutputStream(byteOut,new Deflater(Deflater.DEFAULT_COMPRESSION));
    for (int i=0; i < originalHeight; i++) {
      for (int j=0; j < originalWidth; j++) {
        int pixel=imageSource.getRGB(j,i);
        int alpha=(pixel >> 24) & 0xff;
        int red=(pixel >> 16) & 0xff;
        int green=(pixel >> 8) & 0xff;
        int blue=pixel & 0xff;
        deflateOut.write(transferColor(alpha,red));
        deflateOut.write(transferColor(alpha,green));
        deflateOut.write(transferColor(alpha,blue));
      }
    }
    deflateOut.finish();
    deflateOut.close();
    byte[] byteArray=byteOut.toByteArray();
    byteOut.close();
    out.print(Util.toHexString(byteArray) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void outputImageSource(ArrayImageSource imageSource){
  int originalWidth=imageSource.getWidth();
  int originalHeight=imageSource.getHeight();
  try {
    ByteArrayOutputStream originalSource=new ByteArrayOutputStream();
    for (int i=0; i < originalHeight; i++) {
      for (int j=0; j < originalWidth; j++) {
        int pixel=imageSource.getRGB(j,i);
        int alpha=(pixel >> 24) & 0xff;
        int red=(pixel >> 16) & 0xff;
        int green=(pixel >> 8) & 0xff;
        int blue=pixel & 0xff;
        originalSource.write(transferColor(alpha,red));
        originalSource.write(transferColor(alpha,green));
        originalSource.write(transferColor(alpha,blue));
      }
    }
    byte[] byteArray=deflate(originalSource.toByteArray());
    out.print(Util.toHexString(byteArray) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 69063
Project: 69063
Buggy source:
/** 
 * @return <code>true</code> if the command can be executed
 */
public boolean canExecute(){
  if (cloneElement == null) {
    return false;
  }
  DesignElementHandle childHandle=sourceHandle;
  if (childHandle == null) {
    if (cloneElement instanceof IDesignElement) {
      childHandle=((IDesignElement)cloneElement).getHandle(SessionHandleAdapter.getInstance().getReportDesignHandle().getModule());
    }
 else     if (cloneElement instanceof IElementCopy) {
      childHandle=((IElementCopy)cloneElement).getHandle(SessionHandleAdapter.getInstance().getReportDesignHandle());
    }
  }
  return DNDUtil.handleValidateTargetCanContain(newContainer,childHandle) && DNDUtil.handleValidateTargetCanContainMore(newContainer,1);
}

Fixed version (ground truth):
/** 
 * @return <code>true</code> if the command can be executed
 */
public boolean canExecute(){
  if (cloneElement == null) {
    return false;
  }
  if (newContainer instanceof PropertyHandle && cloneElement instanceof IElementCopy && newContainer instanceof DesignElementHandle) {
    PropertyHandle targetHandle=(PropertyHandle)newContainer;
    return CopyUtil.canPaste((IElementCopy)cloneElement,(DesignElementHandle)newContainer,targetHandle.getPropertyDefn().getName());
  }
  DesignElementHandle childHandle=sourceHandle;
  if (childHandle == null) {
    if (cloneElement instanceof IDesignElement) {
      childHandle=((IDesignElement)cloneElement).getHandle(SessionHandleAdapter.getInstance().getReportDesignHandle().getModule());
    }
 else     if (cloneElement instanceof IElementCopy) {
      childHandle=((IElementCopy)cloneElement).getHandle(SessionHandleAdapter.getInstance().getReportDesignHandle());
    }
  }
  return DNDUtil.handleValidateTargetCanContain(newContainer,childHandle) && DNDUtil.handleValidateTargetCanContainMore(newContainer,1);
}
Program: 69066
Project: 69066
Buggy source:
public void testWhiteSpace() throws IOException {
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  HTMLWriter writer=new HTMLWriter();
  writer.open(stream);
  writer.text("String_Node_Str");
  writer.endWriter();
  assertEquals("String_Node_Str",stream.toString().replaceAll("String_Node_Str","String_Node_Str"));
  stream.close();
}

Fixed version (ground truth):
public void testWhiteSpace() throws IOException {
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  HTMLWriter writer=new HTMLWriter();
  writer.open(stream);
  writer.text("String_Node_Str");
  writer.endWriter();
  writer.close();
  assertEquals("String_Node_Str",stream.toString().replaceAll("String_Node_Str","String_Node_Str"));
  stream.close();
}
Program: 69067
Project: 69067
Buggy source:
public void testStyleEscape() throws IOException {
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  HTMLWriter writer=new HTMLWriter();
  writer.open(stream);
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.endWriter();
  assertEquals("String_Node_Str",stream.toString().replaceAll("String_Node_Str","String_Node_Str"));
  stream.close();
}

Fixed version (ground truth):
public void testStyleEscape() throws IOException {
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  HTMLWriter writer=new HTMLWriter();
  writer.open(stream);
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.endWriter();
  writer.close();
  assertEquals("String_Node_Str",stream.toString().replaceAll("String_Node_Str","String_Node_Str"));
  stream.close();
}
Program: 69068
Project: 69068
Buggy source:
/** 
 * Test HTMLWriter getEscapedStr() <p> Test Case: <ul> <li>getEscapedStr</li> </ul> Excepted: <ul> <li>all the corresponding characters are transformed</li> </ul>
 * @throws IOException
 */
public void testGetEscapeStr() throws IOException {
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  HTMLWriter writer=new HTMLWriter();
  writer.open(stream);
  writer.text("String_Node_Str");
  writer.endWriter();
  assertEquals("String_Node_Str",stream.toString().replaceAll("String_Node_Str","String_Node_Str"));
  stream.close();
}

Fixed version (ground truth):
/** 
 * Test HTMLWriter getEscapedStr() <p> Test Case: <ul> <li>getEscapedStr</li> </ul> Excepted: <ul> <li>all the corresponding characters are transformed</li> </ul>
 * @throws IOException
 */
public void testGetEscapeStr() throws IOException {
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  HTMLWriter writer=new HTMLWriter();
  writer.open(stream);
  writer.text("String_Node_Str");
  writer.endWriter();
  writer.close();
  assertEquals("String_Node_Str",stream.toString().replaceAll("String_Node_Str","String_Node_Str"));
  stream.close();
}
Program: 69069
Project: 69069
Buggy source:
private void writeReport(DataOutputStream dos,Report design) throws IOException {
  IOUtil.writeShort(dos,(short)8);
  IOUtil.writeShort(dos,FIELD_REPORT_VERSION);
  IOUtil.writeString(dos,design.getVersion());
  IOUtil.writeShort(dos,FIELD_REPORT_LOCALE);
  IOUtil.writeString(dos,design.getLocale());
  IOUtil.writeShort(dos,FIELD_REPORT_STYLES);
  writeReportStyles(dos,design);
  IOUtil.writeShort(dos,FIELD_REPORT_USER_PROPERTIES);
  writeExprMap(dos,design.getUserProperties());
  IOUtil.writeShort(dos,FIELD_REPORT_VARIABLE);
  writeReportVariable(dos,design);
  IOUtil.writeShort(dos,FIELD_ON_PAGE_START);
  Expression onPageStart=design.getOnPageStart();
  writeExpression(dos,onPageStart);
  IOUtil.writeShort(dos,FIELD_ON_PAGE_END);
  Expression onPageEnd=design.getOnPageEnd();
  writeExpression(dos,onPageEnd);
  IOUtil.writeShort(dos,FIELD_REPORT_MASTER_PAGES);
  ReportItemWriter writer=new ReportItemWriter(dos);
  writeReportPageSetup(dos,writer,design);
  IOUtil.writeShort(dos,FIELD_REPORT_BODY);
  writeReportBodyContent(dos,writer,design);
}

Fixed version (ground truth):
private void writeReport(DataOutputStream dos,Report design) throws IOException {
  IOUtil.writeShort(dos,(short)9);
  IOUtil.writeShort(dos,FIELD_REPORT_VERSION);
  IOUtil.writeString(dos,design.getVersion());
  IOUtil.writeShort(dos,FIELD_REPORT_LOCALE);
  IOUtil.writeString(dos,design.getLocale());
  IOUtil.writeShort(dos,FIELD_REPORT_STYLES);
  writeReportStyles(dos,design);
  IOUtil.writeShort(dos,FIELD_REPORT_USER_PROPERTIES);
  writeExprMap(dos,design.getUserProperties());
  IOUtil.writeShort(dos,FIELD_REPORT_VARIABLE);
  writeReportVariable(dos,design);
  IOUtil.writeShort(dos,FIELD_ON_PAGE_START);
  Expression onPageStart=design.getOnPageStart();
  writeExpression(dos,onPageStart);
  IOUtil.writeShort(dos,FIELD_ON_PAGE_END);
  Expression onPageEnd=design.getOnPageEnd();
  writeExpression(dos,onPageEnd);
  IOUtil.writeShort(dos,FIELD_REPORT_MASTER_PAGES);
  ReportItemWriter writer=new ReportItemWriter(dos);
  writeReportPageSetup(dos,writer,design);
  IOUtil.writeShort(dos,FIELD_REPORT_BODY);
  writeReportBodyContent(dos,writer,design);
}
Program: 69070
Project: 69070
Buggy source:
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() > context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}

Fixed version (ground truth):
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() > context.getMaxBP() + 3000) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}
Program: 69071
Project: 69071
Buggy source:
/** 
 * Sets the visibility property for ReportItem.
 * @param design The <code>ReportItemDesign</code> object.
 * @param content The <code>ReportItemContent</code> object.
 */
protected void processVisibility(ReportItemDesign design,IContent content){
  VisibilityDesign visibility=design.getVisibility();
  if (visibility != null) {
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < visibility.count(); i++) {
      VisibilityRuleDesign rule=visibility.getRule(i);
      Expression expr=rule.getExpression();
      Boolean result=evaluateBoolean(expr);
      if (result == null) {
        context.addException(new EngineException(MessageConstants.EXPRESSION_EVALUATION_ERROR,rule.getExpression()));
      }
      boolean isHidden=result.booleanValue();
      if (isHidden) {
        buffer.append(rule.getFormat());
        buffer.append("String_Node_Str");
      }
    }
    if (buffer.length() != 0) {
      buffer.setLength(buffer.length() - 1);
      content.getStyle().setVisibleFormat(buffer.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the visibility property for ReportItem.
 * @param design The <code>ReportItemDesign</code> object.
 * @param content The <code>ReportItemContent</code> object.
 */
protected void processVisibility(ReportItemDesign design,IContent content){
  VisibilityDesign visibility=design.getVisibility();
  if (visibility != null) {
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < visibility.count(); i++) {
      VisibilityRuleDesign rule=visibility.getRule(i);
      Expression expr=rule.getExpression();
      Boolean result=evaluateBoolean(expr);
      if (result == null) {
        context.addException(new EngineException(MessageConstants.EXPRESSION_EVALUATION_ERROR,rule.getExpression()));
        continue;
      }
      boolean isHidden=result.booleanValue();
      if (isHidden) {
        buffer.append(rule.getFormat());
        buffer.append("String_Node_Str");
      }
    }
    if (buffer.length() != 0) {
      buffer.setLength(buffer.length() - 1);
      content.getStyle().setVisibleFormat(buffer.toString());
    }
  }
}
Program: 69072
Project: 69072
Buggy source:
/** 
 * Sets the visibility property for column.
 */
protected void processColumnVisibility(ColumnDesign design,Column column){
  VisibilityDesign visibility=design.getVisibility();
  if (visibility != null) {
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < visibility.count(); i++) {
      VisibilityRuleDesign rule=visibility.getRule(i);
      Expression expr=rule.getExpression();
      try {
        Boolean result=evaluateBoolean(expr);
        if (result == null) {
          throw new EngineException(MessageConstants.EXPRESSION_EVALUATION_ERROR,rule.getExpression());
        }
        boolean isHidden=((Boolean)result).booleanValue();
        if (isHidden) {
          buffer.append(rule.getFormat());
          buffer.append("String_Node_Str");
        }
      }
 catch (      BirtException ex) {
        context.addException(ex);
      }
    }
    if (buffer.length() != 0) {
      buffer.setLength(buffer.length() - 1);
      column.setVisibleFormat(buffer.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the visibility property for column.
 */
protected void processColumnVisibility(ColumnDesign design,Column column){
  VisibilityDesign visibility=design.getVisibility();
  if (visibility != null) {
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < visibility.count(); i++) {
      VisibilityRuleDesign rule=visibility.getRule(i);
      Expression expr=rule.getExpression();
      Boolean result=evaluateBoolean(expr);
      if (result == null) {
        context.addException(new EngineException(MessageConstants.EXPRESSION_EVALUATION_ERROR,rule.getExpression()));
        continue;
      }
      boolean isHidden=((Boolean)result).booleanValue();
      if (isHidden) {
        buffer.append(rule.getFormat());
        buffer.append("String_Node_Str");
      }
    }
    if (buffer.length() != 0) {
      buffer.setLength(buffer.length() - 1);
      column.setVisibleFormat(buffer.toString());
    }
  }
}
Program: 69073
Project: 69073
Buggy source:
public ITreeNode next(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  try {
    DocTreeNode nextNode=readNode(nextOffset);
    nextNode.parent=parent;
    nextIndex++;
    nextOffset=nextNode.next;
    return nextNode;
  }
 catch (  IOException ex) {
    fatalError=true;
  }
  return null;
}

Fixed version (ground truth):
public ITreeNode next(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  try {
    DocTreeNode nextNode=readNode(nextOffset);
    nextNode.parent=parent;
    nextIndex++;
    nextOffset=nextNode.next;
    return nextNode;
  }
 catch (  IOException ex) {
    logger.log(Level.INFO,"String_Node_Str" + nextOffset,ex);
    fatalError=true;
  }
  return null;
}
Program: 69074
Project: 69074
Buggy source:
private DocTreeNode readNode(int offset) throws IOException {
  DocTreeNode node=new DocTreeNode();
  node.offset=offset;
  in.seek(offset);
  node.next=in.readInt();
  node.child=in.readInt();
  node.childCount=in.readInt();
  int byteSize=in.readInt();
  byte[] bytes=new byte[byteSize];
  in.readFully(bytes,0,byteSize);
  DataInputStream input=new DataInputStream(new ByteArrayInputStream(bytes));
  node.readNode(input,classloader);
  node.children=new NodeCollection(node);
  return node;
}

Fixed version (ground truth):
synchronized private DocTreeNode readNode(int offset) throws IOException {
  DocTreeNode node=new DocTreeNode();
  node.offset=offset;
  in.seek(offset);
  node.next=in.readInt();
  node.child=in.readInt();
  node.childCount=in.readInt();
  int byteSize=in.readInt();
  byte[] bytes=new byte[byteSize];
  in.readFully(bytes,0,byteSize);
  DataInputStream input=new DataInputStream(new ByteArrayInputStream(bytes));
  node.readNode(input,classloader);
  node.children=new NodeCollection(node);
  return node;
}
Program: 69075
Project: 69075
Buggy source:
public void setDataElement(DataElement data){
  if (!(data == null || data instanceof DateTimeDataElement)) {
    return;
  }
  CDateTime calendar=null;
  if (data != null) {
    calendar=((DateTimeDataElement)data).getValueAsCDateTime();
  }
 else {
    calendar=new CDateTime(1970,1,1,0,0,0);
  }
  if (calendar.getYear() == 1970 && calendar.getMonth() == 0 && calendar.getDay() == 1) {
    btnDate.setSelection(false);
    pickerDate.setEnabled(false);
  }
  if (calendar.getHour() == 0 && calendar.getMinute() == 0 && calendar.getSecond() == 0) {
    btnTime.setSelection(false);
    pickerTime.setEnabled(false);
  }
  pickerDate.setYear(calendar.getYear());
  pickerDate.setMonth(calendar.getMonth());
  pickerDate.setDay(calendar.getDay());
  pickerTime.setHours(calendar.getHour());
  pickerTime.setMinutes(calendar.getMinute());
  pickerTime.setSeconds(calendar.getSecond());
}

Fixed version (ground truth):
public void setDataElement(DataElement data){
  if (!(data == null || data instanceof DateTimeDataElement)) {
    return;
  }
  CDateTime calendar=null;
  if (data != null) {
    calendar=((DateTimeDataElement)data).getValueAsCDateTime();
  }
 else {
    calendar=new CDateTime(1970,1,1,0,0,0);
  }
  if (calendar.getYear() == 1970 && calendar.getMonth() == 0 && calendar.getDay() == 1) {
    btnDate.setSelection(false);
    pickerDate.setEnabled(false);
  }
 else {
    btnDate.setSelection(true);
    pickerDate.setEnabled(true);
  }
  if (calendar.getHour() == 0 && calendar.getMinute() == 0 && calendar.getSecond() == 0) {
    btnTime.setSelection(false);
    pickerTime.setEnabled(false);
  }
 else {
    btnTime.setSelection(true);
    pickerTime.setEnabled(true);
  }
  pickerDate.setYear(calendar.getYear());
  pickerDate.setMonth(calendar.getMonth());
  pickerDate.setDay(calendar.getDay());
  pickerTime.setHours(calendar.getHour());
  pickerTime.setMinutes(calendar.getMinute());
  pickerTime.setSeconds(calendar.getSecond());
}
Program: 69076
Project: 69076
Buggy source:
/** 
 * Returns value of aggregate function parameters.
 * @param orthSD
 * @param baseSD
 * @param orthQuery
 * @since 2.5
 */
public static String[] getAggFunParameters(SeriesDefinition orthSD,SeriesDefinition baseSD,Query orthQuery){
  if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
    SeriesGrouping grouping=orthSD.getGrouping();
    if (grouping.isEnabled()) {
      if (orthQuery != null && orthQuery.getGrouping() != null) {
        return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
      }
      return grouping.getAggregateParameters().toArray(new String[0]);
    }
    return baseSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
 else {
    if (orthQuery != null && orthQuery.getGrouping() != null) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return orthSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
}

Fixed version (ground truth):
/** 
 * Returns value of aggregate function parameters.
 * @param orthSD
 * @param baseSD
 * @param orthQuery
 * @since 2.5
 */
public static String[] getAggFunParameters(SeriesDefinition orthSD,SeriesDefinition baseSD,Query orthQuery){
  if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
    SeriesGrouping grouping=orthSD.getGrouping();
    if (grouping != null && grouping.isEnabled()) {
      if (orthQuery != null && orthQuery.getGrouping() != null) {
        return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
      }
      return grouping.getAggregateParameters().toArray(new String[0]);
    }
    return baseSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
 else {
    if (orthQuery != null && orthQuery.getGrouping() != null) {
      return orthQuery.getGrouping().getAggregateParameters().toArray(new String[0]);
    }
    return orthSD.getGrouping().getAggregateParameters().toArray(new String[0]);
  }
}
Program: 69077
Project: 69077
Buggy source:
public void setAggregation(Query query,SeriesDefinition sd){
  this.query=query;
  this.fSeriesDefi=sd;
  if (query.getGrouping() == null) {
    if (sd.getGrouping() != null) {
      fGrouping=sd.getGrouping().copyInstance();
    }
 else {
      fGrouping=SeriesGroupingImpl.create();
    }
  }
 else {
    fGrouping=query.getGrouping().copyInstance();
  }
}

Fixed version (ground truth):
public void setAggregation(Query query,SeriesDefinition sd){
  this.query=query;
  this.fSeriesDefi=sd;
  fGrouping=null;
  if (sd.getGrouping() != null && sd.getGrouping().isEnabled()) {
    fGrouping=sd.getGrouping().copyInstance();
  }
  if (query.getGrouping() != null && query.getGrouping().isEnabled()) {
    fGrouping=query.getGrouping().copyInstance();
  }
  if (fGrouping == null) {
    fGrouping=SeriesGroupingImpl.create();
  }
}
Program: 69078
Project: 69078
Buggy source:
public void widgetSelected(SelectionEvent e){
  Object source=e.getSource();
  if (source == fCmbAggregate) {
    String aggFunc=((String[])fCmbAggregate.getData())[fCmbAggregate.getSelectionIndex()];
    showAggregateParameters(aggFunc);
    if (AGG_FUNC_NONE.equals(aggFunc)) {
      fGrouping.setEnabled(false);
      fGrouping.setAggregateExpression(null);
    }
 else {
      fGrouping.setEnabled(true);
      fGrouping.setAggregateExpression(aggFunc);
    }
  }
 else   if (isAggParametersWidget(source)) {
    setAggParameter((Text)source);
  }
 else   if (isBuilderBtnWidget(source)) {
    try {
      Text txtArg=fExprBuilderWidgetsMap.get(source);
      String sExpr=fChartContext.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,txtArg.getText(),fChartContext.getExtendedItem(),fTitle);
      txtArg.setText(sExpr);
      setAggParameter(txtArg);
    }
 catch (    ChartException e1) {
      WizardBase.displayException(e1);
    }
  }
 else   if (source == fBtnOK) {
    if (query != null) {
      query.setGrouping(fGrouping);
      query.getGrouping().eAdapters().addAll(query.eAdapters());
    }
 else {
      fSeriesDefi.setGrouping(fGrouping);
      fSeriesDefi.getGrouping().eAdapters().addAll(fSeriesDefi.eAdapters());
    }
    ChartUIUtil.checkAggregateType(fChartContext);
    DataDefinitionTextManager.getInstance().updateTooltip();
    closeAggregateEditor(getShell());
  }
 else   if (source == fBtnCancel) {
    closeAggregateEditor(getShell());
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  Object source=e.getSource();
  if (source == fCmbAggregate) {
    String aggFunc=((String[])fCmbAggregate.getData())[fCmbAggregate.getSelectionIndex()];
    showAggregateParameters(aggFunc);
    if (AGG_FUNC_NONE.equals(aggFunc)) {
      fGrouping.setEnabled(false);
      fGrouping.setAggregateExpression(null);
    }
 else {
      fGrouping.setEnabled(true);
      fGrouping.setAggregateExpression(aggFunc);
    }
  }
 else   if (isAggParametersWidget(source)) {
    setAggParameter((Text)source);
  }
 else   if (isBuilderBtnWidget(source)) {
    try {
      Text txtArg=fExprBuilderWidgetsMap.get(source);
      String sExpr=fChartContext.getUIServiceProvider().invoke(IUIServiceProvider.COMMAND_EXPRESSION_DATA_BINDINGS,txtArg.getText(),fChartContext.getExtendedItem(),fTitle);
      txtArg.setText(sExpr);
      setAggParameter(txtArg);
    }
 catch (    ChartException e1) {
      WizardBase.displayException(e1);
    }
  }
 else   if (source == fBtnOK) {
    if (query != null) {
      query.setGrouping(fGrouping);
      query.getGrouping().eAdapters().addAll(query.eAdapters());
      fSeriesDefi.setGrouping(null);
    }
 else {
      fSeriesDefi.setGrouping(fGrouping);
      fSeriesDefi.getGrouping().eAdapters().addAll(fSeriesDefi.eAdapters());
    }
    ChartUIUtil.checkAggregateType(fChartContext);
    DataDefinitionTextManager.getInstance().updateTooltip();
    closeAggregateEditor(getShell());
  }
 else   if (source == fBtnCancel) {
    closeAggregateEditor(getShell());
  }
}
Program: 69079
Project: 69079
Buggy source:
public void onRow(Object[] args) throws DataException {
  assert(args.length > 0);
  if (args[0] != null) {
    Object value=getTypedData(args[0]);
    Counter counter=(Counter)cacheMap.get(value);
    if (counter == null) {
      counter=new Counter(1,rowIndex);
      cacheMap.put(value,counter);
    }
 else {
      counter.count++;
    }
    if (counter.count > maxCount) {
      mode=value;
      maxCount=counter.count;
      modeMap.clear();
      modeMap.put(value,counter);
    }
 else     if (counter.count == maxCount) {
      modeMap.put(value,counter);
    }
    rowIndex++;
  }
}

Fixed version (ground truth):
public void onRow(Object[] args) throws DataException {
  assert(args.length > 0);
  if (args[0] != null) {
    Object value=getTypedData(args[0]);
    Object obj=cacheMap.get(value);
    int count=1;
    if (obj != null) {
      count=((Integer)obj).intValue();
      count++;
    }
    cacheMap.put(value,count);
    if (count > maxCount) {
      mode=value;
      maxCount=count;
      multiMaxValue=false;
    }
 else     if (count == maxCount) {
      multiMaxValue=true;
    }
  }
}
Program: 69080
Project: 69080
Buggy source:
public void start(){
  super.start();
  rowIndex=0;
  cacheMap=new HashMap();
  maxCount=0;
  mode=null;
  modeMap=new HashMap();
}

Fixed version (ground truth):
public void start(){
  super.start();
  maxCount=0;
  mode=null;
  cacheMap=new LinkedHashMap();
  multiMaxValue=false;
}
Program: 69081
Project: 69081
Buggy source:
public void finish() throws DataException {
  super.finish();
  cacheMap=null;
}

Fixed version (ground truth):
public void finish() throws DataException {
  super.finish();
}
Program: 69082
Project: 69082
Buggy source:
public Object getSummaryValue(){
  if (maxCount == 1) {
    return null;
  }
 else   if (modeMap.isEmpty() == false) {
    int minIndex=Integer.MAX_VALUE;
    for (Iterator i=modeMap.keySet().iterator(); i.hasNext(); ) {
      Object key=(Object)i.next();
      Counter info=(Counter)modeMap.get(key);
      if (info.firstIndex < minIndex) {
        minIndex=info.firstIndex;
        mode=key;
      }
    }
    modeMap=null;
  }
  return mode;
}

Fixed version (ground truth):
public Object getSummaryValue(){
  if (maxCount == 1) {
    return null;
  }
  if (multiMaxValue && cacheMap != null && !cacheMap.isEmpty()) {
    for (Iterator i=cacheMap.keySet().iterator(); i.hasNext(); ) {
      Object key=(Object)i.next();
      int count=(Integer)cacheMap.get(key);
      if (count == maxCount) {
        mode=key;
        break;
      }
    }
  }
  cacheMap=null;
  return mode;
}