nus-yam/ex-repair huggingface dataset:
Program: 70648
Project: 70648
Buggy source:
/** 
 * clear the property binding in dataset to disable it when run the query
 * @param dsHandle
 * @param dataSetMap
 * @param dataSourceMap
 * @throws SemanticException
 */
public static void clearPropertyBindingMap(DataSetHandle dsHandle,Map dataSetMap,Map dataSourceMap) throws SemanticException {
  if (dsHandle instanceof JointDataSetHandle) {
    Iterator iter=((JointDataSetHandle)dsHandle).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle ds=(DataSetHandle)iter.next();
      if (dsHandle != null) {
        clearPropertyBindingMap(ds,dataSetMap,dataSourceMap);
      }
    }
  }
 else   if (dsHandle instanceof OdaDataSetHandle) {
    List dataSetBindingList=dsHandle.getPropertyBindings();
    List dataSourceBindingList=dsHandle.getDataSource().getPropertyBindings();
    if (!dataSetBindingList.isEmpty())     dataSetMap.put(dsHandle.getName(),dataSetBindingList);
    if (!dataSourceBindingList.isEmpty())     dataSourceMap.put(dsHandle.getDataSource().getName(),dataSourceBindingList);
    for (int i=0; i < dataSetBindingList.size(); i++) {
      PropertyBinding binding=(PropertyBinding)dataSetBindingList.get(i);
      dsHandle.setPropertyBinding(binding.getName(),null);
    }
    for (int i=0; i < dataSourceBindingList.size(); i++) {
      PropertyBinding binding=(PropertyBinding)dataSourceBindingList.get(i);
      dsHandle.getDataSource().setPropertyBinding(binding.getName(),null);
    }
  }
}

Fixed version (ground truth):
/** 
 * clear the property binding in dataset to disable it when run the query
 * @param dsHandle
 * @param dataSetMap
 * @param dataSourceMap
 * @throws SemanticException
 */
public static void clearPropertyBindingMap(DataSetHandle dsHandle,Map dataSetMap,Map dataSourceMap) throws SemanticException {
  if (dsHandle.getExtends() != null) {
    return;
  }
  if (dsHandle instanceof JointDataSetHandle) {
    Iterator iter=((JointDataSetHandle)dsHandle).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle ds=(DataSetHandle)iter.next();
      if (dsHandle != null) {
        clearPropertyBindingMap(ds,dataSetMap,dataSourceMap);
      }
    }
  }
 else   if (dsHandle instanceof OdaDataSetHandle) {
    List dataSetBindingList=dsHandle.getPropertyBindings();
    List dataSourceBindingList=dsHandle.getDataSource().getPropertyBindings();
    if (!dataSetBindingList.isEmpty())     dataSetMap.put(dsHandle.getName(),dataSetBindingList);
    if (!dataSourceBindingList.isEmpty())     dataSourceMap.put(dsHandle.getDataSource().getName(),dataSourceBindingList);
    for (int i=0; i < dataSetBindingList.size(); i++) {
      PropertyBinding binding=(PropertyBinding)dataSetBindingList.get(i);
      dsHandle.setPropertyBinding(binding.getName(),null);
    }
    for (int i=0; i < dataSourceBindingList.size(); i++) {
      PropertyBinding binding=(PropertyBinding)dataSourceBindingList.get(i);
      dsHandle.getDataSource().setPropertyBinding(binding.getName(),null);
    }
  }
}
Program: 70649
Project: 70649
Buggy source:
/** 
 * reset the property binding in dataset.
 * @param dsHandle
 * @param dataSetMap
 * @param dataSourceMap
 * @throws SemanticException
 */
public static void resetPropertyBinding(DataSetHandle dsHandle,Map dataSetMap,Map dataSourceMap) throws SemanticException {
  if (dsHandle instanceof JointDataSetHandle) {
    Iterator iter=((JointDataSetHandle)dsHandle).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle ds=(DataSetHandle)iter.next();
      if (dsHandle != null) {
        resetPropertyBinding(ds,dataSetMap,dataSourceMap);
      }
    }
  }
 else {
    if (dsHandle instanceof OdaDataSetHandle) {
      if (dataSetMap.get(dsHandle.getName()) != null) {
        List pList=(List)dataSetMap.get(dsHandle.getName());
        for (int i=0; i < pList.size(); i++) {
          PropertyBinding binding=(PropertyBinding)pList.get(i);
          dsHandle.setPropertyBinding(binding.getName(),binding.getValue());
        }
      }
      if (dataSourceMap.get(dsHandle.getDataSource().getName()) != null) {
        List pList=(List)dataSourceMap.get(dsHandle.getDataSource().getName());
        for (int i=0; i < pList.size(); i++) {
          PropertyBinding binding=(PropertyBinding)pList.get(i);
          dsHandle.getDataSource().setPropertyBinding(binding.getName(),binding.getValue());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * reset the property binding in dataset.
 * @param dsHandle
 * @param dataSetMap
 * @param dataSourceMap
 * @throws SemanticException
 */
public static void resetPropertyBinding(DataSetHandle dsHandle,Map dataSetMap,Map dataSourceMap) throws SemanticException {
  if (dsHandle.getExtends() != null) {
    return;
  }
  if (dsHandle instanceof JointDataSetHandle) {
    Iterator iter=((JointDataSetHandle)dsHandle).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle ds=(DataSetHandle)iter.next();
      if (dsHandle != null) {
        resetPropertyBinding(ds,dataSetMap,dataSourceMap);
      }
    }
  }
 else {
    if (dsHandle instanceof OdaDataSetHandle) {
      if (dataSetMap.get(dsHandle.getName()) != null) {
        List pList=(List)dataSetMap.get(dsHandle.getName());
        for (int i=0; i < pList.size(); i++) {
          PropertyBinding binding=(PropertyBinding)pList.get(i);
          dsHandle.setPropertyBinding(binding.getName(),binding.getValue());
        }
      }
      if (dataSourceMap.get(dsHandle.getDataSource().getName()) != null) {
        List pList=(List)dataSourceMap.get(dsHandle.getDataSource().getName());
        for (int i=0; i < pList.size(); i++) {
          PropertyBinding binding=(PropertyBinding)pList.get(i);
          dsHandle.getDataSource().setPropertyBinding(binding.getName(),binding.getValue());
        }
      }
    }
  }
}
Program: 70651
Project: 70651
Buggy source:
protected void setState(){
  boolean bEnabled=!(getAxisForProcessing().isCategoryAxis() || getAxisForProcessing().getType() == AxisType.TEXT_LITERAL);
  setState(bEnabled);
  if (axisAngleType != AngleType.Y) {
    btnShowOutside.setEnabled(false);
    btnShowOutside.setSelection(false);
    getScale().setShowOutside(false);
  }
 else {
    btnAutoExpand.setSelection(true);
    getScale().setAutoExpand(true);
  }
  boolean bAxisX=(axisAngleType == AngleType.X);
  boolean bEnableAutoExpand=btnStepAuto.getSelection() && bAxisX && !(getAxisForProcessing().getType() == AxisType.TEXT_LITERAL)&& !(getAxisForProcessing().isCategoryAxis());
  btnAutoExpand.setEnabled(bEnableAutoExpand);
  if (getAxisForProcessing().getType() == AxisType.LINEAR_LITERAL && !getAxisForProcessing().isCategoryAxis()) {
    if (!getAxisForProcessing().getScale().isSetStepNumber()) {
      btnFactor.setEnabled(true);
      if (btnFactor.getSelection()) {
        txtFactor.setEnabled(true);
      }
 else {
        txtFactor.setEnabled(false);
      }
    }
    if (btnFactor.getSelection()) {
      btnStepNumber.setEnabled(false);
      spnStepNumber.setEnabled(false);
      lblMax.setEnabled(false);
      txtScaleMax.setEnabled(false);
      lblMin.setEnabled(false);
      txtScaleMin.setEnabled(false);
    }
  }
}

Fixed version (ground truth):
protected void setState(){
  boolean bEnabled=!(getAxisForProcessing().isCategoryAxis() || getAxisForProcessing().getType() == AxisType.TEXT_LITERAL);
  setState(bEnabled);
  if (axisAngleType != AngleType.Y) {
    btnShowOutside.setEnabled(false);
    btnShowOutside.setSelection(false);
    getScale().setShowOutside(false);
  }
 else {
    btnAutoExpand.setSelection(true);
    getScale().setAutoExpand(true);
  }
  boolean bAxisX=(axisAngleType == AngleType.X);
  boolean bEnableAutoExpand=btnStepAuto.getSelection() && bAxisX && !(getAxisForProcessing().getType() == AxisType.TEXT_LITERAL)&& !(getAxisForProcessing().isCategoryAxis());
  btnAutoExpand.setEnabled(bEnableAutoExpand);
  if (getAxisForProcessing().getType() == AxisType.LINEAR_LITERAL && !getAxisForProcessing().isCategoryAxis()) {
    if (!getAxisForProcessing().getScale().isSetStepNumber()) {
      btnFactor.setEnabled(true);
      if (btnFactor.getSelection()) {
        txtFactor.setEnabled(true);
      }
 else {
        txtFactor.setEnabled(false);
      }
    }
    if (btnFactor.getSelection()) {
      btnStepNumber.setEnabled(false);
      spnStepNumber.setEnabled(false);
      lblMax.setEnabled(false);
      txtScaleMax.setEnabled(false);
    }
  }
}
Program: 70653
Project: 70653
Buggy source:
/** 
 * Write a byte array to an output stream only with its raw content.
 * @param dos
 * @param bytes,it can not be null
 * @throws IOException
 */
public final static void writeRawBytes(DataOutputStream dos,byte[] bytes) throws IOException {
}

Fixed version (ground truth):
/** 
 * Write a byte array to an output stream only with its raw content.
 * @param dos
 * @param bytes , it can not be null
 * @throws IOException
 */
public final static void writeRawBytes(DataOutputStream dos,byte[] bytes) throws IOException {
}
Program: 70654
Project: 70654
Buggy source:
/** 
 * private utility method to check whether it is a long string 
 * @param str
 * @return true if it is a long string
 */
private static boolean isLongString(String str){
  int strlen=str.length();
  if (strlen > 65535) {
    return true;
  }
 else   if (strlen < 21845) {
    return false;
  }
  int utflen=getBytesSize(str);
  if (utflen > 65535) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * private utility method to check whether it is a long string
 * @param str
 * @return true if it is a long string
 */
private static boolean isLongString(String str){
  int strlen=str.length();
  if (strlen > 65535) {
    return true;
  }
 else   if (strlen < 21845) {
    return false;
  }
  int utflen=getBytesSize(str);
  if (utflen > 65535) {
    return true;
  }
 else {
    return false;
  }
}
Program: 70655
Project: 70655
Buggy source:
/** 
 * private utility method helping to convert byte[] to a String 
 * @param str
 * @throws UTFDataFormatException
 */
private static int generateCharArray(char[] chararr,byte[] bytearr,int count,int chararr_count) throws UTFDataFormatException {
  int c, char2, char3;
  int utflen=bytearr.length;
  while (count < utflen) {
    c=(int)bytearr[count] & 0xff;
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
      count++;
    chararr[chararr_count++]=(char)c;
  break;
case 12:
case 13:
count+=2;
if (count > utflen) throw new UTFDataFormatException("String_Node_Str");
char2=(int)bytearr[count - 1];
if ((char2 & 0xC0) != 0x80) throw new UTFDataFormatException("String_Node_Str" + count);
chararr[chararr_count++]=(char)(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
count+=3;
if (count > utflen) throw new UTFDataFormatException("String_Node_Str");
char2=(int)bytearr[count - 2];
char3=(int)bytearr[count - 1];
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) throw new UTFDataFormatException("String_Node_Str" + (count - 1));
chararr[chararr_count++]=(char)(((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
break;
default :
throw new UTFDataFormatException("String_Node_Str" + count);
}
}
return chararr_count;
}

Fixed version (ground truth):
/** 
 * private utility method helping to convert byte[] to a String
 * @param str
 * @throws UTFDataFormatException
 */
private static int generateCharArray(char[] chararr,byte[] bytearr,int count,int chararr_count) throws UTFDataFormatException {
  int c, char2, char3;
  int utflen=bytearr.length;
  while (count < utflen) {
    c=(int)bytearr[count] & 0xff;
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
      count++;
    chararr[chararr_count++]=(char)c;
  break;
case 12:
case 13:
count+=2;
if (count > utflen) throw new UTFDataFormatException("String_Node_Str");
char2=(int)bytearr[count - 1];
if ((char2 & 0xC0) != 0x80) throw new UTFDataFormatException("String_Node_Str" + count);
chararr[chararr_count++]=(char)(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
count+=3;
if (count > utflen) throw new UTFDataFormatException("String_Node_Str");
char2=(int)bytearr[count - 2];
char3=(int)bytearr[count - 1];
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) throw new UTFDataFormatException("String_Node_Str" + (count - 1));
chararr[chararr_count++]=(char)(((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
break;
default :
throw new UTFDataFormatException("String_Node_Str" + count);
}
}
return chararr_count;
}
Program: 70656
Project: 70656
Buggy source:
/** 
 * private utility method to read a UTF String 
 * @param str
 * @throws UTFDataFormatException
 */
private static String readUTF(DataInputStream dis) throws IOException {
  int length=dis.readInt();
  byte[] ret=new byte[length];
  dis.read(ret,0,length);
  return convertBytes2String(ret);
}

Fixed version (ground truth):
/** 
 * private utility method to read a UTF String
 * @param str
 * @throws UTFDataFormatException
 */
private static String readUTF(DataInputStream dis) throws IOException {
  int length=dis.readInt();
  byte[] ret=new byte[length];
  dis.read(ret,0,length);
  return convertBytes2String(ret);
}
Program: 70657
Project: 70657
Buggy source:
/** 
 * private utility method to the size of a string in bytes 
 * @param str
 * @throws UTFDataFormatException
 */
private static int getBytesSize(String str){
  int c, utflen=0;
  for (int i=0; i < str.length(); i++) {
    c=str.charAt(i);
    if ((c >= 0x0001) && (c <= 0x007F)) {
      utflen++;
    }
 else     if (c > 0x07FF) {
      utflen+=3;
    }
 else {
      utflen+=2;
    }
  }
  return utflen;
}

Fixed version (ground truth):
/** 
 * private utility method to the size of a string in bytes
 * @param str
 * @throws UTFDataFormatException
 */
private static int getBytesSize(String str){
  int c, utflen=0;
  for (int i=0; i < str.length(); i++) {
    c=str.charAt(i);
    if ((c >= 0x0001) && (c <= 0x007F)) {
      utflen++;
    }
 else     if (c > 0x07FF) {
      utflen+=3;
    }
 else {
      utflen+=2;
    }
  }
  return utflen;
}
Program: 70658
Project: 70658
Buggy source:
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  TableInfo info=LayoutUtil.createTable(table,width);
  if (info == null) {
    return;
  }
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(info,table.getComputedStyle());
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  new ExcelFormulaEngine().startTable(table);
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  TableInfo info=LayoutUtil.createTable(table,width);
  if (info == null) {
    return;
  }
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(info,table.getComputedStyle());
}
Program: 70660
Project: 70660
Buggy source:
/** 
 * Test get/setBookmark methods set an expression as a bookmark then get the bookmark and check the action type to test if they work correctly
 */
public void testBookmark(){
  ActionDesign action=new ActionDesign();
  String bookmark="String_Node_Str";
  action.setBookmark(bookmark);
  assertEquals(action.getActionType(),ActionDesign.ACTION_BOOKMARK);
  assertEquals(action.getBookmark(),bookmark);
}

Fixed version (ground truth):
/** 
 * Test get/setBookmark methods set an expression as a bookmark then get the bookmark and check the action type to test if they work correctly
 */
public void testBookmark(){
  ActionDesign action=new ActionDesign();
  Expression<String> bookmark=Expression.newConstant("String_Node_Str");
  action.setBookmark(bookmark);
  assertEquals(action.getActionType(),ActionDesign.ACTION_BOOKMARK);
  assertEquals(action.getBookmark(),bookmark);
}
Program: 70661
Project: 70661
Buggy source:
/** 
 * Test get/setHyperlink methods set an expression as a hyperlink then get the hyperlink and check the action type to test if they work correctly
 */
public void testHyprrlink(){
  ActionDesign action=new ActionDesign();
  String hyperlink="String_Node_Str";
  action.setHyperlink(hyperlink);
  assertEquals(action.getActionType(),ActionDesign.ACTION_HYPERLINK);
  assertEquals(action.getHyperlink(),hyperlink);
}

Fixed version (ground truth):
/** 
 * Test get/setHyperlink methods set an expression as a hyperlink then get the hyperlink and check the action type to test if they work correctly
 */
public void testHyprrlink(){
  ActionDesign action=new ActionDesign();
  Expression<String> hyperlink=Expression.newConstant("String_Node_Str");
  action.setHyperlink(hyperlink);
  assertEquals(action.getActionType(),ActionDesign.ACTION_HYPERLINK);
  assertEquals(action.getHyperlink(),hyperlink);
}
Program: 70662
Project: 70662
Buggy source:
/** 
 * Test all get/set accessors set values of the cell then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  CellDesign cell=new CellDesign();
  cell.setColSpan(1);
  cell.setColumn(2);
  cell.setRowSpan(3);
  cell.setDrop("String_Node_Str");
  assertEquals(cell.getColSpan(),1);
  assertEquals(cell.getColumn(),2);
  assertEquals(cell.getRowSpan(),3);
  assertEquals(cell.getDrop(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test all get/set accessors set values of the cell then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  CellDesign cell=new CellDesign();
  cell.setColSpan(1);
  cell.setColumn(2);
  cell.setRowSpan(3);
  Expression<String> drop=newConstant("String_Node_Str");
  cell.setDrop(drop);
  assertEquals(cell.getColSpan(),1);
  assertEquals(cell.getColumn(),2);
  assertEquals(cell.getRowSpan(),3);
  assertEquals(cell.getDrop(),drop);
}
Program: 70663
Project: 70663
Buggy source:
/** 
 * Test all get/set accessorss set values of the column then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  ColumnDesign column=(ColumnDesign)element;
  DimensionType width=new DimensionType(5.0,DimensionType.UNITS_CM);
  column.setWidth(width);
  assertEquals(column.getWidth(),width);
}

Fixed version (ground truth):
/** 
 * Test all get/set accessorss set values of the column then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  ColumnDesign column=(ColumnDesign)element;
  Expression<DimensionType> width=newConstant(new DimensionType(5.0,DimensionType.UNITS_CM));
  column.setWidth(width);
  assertEquals(column.getWidth(),width);
}
Program: 70664
Project: 70664
Buggy source:
public void testDrillThrough(){
  DrillThroughActionDesign drillThrough=new DrillThroughActionDesign();
  String reportName="String_Node_Str";
  String bookmark="String_Node_Str";
  Map params=new HashMap();
  drillThrough.setReportName(reportName);
  drillThrough.setBookmark(bookmark);
  drillThrough.setParameters(params);
  assertEquals(drillThrough.getReportName(),reportName);
  assertEquals(drillThrough.getBookmark(),bookmark);
  assertEquals(drillThrough.getParameters(),params);
}

Fixed version (ground truth):
public void testDrillThrough(){
  DrillThroughActionDesign drillThrough=new DrillThroughActionDesign();
  Expression<String> reportName=newConstant("String_Node_Str");
  Expression<String> bookmark=newConstant("String_Node_Str");
  Map params=new HashMap();
  drillThrough.setReportName(reportName);
  drillThrough.setBookmark(bookmark);
  drillThrough.setParameters(params);
  assertEquals(drillThrough.getReportName(),reportName);
  assertEquals(drillThrough.getBookmark(),bookmark);
  assertEquals(drillThrough.getParameters(),params);
}
Program: 70665
Project: 70665
Buggy source:
/** 
 * Test get/setExpression methods set an expression then get the expression and check the text type to test if they work correctly
 */
public void testExpression(){
  DynamicTextItemDesign multi=new DynamicTextItemDesign();
  String exp="String_Node_Str";
  String type="String_Node_Str";
  multi.setContent(exp);
  multi.setContentType(type);
  assertEquals(multi.getContent(),exp);
  assertEquals(multi.getContentType(),type);
}

Fixed version (ground truth):
/** 
 * Test get/setExpression methods set an expression then get the expression and check the text type to test if they work correctly
 */
public void testExpression(){
  DynamicTextItemDesign multi=new DynamicTextItemDesign();
  Expression<String> exp=Expression.newConstant("String_Node_Str");
  Expression<String> type=Expression.newConstant("String_Node_Str");
  multi.setContent(exp);
  multi.setContentType(type);
  assertEquals(multi.getContent(),exp);
  assertEquals(multi.getContentType(),type);
}
Program: 70666
Project: 70666
Buggy source:
/** 
 * Test get/setAltText methods set the texts then get them to test if they work correctly
 */
public void testAltText(){
  ImageItemDesign image=new ImageItemDesign();
  image.setAltText("String_Node_Str","String_Node_Str");
  assertEquals(image.getAltText(),"String_Node_Str");
  assertEquals(image.getAltTextKey(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test get/setAltText methods set the texts then get them to test if they work correctly
 */
public void testAltText(){
  ImageItemDesign image=new ImageItemDesign();
  Expression<String> key=newConstant("String_Node_Str");
  Expression<String> text=newConstant("String_Node_Str");
  image.setAltText(key,text);
  assertEquals(image.getAltText(),text);
  assertEquals(image.getAltTextKey(),key);
}
Program: 70667
Project: 70667
Buggy source:
/** 
 * Test all get/set accessors set values of the label then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  LabelItemDesign label=new LabelItemDesign();
  ActionDesign action=new ActionDesign();
  label.setAction(action);
  label.setText("String_Node_Str","String_Node_Str");
  assertEquals(label.getAction(),action);
  assertEquals(label.getText(),"String_Node_Str");
  assertEquals(label.getTextKey(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test all get/set accessors set values of the label then get the values one by one to test if they work correctly
 */
public void testAccessor(){
  LabelItemDesign label=new LabelItemDesign();
  ActionDesign action=new ActionDesign();
  label.setAction(action);
  Expression<String> key=newConstant("String_Node_Str");
  Expression<String> text=newConstant("String_Node_Str");
  label.setText(key,text);
  assertEquals(label.getAction(),action);
  assertEquals(label.getText(),text);
  assertEquals(label.getTextKey(),key);
}
Program: 70668
Project: 70668
Buggy source:
/** 
 * Test get/setDisplayText methods set the texts then get them to test if they work correctly
 */
public void testAccessor(){
  ((MapRuleDesign)rule).setDisplayText("String_Node_Str","String_Node_Str");
  assertEquals(((MapRuleDesign)rule).getDisplayKey(),"String_Node_Str");
  assertEquals(((MapRuleDesign)rule).getDisplayText(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test get/setDisplayText methods set the texts then get them to test if they work correctly
 */
public void testAccessor(){
  Expression<String> key=newConstant("String_Node_Str");
  Expression<String> text=newConstant("String_Node_Str");
  ((MapRuleDesign)rule).setDisplayText(key,text);
  assertEquals(((MapRuleDesign)rule).getDisplayKey(),key);
  assertEquals(((MapRuleDesign)rule).getDisplayText(),text);
}
Program: 70669
Project: 70669
Buggy source:
/** 
 * Test all get/set accessors in base class set values of the element then get the values one by one to test if they work correctly
 */
public void testBaseItem(){
  ReportItemDesign e=(ReportItemDesign)element;
  DimensionType h=new DimensionType(1,DimensionType.UNITS_CM);
  DimensionType w=new DimensionType(1,DimensionType.UNITS_CM);
  DimensionType x=new DimensionType(1,DimensionType.UNITS_CM);
  DimensionType y=new DimensionType(1,DimensionType.UNITS_CM);
  String bookmark="String_Node_Str";
  e.setHeight(h);
  e.setWidth(w);
  e.setX(x);
  e.setY(y);
  e.setBookmark(bookmark);
  assertEquals(e.getHeight(),h);
  assertEquals(e.getWidth(),w);
  assertEquals(e.getX(),x);
  assertEquals(e.getY(),y);
  assertEquals(e.getBookmark(),bookmark);
}

Fixed version (ground truth):
/** 
 * Test all get/set accessors in base class set values of the element then get the values one by one to test if they work correctly
 */
public void testBaseItem(){
  ReportItemDesign e=(ReportItemDesign)element;
  Expression<DimensionType> h=createDimension();
  Expression<DimensionType> w=createDimension();
  Expression<DimensionType> x=createDimension();
  Expression<DimensionType> y=createDimension();
  Expression<String> bookmark=newConstant("String_Node_Str");
  e.setHeight(h);
  e.setWidth(w);
  e.setX(x);
  e.setY(y);
  e.setBookmark(bookmark);
  assertEquals(e.getHeight(),h);
  assertEquals(e.getWidth(),w);
  assertEquals(e.getX(),x);
  assertEquals(e.getY(),y);
  assertEquals(e.getBookmark(),bookmark);
}
Program: 70670
Project: 70670
Buggy source:
public void testGetSet(){
  RowDesign row=new RowDesign();
  DimensionType height=new DimensionType(1.0,DimensionType.UNITS_CM);
  String bookmark="String_Node_Str";
  row.setHeight(height);
  row.setBookmark(bookmark);
  assertEquals(row.getHeight(),height);
  assertEquals(row.getBookmark(),bookmark);
}

Fixed version (ground truth):
public void testGetSet(){
  RowDesign row=new RowDesign();
  Expression<DimensionType> height=newConstant(new DimensionType(1.0,DimensionType.UNITS_CM));
  Expression<String> bookmark=newConstant("String_Node_Str");
  row.setHeight(height);
  row.setBookmark(bookmark);
  assertEquals(row.getHeight(),height);
  assertEquals(row.getBookmark(),bookmark);
}
Program: 70671
Project: 70671
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");
  }
  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));
}

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};
  Expression<String> exp1=newConstant("String_Node_Str");
  Expression<String> exp2=newConstant("String_Node_Str");
  for (int i=0; i < operator.length; i++) {
    rule.setExpression(operator[i],exp1,exp2);
    assertEquals(rule.getOperator(),operator[i]);
    assertEquals(rule.getValue1(),exp1);
    assertEquals(rule.getValue2(),exp2);
  }
  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,newConstant(values));
  Expression<? extends List> vs=rule.getValue1List();
  assertEquals(rule.getOperator(),operator1);
  assertFalse(vs.isExpression());
  assertEquals(values,vs.getValue());
}
Program: 70672
Project: 70672
Buggy source:
/** 
 * Test get/setStaticText methods set a static text then get the texts and check the text type to test if they work correctly
 */
public void testStaticText(){
  TextItemDesign text=new TextItemDesign();
  text.setText("String_Node_Str","String_Node_Str");
  assertEquals(text.getText(),"String_Node_Str");
  assertEquals(text.getTextKey(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test get/setStaticText methods set a static text then get the texts and check the text type to test if they work correctly
 */
public void testStaticText(){
  TextItemDesign text=new TextItemDesign();
  Expression<String> testKey=newConstant("String_Node_Str");
  Expression<String> testText=newConstant("String_Node_Str");
  text.setText(testKey,testText);
  assertEquals(text.getText(),testText);
  assertEquals(text.getTextKey(),testKey);
}
Program: 70673
Project: 70673
Buggy source:
public Control createDialogArea(Composite parent){
  setParentShell(parent.getShell());
  Control dialogArea=super.createDialogArea(parent);
  getSQLBuilder().addContentChangeListener(this);
  return dialogArea;
}

Fixed version (ground truth):
public Control createDialogArea(Composite parent){
  setParentShell(parent.getShell());
  Control dialogArea=super.createDialogArea(parent);
  getSQLBuilder().addContentChangeListener(this);
  SQLQueryUtility.setSystemHelp(dialogArea,IHelpConstants.CONEXT_ID_DATASET_DIALOG_SQLBUILDER);
  return dialogArea;
}
Program: 70674
Project: 70674
Buggy source:
public void createPageCustomControl(Composite parent){
  IConnectionProfile connProfile=getConnectionProfile(true,true);
  if (connProfile == null)   return;
  ISQLBuilderEditorInput sqbInput=createSQBInput(parent,connProfile);
  setControl(createSQBControl(parent,sqbInput));
}

Fixed version (ground truth):
public void createPageCustomControl(Composite parent){
  IConnectionProfile connProfile=getConnectionProfile(true,true);
  if (connProfile == null)   return;
  ISQLBuilderEditorInput sqbInput=createSQBInput(parent,connProfile);
  setControl(createSQBControl(parent,sqbInput));
  SQLQueryUtility.setSystemHelp(getControl(),IHelpConstants.CONEXT_ID_DATASET_SQLWIZARDPAGE);
}
Program: 70675
Project: 70675
Buggy source:
/** 
 * set default template preference
 */
public void setDefaultTemplatePreference(){
  String defaultDir=UIUtil.getHomeDirectory();
  PreferenceFactory.getInstance().getPreferences(this).setDefault(TEMPLATE_PREFERENCE,defaultDir);
}

Fixed version (ground truth):
/** 
 * set default template preference
 */
public void setDefaultTemplatePreference(){
  String defaultRootDir=UIUtil.getFragmentDirectory();
  File templateFolder=new File(defaultRootDir,"String_Node_Str");
  PreferenceFactory.getInstance().getPreferences(this).setDefault(TEMPLATE_PREFERENCE,templateFolder.getAbsolutePath());
}
Program: 70679
Project: 70679
Buggy source:
public void setAggregation(Query query){
  this.query=query;
  if (query.getGrouping() == null) {
    fGrouping=SeriesGroupingImpl.create();
  }
 else {
    fGrouping=(SeriesGrouping)EcoreUtil.copy(query.getGrouping());
  }
}

Fixed version (ground truth):
public void setAggregation(Query query,SeriesDefinition sd){
  this.query=query;
  this.fSeriesDefi=sd;
  if (query.getGrouping() == null) {
    if (sd.getGrouping() != null) {
      fGrouping=(SeriesGrouping)EcoreUtil.copy(sd.getGrouping());
    }
 else {
      fGrouping=SeriesGroupingImpl.create();
    }
  }
 else {
    fGrouping=(SeriesGrouping)EcoreUtil.copy(query.getGrouping());
  }
}
Program: 70680
Project: 70680
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 (fSeriesDefi == null) {
      query.setGrouping(fGrouping);
      query.getGrouping().eAdapters().addAll(query.eAdapters());
    }
 else {
      fSeriesDefi.setGrouping(fGrouping);
      fSeriesDefi.getGrouping().eAdapters().addAll(fSeriesDefi.eAdapters());
    }
    ChartUIUtil.isValidAggregation(fChartContext,fGrouping,false);
    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());
    }
 else {
      fSeriesDefi.setGrouping(fGrouping);
      fSeriesDefi.getGrouping().eAdapters().addAll(fSeriesDefi.eAdapters());
    }
    ChartUIUtil.isValidAggregation(fChartContext,fGrouping,false);
    closeAggregateEditor(getShell());
  }
 else   if (source == fBtnCancel) {
    closeAggregateEditor(getShell());
  }
}
Program: 70681
Project: 70681
Buggy source:
public AggregateEditorComposite(Composite parent,SeriesDefinition sd,ChartWizardContext context,boolean enabled,Query query){
  super(parent,SWT.NONE);
  setAggregation(query);
  fChartContext=context;
  fEnabled=enabled;
  placeComponents();
}

Fixed version (ground truth):
public AggregateEditorComposite(Composite parent,SeriesDefinition sd,ChartWizardContext context,boolean enabled,Query query){
  super(parent,SWT.NONE);
  setAggregation(query,sd);
  fChartContext=context;
  fEnabled=enabled;
  placeComponents();
}
Program: 70682
Project: 70682
Buggy source:
private void createDropDownComponent(){
  Point pLoc=UIHelper.getScreenLocation(fBtnDropDown.getParent());
  int iXLoc=pLoc.x;
  int iYLoc=pLoc.y + fBtnDropDown.getParent().getSize().y;
  int iShellWidth=BLOCK_WIDTH;
  int iShellHeight=BLOCK_HEIGHT;
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=iShellWidth;
  }
  if (iXLoc + iShellWidth > this.getDisplay().getClientArea().width) {
    iXLoc=this.getDisplay().getClientArea().width - iShellWidth;
  }
  Shell shell=new Shell(this.getShell(),SWT.NONE);
  shell.setLayout(new FillLayout());
  shell.setSize(iShellWidth,iShellHeight);
  shell.setLocation(iXLoc,iYLoc);
  if (fSeriesDefi == null) {
    setAggregation(query);
  }
 else {
    setSeriesDefinition(fSeriesDefi);
  }
  fAggregateEditor=new AggregateDropDownEditorComposite(shell,SWT.NONE,null);
  shell.layout();
  shell.open();
}

Fixed version (ground truth):
private void createDropDownComponent(){
  Point pLoc=UIHelper.getScreenLocation(fBtnDropDown.getParent());
  int iXLoc=pLoc.x;
  int iYLoc=pLoc.y + fBtnDropDown.getParent().getSize().y;
  int iShellWidth=BLOCK_WIDTH;
  int iShellHeight=BLOCK_HEIGHT;
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=iShellWidth;
  }
  if (iXLoc + iShellWidth > this.getDisplay().getClientArea().width) {
    iXLoc=this.getDisplay().getClientArea().width - iShellWidth;
  }
  Shell shell=new Shell(this.getShell(),SWT.NONE);
  shell.setLayout(new FillLayout());
  shell.setSize(iShellWidth,iShellHeight);
  shell.setLocation(iXLoc,iYLoc);
  if (query != null) {
    setAggregation(query,fSeriesDefi);
  }
 else {
    setSeriesDefinition(fSeriesDefi);
  }
  fAggregateEditor=new AggregateDropDownEditorComposite(shell,SWT.NONE,null);
  shell.layout();
  shell.open();
}
Program: 70683
Project: 70683
Buggy source:
public void selectArea(boolean selected,Object data){
  if (data instanceof Object[]) {
    Object[] array=(Object[])data;
    seriesdefinition=(SeriesDefinition)array[0];
    query=(Query)array[1];
    setUIText(getInputControl(),query.getDefinition());
    DataDefinitionTextManager.getInstance().addDataDefinitionText(getInputControl(),this);
    if (fAggEditorComposite != null) {
      fAggEditorComposite.setAggregation(query);
    }
  }
  setColor();
}

Fixed version (ground truth):
public void selectArea(boolean selected,Object data){
  if (data instanceof Object[]) {
    Object[] array=(Object[])data;
    seriesdefinition=(SeriesDefinition)array[0];
    query=(Query)array[1];
    setUIText(getInputControl(),query.getDefinition());
    DataDefinitionTextManager.getInstance().addDataDefinitionText(getInputControl(),this);
    if (fAggEditorComposite != null) {
      fAggEditorComposite.setAggregation(query,seriesdefinition);
    }
  }
  setColor();
}
Program: 70684
Project: 70684
Buggy source:
private void doCompatibility(Chart cm){
  if (cm.getLegend().getItemType() == LegendItemType.CATEGORIES_LITERAL) {
    SeriesDefinition sdBase=ChartUtil.getBaseSeriesDefinitions(cm).get(0);
    if (cm.getLegend().getFormatSpecifier() == null && sdBase.getFormatSpecifier() != null) {
      cm.getLegend().setFormatSpecifier(FormatSpecifierImpl.copyInstance(sdBase.getFormatSpecifier()));
    }
  }
}

Fixed version (ground truth):
private void doCompatibility(Chart cm){
  if (cm.getLegend().getItemType() == LegendItemType.CATEGORIES_LITERAL) {
    SeriesDefinition sdBase=ChartUtil.getBaseSeriesDefinitions(cm).get(0);
    if (cm.getLegend().getFormatSpecifier() == null && sdBase.getFormatSpecifier() != null) {
      cm.getLegend().setFormatSpecifier(FormatSpecifierImpl.copyInstance(sdBase.getFormatSpecifier()));
    }
  }
  if (cm.getEmptyMessage() == null) {
    Label la=LabelImpl.create();
    la.setVisible(false);
    cm.setEmptyMessage(la);
  }
}
Program: 70685
Project: 70685
Buggy source:
private String getFilePath(URL url){
  String path=url.getFile();
  try {
    return URLDecoder.decode(path,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    return path;
  }
}

Fixed version (ground truth):
private static String getFilePath(URL url){
  String path=url.getFile();
  try {
    return URLDecoder.decode(path,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    return path;
  }
}
Program: 70686
Project: 70686
Buggy source:
FileLoader(URL url){
  baseUrl=url;
  baseDir=new File(url.getFile());
  codeSource=new CodeSource(baseUrl,(CodeSigner[])null);
}

Fixed version (ground truth):
FileLoader(URL url){
  baseUrl=url;
  baseDir=new File(getFilePath(url));
  codeSource=new CodeSource(baseUrl,(CodeSigner[])null);
}
Program: 70687
Project: 70687
Buggy source:
public void createTOC(Set bookmarks){
  ULocale ulocale=null;
  Locale locale=context.getLocale();
  if (locale == null) {
    ulocale=ULocale.getDefault();
  }
 else {
    ulocale=ULocale.forLocale(locale);
  }
  TOCNode tocTree=report.getTOCTree("String_Node_Str",ulocale).getRoot();
  if (tocTree == null || tocTree.getChildren().isEmpty()) {
    writer.setViewerPreferences(PdfWriter.PageModeUseNone);
  }
 else {
    writer.setViewerPreferences(PdfWriter.PageModeUseOutlines);
    TOCHandler tocHandler=new TOCHandler(tocTree,writer.getDirectContent().getRootOutline(),bookmarks);
    tocHandler.createTOC();
  }
}

Fixed version (ground truth):
public void createTOC(Set bookmarks){
  if (bookmarks.isEmpty()) {
    return;
  }
  ULocale ulocale=null;
  Locale locale=context.getLocale();
  if (locale == null) {
    ulocale=ULocale.getDefault();
  }
 else {
    ulocale=ULocale.forLocale(locale);
  }
  TOCNode tocTree=report.getTOCTree("String_Node_Str",ulocale).getRoot();
  if (tocTree == null || tocTree.getChildren().isEmpty()) {
    writer.setViewerPreferences(PdfWriter.PageModeUseNone);
  }
 else {
    writer.setViewerPreferences(PdfWriter.PageModeUseOutlines);
    TOCHandler tocHandler=new TOCHandler(tocTree,writer.getDirectContent().getRootOutline(),bookmarks);
    tocHandler.createTOC();
  }
}
Program: 70688
Project: 70688
Buggy source:
protected void propertyChange(Map info){
  Set set=info.keySet();
  Iterator itor=set.iterator();
  while (itor.hasNext()) {
    Object obj=itor.next();
    if (ICrosstabReportItemConstants.MEASURE_DIRECTION_PROP.equals(obj) || ICrosstabReportItemConstants.PAGE_LAYOUT_PROP.equals(obj) || ILevelViewConstants.AGGREGATION_HEADER_LOCATION_PROP.equals(obj)) {
      refresh();
      return;
    }
  }
  super.propertyChange(info);
}

Fixed version (ground truth):
protected void propertyChange(Map info){
  Set set=info.keySet();
  Iterator itor=set.iterator();
  while (itor.hasNext()) {
    Object obj=itor.next();
    if (ICrosstabReportItemConstants.MEASURE_DIRECTION_PROP.equals(obj) || ICrosstabReportItemConstants.PAGE_LAYOUT_PROP.equals(obj) || ILevelViewConstants.AGGREGATION_HEADER_LOCATION_PROP.equals(obj)|| ICrosstabReportItemConstants.HIDE_MEASURE_HEADER_PROP.equals(obj)) {
      refresh();
      return;
    }
  }
  super.propertyChange(info);
}
Program: 70689
Project: 70689
Buggy source:
private int addMesureHeaderToVirtual(List list,int rowNumber,int rowSpan,int columnNumber,int columnSpan,List measures){
  int measureCount=measures.size();
  for (int k=0; k < measureCount; k++) {
    MeasureViewHandle preMmeasureHandle=(MeasureViewHandle)measures.get(k);
    CrosstabCellHandle preMeasureCellHandle=preMmeasureHandle.getHeader();
    CrosstabCellAdapter measureCellAdapt=factory.createCrosstabCellAdapter(ICrosstabCellAdapterFactory.CELL_MEASURE_HEADER,preMeasureCellHandle,rowNumber,rowSpan,columnNumber,columnSpan,false);
    if (isVertical()) {
      rowNumber++;
    }
 else {
      columnNumber++;
    }
    list.add(measureCellAdapt);
  }
  return measureCount;
}

Fixed version (ground truth):
private int addMesureHeaderToVirtual(List list,int rowNumber,int rowSpan,int columnNumber,int columnSpan,List measures){
  int measureCount=measures.size();
  if (isHideHeader()) {
    return measureCount;
  }
  for (int k=0; k < measureCount; k++) {
    MeasureViewHandle preMmeasureHandle=(MeasureViewHandle)measures.get(k);
    CrosstabCellHandle preMeasureCellHandle=preMmeasureHandle.getHeader();
    CrosstabCellAdapter measureCellAdapt=factory.createCrosstabCellAdapter(ICrosstabCellAdapterFactory.CELL_MEASURE_HEADER,preMeasureCellHandle,rowNumber,rowSpan,columnNumber,columnSpan,false);
    if (isVertical()) {
      rowNumber++;
    }
 else {
      columnNumber++;
    }
    list.add(measureCellAdapt);
  }
  return measureCount;
}
Program: 70690
Project: 70690
Buggy source:
private int addMesureHeader(List list,int baseColumn,int area,List measures){
  if (isVertical() && area == ICrosstabConstants.COLUMN_AXIS_TYPE) {
    return 0;
  }
 else   if (!isVertical() && area == ICrosstabConstants.ROW_AXIS_TYPE) {
    return 0;
  }
  int measureCount=measures.size();
  for (int k=0; k < measureCount; k++) {
    MeasureViewHandle preMmeasureHandle=(MeasureViewHandle)measures.get(k);
    CrosstabCellHandle preMeasureCellHandle=preMmeasureHandle.getHeader();
    CrosstabCellAdapter measureCellAdapt=factory.createCrosstabCellAdapter(ICrosstabCellAdapterFactory.CELL_MEASURE_HEADER,preMeasureCellHandle,1,-1,baseColumn + k + 1,-1,isVertical());
    list.add(measureCellAdapt);
  }
  return measureCount;
}

Fixed version (ground truth):
private int addMesureHeader(List list,int baseColumn,int area,List measures){
  if (isVertical() && area == ICrosstabConstants.COLUMN_AXIS_TYPE) {
    return 0;
  }
 else   if (!isVertical() && area == ICrosstabConstants.ROW_AXIS_TYPE) {
    return 0;
  }
  int measureCount=measures.size();
  if (isHideHeader()) {
    return measureCount;
  }
  for (int k=0; k < measureCount; k++) {
    MeasureViewHandle preMmeasureHandle=(MeasureViewHandle)measures.get(k);
    CrosstabCellHandle preMeasureCellHandle=preMmeasureHandle.getHeader();
    CrosstabCellAdapter measureCellAdapt=factory.createCrosstabCellAdapter(ICrosstabCellAdapterFactory.CELL_MEASURE_HEADER,preMeasureCellHandle,1,-1,baseColumn + k + 1,-1,isVertical());
    list.add(measureCellAdapt);
  }
  return measureCount;
}
Program: 70693
Project: 70693
Buggy source:
private void adjustDirection(List columns,List rows){
  String area, otherArea;
  List workList=null;
  if (isVertical()) {
    workList=rows;
    area=ROWAREA_ROW;
    otherArea=ROWAREA_COLUMN;
  }
 else {
    workList=columns;
    area=COLUMNAREA_COLUMN;
    otherArea=COLUMNAREA_ROW;
  }
  if (workList.size() != 1) {
    return;
  }
  Object obj=workList.get(0);
  if (!(obj instanceof VirtualCrosstabCellAdapter)) {
    return;
  }
  CrosstabCellAdapter adapter=(CrosstabCellAdapter)obj;
  List measures=getMeasreViewHandleList();
  if (measures.size() > 0) {
    int number;
    if (isVertical()) {
      number=addMesureHeaderToVirtual(workList,1,1,2,1,measures);
      adapter.setRowSpan(number);
    }
 else {
      number=addMesureHeaderToVirtual(workList,2,1,1,1,measures);
      adapter.setColumnSpan(number);
    }
    if (number == 0) {
      number=1;
    }
    map.put(area,Integer.valueOf(number));
    map.put(otherArea,Integer.valueOf(2));
  }
}

Fixed version (ground truth):
private void adjustDirection(List columns,List rows){
  String area, otherArea;
  List workList=null;
  if (isVertical()) {
    workList=rows;
    area=ROWAREA_ROW;
    otherArea=ROWAREA_COLUMN;
  }
 else {
    workList=columns;
    area=COLUMNAREA_COLUMN;
    otherArea=COLUMNAREA_ROW;
  }
  if (workList.size() != 1) {
    return;
  }
  Object obj=workList.get(0);
  if (!(obj instanceof VirtualCrosstabCellAdapter)) {
    return;
  }
  CrosstabCellAdapter adapter=(CrosstabCellAdapter)obj;
  List measures=getMeasreViewHandleList();
  if (measures.size() > 0) {
    int number;
    if (isVertical()) {
      number=addMesureHeaderToVirtual(workList,1,1,2,1,measures);
      adapter.setRowSpan(number);
    }
 else {
      number=addMesureHeaderToVirtual(workList,2,1,1,1,measures);
      adapter.setColumnSpan(number);
    }
    if (number == 0) {
      number=1;
    }
    map.put(area,Integer.valueOf(number));
    if (isHideHeader()) {
      map.put(otherArea,Integer.valueOf(1));
    }
 else {
      map.put(otherArea,Integer.valueOf(2));
    }
  }
}
Program: 70694
Project: 70694
Buggy source:
protected void writeRunProperties(IStyle style,String fontFamily,boolean ishyperlink){
  writeFont(fontFamily);
  writeFontSize(style);
  writeLetterSpacing(style);
  writeTextUnderline(style);
  writeTextLineThrough(style);
  writeFontStyle(style);
  writeFontWeight(style);
  writeTextColor(style);
  writeHyperlinkStyle(ishyperlink);
}

Fixed version (ground truth):
protected void writeRunProperties(IStyle style,String fontFamily,boolean ishyperlink){
  writeHyperlinkStyle(ishyperlink,style);
  writeFont(fontFamily);
  writeFontSize(style);
  writeLetterSpacing(style);
  writeTextLineThrough(style);
  writeFontStyle(style);
  writeFontWeight(style);
}