nus-yam/ex-repair huggingface dataset:
Program: 78803
Project: 78803
Buggy source:
/** 
 * Creates an embedded image from another library embedded image.
 * @param baseImage
 * @return the created embedded image
 */
public static EmbeddedImage createEmbeddedImage(EmbeddedImageHandle baseImage){
  if (baseImage == null)   return null;
  EmbeddedImage image=new EmbeddedImage();
  Module module=baseImage.getModule();
  String namespace=module instanceof Library ? ((Library)module).getNamespace() : null;
  StructRefValue libReference=new StructRefValue(namespace,baseImage.getName());
  image.setProperty(EmbeddedImage.LIB_REFERENCE_MEMBER,libReference);
  return image;
}

Fixed version (ground truth):
/** 
 * Creates an embedded image from another library embedded image.
 * @param baseImage
 * @return the created embedded image
 * @deprecated by{@link #newEmbeddedImageFrom(EmbeddedImageHandle,String,ModuleHandle)}
 */
public static EmbeddedImage createEmbeddedImage(EmbeddedImageHandle baseImage){
  if (baseImage == null)   return null;
  EmbeddedImage image=new EmbeddedImage();
  Module module=baseImage.getModule();
  String namespace=module instanceof Library ? ((Library)module).getNamespace() : null;
  StructRefValue libReference=new StructRefValue(namespace,baseImage.getName());
  image.setProperty(EmbeddedImage.LIB_REFERENCE_MEMBER,libReference);
  return image;
}
Program: 78804
Project: 78804
Buggy source:
/** 
 * @param index
 * @param name
 * @param type
 * @param path
 * @param originalPath
 * @throws OdaException
 */
public ColumnInfo(int index,String name,String type,String path,String originalPath) throws OdaException {
  this.index=index;
  this.name=name;
  this.type=type;
  if (!DataTypes.isValidType(type))   throw new OdaException("String_Node_Str");
  this.path=buildPath(path);
  this.originalPath=originalPath;
}

Fixed version (ground truth):
/** 
 * @param index
 * @param name
 * @param type
 * @param path
 * @param originalPath
 * @throws OdaException
 */
public ColumnInfo(int index,String name,String type,String path,String originalPath) throws OdaException {
  this.index=index;
  this.name=name;
  this.type=type;
  if (!DataTypes.isValidType(type))   throw new OdaException("String_Node_Str");
  this.path=fixTrailingAttr(buildPath(path));
  this.originalPath=originalPath;
}
Program: 78805
Project: 78805
Buggy source:
private static boolean addGroup(DesignElementHandle parent,int position) throws SemanticException {
  GroupHandle groupHandle=null;
  SlotHandle slotHandle=null;
  DesignElementFactory factory=DesignElementFactory.getInstance(parent.getModuleHandle());
  if (parent instanceof TableHandle) {
    groupHandle=factory.newTableGroup();
    slotHandle=((TableHandle)parent).getGroups();
    int columnCount=((TableHandle)parent).getColumnCount();
    groupHandle.getHeader().add(factory.newTableRow(columnCount));
    groupHandle.getFooter().add(factory.newTableRow(columnCount));
  }
 else   if (parent instanceof ListHandle) {
    groupHandle=factory.newListGroup();
    slotHandle=((ListHandle)parent).getGroups();
  }
  if (groupHandle != null && slotHandle != null) {
    slotHandle.add(groupHandle,position);
    if (!DEUtil.getDataSetList(parent).isEmpty()) {
      GroupDialog dialog=new GroupDialog(getDefaultShell(),GroupDialog.GROUP_DLG_TITLE_NEW);
      dialog.setDataSetList(DEUtil.getDataSetList(parent));
      dialog.setInput(groupHandle);
      if (dialog.open() == Window.CANCEL) {
        return false;
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean addGroup(DesignElementHandle parent,int position) throws SemanticException {
  GroupHandle groupHandle=null;
  SlotHandle slotHandle=null;
  DesignElementFactory factory=DesignElementFactory.getInstance(parent.getModuleHandle());
  if (parent instanceof TableHandle) {
    groupHandle=factory.newTableGroup();
    slotHandle=((TableHandle)parent).getGroups();
    int columnCount=((TableHandle)parent).getColumnCount();
    groupHandle.getHeader().add(factory.newTableRow(columnCount));
    groupHandle.getFooter().add(factory.newTableRow(columnCount));
  }
 else   if (parent instanceof ListHandle) {
    groupHandle=factory.newListGroup();
    slotHandle=((ListHandle)parent).getGroups();
  }
  if (groupHandle != null && slotHandle != null) {
    slotHandle.add(groupHandle,position);
{
      GroupDialog dialog=new GroupDialog(getDefaultShell(),GroupDialog.GROUP_DLG_TITLE_NEW);
      dialog.setDataSetList(DEUtil.getDataSetList(parent));
      dialog.setInput(groupHandle);
      if (dialog.open() == Window.CANCEL) {
        return false;
      }
    }
    return true;
  }
  return false;
}
Program: 78808
Project: 78808
Buggy source:
/** 
 * Returns whether the library with the given namespace can be included in this module.
 * @param namespace the library namespace
 * @return true, if the library with the given namespace can be included.
 */
public boolean isRecursiveNamespace(String namespace){
  Module module=this;
  while (module instanceof Library) {
    Library library=(Library)module;
    if (library.getNamespace().equals(namespace))     return true;
    module=library.getHost();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the library with the given namespace can be included in this module.
 * @param namespace the library namespace
 * @return true, if the library with the given namespace can be included.
 */
public boolean isRecursiveNamespace(String namespace){
  Module module=this;
  while (module instanceof Library) {
    Library library=(Library)module;
    if (namespace.equals(library.getNamespace()))     return true;
    module=library.getHost();
  }
  return false;
}
Program: 78809
Project: 78809
Buggy source:
public void startContainer(IContainerContent container){
  IStyle mergedStyle=container.getStyle();
  push(mergedStyle);
  if (isHidden()) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  String tagName;
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=container.getX();
  DimensionType y=container.getY();
  DimensionType width=container.getWidth();
  DimensionType height=container.getHeight();
  int display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  tagName=openTagByType(display,DISPLAY_FLAG_ALL);
  tagStack.push(tagName);
  setStyleName(container.getStyleClass());
  setBookmark(tagName,container.getBookmark());
  setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  handleStyle(container,styleBuffer);
}

Fixed version (ground truth):
public void startContainer(IContainerContent container){
  IStyle mergedStyle=container.getStyle();
  push(mergedStyle);
  if (isHidden()) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  String tagName;
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=container.getX();
  DimensionType y=container.getY();
  DimensionType width=container.getWidth();
  DimensionType height=container.getHeight();
  int display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  tagName=openTagByType(display,DISPLAY_FLAG_ALL);
  tagStack.push(tagName);
  setStyleName(container.getStyleClass());
  String bookmark=container.getBookmark();
  if (bookmark == null) {
    bookmark=generateUniqueID();
  }
  setBookmark(tagName,bookmark);
  exportElementID(container,bookmark);
  setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  handleStyle(container,styleBuffer);
}
Program: 78810
Project: 78810
Buggy source:
public void setFilters(Filter[] simpleFilterExpression){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public void setFilters(Filter[] simpleFilterExpression){
}
Program: 78811
Project: 78811
Buggy source:
public void setSortConditions(String[] columnNames,int[] directions){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public void setSortConditions(String[] columnNames,int[] directions){
}
Program: 78812
Project: 78812
Buggy source:
public void selectColumns(String[] columnNames){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public void selectColumns(String[] columnNames){
}
Program: 78813
Project: 78813
Buggy source:
protected void exportElementID(IContent content,String bookmark){
  Object generateBy=content.getGenerateBy();
  if (generateBy instanceof TableItemDesign || generateBy instanceof ListItemDesign || generateBy instanceof ExtendedItemDesign) {
    if (renderOption instanceof HTMLRenderOption) {
      List htmlIds=((HTMLRenderOption)renderOption).getInstanceIDs();
      if (htmlIds != null && bookmark != null) {
        htmlIds.add(bookmark);
      }
    }
  }
}

Fixed version (ground truth):
protected void exportElementID(IContent content,String bookmark,String type){
}
Program: 78814
Project: 78814
Buggy source:
protected String generateUniqueID(){
  if (random == null) {
    random=new Random();
  }
  return "String_Node_Str" + random.nextLong();
}

Fixed version (ground truth):
protected String generateUniqueID(){
  if (random == null) {
    random=new Random();
  }
  String randLong="String_Node_Str" + random.nextLong();
  randLong=randLong.replaceAll("String_Node_Str","String_Node_Str");
  return "String_Node_Str" + randLong;
}
Program: 78815
Project: 78815
Buggy source:
public void startContainer(IContainerContent container){
  IStyle mergedStyle=container.getStyle();
  push(mergedStyle);
  if (isHidden()) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  String tagName;
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=container.getX();
  DimensionType y=container.getY();
  DimensionType width=container.getWidth();
  DimensionType height=container.getHeight();
  int display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  tagName=openTagByType(display,DISPLAY_FLAG_ALL);
  tagStack.push(tagName);
  setStyleName(container.getStyleClass());
  String bookmark=container.getBookmark();
  if (bookmark == null) {
    bookmark=generateUniqueID();
  }
  setBookmark(tagName,bookmark);
  exportElementID(container,bookmark);
  setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  handleStyle(container,styleBuffer);
}

Fixed version (ground truth):
public void startContainer(IContainerContent container){
  IStyle mergedStyle=container.getStyle();
  push(mergedStyle);
  if (isHidden()) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  String tagName;
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=container.getX();
  DimensionType y=container.getY();
  DimensionType width=container.getWidth();
  DimensionType height=container.getHeight();
  int display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  tagName=openTagByType(display,DISPLAY_FLAG_ALL);
  tagStack.push(tagName);
  setStyleName(container.getStyleClass());
  String bookmark=container.getBookmark();
  if (bookmark == null) {
    bookmark=generateUniqueID();
  }
  setBookmark(tagName,bookmark);
  exportElementID(container,bookmark,"String_Node_Str");
  setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  handleStyle(container,styleBuffer);
}
Program: 78816
Project: 78816
Buggy source:
protected void exportElementID(IContent content,String bookmark){
  Object generateBy=content.getGenerateBy();
  if (generateBy instanceof TableItemDesign || generateBy instanceof ListItemDesign || generateBy instanceof ImageItemDesign) {
    if (renderOption instanceof HTMLRenderOption) {
      List htmlIds=((HTMLRenderOption)renderOption).getInstanceIDs();
      if (htmlIds != null && bookmark != null) {
        htmlIds.add(bookmark);
      }
    }
  }
}

Fixed version (ground truth):
protected void exportElementID(IContent content,String bookmark){
  Object generateBy=content.getGenerateBy();
  if (generateBy instanceof TableItemDesign || generateBy instanceof ListItemDesign || generateBy instanceof ExtendedItemDesign) {
    if (renderOption instanceof HTMLRenderOption) {
      List htmlIds=((HTMLRenderOption)renderOption).getInstanceIDs();
      if (htmlIds != null && bookmark != null) {
        htmlIds.add(bookmark);
      }
    }
  }
}
Program: 78817
Project: 78817
Buggy source:
/** 
 * @param currentEditorModel The currentEditorModel to set.
 */
public void setCurrentEditorModel(Object current){
  Object old=this.currentEditorModel;
  if (currentEditorModel == null || current instanceof LibraryHandle) {
    this.currentEditorModel=new LibRootModel(current);
  }
 else {
    this.currentEditorModel=current;
  }
  if (currentEditorModel == old) {
    return;
  }
  PropertyChangeEvent event=new PropertyChangeEvent(this,CURRENTMODEL,old,this.currentEditorModel);
  firePropertyChangeEvent(event);
}

Fixed version (ground truth):
/** 
 * @param currentEditorModel The currentEditorModel to set.
 */
public void setCurrentEditorModel(Object current){
  Object old=this.currentEditorModel;
  if (current == null || current instanceof LibraryHandle) {
    this.currentEditorModel=new LibRootModel(current);
  }
 else {
    this.currentEditorModel=current;
  }
  if (currentEditorModel == old) {
    return;
  }
  PropertyChangeEvent event=new PropertyChangeEvent(this,CURRENTMODEL,old,this.currentEditorModel);
  firePropertyChangeEvent(event);
}
Program: 78820
Project: 78820
Buggy source:
private boolean matchDataType(DataSetItemModel column){
  if (column.getDataType() == DataType.UNKNOWN_TYPE) {
    return false;
  }
  String type=getSelectedDataType();
  if (type.equals(DesignChoiceConstants.PARAM_TYPE_STRING)) {
    return true;
  }
switch (column.getDataType()) {
case DataType.BOOLEAN_TYPE:
    return type.equals(DesignChoiceConstants.PARAM_TYPE_BOOLEAN);
case DataType.INTEGER_TYPE:
  return type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL) || type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
case DataType.DATE_TYPE:
return type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME);
case DataType.DECIMAL_TYPE:
return type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL) || type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
case DataType.DOUBLE_TYPE:
return type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
}
return false;
}

Fixed version (ground truth):
private boolean matchDataType(ScalarParameterHandle handle,DataSetItemModel column){
  if (column.getDataType() == DataType.UNKNOWN_TYPE) {
    return false;
  }
  String type=handle.getDataType();
  if (handle == selectedParameter) {
    type=getSelectedDataType();
  }
  if (type.equals(DesignChoiceConstants.PARAM_TYPE_STRING)) {
    return true;
  }
switch (column.getDataType()) {
case DataType.BOOLEAN_TYPE:
    return type.equals(DesignChoiceConstants.PARAM_TYPE_BOOLEAN);
case DataType.INTEGER_TYPE:
  return type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL) || type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
case DataType.DATE_TYPE:
return type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME);
case DataType.DECIMAL_TYPE:
return type.equals(DesignChoiceConstants.PARAM_TYPE_DECIMAL) || type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
case DataType.DOUBLE_TYPE:
return type.equals(DesignChoiceConstants.PARAM_TYPE_FLOAT);
}
return false;
}
Program: 78822
Project: 78822
Buggy source:
private void setCellEditorItems(){
  ((ComboBoxCellEditor)cellEditors[1]).setItems(getDataSetColumns(true));
  ((ComboBoxCellEditor)cellEditors[2]).setItems(getDataSetColumns(false));
}

Fixed version (ground truth):
private void setCellEditorItems(){
  ((ComboBoxCellEditor)cellEditors[1]).setItems(getDataSetColumns(selectedParameter));
  ((ComboBoxCellEditor)cellEditors[2]).setItems(getDataSetColumns());
}
Program: 78823
Project: 78823
Buggy source:
public Object[] getElements(Object inputElement){
  ArrayList elementsList=new ArrayList(inputParameterGroup.getParameters().getContents());
  if (newParameter == null) {
    newParameter=DesignElementFactory.getInstance().newScalarParameter(null);
    try {
      newParameter.setControlType(DesignChoiceConstants.PARAM_CONTROL_LIST_BOX);
      newParameter.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
  elementsList.add(newParameter);
  return elementsList.toArray();
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  ArrayList elementsList=new ArrayList(inputParameterGroup.getParameters().getContents());
  for (Iterator iter=elementsList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle handle=(ScalarParameterHandle)iter.next();
    String[] columns=getDataSetColumns(handle);
    boolean found=false;
    for (int i=0; i < columns.length; i++) {
      if (DEUtil.getColumnExpression(columns[i]).equals(handle.getValueExpr())) {
        found=true;
        break;
      }
    }
    if (!found) {
      try {
        handle.setValueExpr(null);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  if (newParameter == null) {
    newParameter=DesignElementFactory.getInstance().newScalarParameter(null);
    try {
      newParameter.setControlType(DesignChoiceConstants.PARAM_CONTROL_LIST_BOX);
      newParameter.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
  }
  elementsList.add(newParameter);
  return elementsList.toArray();
}
Program: 78824
Project: 78824
Buggy source:
private void updateButtons(){
  boolean okEnable=true;
  if (dataSet == null) {
    okEnable=false;
  }
 else {
    Iterator iter=inputParameterGroup.getParameters().iterator();
    if (!iter.hasNext()) {
      okEnable=false;
    }
 else {
      int count=0;
      while (iter.hasNext()) {
        Object obj=iter.next();
        if (obj instanceof ScalarParameterHandle) {
          ScalarParameterHandle param=(ScalarParameterHandle)obj;
          count++;
          if (param.getValueExpr() == null) {
            okEnable=false;
            break;
          }
        }
      }
      okEnable=(count != 0);
    }
  }
  getOkButton().setEnabled(okEnable);
}

Fixed version (ground truth):
private void updateButtons(){
  boolean okEnable=true;
  if (dataSet == null) {
    okEnable=false;
  }
 else {
    Iterator iter=inputParameterGroup.getParameters().iterator();
    if (!iter.hasNext()) {
      okEnable=false;
    }
 else {
      int count=0;
      while (iter.hasNext()) {
        Object obj=iter.next();
        if (obj instanceof ScalarParameterHandle) {
          ScalarParameterHandle param=(ScalarParameterHandle)obj;
          count++;
          if (param.getValueExpr() == null) {
            okEnable=false;
            break;
          }
        }
      }
      okEnable&=(count != 0);
    }
  }
  getOkButton().setEnabled(okEnable);
}
Program: 78825
Project: 78825
Buggy source:
private void changeDataType(String type){
  initFormatField(type);
  String[] columns=getDataSetColumns(true);
  for (int i=0; i < columns.length; i++) {
    if (DEUtil.getColumnExpression(columns[i]).equals(selectedParameter.getValueExpr())) {
      updateButtons();
      return;
    }
  }
  try {
    selectedParameter.setValueExpr(null);
    valueTable.refresh();
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
  getOkButton().setEnabled(false);
}

Fixed version (ground truth):
private void changeDataType(String type){
  initFormatField(type);
  refreshValueTable();
  updateButtons();
}
Program: 78826
Project: 78826
Buggy source:
public boolean canModify(Object element,String property){
  if (element != selectedParameter) {
    return false;
  }
  if (element == newParameter) {
    if (!property.equals(COLUMN_VALUE)) {
      return false;
    }
  }
 else   if (property.equals(COLUMN_NAME)) {
    return false;
  }
  if (property.equals(COLUMN_VALUE)) {
    if (getDataSetColumns(true).length == 0) {
      return false;
    }
  }
  setCellEditorItems();
  return true;
}

Fixed version (ground truth):
public boolean canModify(Object element,String property){
  if (element != selectedParameter) {
    return false;
  }
  if (element == newParameter) {
    if (!property.equals(COLUMN_VALUE)) {
      return false;
    }
  }
 else   if (property.equals(COLUMN_NAME)) {
    return false;
  }
  if (property.equals(COLUMN_VALUE)) {
    if (getDataSetColumns((ScalarParameterHandle)element).length == 0) {
      return false;
    }
  }
  setCellEditorItems();
  return true;
}
Program: 78827
Project: 78827
Buggy source:
public String getColumnText(Object element,int columnIndex){
  String value=null;
  ScalarParameterHandle paramHandle=null;
  if (element instanceof ScalarParameterHandle) {
    paramHandle=(ScalarParameterHandle)element;
  }
  if (paramHandle == newParameter) {
    if (columnIndex == 0) {
      value=LABEL_CREATE_NEW_PARAMETER;
    }
 else     if (columnIndex == 1) {
      value=LABEL_SELECT_A_VALUE_COLUMN;
    }
  }
 else {
switch (columnIndex) {
case 0:
{
        if (paramHandle != newParameter) {
          String paramName;
          if (paramHandle != selectedParameter) {
            paramName=paramHandle.getName();
          }
 else {
            paramName=paramNameEditor.getText().trim();
          }
          value=getDummyText(paramHandle) + paramName;
        }
        break;
      }
case 1:
{
      if (paramHandle.getValueExpr() != null) {
        value=getColumnName(paramHandle.getValueExpr());
      }
 else {
        value=LABEL_SELECT_A_VALUE_COLUMN;
      }
      break;
    }
case 2:
{
    value=getColumnName(paramHandle.getLabelExpr());
    if (value == null) {
      value=LABEL_SELECT_DISPLAY_COLUMN;
    }
    break;
  }
}
}
if (value == null) {
value="String_Node_Str";
}
return value;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  String value=null;
  ScalarParameterHandle paramHandle=null;
  if (element instanceof ScalarParameterHandle) {
    paramHandle=(ScalarParameterHandle)element;
  }
  if (paramHandle == newParameter) {
    if (columnIndex == 0) {
      value=LABEL_CREATE_NEW_PARAMETER;
    }
 else     if (columnIndex == 1) {
      value=LABEL_SELECT_A_VALUE_COLUMN;
    }
  }
 else {
switch (columnIndex) {
case 0:
{
        if (paramHandle != newParameter) {
          String paramName;
          if (paramHandle != selectedParameter) {
            paramName=paramHandle.getName();
          }
 else {
            paramName=paramNameEditor.getText().trim();
          }
          value=getDummyText(paramHandle) + paramName;
        }
        break;
      }
case 1:
{
      if (paramHandle.getValueExpr() != null) {
        value=getColumnName(paramHandle.getValueExpr());
      }
 else       if (getDataSetColumns(paramHandle).length > 0) {
        value=LABEL_SELECT_A_VALUE_COLUMN;
      }
 else {
        value=LABEL_NO_COLUMN_AVAILABLE;
      }
      break;
    }
case 2:
{
    value=getColumnName(paramHandle.getLabelExpr());
    if (value == null) {
      if (getDataSetColumns().length > 0) {
        value=LABEL_SELECT_DISPLAY_COLUMN;
      }
 else {
        value=LABEL_NO_COLUMN_AVAILABLE;
      }
    }
    break;
  }
}
}
if (value == null) {
value="String_Node_Str";
}
return value;
}
Program: 78829
Project: 78829
Buggy source:
private String[] getDataSetColumns(boolean needFilte){
  if (dataSet == null) {
    return new String[0];
  }
  DataSetItemModel[] models=DataSetManager.getCurrentInstance().getColumns(dataSet,true);
  if (models == null) {
    return new String[0];
  }
  ArrayList valueList=new ArrayList(models.length);
  for (int i=0; i < models.length; i++) {
    if (!needFilte || matchDataType(models[i])) {
      valueList.add(models[i].getName());
    }
  }
  return (String[])valueList.toArray(new String[0]);
}

Fixed version (ground truth):
private String[] getDataSetColumns(ScalarParameterHandle handle){
  if (dataSet == null) {
    return new String[0];
  }
  DataSetItemModel[] models=DataSetManager.getCurrentInstance().getColumns(dataSet,true);
  if (models == null) {
    return new String[0];
  }
  ArrayList valueList=new ArrayList(models.length);
  for (int i=0; i < models.length; i++) {
    if (handle == null || matchDataType(handle,models[i])) {
      valueList.add(models[i].getName());
    }
  }
  return (String[])valueList.toArray(new String[0]);
}
Program: 78830
Project: 78830
Buggy source:
private void saveParameterProperties() throws SemanticException {
  if (selectedParameter != null && selectedParameter != newParameter) {
    selectedParameter.setPromptText(UIUtil.convertToModelString(promptText.getText(),false));
    selectedParameter.setDefaultValue(UIUtil.convertToModelString(defaultValueEditor.getText(),true));
    selectedParameter.setHelpText(UIUtil.convertToModelString(helpTextEditor.getText(),true));
    if (StringUtil.isBlank(listLimit.getText())) {
      selectedParameter.setProperty(ScalarParameterHandle.LIST_LIMIT_PROP,null);
    }
 else {
      selectedParameter.setListlimit(Integer.parseInt(listLimit.getText()));
    }
    selectedParameter.setAllowNull(allowNull.getSelection());
    selectedParameter.setName(UIUtil.convertToModelString(paramNameEditor.getText(),true));
    refreshValueTable();
  }
  ;
}

Fixed version (ground truth):
private void saveParameterProperties() throws SemanticException {
  if (selectedParameter != null && selectedParameter != newParameter) {
    selectedParameter.setPromptText(UIUtil.convertToModelString(promptText.getText(),false));
    selectedParameter.setHelpText(UIUtil.convertToModelString(helpTextEditor.getText(),true));
    selectedParameter.setDefaultValue(UIUtil.convertToModelString(defaultValueEditor.getText(),true));
    if (StringUtil.isBlank(listLimit.getText())) {
      selectedParameter.setProperty(ScalarParameterHandle.LIST_LIMIT_PROP,null);
    }
 else {
      selectedParameter.setListlimit(Integer.parseInt(listLimit.getText()));
    }
    selectedParameter.setAllowNull(allowNull.getSelection());
    selectedParameter.setName(UIUtil.convertToModelString(paramNameEditor.getText(),true));
    refreshValueTable();
  }
  ;
}
Program: 78831
Project: 78831
Buggy source:
public String getDisplayText(Object element){
  if (element instanceof Object[]) {
    if (element instanceof Operator[]) {
      if (element == OPERATORS_ASSIGNMENT) {
        return DISPLAY_TEXT_ASSIGNMENT;
      }
 else       if (element == OPERATORS_COMPARISON) {
        return DISPLAY_TEXT_COMPARISON;
      }
 else       if (element == OPERATORS_COMPUTATIONAL) {
        return DISPLAY_TEXT_COMPUTATIONAL;
      }
 else       if (element == OPERATORS_LOGICAL) {
        return DISPLAY_TEXT_LOGICAL;
      }
    }
 else     if (element instanceof ILocalizableInfo[]) {
      ILocalizableInfo info=((ILocalizableInfo[])element)[1];
      StringBuffer displayText=new StringBuffer(info.getName());
      if (info instanceof IMethodInfo) {
        IMethodInfo method=(IMethodInfo)info;
        displayText.append("String_Node_Str");
        displayText.append("String_Node_Str");
        displayText.append(method.getReturnType());
      }
      return displayText.toString();
    }
    return ALL;
  }
 else   if (element instanceof String) {
    return (String)element;
  }
 else   if (element instanceof Operator) {
    return ((Operator)element).symbol;
  }
 else   if (element instanceof DesignElementHandle) {
    return ((DesignElementHandle)element).getQualifiedName();
  }
 else   if (element instanceof DataSetItemModel) {
    return ((DataSetItemModel)element).getName();
  }
  return element.toString();
}

Fixed version (ground truth):
public String getDisplayText(Object element){
  if (element instanceof Object[]) {
    if (element instanceof Operator[]) {
      if (element == OPERATORS_ASSIGNMENT) {
        return DISPLAY_TEXT_ASSIGNMENT;
      }
 else       if (element == OPERATORS_COMPARISON) {
        return DISPLAY_TEXT_COMPARISON;
      }
 else       if (element == OPERATORS_COMPUTATIONAL) {
        return DISPLAY_TEXT_COMPUTATIONAL;
      }
 else       if (element == OPERATORS_LOGICAL) {
        return DISPLAY_TEXT_LOGICAL;
      }
    }
 else     if (element instanceof ILocalizableInfo[]) {
      ILocalizableInfo info=((ILocalizableInfo[])element)[1];
      StringBuffer displayText=new StringBuffer(info.getName());
      if (info instanceof IMethodInfo) {
        IMethodInfo method=(IMethodInfo)info;
        displayText.append("String_Node_Str");
        displayText.append("String_Node_Str");
        displayText.append(method.getReturnType());
      }
      return displayText.toString();
    }
    return ALL;
  }
 else   if (element instanceof String) {
    return (String)element;
  }
 else   if (element instanceof Operator) {
    return ((Operator)element).symbol;
  }
 else   if (element instanceof DesignElementHandle) {
    return ((DesignElementHandle)element).getQualifiedName();
  }
 else   if (element instanceof DataSetItemModel) {
    return ((DataSetItemModel)element).getDisplayName();
  }
  return element.toString();
}
Program: 78833
Project: 78833
Buggy source:
/** 
 * Return the table's ancestor path. A table's ancestor path is the common prefix that all table columns' pathes shared. Table's rootpath should only equal to, or prefixed with a table's ancestor path.
 * @return
 */
public String getAncestor(){
  String[] columnNames=this.getColumnNames();
  if (columnNames.length == 1)   return getPath(columnNames[0]);
  String[] paths=new String[columnNames.length];
  for (int i=0; i < paths.length; i++) {
    paths[i]=getPath(columnNames[i]);
  }
  String theLongestPath="String_Node_Str";
  for (int i=0; i < paths.length; i++) {
    if (paths[i].split("String_Node_Str").length > theLongestPath.split("String_Node_Str").length)     theLongestPath=paths[i];
  }
  boolean isAbsolutePath=false;
  if (theLongestPath.startsWith("String_Node_Str")) {
    isAbsolutePath=false;
    theLongestPath=theLongestPath.replaceFirst("String_Node_Str","String_Node_Str");
  }
 else {
    isAbsolutePath=true;
    theLongestPath=theLongestPath.replaceFirst("String_Node_Str","String_Node_Str");
  }
  String[] temp=theLongestPath.split("String_Node_Str");
  String prefix=isAbsolutePath ? "String_Node_Str" : "String_Node_Str";
  for (int j=0; j < temp.length; j++) {
    String attempedPrefix=j == 0 ? prefix + temp[j] : prefix + "String_Node_Str" + temp[j];
    for (int i=0; i < paths.length; i++) {
      if (!paths[i].startsWith(attempedPrefix))       return prefix;
    }
    prefix=attempedPrefix;
  }
  return prefix;
}

Fixed version (ground truth):
/** 
 * Return the table's ancestor path. A table's ancestor path is the common prefix that all table columns' pathes shared. Table's rootpath should only equal to, or prefixed with a table's ancestor path.
 * @return
 */
public String getAncestor(){
  String[] columnNames=this.getColumnNames();
  if (columnNames.length == 1)   return getPath(columnNames[0]);
  String[] paths=new String[columnNames.length];
  for (int i=0; i < paths.length; i++) {
    paths[i]=getPath(columnNames[i]).replaceFirst("String_Node_Str","String_Node_Str");
  }
  String theLongestPath="String_Node_Str";
  for (int i=0; i < paths.length; i++) {
    if (paths[i].split("String_Node_Str").length > theLongestPath.split("String_Node_Str").length)     theLongestPath=paths[i];
  }
  boolean isAbsolutePath=false;
  if (theLongestPath.startsWith("String_Node_Str")) {
    isAbsolutePath=false;
    theLongestPath=theLongestPath.replaceFirst("String_Node_Str","String_Node_Str");
  }
 else {
    isAbsolutePath=true;
    theLongestPath=theLongestPath.replaceFirst("String_Node_Str","String_Node_Str");
  }
  String[] temp=theLongestPath.split("String_Node_Str");
  String prefix=isAbsolutePath ? "String_Node_Str" : "String_Node_Str";
  for (int j=0; j < temp.length; j++) {
    String attempedPrefix=j == 0 ? prefix + temp[j] : prefix + "String_Node_Str" + temp[j];
    for (int i=0; i < paths.length; i++) {
      if (!paths[i].startsWith(attempedPrefix))       return prefix;
    }
    prefix=attempedPrefix;
  }
  return prefix;
}
Program: 78834
Project: 78834
Buggy source:
public void run(){
  XMLReader xr;
  try {
    xr=new SAXParser();
    xr.setContentHandler(this);
    xr.setErrorHandler(this);
    Reader file=new InputStreamReader(new File(xmlFile).toURL().openStream());
    xr.parse(new InputSource(file));
  }
 catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    this.alive=false;
    spConsumer.wakeup();
  }
}

Fixed version (ground truth):
public void run(){
  XMLReader xr;
  try {
    xr=new SAXParser();
    xr.setContentHandler(this);
    xr.setErrorHandler(this);
    URL url=null;
    Reader file=null;
    try {
      File f=new File(xmlFile);
      url=f.toURL();
      file=new InputStreamReader(url.openStream());
    }
 catch (    IOException e) {
      url=null;
    }
    if (url == null) {
      url=new URL(xmlFile);
    }
    file=new InputStreamReader(url.openStream());
    xr.parse(new InputSource(file));
  }
 catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    this.alive=false;
    spConsumer.wakeup();
  }
}
Program: 78835
Project: 78835
Buggy source:
/** 
 * @param rs
 * @param rinfo
 * @param fileName
 * @param tName
 * @throws OdaException
 */
public SaxParserConsumer(ResultSet rs,RelationInformation rinfo,String fileName,String tName) throws OdaException {
  this.resultSet=rs;
  cachedResultSetRowNo=0;
  currentAvailableMaxLineNo=-1;
  tableName=tName;
  relationInfo=rinfo;
  currentRowNo=0;
  cachedResultSet=new String[Constants.CACHED_RESULT_SET_LENGTH][resultSet.getMetaData().getColumnCount()];
  this.rootPath=relationInfo.getTableRootPath(tableName);
  this.ancestorPath=relationInfo.getTableAncestor(tableName);
  this.isNotNestedXMLTable=rootPath.equals(ancestorPath);
  this.namesOfCachedColumns=relationInfo.getTableNestedXMLColumnNames(tableName);
  this.namesOfColumns=relationInfo.getTableColumnNames(tableName);
  if (!isNotNestedXMLTable) {
    spNestedQueryHelper=new SaxParserNestedQueryHelper(rinfo,fileName,tName);
    while (spNestedQueryHelper.isPrepared()) {
      try {
synchronized (this) {
          wait(1000);
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
  sp=new SaxParser(fileName,this);
  spThread=new Thread(sp);
  spThread.start();
}

Fixed version (ground truth):
/** 
 * @param rs
 * @param rinfo
 * @param fileName
 * @param tName
 * @throws OdaException
 */
public SaxParserConsumer(ResultSet rs,RelationInformation rinfo,String fileName,String tName) throws OdaException {
  this.resultSet=rs;
  cachedResultSetRowNo=0;
  currentAvailableMaxLineNo=-1;
  tableName=tName;
  relationInfo=rinfo;
  currentRowNo=0;
  cachedResultSet=new String[Constants.CACHED_RESULT_SET_LENGTH][resultSet.getMetaData().getColumnCount()];
  this.rootPath=relationInfo.getTableRootPath(tableName);
  this.ancestorPath=relationInfo.getTableAncestor(tableName);
  this.isNotNestedXMLTable=rootPath.equals(ancestorPath);
  this.namesOfCachedColumns=relationInfo.getTableNestedXMLColumnNames(tableName);
  this.namesOfColumns=relationInfo.getTableColumnNames(tableName);
  if (!isNotNestedXMLTable) {
    spNestedQueryHelper=new SaxParserNestedQueryHelper(rinfo,fileName,tName);
    while (!spNestedQueryHelper.isPrepared()) {
      try {
synchronized (this) {
          wait(1000);
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
  sp=new SaxParser(fileName,this);
  spThread=new Thread(sp);
  spThread.start();
}
Program: 78836
Project: 78836
Buggy source:
/** 
 * Creates a new multi line data item.
 * @param name the optional multi line data name. Can be <code>null</code>.
 * @return a handle to multi line data item
 */
public TextDataHandle newTextData(String name){
  String newName=getNewName(ReportDesignConstants.TEXT_ITEM,name);
  return factory.newTextData(newName);
}

Fixed version (ground truth):
/** 
 * Creates a new multi line data item.
 * @param name the optional multi line data name. Can be <code>null</code>.
 * @return a handle to multi line data item
 */
public TextDataHandle newTextData(String name){
  String newName=getNewName(ReportDesignConstants.TEXT_DATA_ITEM,name);
  return factory.newTextData(newName);
}
Program: 78838
Project: 78838
Buggy source:
public String getColumnText(Object element,int columnIndex){
  SelectionChoice choice=((SelectionChoice)element);
  final int valueIndex=valueTable.getColumnProperties().length - 2;
  String text=null;
  if (valueTable.getColumnProperties().length == 4 && columnIndex == 1) {
    if (isDefaultChoice(choice)) {
      text=FLAG_DEFAULT;
    }
  }
 else   if (columnIndex == valueIndex) {
    if (choice == dummyChoice) {
      text=INPUT_PROPMT;
    }
 else {
      text=format(choice.getValue());
    }
  }
 else   if (columnIndex == valueIndex + 1) {
    text=choice.getLabel();
  }
  if (text == null) {
    text="String_Node_Str";
  }
  return text;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  SelectionChoice choice=((SelectionChoice)element);
  final int valueIndex=valueTable.getColumnProperties().length - 2;
  String text=null;
  if (valueTable.getColumnProperties().length == 4 && columnIndex == 1) {
    if (isDefaultChoice(choice)) {
      text=FLAG_DEFAULT;
    }
  }
 else   if (columnIndex == valueIndex) {
    if (choice == dummyChoice) {
      text=INPUT_PROPMT;
    }
 else {
      text=choice.getValue();
    }
  }
 else   if (columnIndex == valueIndex + 1) {
    text=choice.getLabel();
    if (text == null) {
      text=format(choice.getValue());
    }
  }
  if (text == null) {
    text="String_Node_Str";
  }
  return text;
}
Program: 78840
Project: 78840
Buggy source:
/** 
 * Checks the element after the paste action.
 * @param content the pasted element
 * @return a list containing parsing errors. Each element in the list is<code>ErrorDetail</code>.
 */
private List checkPostPasteErrors(DesignElement content){
  Module currentModule=getElementHandle().getEffectiveModule();
  String nameSpace=null;
  if (currentModule != null && currentModule instanceof Library)   nameSpace=((Library)currentModule).getNamespace();
  reviseNameSpace(content,nameSpace);
  List exceptionList=content.validateWithContents(getModule());
  List errorDetailList=ErrorDetail.convertExceptionList(exceptionList);
  return errorDetailList;
}

Fixed version (ground truth):
/** 
 * Checks the element after the paste action.
 * @param content the pasted element
 * @return a list containing parsing errors. Each element in the list is<code>ErrorDetail</code>.
 */
private List checkPostPasteErrors(DesignElement content){
  Module currentModule=getElementHandle().getEffectiveModule();
  String nameSpace=null;
  if (currentModule != null && currentModule instanceof Library)   nameSpace=((Library)currentModule).getNamespace();
  ModelUtil.reviseNameSpace(getElementHandle().getEffectiveModule(),content,nameSpace);
  List exceptionList=content.validateWithContents(getModule());
  List errorDetailList=ErrorDetail.convertExceptionList(exceptionList);
  return errorDetailList;
}
Program: 78841
Project: 78841
Buggy source:
private void switchToDrillthrough(){
  new Label(displayArea,SWT.NONE).setText(REQUIED_MARK + LABEL_REPORT);
  locationEditor=new Text(displayArea,SWT.BORDER | SWT.SINGLE);
  locationEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  locationEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      initParamterBindings();
      updateButtons();
    }
  }
);
  createBrowerButton(displayArea,locationEditor,false,true);
  UIUtil.createBlankLabel(displayArea);
  messageLine=new CLabel(displayArea,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  messageLine.setLayoutData(gd);
  createBindingTable();
  createBookmarkBar(false);
  createTargetBar();
  createFormatBar();
}

Fixed version (ground truth):
private void switchToDrillthrough(){
  new Label(displayArea,SWT.NONE).setText(REQUIED_MARK + LABEL_REPORT);
  locationEditor=new Text(displayArea,SWT.BORDER | SWT.SINGLE);
  locationEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  locationEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      closeReport();
      initParamterBindings();
      updateButtons();
    }
  }
);
  createBrowerButton(displayArea,locationEditor,false,true);
  UIUtil.createBlankLabel(displayArea);
  messageLine=new CLabel(displayArea,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan=2;
  messageLine.setLayoutData(gd);
  createBindingTable();
  createBookmarkBar(false);
  createTargetBar();
  createFormatBar();
}
Program: 78843
Project: 78843
Buggy source:
private void createBrowerButton(Composite parent,final Text text,final boolean needQuote,final boolean needFilter){
  Button button=new Button(parent,SWT.PUSH);
  button.setLayoutData(new GridData());
  button.setImage(IMAGE_OPEN_FILE);
  button.setToolTipText(TOOLTIP_BROWSE_FILE);
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      FileDialog dialog=new FileDialog(UIUtil.getDefaultShell());
      if (needFilter) {
        dialog.setFilterExtensions(new String[]{"String_Node_Str"});
      }
      try {
        String filename=dialog.open();
        if (filename != null) {
          if (needQuote) {
            filename="String_Node_Str" + filename + "String_Node_Str";
          }
          text.setText(filename);
        }
 else {
          text.setText("String_Node_Str");
        }
        updateButtons();
      }
 catch (      Exception ex) {
        ExceptionHandler.handle(ex);
      }
    }
  }
);
}

Fixed version (ground truth):
private void createBrowerButton(Composite parent,final Text text,final boolean needQuote,final boolean needFilter){
  Button button=new Button(parent,SWT.PUSH);
  button.setLayoutData(new GridData());
  button.setImage(IMAGE_OPEN_FILE);
  button.setToolTipText(TOOLTIP_BROWSE_FILE);
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      FileDialog dialog=new FileDialog(UIUtil.getDefaultShell());
      if (needFilter) {
        dialog.setFilterExtensions(new String[]{"String_Node_Str"});
      }
      try {
        String filename=dialog.open();
        if (filename != null) {
          if (needFilter) {
            filename=URIUtil.getRelativePath(getBasePath(),filename);
          }
          if (needQuote) {
            filename="String_Node_Str" + filename + "String_Node_Str";
          }
          text.setText(filename);
        }
 else {
          text.setText("String_Node_Str");
        }
        updateButtons();
      }
 catch (      Exception ex) {
        ExceptionHandler.handle(ex);
      }
    }
  }
);
}
Program: 78844
Project: 78844
Buggy source:
/** 
 * @return socpe
 */
public abstract Scriptable getJavaScriptScope();

Fixed version (ground truth):
/** 
 * @return current top scope
 */
public Scriptable getJavaScriptScope(){
  return scope;
}
Program: 78845
Project: 78845
Buggy source:
/** 
 * When mode is MODE_GENERATION, the output stream of archive will be used. When mode is MODE_PRESENTATION, the input stream of archive will be used. When mode is DIRECT_PRESENTATION, the archive will not be used.
 * @param mode
 * @param scope
 * @param archive
 * @return an instance of DataEngineContext
 */
public static DataEngineContext newInstance(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  return new DataEngineContextImpl(mode,scope,reader,writer);
}

Fixed version (ground truth):
/** 
 * When mode is MODE_GENERATION, the writer stream of archive will be used. When mode is MODE_PRESENTATION, the reader stream of archive will be used. When mode is DIRECT_PRESENTATION, the archive will not be used.
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @return an instance of DataEngineContext
 */
public static DataEngineContext newInstance(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer) throws BirtException {
  return new DataEngineContext(mode,scope,reader,writer);
}
Program: 78846
Project: 78846
Buggy source:
/** 
 * According to the paramters of streamID and streamType, an output stream will be created for it. To make stream close simply, the output stream needs to be closed by caller, and then caller requires to add buffer stream layer when it is used.
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return output stream for specified streamID and streamType
 */
public abstract OutputStream getOutputStream(String streamID,String subStreamID,int streamType);

Fixed version (ground truth):
/** 
 * According to the paramters of streamID, subStreamID and streamType, an output stream will be created for it. To make stream close simply, the stream needs to be closed by caller, and then caller requires to add buffer stream layer when needed.
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return output stream for specified streamID, subStreamID and streamType
 */
public OutputStream getOutputStream(String streamID,String subStreamID,int streamType) throws DataException {
}
Program: 78847
Project: 78847
Buggy source:
/** 
 * @return mode
 */
public abstract int getMode();

Fixed version (ground truth):
/** 
 * @return current context mode
 */
public int getMode(){
  return mode;
}
Program: 78848
Project: 78848
Buggy source:
/** 
 * According to the paramters of streamID and streamType, an input stream will be created for it. To make stream close simply, the input stream needs to be closed by caller, and then caller requires to add buffer stream layer when it is used.
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return input stream for specified streamID and streamType
 */
public abstract InputStream getInputStream(String streamID,String subStreamID,int streamType);

Fixed version (ground truth):
/** 
 * According to the paramters of streamID, subStreamID and streamType, an input stream will be created for it. To make stream close simply, the stream needs to be closed by caller, and then caller requires to add buffer stream layer when needed.
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return input stream for specified streamID, subStreamID and streamType
 */
public InputStream getInputStream(String streamID,String subStreamID,int streamType) throws DataException {
}
Program: 78849
Project: 78849
Buggy source:
/** 
 * Determins whether one particula stream exists
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return boolean value
 */
public abstract boolean hasStream(String streamID,String subStreamID,int streamType);

Fixed version (ground truth):
/** 
 * Determins whether one particular stream exists
 * @param streamID
 * @param subStreamID
 * @param streamType
 * @return boolean value
 */
public boolean hasStream(String streamID,String subStreamID,int streamType){
  String relativePath=getPath(streamID,subStreamID,streamType);
  if (mode == MODE_GENERATION)   return writer.exists(relativePath);
 else   if (mode == MODE_GENERATION)   return reader.exists(relativePath);
 else   return false;
}
Program: 78850
Project: 78850
Buggy source:
public IStyle getContentStyle(){
  if (body == null) {
    if (generateBy instanceof MasterPageDesign) {
      body=report.createCellContent();
      body.setInlineStyle(((MasterPageDesign)generateBy).getContentStyle());
    }
  }
  return body.getComputedStyle();
}

Fixed version (ground truth):
public IStyle getContentStyle(){
  if (generateBy instanceof MasterPageDesign) {
    return ((MasterPageDesign)generateBy).getContentStyle();
  }
  return null;
}