nus-yam/ex-repair huggingface dataset:
Program: 69141
Project: 69141
Buggy source:
protected void delegateSetLength(long newLength) throws IOException {
  if (delegate == null) {
    if (newLength > memoryDelegate.length) {
      createRandomAccessFile();
    }
 else {
      length=(int)newLength;
    }
    return;
  }
  delegate.setLength(newLength);
}

Fixed version (ground truth):
protected void delegateSetLength(long newLength) throws IOException {
  if (delegate == null) {
    if (newLength > memoryDelegate.length && !pureMemory) {
      createRandomAccessFile();
    }
 else {
      if (newLength > memoryDelegate.length) {
        restructMemoryDelegate();
      }
      length=(int)newLength;
    }
    return;
  }
  delegate.setLength(newLength);
}
Program: 69142
Project: 69142
Buggy source:
protected void delegateSeek(long pos) throws IOException {
  if (delegate == null) {
    if (pos > memoryDelegate.length) {
      createRandomAccessFile();
    }
 else {
      pointer=(int)pos;
      return;
    }
  }
  delegate.seek(pos);
}

Fixed version (ground truth):
protected void delegateSeek(long pos) throws IOException {
  if (delegate == null) {
    if (pos > memoryDelegate.length && !pureMemory) {
      createRandomAccessFile();
    }
 else {
      if (pos > memoryDelegate.length) {
        restructMemoryDelegate();
      }
      pointer=(int)pos;
      return;
    }
  }
  delegate.seek(pos);
}
Program: 69143
Project: 69143
Buggy source:
protected void delegateWrite(byte[] b,int pos,int len) throws IOException {
  if (delegate == null) {
    if (pointer + len > memoryDelegate.length) {
      createRandomAccessFile();
    }
 else {
      System.arraycopy(b,pos,memoryDelegate,pointer,len);
      if (pointer + len > length) {
        length=pointer + len;
      }
      pointer+=len;
      return;
    }
  }
  delegate.write(b,pos,len);
}

Fixed version (ground truth):
protected void delegateWrite(byte[] b,int pos,int len) throws IOException {
  if (delegate == null) {
    if (pointer + len > memoryDelegate.length && !pureMemory) {
      createRandomAccessFile();
    }
 else {
      if (pointer + len > memoryDelegate.length) {
        restructMemoryDelegate();
      }
      System.arraycopy(b,pos,memoryDelegate,pointer,len);
      if (pointer + len > length) {
        length=pointer + len;
      }
      pointer+=len;
      return;
    }
  }
  delegate.write(b,pos,len);
}
Program: 69144
Project: 69144
Buggy source:
public static ExtendedItemHandle createChartHandle(DesignElementHandle anyHandle,String chartType,ExtendedItemHandle hostChartHandle) throws SemanticException {
  String name=ReportPlugin.getDefault().getCustomName(ChartReportItemConstants.CHART_EXTENSION_NAME);
  ExtendedItemHandle chartHandle=anyHandle.getElementFactory().newExtendedItem(name,ChartReportItemConstants.CHART_EXTENSION_NAME);
  if (chartType != null) {
    chartHandle.setProperty(ChartReportItemConstants.PROPERTY_CHART_TYPE,chartType);
  }
  if (hostChartHandle != null) {
    chartHandle.setProperty(ChartReportItemConstants.PROPERTY_HOST_CHART,hostChartHandle);
  }
  return chartHandle;
}

Fixed version (ground truth):
public static ExtendedItemHandle createChartHandle(DesignElementHandle anyHandle,String chartType,ExtendedItemHandle hostChartHandle) throws SemanticException {
  String name=ReportPlugin.getDefault().getCustomName(ChartReportItemConstants.CHART_EXTENSION_NAME);
  ExtendedItemHandle chartHandle=anyHandle.getElementFactory().newExtendedItem(name,ChartReportItemConstants.CHART_EXTENSION_NAME);
  if (chartType != null) {
    chartHandle.setProperty(ChartReportItemConstants.PROPERTY_CHART_TYPE,chartType);
  }
  if (hostChartHandle != null) {
    chartHandle.setProperty(ChartReportItemConstants.PROPERTY_HOST_CHART,hostChartHandle);
  }
 else {
    String namePrexif=name != null && name.length() > 0 ? name : org.eclipse.birt.chart.reportitem.i18n.Messages.getString((String)chartHandle.getDefn().getDisplayNameKey());
    chartHandle.makeUniqueName(namePrexif);
  }
  return chartHandle;
}
Program: 69147
Project: 69147
Buggy source:
public boolean isVisible(ICellContent cell){
  IElement parent=cell.getParent();
  if (parent instanceof IContent) {
    if (LayoutUtil.isHidden(((IContent)parent),format,context.getOutputDisplayNone())) {
      return false;
    }
  }
  IColumn column=cell.getColumnInstance();
  if (column == null) {
    return false;
  }
  if (isColumnHidden(column)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean isVisible(ICellContent cell){
  IElement parent=cell.getParent();
  boolean hiddenMask=context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN;
  if (parent instanceof IContent) {
    if (LayoutUtil.isHidden(((IContent)parent),format,context.getOutputDisplayNone(),hiddenMask)) {
      return false;
    }
  }
  IColumn column=cell.getColumnInstance();
  if (column == null) {
    return false;
  }
  if (isColumnHidden(column)) {
    return false;
  }
  return true;
}
Program: 69148
Project: 69148
Buggy source:
private boolean isColumnHidden(IColumn column){
  return LayoutUtil.isHiddenByVisibility(column,format);
}

Fixed version (ground truth):
private boolean isColumnHidden(IColumn column){
  boolean hiddenMask=context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN;
  return LayoutUtil.isHiddenByVisibility(column,format,hiddenMask);
}
Program: 69149
Project: 69149
Buggy source:
public static boolean isHiddenByVisibility(IColumn column,String format){
  String columnFormats=column.getVisibleFormat();
  if (columnFormats != null) {
    if (contains(columnFormats,EngineIRConstants.FORMAT_TYPE_VIEWER) || contains(columnFormats,BIRTConstants.BIRT_ALL_VALUE) || contains(columnFormats,format)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isHiddenByVisibility(IColumn column,String format,boolean hiddenMask){
  String columnFormats=column.getVisibleFormat();
  if (columnFormats != null) {
    if (hiddenMask) {
      if (contains(columnFormats,BIRTConstants.BIRT_ALL_VALUE)) {
        return true;
      }
    }
 else {
      if (contains(columnFormats,EngineIRConstants.FORMAT_TYPE_VIEWER) || contains(columnFormats,BIRTConstants.BIRT_ALL_VALUE) || contains(columnFormats,format)) {
        return true;
      }
    }
  }
  return false;
}
Program: 69150
Project: 69150
Buggy source:
public static boolean isHidden(IContent content,String format,boolean outputDisplayNone){
  if (content != null) {
    IStyle style=content.getStyle();
    if (!outputDisplayNone) {
      if (IStyle.NONE_VALUE == style.getProperty(IStyle.STYLE_DISPLAY)) {
        return true;
      }
    }
    if (isHiddenByVisibility(style,format)) {
      return true;
    }
    if (content.getContentType() == IContent.CELL_CONTENT) {
      ICellContent cell=(ICellContent)content;
      IColumn column=cell.getColumnInstance();
      if (column != null) {
        return isHiddenByVisibility(column,format);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isHidden(IContent content,String format,boolean outputDisplayNone,boolean hiddenMask){
  if (content != null) {
    IStyle style=content.getStyle();
    if (!outputDisplayNone) {
      if (IStyle.NONE_VALUE == style.getProperty(IStyle.STYLE_DISPLAY)) {
        return true;
      }
    }
    if (isHiddenByVisibility(style,format,hiddenMask)) {
      return true;
    }
    if (content.getContentType() == IContent.CELL_CONTENT) {
      ICellContent cell=(ICellContent)content;
      IColumn column=cell.getColumnInstance();
      if (column != null) {
        return isHiddenByVisibility(column,format,hiddenMask);
      }
    }
  }
  return false;
}
Program: 69151
Project: 69151
Buggy source:
public void startRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.startRow(row);
  }
 else {
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
      isHidden=false;
    }
    if (!isNestTable()) {
      int rowId=row.getRowID();
      if (lastRowId >= 0 && rowId > lastRowId + 1) {
        for (int i=lastRowId + 1; i < rowId; i++) {
          IRowContent newRow=(IRowContent)row.cloneContent(false);
          newRow.setParent(row.getParent());
          newRow.setRowID(i);
          startRow(newRow);
          endRow(newRow);
        }
      }
      layout.createRow(row,isHidden);
      if (!isHidden) {
        if (hasDropCell()) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          return;
        }
 else         if (layout.hasUnResolvedRow() && !LayoutUtil.isRepeatableRow(row)) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          hasDropCell=true;
          return;
        }
      }
    }
    if (!isHidden) {
      emitter.startRow(row);
    }
  }
}

Fixed version (ground truth):
public void startRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.startRow(row);
  }
 else {
    boolean hiddenMask=context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN;
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone(),hiddenMask);
    if (!isNestTable()) {
      int rowId=row.getRowID();
      if (lastRowId >= 0 && rowId > lastRowId + 1) {
        for (int i=lastRowId + 1; i < rowId; i++) {
          IRowContent newRow=(IRowContent)row.cloneContent(false);
          newRow.setParent(row.getParent());
          newRow.setRowID(i);
          startRow(newRow);
          endRow(newRow);
        }
      }
      layout.createRow(row,isHidden);
      if (!isHidden) {
        if (hasDropCell()) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          return;
        }
 else         if (layout.hasUnResolvedRow() && !LayoutUtil.isRepeatableRow(row)) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          hasDropCell=true;
          return;
        }
      }
    }
    if (!isHidden) {
      emitter.startRow(row);
    }
  }
}
Program: 69152
Project: 69152
Buggy source:
public void endRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.endRow(row);
  }
 else {
    if (!isNestTable()) {
      layout.endRow(row);
      lastRowId=row.getRowID();
      hasDropCell=layout.hasDropCell();
      if (hasDropCell()) {
        return;
      }
      if (layoutEvents.size() > 0) {
        flush();
        return;
      }
    }
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
      isHidden=false;
    }
    if (!isHidden) {
      emitter.endRow(row);
    }
  }
}

Fixed version (ground truth):
public void endRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.endRow(row);
  }
 else {
    if (!isNestTable()) {
      layout.endRow(row);
      lastRowId=row.getRowID();
      hasDropCell=layout.hasDropCell();
      if (hasDropCell()) {
        return;
      }
      if (layoutEvents.size() > 0) {
        flush();
        return;
      }
    }
    boolean hiddenMask=context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN;
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone(),hiddenMask);
    if (!isHidden) {
      emitter.endRow(row);
    }
  }
}
Program: 69153
Project: 69153
Buggy source:
public void startContent(IContent content,IContentEmitter emitter,boolean visible) throws BirtException {
  if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
    visible=true;
  }
  if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}

Fixed version (ground truth):
public void startContent(IContent content,IContentEmitter emitter,boolean visible) throws BirtException {
  if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}
Program: 69154
Project: 69154
Buggy source:
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter,boolean visible) throws BirtException {
  int type=content.getContentType();
  if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
    visible=true;
  }
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean first=isFirst && !isRepeated;
  ContainerBufferNode bandNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(bandNode,first);
currentNode=bandNode;
break;
case IContent.CELL_CONTENT:
ContainerBufferNode cellNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(cellNode,isFirst);
if (currentNode.isStarted()) {
cellNode.start();
}
currentNode=cellNode;
break;
case IContent.PAGE_CONTENT:
PageNode pageNode=new PageNode(content,emitter,generator,visible);
setup(pageNode,isFirst);
currentNode=pageNode;
break;
case IContent.TABLE_CONTENT:
tableIds.add(content.getInstanceID().toUniqueString());
default :
ContainerBufferNode node=new ContainerBufferNode(content,emitter,generator,visible);
setup(node,isFirst);
currentNode=node;
break;
}
}

Fixed version (ground truth):
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter,boolean visible) throws BirtException {
  int type=content.getContentType();
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean first=isFirst && !isRepeated;
  ContainerBufferNode bandNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(bandNode,first);
currentNode=bandNode;
break;
case IContent.CELL_CONTENT:
ContainerBufferNode cellNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(cellNode,isFirst);
if (currentNode.isStarted()) {
cellNode.start();
}
currentNode=cellNode;
break;
case IContent.PAGE_CONTENT:
PageNode pageNode=new PageNode(content,emitter,generator,visible);
setup(pageNode,isFirst);
currentNode=pageNode;
break;
case IContent.TABLE_CONTENT:
tableIds.add(content.getInstanceID().toUniqueString());
default :
ContainerBufferNode node=new ContainerBufferNode(content,emitter,generator,visible);
setup(node,isFirst);
currentNode=node;
break;
}
}
Program: 69155
Project: 69155
Buggy source:
private boolean isColumnHidden(IColumn column){
  String format=context.getFormat();
  return LayoutUtil.isHiddenByVisibility(column,format);
}

Fixed version (ground truth):
private boolean isColumnHidden(IColumn column){
  String format=context.getFormat();
  return LayoutUtil.isHiddenByVisibility(column,format,false);
}
Program: 69156
Project: 69156
Buggy source:
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  scriptContext=context;
  if (scriptContext != null) {
    ULocale locale=(ULocale)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.LOCALE);
    if (defaultLocale != locale) {
      abbrMonthFormat=null;
      monthFormat=null;
      abbrWeekFormat=null;
      weekFormat=null;
      defaultLocale=locale;
    }
    timeZone=(TimeZone)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.TIMEZONE);
  }
  return this.executor.execute(arguments,context);
}

Fixed version (ground truth):
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  scriptContext=context;
  if (scriptContext != null) {
    ULocale locale=(ULocale)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.LOCALE);
    if (defaultLocale != locale) {
      abbrMonthFormat=null;
      monthFormat=null;
      abbrWeekFormat=null;
      weekFormat=null;
      defaultLocale=locale;
    }
    timeZone=(TimeZone)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.TIMEZONE);
  }
  if (timeZone == null) {
    timeZone=TimeZone.getDefault();
  }
  return this.executor.execute(arguments,context);
}
Program: 69157
Project: 69157
Buggy source:
/** 
 * Return difference in number of seconds
 * @param d1
 * @param d2
 * @return
 */
private static long diffSecond(Date d1,Date d2){
  if (d1 == null || d2 == null) {
    throw new java.lang.IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  long diff=d2.getTime() - d1.getTime();
  if (timeZone.inDaylightTime(d1))   diff-=timeZone.getDSTSavings();
  if (timeZone.inDaylightTime(d2))   diff+=timeZone.getDSTSavings();
  return (new Long(diff / 1000)).longValue();
}

Fixed version (ground truth):
/** 
 * Return difference in number of seconds
 * @param d1
 * @param d2
 * @return
 */
private static long diffSecond(Date d1,Date d2){
  if (d1 == null || d2 == null) {
    throw new java.lang.IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  long diff=d2.getTime() - d1.getTime();
  if (timeZone != null && timeZone.inDaylightTime(d1))   diff-=timeZone.getDSTSavings();
  if (timeZone != null && timeZone.inDaylightTime(d2))   diff+=timeZone.getDSTSavings();
  return (new Long(diff / 1000)).longValue();
}
Program: 69159
Project: 69159
Buggy source:
private BufferedStructureArray passBaseCubeResultSet(IAggregationResultSet baseResultSet,List<IAggregationResultSet> drillResultSets,List<IEdgeDrillFilter> drillFilters) throws IOException {
  BufferedStructureArray tempBufferArray=new BufferedStructureArray(Member.getCreator(),2000);
  List<Member[]> currentMemberList;
  List<Member[]> previewMemberList=new ArrayList<Member[]>();
  for (int i=0; i < baseResultSet.length(); i++) {
    baseResultSet.seek(i);
    IAggregationResultRow row=baseResultSet.getCurrentRow();
    currentMemberList=getDrilledMemberList(row.getLevelMembers(),drillResultSets,drillFilters);
    addMemberIntoBufferedArray(tempBufferArray,currentMemberList,previewMemberList);
  }
  return tempBufferArray;
}

Fixed version (ground truth):
private BufferedStructureArray passBaseCubeResultSet(IAggregationResultSet baseResultSet,List<IAggregationResultSet> drillResultSets,List<IEdgeDrillFilter> drillFilters) throws IOException {
  BufferedStructureArray tempBufferArray=new BufferedStructureArray(AggregationResultRow.getCreator(),2000);
  List<Member[]> currentMemberList;
  List<Member[]> previewMemberList=new ArrayList<Member[]>();
  for (int i=0; i < baseResultSet.length(); i++) {
    baseResultSet.seek(i);
    IAggregationResultRow row=baseResultSet.getCurrentRow();
    currentMemberList=getDrilledMemberList(row.getLevelMembers(),drillResultSets,drillFilters);
    addMemberIntoBufferedArray(tempBufferArray,currentMemberList,previewMemberList);
  }
  return tempBufferArray;
}
Program: 69160
Project: 69160
Buggy source:
public IAggregationResultRow getCurrentRow() throws IOException {
  return rs.getCurrentRow();
}

Fixed version (ground truth):
public IAggregationResultRow getCurrentRow() throws IOException {
  Member[] member=new Member[resultObject.length];
  for (int i=0; i < resultObject.length; i++) {
    member[i]=(Member)resultObject[i];
  }
  IAggregationResultRow row=new AggregationResultRow(member,null);
  return row;
}
Program: 69161
Project: 69161
Buggy source:
private static boolean isGrandTotalOnEdge(List aggrOns,List dimLevelOnColumn) throws DataException {
  boolean flag=false;
  for (int i=0; i < aggrOns.size(); i++) {
    String aggrExpr=aggrOns.get(i).toString();
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(aggrExpr);
    if (dimLevelOnColumn.get(dimLevelOnColumn.size() - 1).equals(target)) {
      flag=true;
      break;
    }
  }
  return flag;
}

Fixed version (ground truth):
private static boolean isGrandTotalOnEdge(List aggrOns,List dimLevels) throws DataException {
  boolean flag=false;
  for (int i=0; i < aggrOns.size(); i++) {
    String aggrExpr=aggrOns.get(i).toString();
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(aggrExpr);
    if (!dimLevels.isEmpty() && dimLevels.get(dimLevels.size() - 1).equals(target)) {
      flag=true;
      break;
    }
  }
  return flag;
}
Program: 69162
Project: 69162
Buggy source:
DataSetHandle createSelectedDataSet(){
  DataSetHandle dataSetHandle=null;
  try {
    if (useODAV3) {
      dataSetHandle=createDataSetODAV3();
    }
 else {
      dataSetHandle=createDataSetODAV2();
    }
    return dataSetHandle;
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return null;
  }
catch (  IllegalStateException e) {
    ExceptionHandler.handle(e);
    return null;
  }
catch (  OdaException e) {
    ExceptionHandler.handle(e);
    return null;
  }
}

Fixed version (ground truth):
DataSetHandle createSelectedDataSet(){
  DataSetHandle dataSetHandle=null;
  try {
    if (useODAV3) {
      dataSetHandle=createDataSetODAV3();
    }
 else {
      dataSetHandle=createDataSetODAV2();
    }
    if (nameEditor != null && !nameEditor.isDisposed())     dataSetHandle.setName(nameEditor.getText());
    return dataSetHandle;
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return null;
  }
catch (  IllegalStateException e) {
    ExceptionHandler.handle(e);
    return null;
  }
catch (  OdaException e) {
    ExceptionHandler.handle(e);
    return null;
  }
}
Program: 69163
Project: 69163
Buggy source:
public void startRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.startRow(row);
  }
 else {
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (!isNestTable()) {
      int rowId=row.getRowID();
      if (lastRowId >= 0 && rowId > lastRowId + 1) {
        for (int i=lastRowId + 1; i < rowId; i++) {
          IRowContent newRow=(IRowContent)row.cloneContent(false);
          newRow.setParent(row.getParent());
          newRow.setRowID(i);
          startRow(newRow);
          endRow(newRow);
        }
      }
      layout.createRow(row,isHidden);
      if (!isHidden) {
        if (hasDropCell()) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          return;
        }
 else         if (layout.hasUnResolvedRow() && !LayoutUtil.isRepeatableRow(row)) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          hasDropCell=true;
          return;
        }
      }
    }
    if (!isHidden) {
      emitter.startRow(row);
    }
  }
}

Fixed version (ground truth):
public void startRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.startRow(row);
  }
 else {
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
      isHidden=false;
    }
    if (!isNestTable()) {
      int rowId=row.getRowID();
      if (lastRowId >= 0 && rowId > lastRowId + 1) {
        for (int i=lastRowId + 1; i < rowId; i++) {
          IRowContent newRow=(IRowContent)row.cloneContent(false);
          newRow.setParent(row.getParent());
          newRow.setRowID(i);
          startRow(newRow);
          endRow(newRow);
        }
      }
      layout.createRow(row,isHidden);
      if (!isHidden) {
        if (hasDropCell()) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          return;
        }
 else         if (layout.hasUnResolvedRow() && !LayoutUtil.isRepeatableRow(row)) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          hasDropCell=true;
          return;
        }
      }
    }
    if (!isHidden) {
      emitter.startRow(row);
    }
  }
}
Program: 69164
Project: 69164
Buggy source:
public void endRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.endRow(row);
  }
 else {
    if (!isNestTable()) {
      layout.endRow(row);
      lastRowId=row.getRowID();
      hasDropCell=layout.hasDropCell();
      if (hasDropCell()) {
        return;
      }
      if (layoutEvents.size() > 0) {
        flush();
        return;
      }
    }
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (!isHidden) {
      emitter.endRow(row);
    }
  }
}

Fixed version (ground truth):
public void endRow(IRowContent row) throws BirtException {
  if (cellEmitter != null) {
    cellEmitter.endRow(row);
  }
 else {
    if (!isNestTable()) {
      layout.endRow(row);
      lastRowId=row.getRowID();
      hasDropCell=layout.hasDropCell();
      if (hasDropCell()) {
        return;
      }
      if (layoutEvents.size() > 0) {
        flush();
        return;
      }
    }
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
      isHidden=false;
    }
    if (!isHidden) {
      emitter.endRow(row);
    }
  }
}
Program: 69166
Project: 69166
Buggy source:
private void createExpressionCell(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  defaultValueComposite=ControlProvider.getDefaultComposite(parent);
  defaultValueString=Utility.getNonNullString(structureHandle.getDefaultValue());
  defaultValue=ControlProvider.createText(defaultValueComposite,defaultValueString);
  defaultValue.setLayoutData(ControlProvider.getGridDataWithHSpan(1));
  defaultValue.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (defaultValue.isEnabled()) {
        validateSyntax();
      }
    }
  }
);
  SelectionAdapter listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      ExpressionBuilder expressionBuilder=new ExpressionBuilder(defaultValue.getText());
      expressionBuilder.setExpressionProvier(null);
      if (expressionBuilder.open() == OK) {
        defaultValue.setText(expressionBuilder.getResult().trim());
      }
    }
  }
;
  ExpressionButton exprButton=createExpressionButton(defaultValueComposite);
  defaultValue.setData(DataUIConstants.EXPR_BUTTON,exprButton);
  ExpressionHandle expr=getExpressionHandle();
  defaultValue.setText(expr == null || expr.getExpression() == null ? "String_Node_Str" : (String)expr.getExpression());
  defaultValue.setData(DataUIConstants.EXPR_TYPE,expr == null || expr.getType() == null ? UIUtil.getDefaultScriptType() : (String)expr.getType());
  ExpressionButton button=(ExpressionButton)defaultValue.getData(DataUIConstants.EXPR_BUTTON);
  if (button != null)   button.refresh();
}

Fixed version (ground truth):
private void createExpressionCell(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  defaultValueComposite=ControlProvider.getDefaultComposite(parent);
  defaultValueString=Utility.getNonNullString(structureHandle.getDefaultValue());
  defaultValue=ControlProvider.createText(defaultValueComposite,defaultValueString);
  defaultValue.setLayoutData(ControlProvider.getGridDataWithHSpan(1));
  defaultValue.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (defaultValue.isEnabled()) {
        validateSyntax();
      }
    }
  }
);
  SelectionAdapter listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      ExpressionBuilder expressionBuilder=new ExpressionBuilder(defaultValue.getText());
      expressionBuilder.setExpressionProvier(null);
      if (expressionBuilder.open() == OK) {
        defaultValue.setText(expressionBuilder.getResult().trim());
      }
    }
  }
;
  ExpressionProvider provider=new ExpressionProvider((DataSetHandle)getContainer().getModel());
  ExpressionButtonUtil.createExpressionButton(defaultValueComposite,defaultValue,provider,true,SWT.PUSH);
  ExpressionButtonUtil.initExpressionButtonControl(defaultValue,structureHandle,DataSetParameter.DEFAULT_VALUE_MEMBER);
}
Program: 69167
Project: 69167
Buggy source:
private Status updateStructureHandle(){
  try {
    structureHandle.setName(dataSetParamName.getText());
    structureHandle.setParameterDataType(ParameterPageUtil.getTypeName(dataType.getText()));
    setDirection(direction.getText());
    structureHandle.setExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER,new Expression(defaultValue.isEnabled() ? defaultValue.getText().trim() : defaultValueString,(String)defaultValue.getData(DataUIConstants.EXPR_TYPE)));
    if (isOdaDataSetHandle)     ((OdaDataSetParameterHandle)structureHandle).setParamName(Utility.findIndex(linkToSalarParameter.getItems(),linkToSalarParameter.getText()) == 0 ? null : linkToSalarParameter.getText());
  }
 catch (  SemanticException e) {
    return getMiscStatus(IStatus.ERROR,Utility.getNonNullString(e.getMessage()));
  }
  return null;
}

Fixed version (ground truth):
private Status updateStructureHandle(){
  try {
    structureHandle.setName(dataSetParamName.getText());
    structureHandle.setParameterDataType(ParameterPageUtil.getTypeName(dataType.getText()));
    setDirection(direction.getText());
    ExpressionButtonUtil.saveExpressionButtonControl(defaultValue,structureHandle,DataSetParameter.DEFAULT_VALUE_MEMBER);
    if (isOdaDataSetHandle)     ((OdaDataSetParameterHandle)structureHandle).setParamName(Utility.findIndex(linkToSalarParameter.getItems(),linkToSalarParameter.getText()) == 0 ? null : linkToSalarParameter.getText());
  }
 catch (  SemanticException e) {
    return getMiscStatus(IStatus.ERROR,Utility.getNonNullString(e.getMessage()));
  }
  return null;
}
Program: 69168
Project: 69168
Buggy source:
private void createExpressionButton(Composite composite,final Text property,String propName){
  ExpressionButton exprButton=UIUtil.createExpressionButton(composite,SWT.PUSH);
  if (handle == null) {
    handle=DesignElementFactory.getInstance(getModuleHandle()).newOdaDataSet(null);
  }
  IExpressionHelper helper=new IExpressionHelper(){
    public String getExpression(){
      if (property != null)       return property.getText();
 else       return "String_Node_Str";
    }
    public void setExpression(    String expression){
      if (property != null)       property.setText(expression);
    }
    public void notifyExpressionChangeEvent(    String oldExpression,    String newExpression){
    }
    public IExpressionProvider getExpressionProvider(){
      return new ExpressionProvider(handle);
    }
    public String getExpressionType(){
      return (String)property.getData(DataUIConstants.EXPR_TYPE);
    }
    public void setExpressionType(    String exprType){
      property.setData(DataUIConstants.EXPR_TYPE,exprType);
    }
  }
;
  helper.setExpressionType(UIUtil.getDefaultScriptType());
  exprButton.setExpressionHelper(helper);
  if (PASSWORD.equals(propName)) {
    exprButton.setExpressionButtonProvider(new ExprButtonProvider(true,property));
  }
  Expression expr=handle.getPropertyBindingExpression(propName);
  property.setData(DataUIConstants.EXPR_BUTTON,exprButton);
  property.setText((expr == null || expr.getStringExpression() == null) ? "String_Node_Str" : expr.getStringExpression());
  if (expr != null)   property.setData(DataUIConstants.EXPR_TYPE,expr.getType());
  exprButton=(ExpressionButton)property.getData(DataUIConstants.EXPR_BUTTON);
  if (exprButton != null)   exprButton.refresh();
}

Fixed version (ground truth):
private void createExpressionButton(Composite composite,final Text property,String propName){
  ExpressionButton exprButton=ExpressionButtonUtil.createExpressionButton(composite,property,new ExpressionProvider(handle),true,SWT.PUSH);
  if (PASSWORD.equals(propName)) {
    exprButton.setExpressionButtonProvider(new ExprButtonProvider(true,property));
  }
  Expression expr=handle.getPropertyBindingExpression(propName);
  property.setData(ExpressionButtonUtil.EXPR_TYPE,expr == null || expr.getType() == null ? UIUtil.getDefaultScriptType() : (String)expr.getType());
  property.setText((expr == null || expr.getStringExpression() == null) ? "String_Node_Str" : expr.getStringExpression());
  exprButton.refresh();
}
Program: 69170
Project: 69170
Buggy source:
/** 
 * A convenience methods provided to create an initialized NumberFormatSpecifier instance NOTE: Manually written
 * @return this instance
 */
public static StringFormatSpecifier create(){
  final StringFormatSpecifier sfs=AttributeFactory.eINSTANCE.createStringFormatSpecifier();
  return sfs;
}

Fixed version (ground truth):
public static StringFormatSpecifier create(String pattern){
  final StringFormatSpecifier sfs=create();
  sfs.setPattern(pattern);
  return sfs;
}
Program: 69171
Project: 69171
Buggy source:
/** 
 * Returns the background color of current style.
 * @return
 */
ColorDefinition getBackgroundColor();

Fixed version (ground truth):
/** 
 * Returns the background color of current style.
 * @return ColorDefinition
 */
ColorDefinition getBackgroundColor();
Program: 69172
Project: 69172
Buggy source:
/** 
 * Returns the padding of current style.
 * @return
 */
Insets getPadding();

Fixed version (ground truth):
/** 
 * Returns the padding of current style.
 * @return Insets
 */
Insets getPadding();
Program: 69173
Project: 69173
Buggy source:
/** 
 * Returns the color of current style.
 * @return
 */
ColorDefinition getColor();

Fixed version (ground truth):
/** 
 * Returns the color of current style.
 * @return ColorDefinition
 */
ColorDefinition getColor();
Program: 69174
Project: 69174
Buggy source:
/** 
 * Returns the font of current style.
 * @return
 */
FontDefinition getFont();

Fixed version (ground truth):
/** 
 * Returns the font of current style.
 * @return FontDefinition
 */
FontDefinition getFont();
Program: 69175
Project: 69175
Buggy source:
/** 
 * Returns the background image of current style.
 * @return
 */
Image getBackgroundImage();

Fixed version (ground truth):
/** 
 * Returns the background image of current style.
 * @return Image
 */
Image getBackgroundImage();
Program: 69176
Project: 69176
Buggy source:
/** 
 * The constructor.
 * @param src
 */
public SimpleStyle(IStyle src){
  super();
  if (src != null) {
    if (src.getFont() != null) {
      setFont(goFactory.copyOf(src.getFont()));
    }
    if (src.getColor() != null) {
      setColor(goFactory.copyOf(src.getColor()));
    }
    if (src.getBackgroundColor() != null) {
      setBackgroundColor(goFactory.copyOf(src.getBackgroundColor()));
    }
    if (src.getBackgroundImage() != null) {
      setBackgroundImage(goFactory.copyOf(src.getBackgroundImage()));
    }
    if (src.getPadding() != null) {
      setPadding(goFactory.copyOf(src.getPadding()));
    }
  }
}

Fixed version (ground truth):
/** 
 * The constructor.
 * @param src
 */
public SimpleStyle(IStyle src){
  super();
  if (src != null) {
    if (src.getFont() != null) {
      setFont(goFactory.copyOf(src.getFont()));
    }
    if (src.getColor() != null) {
      setColor(goFactory.copyOf(src.getColor()));
    }
    if (src.getBackgroundColor() != null) {
      setBackgroundColor(goFactory.copyOf(src.getBackgroundColor()));
    }
    if (src.getBackgroundImage() != null) {
      setBackgroundImage(goFactory.copyOf(src.getBackgroundImage()));
    }
    if (src.getPadding() != null) {
      setPadding(goFactory.copyOf(src.getPadding()));
    }
    if (src.getDateTimeFormat() != null) {
      setDateTimeFormat(src.getDateTimeFormat().copyInstance());
    }
    if (src.getNumberFormat() != null) {
      setNumberFormat(src.getNumberFormat().copyInstance());
    }
    if (src.getStringFormat() != null) {
      setStringFormat(src.getStringFormat().copyInstance());
    }
  }
}
Program: 69177
Project: 69177
Buggy source:
/** 
 * Returns a copy of current instance.
 * @return
 */
public SimpleStyle copy(){
  SimpleStyle ss=new SimpleStyle();
  if (font != null) {
    ss.setFont(goFactory.copyOf(font));
  }
  if (color != null) {
    ss.setColor(goFactory.copyOf(color));
  }
  if (backcolor != null) {
    ss.setBackgroundColor(goFactory.copyOf(backcolor));
  }
  if (backimage != null) {
    ss.setBackgroundImage(goFactory.copyOf(backimage));
  }
  if (padding != null) {
    ss.setPadding(goFactory.copyOf(padding));
  }
  return ss;
}

Fixed version (ground truth):
/** 
 * Returns a copy of current instance.
 * @return
 */
public SimpleStyle copy(){
  SimpleStyle ss=new SimpleStyle();
  if (font != null) {
    ss.setFont(goFactory.copyOf(font));
  }
  if (color != null) {
    ss.setColor(goFactory.copyOf(color));
  }
  if (backcolor != null) {
    ss.setBackgroundColor(goFactory.copyOf(backcolor));
  }
  if (backimage != null) {
    ss.setBackgroundImage(goFactory.copyOf(backimage));
  }
  if (padding != null) {
    ss.setPadding(goFactory.copyOf(padding));
  }
  if (dateTimeFormat != null) {
    ss.setDateTimeFormat(dateTimeFormat.copyInstance());
  }
  if (numberFormat != null) {
    ss.setNumberFormat(numberFormat.copyInstance());
  }
  if (stringFormat != null) {
    ss.setStringFormat(stringFormat.copyInstance());
  }
  return ss;
}
Program: 69180
Project: 69180
Buggy source:
public void testGetSelectionListType_none(){
  scalarDefn=(IScalarParameterDefn)paramTask.getParameterDefn("String_Node_Str");
  assertEquals("String_Node_Str",IScalarParameterDefn.SELECTION_LIST_NONE,scalarDefn.getSelectionListType());
}

Fixed version (ground truth):
public void testGetSelectionListType_none(){
  scalarDefn=(IScalarParameterDefn)paramTask.getParameterDefn("String_Node_Str");
  assertEquals("String_Node_Str",IScalarParameterDefn.SELECTION_LIST_STATIC,scalarDefn.getSelectionListType());
}
Program: 69182
Project: 69182
Buggy source:
/** 
 * Creates a status .
 * @param severity The status severity: ERROR, WARNING, INFO and OK.
 * @param message The message of the status. Applies only for ERROR, WARNING and INFO.
 */
public StatusInfo(int severity,String message){
  fStatusMessage=message;
  fSeverity=severity;
}

Fixed version (ground truth):
/** 
 * Creates a status .
 * @param pluginID the plugin id this status is associated with.
 * @param severity The status severity: ERROR, WARNING, INFO and OK.
 * @param message The message of the status. Applies only for ERROR, WARNING and INFO.
 */
public StatusInfo(String pluginID,int severity,String message){
  fPluginID=pluginID;
  fStatusMessage=message;
  fSeverity=severity;
}
Program: 69183
Project: 69183
Buggy source:
public String getPlugin(){
  return ReportPlugin.REPORT_UI;
}

Fixed version (ground truth):
public String getPlugin(){
  return fPluginID == null ? ReportPlugin.REPORT_UI : fPluginID;
}
Program: 69184
Project: 69184
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),getModel().getVersion()) > 0) {
    if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
      return;
    }
  }
  getCurrentPageInstance().doSave(monitor);
  fireDesignFileChangeEvent();
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  boolean isReselect=false;
  if (ModuleUtil.compareReportVersion(ModuleUtil.getReportVersion(),getModel().getVersion()) > 0) {
    if (!MessageDialog.openConfirm(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
      return;
    }
 else {
      isReselect=true;
    }
  }
  getCurrentPageInstance().doSave(monitor);
  fireDesignFileChangeEvent();
  if (isReselect) {
    Display.getCurrent().asyncExec(new Runnable(){
      public void run(){
        if (getActivePageInstance() instanceof GraphicalEditorWithFlyoutPalette) {
          if (((GraphicalEditorWithFlyoutPalette)getActivePageInstance()).getGraphicalViewer() != null) {
            GraphicalEditorWithFlyoutPalette editor=(GraphicalEditorWithFlyoutPalette)getActivePageInstance();
            GraphicalViewer view=editor.getGraphicalViewer();
            UIUtil.resetViewSelection(view,true);
          }
        }
      }
    }
);
  }
}
Program: 69185
Project: 69185
Buggy source:
/** 
 * Return difference in number of seconds
 * @param d1
 * @param d2
 * @return
 */
private static long diffSecond(Date d1,Date d2){
  if (d1 == null || d2 == null) {
    throw new java.lang.IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  long diff=d2.getTime() - d1.getTime();
  diff+=timeZone.getDSTSavings();
  return (new Long(diff / 1000)).longValue();
}

Fixed version (ground truth):
/** 
 * Return difference in number of seconds
 * @param d1
 * @param d2
 * @return
 */
private static long diffSecond(Date d1,Date d2){
  if (d1 == null || d2 == null) {
    throw new java.lang.IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  long diff=d2.getTime() - d1.getTime();
  if (timeZone.inDaylightTime(d1))   diff-=timeZone.getDSTSavings();
  if (timeZone.inDaylightTime(d2))   diff+=timeZone.getDSTSavings();
  return (new Long(diff / 1000)).longValue();
}
Program: 69187
Project: 69187
Buggy source:
public boolean equals(Vector other){
  return v[0] == other.v[0] && v[1] == other.v[1] && v[2] == other.v[2];
}

Fixed version (ground truth):
public boolean equals(Object other){
  if (other instanceof Vector) {
    Vector ot=(Vector)other;
    return v[0] == ot.v[0] && v[1] == ot.v[1] && v[2] == ot.v[2];
  }
 else {
    return false;
  }
}
Program: 69188
Project: 69188
Buggy source:
public Object clone(){
  return new AxisTickCoordinates(size,dStart,dEnd,dStep,isTickBetweenCategory);
}

Fixed version (ground truth):
public Object clone(){
  try {
    AxisTickCoordinates cl=(AxisTickCoordinates)super.clone();
    cl.size=this.size;
    cl.dStart=this.dStart;
    cl.dEnd=this.dEnd;
    cl.dStep=this.dStep;
    cl.isTickBetweenCategory=this.isTickBetweenCategory;
    return cl;
  }
 catch (  CloneNotSupportedException e) {
    return new AxisTickCoordinates(size,dStart,dEnd,dStep,isTickBetweenCategory);
  }
}
Program: 69192
Project: 69192
Buggy source:
@Override protected void updateDefaultsByLocale(){
  ULocale locale=getLocaleByDisplayName(localeChoicer.getText());
  if (locale == null) {
    locale=ULocale.getDefault();
  }
  String category=formatAdapter.getCategory4DisplayName(typeChoicer.getText());
  if (category.equals(DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY)) {
    String defaultPosition=FormatCurrencyNumPattern.getDefaultSymbolPosition(locale);
    boolean defaultUseSpace=FormatCurrencyNumPattern.getDefaultUsingSymbolSpace(locale);
    cUseSpace.setSelection(defaultUseSpace);
    if (defaultPosition != null) {
      cSymPosChoice.setText(defaultPosition);
    }
  }
 else   if (category.equals(DesignChoiceConstants.NUMBER_FORMAT_TYPE_PERCENT)) {
    String defaultPosition=FormatPercentNumPattern.getDefaultSymbolPosition(locale);
    if (defaultPosition != null) {
      pSymPosChoice.setText(defaultPosition);
    }
  }
}

Fixed version (ground truth):
@Override protected void updateDefaultsByLocale(){
  ULocale locale=getLocaleByDisplayName(localeChoicer.getText());
  if (locale == null) {
    locale=ULocale.getDefault();
  }
  String category=formatAdapter.getCategory4DisplayName(typeChoicer.getText());
  if (category.equals(DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY)) {
    String defaultPosition=FormatCurrencyNumPattern.getDefaultSymbolPosition(locale);
    boolean defaultUseSpace=FormatCurrencyNumPattern.getDefaultUsingSymbolSpace(locale);
    int defaultDigits=FormatCurrencyNumPattern.getDefaultFractionDigits(locale);
    cUseSpace.setSelection(defaultUseSpace);
    if (defaultPosition != null) {
      cSymPosChoice.setText(defaultPosition);
    }
    cPlacesChoice.setText(String.valueOf(defaultDigits));
  }
 else   if (category.equals(DesignChoiceConstants.NUMBER_FORMAT_TYPE_PERCENT)) {
    String defaultPosition=FormatPercentNumPattern.getDefaultSymbolPosition(locale);
    if (defaultPosition != null) {
      pSymPosChoice.setText(defaultPosition);
    }
  }
}
Program: 69193
Project: 69193
Buggy source:
/** 
 * @param parent
 * @param index
 */
private void createComboBoxCell(Composite parent,final int index){
  ControlProvider.createLabel(parent,dialogLabels[index]);
  cmbDataType=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbDataType.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  populateDataTypeComboItems();
  cmbDataType.select(Utility.findIndex(cmbDataType.getItems(),getTypeDisplayName((String)getProperty(getStructureOrHandle(),cellProperties[index]))));
  cmbDataType.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      validateSyntax();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param index
 */
private void createComboBoxCell(Composite parent,final int index){
  Label label=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(label);
  cmbDataType=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbDataType.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  populateDataTypeComboItems();
  cmbDataType.select(Utility.findIndex(cmbDataType.getItems(),getTypeDisplayName((String)getProperty(getStructureOrHandle(),cellProperties[index]))));
  cmbDataType.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      validateSyntax();
    }
  }
);
}
Program: 69195
Project: 69195
Buggy source:
/** 
 * @param parent
 * @param index
 */
private void createTextCell(Composite parent,final int index){
  firstLabel=ControlProvider.createLabel(parent,dialogLabels[index]);
  txtColumnName=ControlProvider.createText(parent,(String)getProperty(getStructureOrHandle(),cellProperties[index]));
  txtColumnName.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  columnName=txtColumnName.getText();
  txtColumnName.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      validateSyntax();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param index
 */
private void createTextCell(Composite parent,final int index){
  firstLabel=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(firstLabel);
  txtColumnName=ControlProvider.createText(parent,(String)getProperty(getStructureOrHandle(),cellProperties[index]));
  txtColumnName.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  columnName=txtColumnName.getText();
  txtColumnName.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      validateSyntax();
    }
  }
);
}