nus-yam/ex-repair huggingface dataset:
Program: 74309
Project: 74309
Buggy source:
protected void updateLine(){
  if (root == null) {
    return;
  }
  Iterator iter=root.getChildren();
  int height=root.getHeight();
  int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    int childHeight=child.getAllocatedHeight();
    height=Math.max(height,childHeight);
  }
  if (parent.isPageEmpty()) {
    height=Math.min(maxAvaHeight,Math.max(height,lineHeight));
  }
 else {
    height=Math.max(height,lineHeight);
  }
  root.setContentHeight(height);
}

Fixed version (ground truth):
protected void updateLine(){
  if (root == null) {
    return;
  }
  Iterator iter=root.getChildren();
  int height=root.getHeight();
  int lineHeight=((PDFBlockStackingLM)parent).getLineHeight();
  if (lineHeight > maxAvaHeight) {
    lineHeight=0;
  }
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    int childHeight=child.getAllocatedHeight();
    height=Math.max(height,childHeight);
  }
  if (parent.isPageEmpty()) {
    height=Math.min(maxAvaHeight,Math.max(height,lineHeight));
  }
 else {
    height=Math.max(height,lineHeight);
  }
  root.setContentHeight(height);
}
Program: 74310
Project: 74310
Buggy source:
/** 
 * Sets the UI instance of the element
 * @param reportItemUI the UI instance to set.It cannot be null
 */
void setReportItemUI(IReportItemFigureProvider reportItemUI){
  Assert.isLegal(reportItemUI != null);
  this.reportItemUI=reportItemUI;
}

Fixed version (ground truth):
/** 
 * Sets the UI instance of the element
 * @param reportItemUI the UI instance to set.It cannot be null
 */
void setReportItemUI(IReportItemFigureProvider reportItemUI){
}
Program: 74311
Project: 74311
Buggy source:
/** 
 * Sets the corresponding attribute of the key of the extended element
 * @param key the key of the attribute.It cannot be null
 */
void setAttribute(String key,Object value){
  Assert.isLegal(key != null);
  attributesMap.put(key,value);
}

Fixed version (ground truth):
/** 
 * Sets the corresponding attribute of the key of the extended element
 * @param key the key of the attribute.It cannot be null
 */
void setAttribute(String key,Object value){
}
Program: 74312
Project: 74312
Buggy source:
/** 
 * Gets the corresponding attribute of the key of the extended element
 * @param key the key of the attribute. It cannot be null. One of the constants defined in IExtensionConstants
 * @return Returns the corresponding attribute, or null if the key isinvalid or the corresponding attribute hasn't been set
 */
public Object getAttribute(String key){
  Assert.isLegal(key != null);
  return attributesMap.get(key);
}

Fixed version (ground truth):
/** 
 * Gets the corresponding attribute of the key of the extended element
 * @param key the key of the attribute. It cannot be null. One of the constants defined in IExtensionConstants
 * @return Returns the corresponding attribute, or null if the key isinvalid or the corresponding attribute hasn't been set
 */
public Object getAttribute(String key){
}
Program: 74313
Project: 74313
Buggy source:
private ImageDescriptor getImageDescriptor(IConfigurationElement element){
  Assert.isLegal(element != null);
  IExtension extension=element.getDeclaringExtension();
  String iconPath=element.getAttribute(IExtensionConstants.ATTRIBUTE_ICON);
  if (iconPath == null) {
    return null;
  }
  URL path=Platform.getBundle(extension.getNamespace()).getEntry("String_Node_Str");
  try {
    return ImageDescriptor.createFromURL(new URL(path,iconPath));
  }
 catch (  MalformedURLException e) {
  }
  return null;
}

Fixed version (ground truth):
private ImageDescriptor getImageDescriptor(IConfigurationElement element){
}
Program: 74314
Project: 74314
Buggy source:
/** 
 * Gets the extended element point with the specified extension name.
 * @param extensionName the extension name of the extended element
 * @return Returns the extended element point, or null if any problem exists
 */
public ExtendedElementUIPoint getExtendedElementPoint(String extensionName){
  Assert.isLegal(extensionName != null);
  return (ExtendedElementUIPoint)getReportItemUIMap().get(extensionName);
}

Fixed version (ground truth):
/** 
 * Gets the extended element point with the specified extension name.
 * @param extensionName the extension name of the extended element
 * @return Returns the extended element point, or null if any problem exists
 */
public ExtendedElementUIPoint getExtendedElementPoint(String extensionName){
}
Program: 74315
Project: 74315
Buggy source:
/** 
 * createGetParameterDefinitionTask.
 * @param runnable
 * @return the get parameter definition task
 */
public IGetParameterDefinitionTask createGetParameterDefinitionTask(IReportRunnable runnable,InputOptions options){
  IGetParameterDefinitionTask task=null;
  try {
    HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
    task=engine.createGetParameterDefinitionTask(runnable);
    Map context=BirtUtility.getAppContext(request,ReportEngineService.class.getClassLoader());
    task.setAppContext(context);
  }
 catch (  Exception e) {
  }
  return task;
}

Fixed version (ground truth):
/** 
 * createGetParameterDefinitionTask.
 * @param runnable
 * @return the get parameter definition task
 */
public IGetParameterDefinitionTask createGetParameterDefinitionTask(IReportRunnable runnable,InputOptions options){
  IGetParameterDefinitionTask task=null;
  try {
    HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
    Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
    task=engine.createGetParameterDefinitionTask(runnable);
    task.setLocale(locale);
    Map context=BirtUtility.getAppContext(request,ReportEngineService.class.getClassLoader());
    task.setAppContext(context);
  }
 catch (  Exception e) {
  }
  return task;
}
Program: 74317
Project: 74317
Buggy source:
public void handleOnFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),ON_FETCH,dataSetHandle.getOnFetch());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.onFetch(new DataSetInstance(dataSet),new DataSetRow(row),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleOnFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  if (reportContext == null)   return;
  try {
    if (!this.useOnFetchEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),ON_FETCH,dataSetHandle.getOnFetch());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.onFetch(new DataSetInstance(dataSet),new DataSetRow(row),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74318
Project: 74318
Buggy source:
public void handleBeforeOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),BEFORE_OPEN,dataSetHandle.getBeforeOpen());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),BEFORE_OPEN,dataSetHandle.getBeforeOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74319
Project: 74319
Buggy source:
public void handleBeforeClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),BEFORE_CLOSE,dataSetHandle.getBeforeClose());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.beforeClose(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),BEFORE_CLOSE,dataSetHandle.getBeforeClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74320
Project: 74320
Buggy source:
public void handleAfterClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),AFTER_CLOSE,dataSetHandle.getAfterClose());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterClose(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),AFTER_CLOSE,dataSetHandle.getAfterClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74321
Project: 74321
Buggy source:
public DataSetScriptExecutor(DataSetHandle dataSetHandle,ExecutionContext context){
  super(context);
  this.dataSetHandle=dataSetHandle;
  String className=dataSetHandle.getEventHandlerClass();
  initEventHandler(className);
}

Fixed version (ground truth):
public DataSetScriptExecutor(DataSetHandle dataSetHandle,ExecutionContext context){
  super(context);
  this.dataSetHandle=dataSetHandle;
  String className=dataSetHandle.getEventHandlerClass();
  initEventHandler(className);
  useOnFetchEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getOnFetch());
  useAfterCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getAfterClose());
  useAfterOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getAfterOpen());
  useBeforeOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getBeforeOpen());
  useBeforeCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getBeforeClose());
}
Program: 74322
Project: 74322
Buggy source:
public void handleAfterOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),AFTER_OPEN,dataSetHandle.getAfterOpen());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.afterOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterOpen(IDataSetInstanceHandle dataSet){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),AFTER_OPEN,dataSetHandle.getAfterOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSetInstance(dataSet),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74323
Project: 74323
Buggy source:
public DataSourceScriptExecutor(DataSourceHandle dataSourceHandle,ExecutionContext context){
  super(context);
  this.dataSourceHandle=dataSourceHandle;
  String className=dataSourceHandle.getEventHandlerClass();
  initEventHandler(className);
}

Fixed version (ground truth):
public DataSourceScriptExecutor(DataSourceHandle dataSourceHandle,ExecutionContext context){
  super(context);
  this.dataSourceHandle=dataSourceHandle;
  String className=dataSourceHandle.getEventHandlerClass();
  initEventHandler(className);
  this.useBeforeOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getBeforeOpen());
  this.useBeforeCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getBeforeClose());
  this.useAfterOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getAfterOpen());
  this.useAfterCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSourceHandle.getAfterClose());
}
Program: 74324
Project: 74324
Buggy source:
public void handleBeforeOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_OPEN,dataSourceHandle.getBeforeOpen());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_OPEN,dataSourceHandle.getBeforeOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74325
Project: 74325
Buggy source:
public void handleBeforeClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_CLOSE,dataSourceHandle.getBeforeClose());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.beforeClose(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleBeforeClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useBeforeCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),BEFORE_CLOSE,dataSourceHandle.getBeforeClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.beforeClose(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74326
Project: 74326
Buggy source:
public void handleAfterClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_CLOSE,dataSourceHandle.getAfterClose());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterClose(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_CLOSE,dataSourceHandle.getAfterClose());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterClose(reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74327
Project: 74327
Buggy source:
public void handleAfterOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_OPEN,dataSourceHandle.getAfterOpen());
    if (status.didRun())     return;
    if (eventHandler != null)     eventHandler.afterOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleAfterOpen(IDataSourceInstanceHandle dataSource){
  if (reportContext == null)   return;
  try {
    if (!this.useAfterOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSource.getScriptScope(),dataSource.getName(),AFTER_OPEN,dataSourceHandle.getAfterOpen());
      if (status.didRun())       return;
    }
    if (eventHandler != null)     eventHandler.afterOpen(new DataSourceInstance(dataSource),reportContext);
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74328
Project: 74328
Buggy source:
public boolean handleDescribe(IDataSetInstanceHandle dataSet,IScriptDataSetMetaDataDefinition metaData) throws BirtException {
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),DESCRIBE,((ScriptDataSetHandle)dataSetHandle).getDescribe());
    if (status.didRun()) {
      Object result=status.result();
      if (result instanceof Boolean)       return ((Boolean)result).booleanValue();
 else       throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,"String_Node_Str");
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.describe(new DataSetInstance(dataSet),new ScriptedDataSetMetaData(metaData));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}

Fixed version (ground truth):
public boolean handleDescribe(IDataSetInstanceHandle dataSet,IScriptDataSetMetaDataDefinition metaData) throws BirtException {
  try {
    if (!this.useDescribeEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),DESCRIBE,((ScriptDataSetHandle)dataSetHandle).getDescribe());
      if (status.didRun()) {
        Object result=status.result();
        if (result instanceof Boolean)         return ((Boolean)result).booleanValue();
 else         throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,"String_Node_Str");
      }
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.describe(new DataSetInstance(dataSet),new ScriptedDataSetMetaData(metaData));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}
Program: 74329
Project: 74329
Buggy source:
public void handleOpen(IDataSetInstanceHandle dataSet) throws BirtException {
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),OPEN,((ScriptDataSetHandle)dataSetHandle).getOpen());
    if (status.didRun())     return;
    if (scriptedEventHandler != null)     scriptedEventHandler.open(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleOpen(IDataSetInstanceHandle dataSet) throws BirtException {
  try {
    if (!this.useOpenEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),OPEN,((ScriptDataSetHandle)dataSetHandle).getOpen());
      if (status.didRun())       return;
    }
    if (scriptedEventHandler != null)     scriptedEventHandler.open(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74330
Project: 74330
Buggy source:
public void handleClose(IDataSetInstanceHandle dataSet){
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),CLOSE,((ScriptDataSetHandle)dataSetHandle).getClose());
    if (status.didRun())     return;
    if (scriptedEventHandler != null)     scriptedEventHandler.close(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}

Fixed version (ground truth):
public void handleClose(IDataSetInstanceHandle dataSet){
  try {
    if (!this.useCloseEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),CLOSE,((ScriptDataSetHandle)dataSetHandle).getClose());
      if (status.didRun())       return;
    }
    if (scriptedEventHandler != null)     scriptedEventHandler.close(new DataSetInstance(dataSet));
  }
 catch (  Exception e) {
    addException(context,e);
  }
}
Program: 74331
Project: 74331
Buggy source:
public ScriptDataSetScriptExecutor(ScriptDataSetHandle dataSetHandle,ExecutionContext context){
  super(dataSetHandle,context);
}

Fixed version (ground truth):
public ScriptDataSetScriptExecutor(ScriptDataSetHandle dataSetHandle,ExecutionContext context){
  super(dataSetHandle,context);
  useOpenEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getOpen());
  useFetchEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getFetch());
  useCloseEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getClose());
  useDescribeEventHandler=ScriptTextUtil.isNullOrComments(dataSetHandle.getDescribe());
}
Program: 74332
Project: 74332
Buggy source:
public boolean handleFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  try {
    JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),FETCH,((ScriptDataSetHandle)dataSetHandle).getFetch());
    if (status.didRun()) {
      Object result=status.result();
      if (result instanceof Boolean)       return ((Boolean)result).booleanValue();
 else       throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,"String_Node_Str");
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.fetch(new DataSetInstance(dataSet),new UpdatableDataSetRow(row));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}

Fixed version (ground truth):
public boolean handleFetch(IDataSetInstanceHandle dataSet,IDataRow row){
  try {
    if (!useFetchEventHandler) {
      JSScriptStatus status=handleJS(dataSet.getScriptScope(),dataSet.getName(),FETCH,((ScriptDataSetHandle)dataSetHandle).getFetch());
      if (status.didRun()) {
        Object result=status.result();
        if (result instanceof Boolean)         return ((Boolean)result).booleanValue();
 else         throw new DataException(ResourceConstants.EXPECT_BOOLEAN_RETURN_TYPE,"String_Node_Str");
      }
    }
    if (scriptedEventHandler != null)     return scriptedEventHandler.fetch(new DataSetInstance(dataSet),new UpdatableDataSetRow(row));
  }
 catch (  Exception e) {
    addException(context,e);
  }
  return false;
}
Program: 74333
Project: 74333
Buggy source:
/** 
 * @return the test
 */
public static Test suite(){
  TestSuite test=new TestSuite();
  test.addTestSuite(CellOverlappingValidatorTest.class);
  test.addTestSuite(DataSetRequiredValidatorTest.class);
  test.addTestSuite(GroupNameValidatorTest.class);
  test.addTestSuite(InconsistentColumnsValidatorTest.class);
  test.addTestSuite(MasterPageMultiColumnValidatorTest.class);
  test.addTestSuite(MasterPageRequiredValidatorTest.class);
  test.addTestSuite(MasterPageSizeValidatorTest.class);
  test.addTestSuite(MasterPageTypeValidatorTest.class);
  test.addTestSuite(StructureListValidatorTest.class);
  test.addTestSuite(ValidationPerformanceTest.class);
  test.addTestSuite(ValueRequiredValidatorTest.class);
  return test;
}

Fixed version (ground truth):
/** 
 * @return the test
 */
public static Test suite(){
  TestSuite test=new TestSuite();
  test.addTestSuite(CellOverlappingValidatorTest.class);
  test.addTestSuite(DataSetRequiredValidatorTest.class);
  test.addTestSuite(GroupNameValidatorTest.class);
  test.addTestSuite(InconsistentColumnsValidatorTest.class);
  test.addTestSuite(MasterPageMultiColumnValidatorTest.class);
  test.addTestSuite(MasterPageRequiredValidatorTest.class);
  test.addTestSuite(MasterPageSizeValidatorTest.class);
  test.addTestSuite(MasterPageTypeValidatorTest.class);
  test.addTestSuite(StructureListValidatorTest.class);
  test.addTestSuite(ValidationPerformanceTest.class);
  test.addTestSuite(ValueRequiredValidatorTest.class);
  test.addTestSuite(DataColumnNameValidatorTest.class);
  return test;
}
Program: 74334
Project: 74334
Buggy source:
public Object getValue(IResultIterator resultIterator) throws BirtException {
  Object value=resultIterator.getString(valueColumnName);
  return EngineTask.convertParameterType(value,valueType);
}

Fixed version (ground truth):
public Object getValue(IResultIterator resultIterator) throws BirtException {
  Object value=resultIterator.getValue(valueColumnName);
  return EngineTask.convertParameterType(value,valueType);
}
Program: 74335
Project: 74335
Buggy source:
/** 
 * @param cubeView
 * @param result
 * @param relationMap
 * @param manager
 * @param appContext
 * @throws OLAPException
 */
public CubeCursorImpl(BirtCubeView cubeView,IResultSet result,Map relationMap,MeasureNameManager manager,Map appContext) throws OLAPException {
  super(null,new AggregationAccessor(cubeView,result,relationMap,manager));
  if (result == null)   return;
  EdgeAxis[] calculatedMemberAxis=result.getMeasureResult();
  BirtEdgeView[] calculatedMemberView=cubeView.getMeasureEdgeView();
  if (calculatedMemberAxis != null) {
    for (int i=0; i < calculatedMemberAxis.length; i++) {
      pageEdge.add(new EdgeCursorImpl(calculatedMemberView[i],true,calculatedMemberAxis[i],this));
    }
  }
  if (cubeView.getColumnEdgeView() != null) {
    EdgeCursor columnEdgeCursor=new EdgeCursorImpl(cubeView.getColumnEdgeView(),false,result.getColumnEdgeResult(),this);
    if (appContext != null)     columnEdgeCursor.setFetchSize(populateFetchLimitSize(appContext.get("String_Node_Str")));
    result.getColumnEdgeResult().populateEdgeInfo();
    ordinateEdge.add(columnEdgeCursor);
  }
  if (cubeView.getRowEdgeView() != null) {
    EdgeCursor rowEdgeCursor=new EdgeCursorImpl(cubeView.getRowEdgeView(),false,result.getRowEdgeResult(),this);
    if (appContext != null)     rowEdgeCursor.setFetchSize(populateFetchLimitSize(appContext.get("String_Node_Str")));
    result.getRowEdgeResult().populateEdgeInfo();
    ordinateEdge.add(rowEdgeCursor);
  }
}

Fixed version (ground truth):
/** 
 * @param cubeView
 * @param result
 * @param relationMap
 * @param manager
 * @param appContext
 * @throws OLAPException
 */
public CubeCursorImpl(BirtCubeView cubeView,IResultSet result,Map relationMap,MeasureNameManager manager,Map appContext) throws OLAPException {
  super(null,new AggregationAccessor(cubeView,result,relationMap,manager));
  if (result == null)   return;
  EdgeAxis[] calculatedMemberAxis=result.getMeasureResult();
  BirtEdgeView[] calculatedMemberView=cubeView.getMeasureEdgeView();
  if (calculatedMemberAxis != null) {
    for (int i=0; i < calculatedMemberAxis.length; i++) {
      pageEdge.add(new EdgeCursorImpl(calculatedMemberView[i],true,calculatedMemberAxis[i],this));
    }
  }
  if (cubeView.getColumnEdgeView() != null) {
    EdgeCursor columnEdgeCursor=new EdgeCursorImpl(cubeView.getColumnEdgeView(),false,result.getColumnEdgeResult(),this);
    if (appContext != null)     columnEdgeCursor.setFetchSize(populateFetchLimitSize(appContext.get(DataEngine.CUBECURSOR_FETCH_LIMIT_ON_COLUMN_EDGE)));
    result.getColumnEdgeResult().populateEdgeInfo();
    ordinateEdge.add(columnEdgeCursor);
  }
  if (cubeView.getRowEdgeView() != null) {
    EdgeCursor rowEdgeCursor=new EdgeCursorImpl(cubeView.getRowEdgeView(),false,result.getRowEdgeResult(),this);
    if (appContext != null)     rowEdgeCursor.setFetchSize(populateFetchLimitSize(appContext.get(DataEngine.CUBECUSROR_FETCH_LIMIT_ON_ROW_EDGE)));
    result.getRowEdgeResult().populateEdgeInfo();
    ordinateEdge.add(rowEdgeCursor);
  }
}
Program: 74336
Project: 74336
Buggy source:
public IPreparedCubeQuery prepare(ICubeQueryDefinition query,Map appContext) throws BirtException {
  if (stopSign != null)   stopSign.start();
  if (this.cubeHandleMap.get(query.getName()) != null) {
    this.materializeCube((CubeHandle)this.cubeHandleMap.get(query.getName()),appContext,stopSign);
    this.cubeHandleMap.remove(query.getName());
  }
  ICubeQueryDefinition cubeQueryDefn=new CubeQueryDefinitionAdapter(query);
  if (this.sessionContext.getDataEngineContext().getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    int size=0;
    if (appContext != null) {
      size=populateFetchLimitSize(appContext.get(DataEngine.CUBECURSOR_FETCH_LIMIT_ON_LEVEL));
      if (size > 0) {
        cubeQueryDefn.getFilters().addAll(fetchFilterList(cubeQueryDefn.getEdge(ICubeQueryDefinition.COLUMN_EDGE),size));
        cubeQueryDefn.getFilters().addAll(fetchFilterList(cubeQueryDefn.getEdge(ICubeQueryDefinition.ROW_EDGE),size));
      }
    }
  }
  return this.dataEngine.prepare(cubeQueryDefn,appContext);
}

Fixed version (ground truth):
public IPreparedCubeQuery prepare(ICubeQueryDefinition query,Map appContext) throws BirtException {
  if (stopSign != null)   stopSign.start();
  if (this.cubeHandleMap.get(query.getName()) != null) {
    this.materializeCube((CubeHandle)this.cubeHandleMap.get(query.getName()),appContext,stopSign);
    this.cubeHandleMap.remove(query.getName());
  }
  return this.dataEngine.prepare(query,appContext);
}
Program: 74337
Project: 74337
Buggy source:
protected MapDesign readMap(DataInputStream in) throws IOException {
  MapDesign map=new MapDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=new MapRuleDesign();
    ;
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    boolean valuseIsList=IOUtil.readBool(in);
    if (valuseIsList) {
      List valueList=IOUtil.readList(in);
      rule.setExpression(oper,valueList);
    }
 else {
      String value1=IOUtil.readString(in);
      String value2=IOUtil.readString(in);
      rule.setExpression(oper,value1,value2);
    }
    String displayText=IOUtil.readString(in);
    String displayKey=IOUtil.readString(in);
    rule.setValueIsList(valuseIsList);
    rule.setTestExpression(testExpr);
    rule.setDisplayText(displayKey,displayText);
    map.addRule(rule);
  }
  return map;
}

Fixed version (ground truth):
protected MapDesign readMap(DataInputStream in) throws IOException {
  MapDesign map=new MapDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=new MapRuleDesign();
    ;
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    Object object1=IOUtil.readObject(in);
    Object object2=IOUtil.readObject(in);
    if (object1 instanceof List) {
      rule.setExpression(oper,(List)object1);
      rule.setValueIsList(true);
    }
 else {
      rule.setExpression(oper,(String)object1,(String)object2);
      rule.setValueIsList(false);
    }
    String displayText=IOUtil.readString(in);
    String displayKey=IOUtil.readString(in);
    rule.setTestExpression(testExpr);
    rule.setDisplayText(displayKey,displayText);
    map.addRule(rule);
  }
  return map;
}
Program: 74338
Project: 74338
Buggy source:
protected HighlightDesign readHighlight(DataInputStream in) throws IOException {
  HighlightDesign highlight=new HighlightDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=new HighlightRuleDesign();
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    boolean valuseIsList=IOUtil.readBool(in);
    if (valuseIsList) {
      List valueList=IOUtil.readList(in);
      rule.setExpression(oper,valueList);
    }
 else {
      String value1=IOUtil.readString(in);
      String value2=IOUtil.readString(in);
      rule.setExpression(oper,value1,value2);
    }
    IStyle style=readStyle(in);
    rule.setValueIsList(valuseIsList);
    rule.setTestExpression(testExpr);
    rule.setStyle(style);
    highlight.addRule(rule);
  }
  return highlight;
}

Fixed version (ground truth):
protected HighlightDesign readHighlight(DataInputStream in) throws IOException {
  HighlightDesign highlight=new HighlightDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=new HighlightRuleDesign();
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    Object object1=IOUtil.readObject(in);
    Object object2=IOUtil.readObject(in);
    if (object1 instanceof List) {
      rule.setExpression(oper,(List)object1);
      rule.setValueIsList(true);
    }
 else {
      rule.setExpression(oper,(String)object1,(String)object2);
      rule.setValueIsList(false);
    }
    IStyle style=readStyle(in);
    rule.setTestExpression(testExpr);
    rule.setStyle(style);
    highlight.addRule(rule);
  }
  return highlight;
}
Program: 74339
Project: 74339
Buggy source:
protected void writeMap(DataOutputStream out,MapDesign map) throws IOException {
  int ruleCount=map.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=map.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    IOUtil.writeBool(out,rule.ifValueIsList());
    if (rule.ifValueIsList()) {
      IOUtil.writeList(out,rule.getValue1List());
    }
 else {
      IOUtil.writeString(out,rule.getValue1());
      IOUtil.writeString(out,rule.getValue2());
    }
    IOUtil.writeString(out,rule.getDisplayText());
    IOUtil.writeString(out,rule.getDisplayKey());
  }
}

Fixed version (ground truth):
protected void writeMap(DataOutputStream out,MapDesign map) throws IOException {
  int ruleCount=map.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=map.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    if (rule.ifValueIsList()) {
      IOUtil.writeObject(out,rule.getValue1List());
      IOUtil.writeObject(out,null);
    }
 else {
      IOUtil.writeObject(out,rule.getValue1());
      IOUtil.writeObject(out,rule.getValue2());
    }
    IOUtil.writeString(out,rule.getDisplayText());
    IOUtil.writeString(out,rule.getDisplayKey());
  }
}
Program: 74340
Project: 74340
Buggy source:
protected void writeHighlight(DataOutputStream out,HighlightDesign highlight) throws IOException {
  int ruleCount=highlight.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=highlight.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    IOUtil.writeBool(out,rule.ifValueIsList());
    if (rule.ifValueIsList()) {
      IOUtil.writeList(out,rule.getValue1List());
    }
 else {
      IOUtil.writeString(out,rule.getValue1());
      IOUtil.writeString(out,rule.getValue2());
    }
    writeStyle(out,rule.getStyle());
  }
}

Fixed version (ground truth):
protected void writeHighlight(DataOutputStream out,HighlightDesign highlight) throws IOException {
  int ruleCount=highlight.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=highlight.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    if (rule.ifValueIsList()) {
      IOUtil.writeObject(out,rule.getValue1List());
      IOUtil.writeObject(out,null);
    }
 else {
      IOUtil.writeObject(out,rule.getValue1());
      IOUtil.writeObject(out,rule.getValue2());
    }
    writeStyle(out,rule.getStyle());
  }
}
Program: 74341
Project: 74341
Buggy source:
/** 
 * Test all get/set accessors in base class set values of the rule then get the values one by one to test if they work correctly
 */
public void testBaseRule(){
  String[] operator={EngineIRConstants.MAP_OPERATOR_ANY,EngineIRConstants.MAP_OPERATOR_BETWEEN,EngineIRConstants.MAP_OPERATOR_EQ,EngineIRConstants.MAP_OPERATOR_FALSE,EngineIRConstants.MAP_OPERATOR_GE,EngineIRConstants.MAP_OPERATOR_GT,EngineIRConstants.MAP_OPERATOR_LE,EngineIRConstants.MAP_OPERATOR_LIKE,EngineIRConstants.MAP_OPERATOR_LT,EngineIRConstants.MAP_OPERATOR_NE,EngineIRConstants.MAP_OPERATOR_NOT_BETWEEN,EngineIRConstants.MAP_OPERATOR_NOT_NULL,EngineIRConstants.MAP_OPERATOR_NULL,EngineIRConstants.MAP_OPERATOR_TRUE};
  for (int i=0; i < operator.length; i++) {
    rule.setExpression(operator[i],"String_Node_Str","String_Node_Str");
    assertEquals(rule.getOperator(),operator[i]);
    assertEquals(rule.getValue1(),"String_Node_Str");
    assertEquals(rule.getValue2(),"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Test all get/set accessors in base class set values of the rule then get the values one by one to test if they work correctly
 */
public void testBaseRule(){
  String[] operator={EngineIRConstants.MAP_OPERATOR_ANY,EngineIRConstants.MAP_OPERATOR_BETWEEN,EngineIRConstants.MAP_OPERATOR_EQ,EngineIRConstants.MAP_OPERATOR_FALSE,EngineIRConstants.MAP_OPERATOR_GE,EngineIRConstants.MAP_OPERATOR_GT,EngineIRConstants.MAP_OPERATOR_LE,EngineIRConstants.MAP_OPERATOR_LIKE,EngineIRConstants.MAP_OPERATOR_LT,EngineIRConstants.MAP_OPERATOR_NE,EngineIRConstants.MAP_OPERATOR_NOT_BETWEEN,EngineIRConstants.MAP_OPERATOR_NOT_NULL,EngineIRConstants.MAP_OPERATOR_NULL,EngineIRConstants.MAP_OPERATOR_TRUE};
  for (int i=0; i < operator.length; i++) {
    rule.setExpression(operator[i],"String_Node_Str","String_Node_Str");
    assertEquals(rule.getOperator(),operator[i]);
    assertEquals(rule.getValue1(),"String_Node_Str");
    assertEquals(rule.getValue2(),"String_Node_Str");
  }
  String operator1=EngineIRConstants.MAP_OPERATOR_IN;
  ArrayList values=new ArrayList();
  values.add("String_Node_Str");
  values.add("String_Node_Str");
  values.add("String_Node_Str");
  values.add("String_Node_Str");
  rule.setExpression(operator1,values);
  List vs=rule.getValue1List();
  assertEquals(rule.getOperator(),operator1);
  assertEquals(values.size(),vs.size());
  assertEquals(values.get(0),vs.get(0));
  assertEquals(values.get(1),vs.get(1));
  assertEquals(values.get(2),vs.get(2));
  assertEquals(values.get(3),vs.get(3));
}
Program: 74342
Project: 74342
Buggy source:
/** 
 * Get the highlight style.
 * @param style The style with highlight.
 * @param defaultTestExp the test expression
 * @return The highlight style.
 */
private StyleDeclaration createHighlightStyle(HighlightDesign highlight){
  StyleDeclaration style=(StyleDeclaration)report.createStyle();
  for (int i=0; i < highlight.getRuleCount(); i++) {
    HighlightRuleDesign rule=highlight.getRule(i);
    if (rule != null) {
      Object value=null;
      Object expression=rule.getConditionExpr();
      if (expression != null) {
        if (expression instanceof String) {
          value=evaluate((String)expression);
        }
 else {
          value=evaluate((IConditionalExpression)expression);
        }
      }
 else {
        IConditionalExpression newExpression=expressionUtil.createConditionalExpression(rule.getTestExpression(),rule.getOperator(),rule.getValue1(),rule.getValue2());
        value=evaluate(newExpression);
      }
      if ((value != null) && (value instanceof Boolean) && (((Boolean)value).booleanValue())) {
        style.setProperties(rule.getStyle());
      }
    }
  }
  return style;
}

Fixed version (ground truth):
/** 
 * Get the highlight style.
 * @param style The style with highlight.
 * @param defaultTestExp the test expression
 * @return The highlight style.
 */
private StyleDeclaration createHighlightStyle(HighlightDesign highlight){
  StyleDeclaration style=(StyleDeclaration)report.createStyle();
  for (int i=0; i < highlight.getRuleCount(); i++) {
    HighlightRuleDesign rule=highlight.getRule(i);
    if (rule != null) {
      Object value=null;
      Object expression=rule.getConditionExpr();
      if (expression != null) {
        if (expression instanceof String) {
          value=evaluate((String)expression);
        }
 else {
          value=evaluate((IConditionalExpression)expression);
        }
      }
 else {
        IConditionalExpression newExpression=null;
        if (rule.ifValueIsList()) {
          newExpression=expressionUtil.createConditionExpression(rule.getTestExpression(),rule.getOperator(),rule.getValue1List());
        }
 else {
          newExpression=expressionUtil.createConditionalExpression(rule.getTestExpression(),rule.getOperator(),rule.getValue1(),rule.getValue2());
        }
        value=evaluate(newExpression);
      }
      if ((value != null) && (value instanceof Boolean) && (((Boolean)value).booleanValue())) {
        style.setProperties(rule.getStyle());
      }
    }
  }
  return style;
}
Program: 74344
Project: 74344
Buggy source:
protected MapDesign readMap(DataInputStream in) throws IOException {
  MapDesign map=new MapDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=new MapRuleDesign();
    ;
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    String value1=IOUtil.readString(in);
    String value2=IOUtil.readString(in);
    String displayText=IOUtil.readString(in);
    String displayKey=IOUtil.readString(in);
    rule.setTestExpression(testExpr);
    rule.setExpression(oper,value1,value2);
    rule.setDisplayText(displayKey,displayText);
    map.addRule(rule);
  }
  return map;
}

Fixed version (ground truth):
protected MapDesign readMap(DataInputStream in) throws IOException {
  MapDesign map=new MapDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=new MapRuleDesign();
    ;
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    boolean valuseIsList=IOUtil.readBool(in);
    if (valuseIsList) {
      List valueList=IOUtil.readList(in);
      rule.setExpression(oper,valueList);
    }
 else {
      String value1=IOUtil.readString(in);
      String value2=IOUtil.readString(in);
      rule.setExpression(oper,value1,value2);
    }
    String displayText=IOUtil.readString(in);
    String displayKey=IOUtil.readString(in);
    rule.setValueIsList(valuseIsList);
    rule.setTestExpression(testExpr);
    rule.setDisplayText(displayKey,displayText);
    map.addRule(rule);
  }
  return map;
}
Program: 74345
Project: 74345
Buggy source:
protected HighlightDesign readHighlight(DataInputStream in) throws IOException {
  HighlightDesign highlight=new HighlightDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=new HighlightRuleDesign();
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    String value1=IOUtil.readString(in);
    String value2=IOUtil.readString(in);
    IStyle style=readStyle(in);
    rule.setTestExpression(testExpr);
    rule.setExpression(oper,value1,value2);
    rule.setStyle(style);
    highlight.addRule(rule);
  }
  return highlight;
}

Fixed version (ground truth):
protected HighlightDesign readHighlight(DataInputStream in) throws IOException {
  HighlightDesign highlight=new HighlightDesign();
  int ruleCount=IOUtil.readInt(in);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=new HighlightRuleDesign();
    String testExpr=IOUtil.readString(in);
    String oper=IOUtil.readString(in);
    boolean valuseIsList=IOUtil.readBool(in);
    if (valuseIsList) {
      List valueList=IOUtil.readList(in);
      rule.setExpression(oper,valueList);
    }
 else {
      String value1=IOUtil.readString(in);
      String value2=IOUtil.readString(in);
      rule.setExpression(oper,value1,value2);
    }
    IStyle style=readStyle(in);
    rule.setValueIsList(valuseIsList);
    rule.setTestExpression(testExpr);
    rule.setStyle(style);
    highlight.addRule(rule);
  }
  return highlight;
}
Program: 74346
Project: 74346
Buggy source:
protected void writeMap(DataOutputStream out,MapDesign map) throws IOException {
  int ruleCount=map.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=map.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    IOUtil.writeString(out,rule.getValue1());
    IOUtil.writeString(out,rule.getValue2());
    IOUtil.writeString(out,rule.getDisplayText());
    IOUtil.writeString(out,rule.getDisplayKey());
  }
}

Fixed version (ground truth):
protected void writeMap(DataOutputStream out,MapDesign map) throws IOException {
  int ruleCount=map.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    MapRuleDesign rule=map.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    IOUtil.writeBool(out,rule.ifValueIsList());
    if (rule.ifValueIsList()) {
      IOUtil.writeList(out,rule.getValue1List());
    }
 else {
      IOUtil.writeString(out,rule.getValue1());
      IOUtil.writeString(out,rule.getValue2());
    }
    IOUtil.writeString(out,rule.getDisplayText());
    IOUtil.writeString(out,rule.getDisplayKey());
  }
}
Program: 74347
Project: 74347
Buggy source:
protected void writeHighlight(DataOutputStream out,HighlightDesign highlight) throws IOException {
  int ruleCount=highlight.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=highlight.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    IOUtil.writeString(out,rule.getValue1());
    IOUtil.writeString(out,rule.getValue2());
    writeStyle(out,rule.getStyle());
  }
}

Fixed version (ground truth):
protected void writeHighlight(DataOutputStream out,HighlightDesign highlight) throws IOException {
  int ruleCount=highlight.getRuleCount();
  IOUtil.writeInt(out,ruleCount);
  for (int i=0; i < ruleCount; i++) {
    HighlightRuleDesign rule=highlight.getRule(i);
    IOUtil.writeString(out,rule.getTestExpression());
    IOUtil.writeString(out,rule.getOperator());
    IOUtil.writeBool(out,rule.ifValueIsList());
    if (rule.ifValueIsList()) {
      IOUtil.writeList(out,rule.getValue1List());
    }
 else {
      IOUtil.writeString(out,rule.getValue1());
      IOUtil.writeString(out,rule.getValue2());
    }
    writeStyle(out,rule.getStyle());
  }
}
Program: 74348
Project: 74348
Buggy source:
public void setExpression(String operator,String value1,String value2){
  this.operator=operator;
  this.value1=value1;
  this.value2=value2;
}

Fixed version (ground truth):
public void setExpression(String operator,String value1,String value2){
  this.operator=operator;
  this.value1=value1;
  this.value2=value2;
  this.valueIsList=false;
}
Program: 74349
Project: 74349
Buggy source:
/** 
 * create a map rule.
 * @param obj map rule in DE.
 * @return map rule in ENGINE.
 */
protected MapRuleDesign createMapRule(MapRuleHandle handle,String defaultStr){
  MapRuleDesign rule=new MapRuleDesign();
  rule.setExpression(handle.getOperator(),handle.getValue1(),handle.getValue2());
  String displayText=handle.getDisplay();
  rule.setDisplayText(handle.getDisplayKey(),displayText == null ? "String_Node_Str" : displayText);
  String testExpr=handle.getTestExpression();
  if (testExpr != null && testExpr.length() > 0) {
    rule.setTestExpression(testExpr);
  }
 else   if ((defaultStr != null) && defaultStr.length() > 0) {
    rule.setTestExpression(defaultStr);
  }
 else {
    return null;
  }
  return rule;
}

Fixed version (ground truth):
/** 
 * create a map rule.
 * @param obj map rule in DE.
 * @return map rule in ENGINE.
 */
protected MapRuleDesign createMapRule(MapRuleHandle handle,String defaultStr){
  boolean isListStyle=ModuleUtil.isListStyleRuleValue(handle);
  MapRuleDesign rule=new MapRuleDesign();
  if (isListStyle) {
    rule.setExpression(handle.getOperator(),handle.getValue1List());
  }
 else {
    rule.setExpression(handle.getOperator(),handle.getValue1(),handle.getValue2());
  }
  String displayText=handle.getDisplay();
  rule.setDisplayText(handle.getDisplayKey(),displayText == null ? "String_Node_Str" : displayText);
  String testExpr=handle.getTestExpression();
  if (testExpr != null && testExpr.length() > 0) {
    rule.setTestExpression(testExpr);
  }
 else   if ((defaultStr != null) && defaultStr.length() > 0) {
    rule.setTestExpression(defaultStr);
  }
 else {
    return null;
  }
  return rule;
}