nus-yam/ex-repair huggingface dataset:
Program: 79105
Project: 79105
Buggy source:
/** 
 * get the tree item name from the tree item's object
 * @param selectedItem
 * @return
 */
public static String getTreeItemsName(TreeItem selectedItem){
  if (selectedItem == null) {
    return null;
  }
  String name="String_Node_Str";
  Object source=selectedItem.getData();
  if (source instanceof String) {
    name=(String)source;
  }
 else   if (source instanceof TableImpl) {
    TableImpl table=(TableImpl)source;
    name=table.getFullyQualifiedName();
  }
 else   if (source instanceof TableItem) {
    name=(String)((TableItem)source).getData();
  }
 else   if (source instanceof DbObject) {
    DbObject dbObject=(DbObject)source;
    name=dbObject.getName();
  }
 else   if (source instanceof Column) {
    Column column=(Column)source;
    String displayName=column.getName();
    name=column.getTableName() + "String_Node_Str" + displayName;
    String type=column.getDbType();
    displayName=displayName + "String_Node_Str" + type+ "String_Node_Str";
    if (column.getSchemaName() != null) {
      name=column.getSchemaName() + "String_Node_Str" + name;
    }
  }
  return name;
}

Fixed version (ground truth):
/** 
 * get the tree item name from the tree item's object
 * @param selectedItem
 * @return
 */
public static String getTreeItemsName(TreeItem selectedItem){
  if (selectedItem == null) {
    return null;
  }
  String name="String_Node_Str";
  Object source=selectedItem.getData();
  if (source instanceof String) {
    name=(String)source;
  }
 else   if (source instanceof TableImpl) {
    TableImpl table=(TableImpl)source;
    name=table.getFullyQualifiedName();
  }
 else   if (source instanceof TableItem) {
    name=(String)((TableItem)source).getData();
  }
 else   if (source instanceof DbObject) {
    DbObject dbObject=(DbObject)source;
    name=dbObject.getName();
  }
 else   if (source instanceof Column) {
    Column column=(Column)source;
    String displayName=column.getName();
    name=column.getTableName() + "String_Node_Str" + displayName;
    String type=column.getDbType();
    displayName=displayName + "String_Node_Str" + type+ "String_Node_Str";
    if (column.getSchemaName() != null) {
      name=column.getSchemaName() + "String_Node_Str" + name;
    }
  }
 else   if (source instanceof Procedure) {
    Procedure column=(Procedure)source;
    name=column.getProcedureName();
    if (column.getSchema() != null) {
      name=column.getSchema() + "String_Node_Str" + name;
    }
  }
  return name;
}
Program: 79108
Project: 79108
Buggy source:
/** 
 * @return count of result objects
 */
public int getCount();

Fixed version (ground truth):
/** 
 * @return count of result objects
 */
public int getCount() throws DataException ;
Program: 79109
Project: 79109
Buggy source:
public boolean next() throws DataException {
  return resultSetCache.next();
}

Fixed version (ground truth):
public boolean next() throws DataException {
  checkOpenStates();
  return resultSetCache.next();
}
Program: 79110
Project: 79110
Buggy source:
public int getCurrentIndex() throws DataException {
  return resultSetCache.getCurrentIndex();
}

Fixed version (ground truth):
public int getCurrentIndex() throws DataException {
  checkOpenStates();
  return resultSetCache.getCurrentIndex();
}
Program: 79111
Project: 79111
Buggy source:
public IResultObject getCurrentResult() throws DataException {
  return resultSetCache.getCurrentResult();
}

Fixed version (ground truth):
public IResultObject getCurrentResult() throws DataException {
  checkOpenStates();
  return resultSetCache.getCurrentResult();
}
Program: 79112
Project: 79112
Buggy source:
public IResultObject fetch() throws DataException {
  return resultSetCache.fetch();
}

Fixed version (ground truth):
public IResultObject fetch() throws DataException {
  checkOpenStates();
  return resultSetCache.fetch();
}
Program: 79113
Project: 79113
Buggy source:
public void reset() throws DataException {
  resultSetCache.reset();
}

Fixed version (ground truth):
public void reset() throws DataException {
  checkOpenStates();
  resultSetCache.reset();
}
Program: 79114
Project: 79114
Buggy source:
public int getCount(){
  return resultSetCache.getCount();
}

Fixed version (ground truth):
public int getCount() throws DataException {
  checkOpenStates();
  return resultSetCache.getCount();
}
Program: 79115
Project: 79115
Buggy source:
public void close(){
  resultSetCache.close();
  resultSetCache=null;
}

Fixed version (ground truth):
public void close(){
  if (isOpen == false)   return;
  resultSetCache.close();
  resultSetCache=null;
  isOpen=false;
}
Program: 79116
Project: 79116
Buggy source:
public void moveTo(int destIndex) throws DataException {
  resultSetCache.moveTo(destIndex);
}

Fixed version (ground truth):
public void moveTo(int destIndex) throws DataException {
  checkOpenStates();
  resultSetCache.moveTo(destIndex);
}
Program: 79117
Project: 79117
Buggy source:
private String findWord(ITextViewer viewer,int offset) throws BadLocationException {
  char ch=viewer.getDocument().getChar(offset);
  int startOffset=offset;
  if (isClosingQuoteChar(ch)) {
    startOffset--;
    char quoteChar=ch;
    if (quoteChar != '\'' || quoteChar != '"') {
      quoteChar=getOpeningQuoteChar();
    }
    for (; startOffset > viewer.getTopIndexStartOffset(); startOffset--) {
      ch=viewer.getDocument().getChar(startOffset);
      if (ch == quoteChar) {
        break;
      }
    }
  }
 else {
    while (startOffset > viewer.getTopIndexStartOffset() && Character.isLetterOrDigit(viewer.getDocument().getChar(startOffset))) {
      startOffset--;
    }
    startOffset++;
  }
  return viewer.getDocument().get(startOffset,offset - startOffset + 1);
}

Fixed version (ground truth):
private String findWord(ITextViewer viewer,int offset) throws BadLocationException {
  char ch=viewer.getDocument().getChar(offset);
  int startOffset=offset;
  if (isClosingQuoteChar(ch)) {
    startOffset--;
    char quoteChar=ch;
    if (quoteChar != '\'' || quoteChar != '"') {
      quoteChar=getOpeningQuoteChar();
    }
    for (; startOffset > viewer.getTopIndexStartOffset(); startOffset--) {
      ch=viewer.getDocument().getChar(startOffset);
      if (ch == quoteChar) {
        break;
      }
    }
  }
 else {
    while (startOffset > viewer.getTopIndexStartOffset() && viewer.getDocument().getChar(startOffset) != '.' && viewer.getDocument().getChar(startOffset) != ' ') {
      startOffset--;
    }
    startOffset++;
  }
  return viewer.getDocument().get(startOffset,offset - startOffset + 1);
}
Program: 79118
Project: 79118
Buggy source:
protected Connection connectMetadataProvider(IMetaDataProvider metadata,OdaDataSourceHandle dataSourceHandle){
  if (dataSourceHandle.getExtensionID().equals(SampleDBDriver.DATA_SOURCE_ID) && metadata instanceof JdbcMetaDataProvider) {
    String user="String_Node_Str";
    String password="String_Node_Str";
    String url=SampleDBDriver.getUrl();
    return ((JdbcMetaDataProvider)metadata).connect(user,password,url,SampleDBDriver.DRIVER_CLASS,SampleDBDriver.DATA_SOURCE_ID);
  }
 else   return super.connectMetadataProvider(metadata,dataSourceHandle);
}

Fixed version (ground truth):
protected Connection connectMetadataProvider(IMetaDataProvider metadata,OdaDataSourceHandle dataSourceHandle){
  if (dataSourceHandle.getExtensionID().equals(SampleDBDriver.DATA_SOURCE_ID) && metadata instanceof JdbcMetaDataProvider) {
    String user="String_Node_Str";
    String password="String_Node_Str";
    String url=SampleDBDriver.getUrl();
    try {
      dataSourceHandle.setProperty("String_Node_Str",SampleDBDriver.DRIVER_CLASS);
      dataSourceHandle.setProperty("String_Node_Str",url);
      dataSourceHandle.setProperty("String_Node_Str",SampleDBDriver.SAMPLE_DB_SCHEMA);
    }
 catch (    SemanticException e) {
    }
    return ((JdbcMetaDataProvider)metadata).connect(user,password,url,SampleDBDriver.DRIVER_CLASS,SampleDBDriver.DATA_SOURCE_ID);
  }
 else   return super.connectMetadataProvider(metadata,dataSourceHandle);
}
Program: 79119
Project: 79119
Buggy source:
protected Control createContents(Composite parent){
  Control control=super.createContents(parent);
  setTitle(DIALOG_TITLE);
  setMessage(PROMRT_MESSAGE);
  getShell().setText(title);
  categoryTable.setInput("String_Node_Str");
  sourceViewer.getTextWidget().setFocus();
  return control;
}

Fixed version (ground truth):
protected Control createContents(Composite parent){
  Control control=super.createContents(parent);
  setTitle(DIALOG_TITLE);
  setMessage(PROMRT_MESSAGE);
  getShell().setText(title);
  categoryTable.setInput("String_Node_Str");
  getShell().setDefaultButton(null);
  sourceViewer.getTextWidget().setFocus();
  return control;
}
Program: 79120
Project: 79120
Buggy source:
public void widgetSelected(SelectionEvent e){
  Button button=(Button)e.getSource();
  sourceViewer.getTextWidget().insert((String)button.getData());
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  Button button=(Button)e.getSource();
  insertText((String)button.getData());
}
Program: 79121
Project: 79121
Buggy source:
private void createOperatorsBar(Composite parent){
  String[] operators=provider.getOperators();
  if (operators == null || operators.length == 0) {
    return;
  }
  Composite operatorsBar=new Composite(parent,SWT.NONE);
  operatorsBar.setLayout(new GridLayout(2,false));
  operatorsBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  Label lable=new Label(operatorsBar,SWT.NONE);
  lable.setText(LABEL_OPERATORS);
  lable.setLayoutData(new GridData(70,SWT.DEFAULT));
  Composite operatorsArea=new Composite(operatorsBar,SWT.NONE);
  operatorsArea.setLayout(UIUtil.createGridLayoutWithoutMargin(operators.length,true));
  SelectionAdapter selectionAdapter=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      Button button=(Button)e.getSource();
      sourceViewer.getTextWidget().insert((String)button.getData());
    }
  }
;
  for (int i=0; i < operators.length; i++) {
    Button button=new Button(operatorsArea,SWT.PUSH);
    button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (operators[i] != IExpressionProvider.OPERATOR_SEPARATOR) {
      button.setData(operators[i]);
      String text=operators[i];
      if (text.indexOf("String_Node_Str") != -1) {
        text=text.replaceAll("String_Node_Str","String_Node_Str");
      }
      button.setText(text);
      button.addSelectionListener(selectionAdapter);
    }
 else {
      button.setVisible(false);
    }
  }
}

Fixed version (ground truth):
private void createOperatorsBar(Composite parent){
  String[] operators=provider.getOperators();
  if (operators == null || operators.length == 0) {
    return;
  }
  Composite operatorsBar=new Composite(parent,SWT.NONE);
  operatorsBar.setLayout(new GridLayout(2,false));
  operatorsBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  Label lable=new Label(operatorsBar,SWT.NONE);
  lable.setText(LABEL_OPERATORS);
  lable.setLayoutData(new GridData(70,SWT.DEFAULT));
  Composite operatorsArea=new Composite(operatorsBar,SWT.NONE);
  operatorsArea.setLayout(UIUtil.createGridLayoutWithoutMargin(operators.length,true));
  SelectionAdapter selectionAdapter=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      Button button=(Button)e.getSource();
      insertText((String)button.getData());
    }
  }
;
  for (int i=0; i < operators.length; i++) {
    Button button=new Button(operatorsArea,SWT.PUSH);
    button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (operators[i] != IExpressionProvider.OPERATOR_SEPARATOR) {
      button.setData(operators[i]);
      String text=operators[i];
      if (text.indexOf("String_Node_Str") != -1) {
        text=text.replaceAll("String_Node_Str","String_Node_Str");
      }
      button.setText(text);
      button.addSelectionListener(selectionAdapter);
    }
 else {
      button.setVisible(false);
    }
  }
}
Program: 79122
Project: 79122
Buggy source:
public void doubleClick(DoubleClickEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  if (selection.isEmpty()) {
    return;
  }
  if (event.getSource() == functionTable) {
    String insertText=provider.getInsertText(selection.getFirstElement());
    if (insertText != null) {
      sourceViewer.getTextWidget().insert(insertText);
    }
    return;
  }
}

Fixed version (ground truth):
public void doubleClick(DoubleClickEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  if (selection.isEmpty()) {
    return;
  }
  if (event.getSource() == functionTable) {
    String insertText=provider.getInsertText(selection.getFirstElement());
    if (insertText != null) {
      insertText(insertText);
    }
    return;
  }
}
Program: 79123
Project: 79123
Buggy source:
protected void okPressed(){
  expression=UIUtil.convertToModelString(sourceViewer.getTextWidget().getText(),true);
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  expression=sourceViewer.getTextWidget().getText().trim();
  super.okPressed();
}
Program: 79124
Project: 79124
Buggy source:
protected Control createButtonBar(Composite parent){
  Composite composite=(Composite)super.createButtonBar(buttonBar);
  createButton(composite,IDialogConstants.HELP_ID,IDialogConstants.HELP_LABEL,false);
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=1;
  composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
  return composite;
}

Fixed version (ground truth):
protected Control createButtonBar(Composite parent){
  Composite composite=(Composite)super.createButtonBar(buttonBar);
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=1;
  composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
  return composite;
}
Program: 79126
Project: 79126
Buggy source:
/** 
 * In serializaing data to file and deserializing it from file, metadata information is necessary to know which data type a column is, and then proper read/write method will be called. This method must be called at first when any actual read/write action is taken. Since multi thread might call DtE at the same time, an instance needs to be new to correspond to different metadata.
 * @param rsMetaData
 * @throws DataException
 */
static ResultObjectUtil newInstance(IResultClass rsMetaData){
  ResultObjectUtil instance=new ResultObjectUtil();
  int length=rsMetaData.getFieldCount();
  instance.typeArray=new Class[length];
  for (int i=0; i < length; i++) {
    try {
      instance.typeArray[i]=rsMetaData.getFieldValueClass(i + 1);
    }
 catch (    DataException e) {
    }
  }
  instance.columnCount=rsMetaData.getFieldCount();
  instance.rsMetaData=rsMetaData;
  instance.readIndex=0;
  instance.writeIndex=0;
  instance.nullObjectSet=new HashSet();
  return instance;
}

Fixed version (ground truth):
/** 
 * In serializaing data to file and deserializing it from file, metadata information is necessary to know which data type a column is, and then proper read/write method will be called. This method must be called at first when any actual read/write action is taken. Since multi thread might call DtE at the same time, an instance needs to be new to correspond to different metadata.
 * @param rsMetaData
 * @throws DataException
 */
static ResultObjectUtil newInstance(IResultClass rsMetaData){
  ResultObjectUtil instance=new ResultObjectUtil();
  int length=rsMetaData.getFieldCount();
  instance.typeArray=new Class[length];
  for (int i=0; i < length; i++) {
    try {
      instance.typeArray[i]=rsMetaData.getFieldValueClass(i + 1);
    }
 catch (    DataException e) {
    }
  }
  instance.columnCount=rsMetaData.getFieldCount();
  instance.rsMetaData=rsMetaData;
  instance.writeIndex=0;
  instance.nullObjectSet=new HashSet();
  return instance;
}
Program: 79128
Project: 79128
Buggy source:
/** 
 * Parses a dimension string.
 * @param value the dimension string to parse
 * @param localeDependent <code>ture</code> means that the string needs to be parsed in locale-dependent way.
 * @return a dimension object representing the dimension string.
 * @throws PropertyValueException if the string is not valid
 */
private static DimensionValue doParse(String value,boolean localeDependent) throws PropertyValueException {
  value=StringUtil.trimString(value);
  if (value == null)   return null;
  String units=validateUnit(value);
  int indexOfFirstLetter=indexOfUnitLetter(value);
  if (indexOfFirstLetter != -1) {
    value=value.substring(0,indexOfFirstLetter).trim();
  }
  double measure=0;
  try {
    if (localeDependent) {
      validateDecimalValue(value);
      Number number=NumberFormat.getNumberInstance(ThreadResources.getLocale()).parse(value);
      measure=number.doubleValue();
    }
 else {
      measure=Double.parseDouble(value);
    }
  }
 catch (  ParseException e) {
    throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,PropertyType.DIMENSION_TYPE);
  }
  return new DimensionValue(measure,units);
}

Fixed version (ground truth):
/** 
 * Parses a dimension string.
 * @param value the dimension string to parse
 * @param localeDependent <code>ture</code> means that the string needs to be parsed in locale-dependent way.
 * @return a dimension object representing the dimension string.
 * @throws PropertyValueException if the string is not valid
 */
private static DimensionValue doParse(String value,boolean localeDependent) throws PropertyValueException {
  value=StringUtil.trimString(value);
  if (value == null)   return null;
  String units=validateUnit(value);
  int indexOfFirstLetter=indexOfUnitLetter(value);
  if (indexOfFirstLetter != -1) {
    value=StringUtil.trimString(value.substring(0,indexOfFirstLetter));
    if (value == null)     return null;
  }
  double measure=0;
  try {
    if (localeDependent) {
      validateDecimalValue(value);
      Number number=NumberFormat.getNumberInstance(ThreadResources.getLocale()).parse(value);
      measure=number.doubleValue();
    }
 else {
      measure=Double.parseDouble(value);
    }
  }
 catch (  ParseException e) {
    throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,PropertyType.DIMENSION_TYPE);
  }
  return new DimensionValue(measure,units);
}
Program: 79129
Project: 79129
Buggy source:
/** 
 * Resolves the layout to specified rows. This is for rows in Table Header, Table Footer, Detail and Group Footer.
 * @param mappingSlot the slot information
 * @param row the table row to resolve
 * @param module the report module
 */
private static void applyLayoutOnRow(LayoutSlot mappingSlot,TableRow row,Module module){
  List cells=row.getContentsSlot();
  if (cells.size() == 0)   return;
  LayoutRow mappingRow=mappingSlot.getCurrentLayoutRow();
  for (int i=0, startCol=1; i < cells.size(); i++) {
    Cell cell=(Cell)cells.get(i);
    int colSpan=cell.getColSpan(module);
    int definedColumn=cell.getColumn(module);
    if (definedColumn != 0) {
      startCol=definedColumn;
      cell.setProperty(Cell.COLUMN_PROP,null);
    }
 else     startCol=findFillInPosition(mappingRow,startCol,colSpan);
    mappingSlot.addCell(startCol,cell.getRowSpan(module),colSpan,cell,false);
    startCol+=colSpan;
  }
}

Fixed version (ground truth):
/** 
 * Resolves the layout to specified rows. This is for rows in Table Header, Table Footer, Detail and Group Footer.
 * @param mappingSlot the slot information
 * @param row the table row to resolve
 * @param module the report module
 */
private static void applyLayoutOnRow(LayoutSlot mappingSlot,TableRow row,Module module){
  List cells=row.getContentsSlot();
  if (cells.size() == 0)   return;
  LayoutRow mappingRow=mappingSlot.getCurrentLayoutRow();
  for (int i=0, startCol=1; i < cells.size(); i++) {
    Cell cell=(Cell)cells.get(i);
    int colSpan=cell.getColSpan(module);
    int definedColumn=cell.getColumn(module);
    if (definedColumn != 0)     startCol=definedColumn;
 else     startCol=findFillInPosition(mappingRow,startCol,colSpan);
    mappingSlot.addCell(startCol,cell.getRowSpan(module),colSpan,cell,false);
    startCol+=colSpan;
  }
}
Program: 79130
Project: 79130
Buggy source:
public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  odaStatement=dataSource.prepareStatement(queryText,queryType);
  addProperties();
  addParameterHints();
  addCustomFields(odaStatement);
  addColumnHints(odaStatement);
  try {
    odaStatement.setColumnsProjection(this.projectedFields);
  }
 catch (  DataException e) {
  }
  try {
    resultMetadata=odaStatement.getMetaData();
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}

Fixed version (ground truth):
public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  odaStatement=dataSource.prepareStatement(queryText,queryType);
  addProperties();
  addParameterHints();
  addCustomFields(odaStatement);
  addColumnHints(odaStatement);
  odaStatement.setColumnsProjection(this.projectedFields);
  try {
    resultMetadata=odaStatement.getMetaData();
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}
Program: 79131
Project: 79131
Buggy source:
/** 
 * Inserts a copied column to the given column index.
 * @param columnIndex the column index
 * @param data the copied column band data
 * @return a list containing post-parsing errors. Each element in the listis <code>ErrorDetail</code>.
 * @throws SemanticException if layouts of slots are different.
 */
protected List insertAndPasteColumnBand(int columnIndex,ColumnBandData data) throws SemanticException {
  boolean canDone=canInsertAndPaste(columnIndex,data);
  if (!canDone)   throw new SemanticError(adapter.getElementHandle().getElement(),new String[]{adapter.getElementHandle().getName()},SemanticError.DESIGN_EXCEPTION_COLUMN_PASTE_FORBIDDEN);
  TableColumn column=data.getColumn();
  List cells=data.getCells();
  List originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(columnIndex));
  try {
    adapter.getModule().getActivityStack().startSlientTrans();
    pasteColumn(column,columnIndex,true);
    pasteCells(cells,originalCells,columnIndex,true);
  }
 catch (  SemanticException e) {
    adapter.getModule().getActivityStack().rollback();
    throw e;
  }
  adapter.getModule().getActivityStack().commit();
  return doPostPasteCheck(column,cells);
}

Fixed version (ground truth):
/** 
 * Inserts a copied column to the given column index.
 * @param columnIndex the column index
 * @param data the copied column band data
 * @return a list containing post-parsing errors. Each element in the listis <code>ErrorDetail</code>.
 * @throws SemanticException if layouts of slots are different.
 */
protected List insertAndPasteColumnBand(int columnIndex,ColumnBandData data) throws SemanticException {
  boolean canDone=canInsertAndPaste(columnIndex,data);
  if (!canDone)   throw new SemanticError(adapter.getElementHandle().getElement(),new String[]{adapter.getElementHandle().getName()},SemanticError.DESIGN_EXCEPTION_COLUMN_PASTE_FORBIDDEN);
  TableColumn column=data.getColumn();
  List cells=data.getCells();
  List originalCells=getCellsContextInfo(adapter.getCellsUnderColumn(columnIndex));
  try {
    adapter.getModule().getActivityStack().startTrans();
    pasteColumn(column,columnIndex,true);
    pasteCells(cells,originalCells,columnIndex,true);
  }
 catch (  SemanticException e) {
    adapter.getModule().getActivityStack().rollback();
    throw e;
  }
  adapter.getModule().getActivityStack().commit();
  return doPostPasteCheck(column,cells);
}
Program: 79133
Project: 79133
Buggy source:
/** 
 * Moves one column band from <code>sourceColumn</code> to <code>destColumn</code>.
 * @param sourceColumn the source column to shift
 * @param destColumn the target column to shift
 * @throws SemanticException
 */
protected void shiftColumnBand(int sourceColumn,int destColumn) throws SemanticException {
  ColumnBandData data=getShiftData(sourceColumn);
  int newPosn=adjustDestPosn(sourceColumn,destColumn);
  if (newPosn == -1)   return;
  if (!checkTargetColumn(sourceColumn,destColumn))   throw new SemanticError(adapter.getElementHandle().getElement(),new String[]{Integer.toString(sourceColumn),adapter.getElementHandle().getName()},SemanticError.DESIGN_EXCEPTION_COLUMN_PASTE_FORBIDDEN);
  try {
    adapter.getModule().getActivityStack().startSlientTrans();
    shiftColumn(data.getColumn(),sourceColumn,newPosn);
    shiftCells(data.getCells(),sourceColumn,newPosn);
  }
 catch (  SemanticException e) {
    adapter.getModule().getActivityStack().rollback();
    throw e;
  }
  adapter.getModule().getActivityStack().commit();
}

Fixed version (ground truth):
/** 
 * Moves one column band from <code>sourceColumn</code> to <code>destColumn</code>.
 * @param sourceColumn the source column to shift
 * @param destColumn the target column to shift
 * @throws SemanticException
 */
protected void shiftColumnBand(int sourceColumn,int destColumn) throws SemanticException {
  ColumnBandData data=getShiftData(sourceColumn);
  int newPosn=adjustDestPosn(sourceColumn,destColumn);
  if (newPosn == -1)   return;
  if (!checkTargetColumn(sourceColumn,destColumn))   throw new SemanticError(adapter.getElementHandle().getElement(),new String[]{Integer.toString(sourceColumn),adapter.getElementHandle().getName()},SemanticError.DESIGN_EXCEPTION_COLUMN_PASTE_FORBIDDEN);
  try {
    adapter.getModule().getActivityStack().startTrans();
    shiftColumn(data.getColumn(),sourceColumn,newPosn);
    shiftCells(data.getCells(),sourceColumn,newPosn);
  }
 catch (  SemanticException e) {
    adapter.getModule().getActivityStack().rollback();
    throw e;
  }
  adapter.getModule().getActivityStack().commit();
}
Program: 79134
Project: 79134
Buggy source:
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  java.sql.ResultSetMetaData resultmd=null;
  try {
    assertNotNull(callStat);
    resultmd=callStat.getMetaData();
  }
 catch (  NullPointerException e) {
    resultmd=null;
  }
catch (  SQLException e) {
  }
  IResultSetMetaData pstmtResultMetaData=null;
  if (resultmd != null) {
    pstmtResultMetaData=new ResultSetMetaData(resultmd);
  }
 else {
    IResultSet mdRs=executeQuery();
    try {
      if (mdRs != null)       pstmtResultMetaData=mdRs.getMetaData();
    }
 catch (    OdaException e) {
    }
  }
  return pstmtResultMetaData;
}

Fixed version (ground truth):
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  java.sql.ResultSetMetaData resultmd=null;
  try {
    assertNotNull(callStat);
    resultmd=callStat.getMetaData();
  }
 catch (  NullPointerException e) {
    resultmd=null;
  }
catch (  SQLException e) {
  }
  IResultSetMetaData pstmtResultMetaData=null;
  if (resultmd != null) {
    pstmtResultMetaData=new ResultSetMetaData(resultmd);
  }
 else {
    IResultSet mdRs=null;
    try {
      mdRs=executeQuery();
    }
 catch (    OdaException e) {
      mdRs=null;
    }
    try {
      if (mdRs != null)       pstmtResultMetaData=mdRs.getMetaData();
 else       pstmtResultMetaData=new SPResultSetMetaData(null);
    }
 catch (    OdaException e) {
    }
  }
  return pstmtResultMetaData;
}
Program: 79135
Project: 79135
Buggy source:
/** 
 * get Localized string by the resouce key of this item and <code>Locale</code> object in <code>context</code>
 * @param resourceKey the resource key
 * @param text the default value
 * @return the localized string if it is defined in report deign, elsereturn the default value
 */
protected String getLocalizedString(String resourceKey,String text){
  if (context.getReport() == null || resourceKey == null) {
    return text;
  }
  String ret=context.getReport().getMessage(resourceKey,context.getLocale());
  if (ret == null) {
    logger.log(Level.SEVERE,"String_Node_Str",new Object[]{resourceKey,context.getLocale().toString()});
    return text;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * get Localized string by the resouce key of this item and <code>Locale</code> object in <code>context</code>
 * @param resourceKey the resource key
 * @param text the default value
 * @return the localized string if it is defined in report deign, elsereturn the default value
 */
protected String getLocalizedString(String resourceKey,String text){
  if (context.getReport() == null || resourceKey == null) {
    return text;
  }
  String ret=context.getReport().getMessage(resourceKey,context.getLocale());
  if (ret == null || "String_Node_Str".equals(ret)) {
    logger.log(Level.SEVERE,"String_Node_Str",new Object[]{resourceKey,context.getLocale().toString()});
    return text;
  }
  return ret;
}
Program: 79136
Project: 79136
Buggy source:
public boolean process(IResultObject resultObject) throws DataException {
}

Fixed version (ground truth):
public boolean process(IResultObject resultObject,int rowIndex) throws DataException {
}
Program: 79137
Project: 79137
Buggy source:
public boolean process(IResultObject row) throws DataException {
  logger.entering(FilterByRow.class.getName(),"String_Node_Str");
  Context cx=Context.enter();
  try {
    boolean isAccepted=true;
    Iterator filterIt=filters.iterator();
    scriptObj.setRowObject(row,false);
    while (filterIt.hasNext()) {
      IFilterDefinition filter=(IFilterDefinition)filterIt.next();
      IBaseExpression expr=filter.getExpression();
      Object result=ScriptEvalUtil.evalExpr(expr,cx,scope,"String_Node_Str",0);
      if (result == null) {
        Object info=null;
        if (expr instanceof IScriptExpression)         info=((IScriptExpression)expr).getText();
 else         info=expr;
        throw new DataException(ResourceConstants.INVALID_EXPRESSION_IN_FILTER,info);
      }
      try {
        if (DataTypeUtil.toBoolean(result).booleanValue() == false) {
          isAccepted=false;
          break;
        }
      }
 catch (      BirtException e) {
        DataException e1=new DataException(ResourceConstants.DATATYPEUTIL_ERROR,e);
        logger.logp(Level.FINE,FilterByRow.class.getName(),"String_Node_Str","String_Node_Str",e1);
        throw e1;
      }
    }
    return isAccepted;
  }
  finally {
    Context.exit();
    logger.exiting(FilterByRow.class.getName(),"String_Node_Str");
  }
}

Fixed version (ground truth):
public boolean process(IResultObject row,int rowIndex) throws DataException {
  logger.entering(FilterByRow.class.getName(),"String_Node_Str");
  Context cx=Context.enter();
  try {
    boolean isAccepted=true;
    Iterator filterIt=filters.iterator();
    scriptObj.setRowObject(row,false);
    scriptObj.setCurrentRowIndex(rowIndex);
    while (filterIt.hasNext()) {
      IFilterDefinition filter=(IFilterDefinition)filterIt.next();
      IBaseExpression expr=filter.getExpression();
      Object result=ScriptEvalUtil.evalExpr(expr,cx,scope,"String_Node_Str",0);
      if (result == null) {
        Object info=null;
        if (expr instanceof IScriptExpression)         info=((IScriptExpression)expr).getText();
 else         info=expr;
        throw new DataException(ResourceConstants.INVALID_EXPRESSION_IN_FILTER,info);
      }
      try {
        if (DataTypeUtil.toBoolean(result).booleanValue() == false) {
          isAccepted=false;
          break;
        }
      }
 catch (      BirtException e) {
        DataException e1=new DataException(ResourceConstants.DATATYPEUTIL_ERROR,e);
        logger.logp(Level.FINE,FilterByRow.class.getName(),"String_Node_Str","String_Node_Str",e1);
        throw e1;
      }
    }
    return isAccepted;
  }
  finally {
    Context.exit();
    logger.exiting(FilterByRow.class.getName(),"String_Node_Str");
  }
}
Program: 79138
Project: 79138
Buggy source:
/** 
 * Process the provided result object. This method may decide to exclude  this object from the result set by returning false.  This method may modify the object by setting custom field values.
 * @return true  if resultObject should be accepted false if resultObject should be excluded
 * @throws DataException
 */
public boolean process(IResultObject resultObject) throws DataException ;

Fixed version (ground truth):
/** 
 * Process the provided result object. This method may decide to exclude  this object from the result set by returning false.  This method may modify the object by setting custom field values.
 * @return true  if resultObject should be accepted false if resultObject should be excluded
 * @throws DataException
 */
public boolean process(IResultObject resultObject,int rowIndex) throws DataException ;
Program: 79139
Project: 79139
Buggy source:
/** 
 * Gets a named property
 */
public Object get(String name,Scriptable start){
  logger.entering(JSRowObject.class.getName(),"String_Node_Str",name);
  if (name.equals(DATA_SET)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str",dataSet.getScriptable());
    return dataSet.getScriptable();
  }
 else   if (name.equals(COLUMN_MD)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str",getColumnMetadataScriptable());
    return getColumnMetadataScriptable();
  }
 else   if (name.equals(ROW_POSITION)) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.exiting(JSRowObject.class.getName(),"String_Node_Str",new Integer(resultSet.getCurrentResultIndex()));
      return new Integer(resultSet.getCurrentResultIndex());
    }
 catch (    DataException e) {
      logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    }
  }
  try {
    IResultObject obj=this.getResultObject();
    if (obj != null) {
      if (logger.isLoggable(Level.FINER))       logger.exiting(JSRowObject.class.getName(),"String_Node_Str",obj.getFieldValue(name));
      return obj.getFieldValue(name);
    }
  }
 catch (  DataException e) {
    logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    return new DataExceptionMocker(e);
  }
  if (logger.isLoggable(Level.FINER))   logger.exiting(JSRowObject.class.getName(),"String_Node_Str",super.get(name,start));
  return super.get(name,start);
}

Fixed version (ground truth):
/** 
 * Gets a named property
 */
public Object get(String name,Scriptable start){
  logger.entering(JSRowObject.class.getName(),"String_Node_Str",name);
  if (name.equals(DATA_SET)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str",dataSet.getScriptable());
    return dataSet.getScriptable();
  }
 else   if (name.equals(COLUMN_MD)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str",getColumnMetadataScriptable());
    return getColumnMetadataScriptable();
  }
 else   if (name.equals(ROW_POSITION)) {
    try {
      return getCurrentRowIndex();
    }
 catch (    DataException e) {
      logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    }
  }
  try {
    IResultObject obj=this.getResultObject();
    if (obj != null) {
      if (logger.isLoggable(Level.FINER))       logger.exiting(JSRowObject.class.getName(),"String_Node_Str",obj.getFieldValue(name));
      return obj.getFieldValue(name);
    }
  }
 catch (  DataException e) {
    logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    return new DataExceptionMocker(e);
  }
  if (logger.isLoggable(Level.FINER))   logger.exiting(JSRowObject.class.getName(),"String_Node_Str",super.get(name,start));
  return super.get(name,start);
}
Program: 79140
Project: 79140
Buggy source:
/** 
 * @see org.eclipse.birt.data.engine.odi.IResultObjectEvent#process(org.eclipse.birt.data.engine.odi.IResultObject)
 */
public boolean process(IResultObject resultObject) throws DataException {
  rowObject.setRowObject(resultObject,true);
  Context cx=Context.enter();
  try {
    ScriptEvalUtil.evaluateJSAsMethod(cx,scope,script,"String_Node_Str",0);
  }
  finally {
    Context.exit();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.birt.data.engine.odi.IResultObjectEvent#process(org.eclipse.birt.data.engine.odi.IResultObject)
 */
public boolean process(IResultObject resultObject,int rowIndex) throws DataException {
  rowObject.setRowObject(resultObject,true);
  rowObject.setCurrentRowIndex(rowIndex);
  Context cx=Context.enter();
  try {
    ScriptEvalUtil.evaluateJSAsMethod(cx,scope,script,"String_Node_Str",0);
  }
  finally {
    Context.exit();
  }
  return true;
}
Program: 79141
Project: 79141
Buggy source:
private void prepareExecution(IQueryResults outerRts,Scriptable targetScope) throws DataException {
  if (isPrepared)   return;
  dataSource=findDataSource();
  if (targetScope == null) {
    if (this.dataSource != null) {
      dataSource.setScope(engine.getSharedScope());
      this.scope=DataEngineImpl.createSubscope(this.dataSource.getScriptable());
    }
 else     this.scope=DataEngineImpl.createSubscope(engine.getSharedScope());
  }
 else {
    if (this.dataSource != null) {
      dataSource.setScope(targetScope);
      this.scope=DataEngineImpl.createSubscope(this.dataSource.getScriptable());
    }
 else     this.scope=targetScope;
  }
  openDataSource();
  this.outerResults=outerRts;
  dataSet=newDataSetRuntime();
  rowObject=new JSRowObject(dataSet);
  this.scope.put("String_Node_Str",this.scope,rowObject);
  if (dataSet != null) {
    dataSet.beforeOpen();
  }
  odiQuery=createOdiQuery();
  populateOdiQuery();
  prepareOdiQuery();
  isPrepared=true;
}

Fixed version (ground truth):
private void prepareExecution(IQueryResults outerRts,Scriptable targetScope) throws DataException {
  if (isPrepared)   return;
  dataSource=findDataSource();
  if (targetScope == null) {
    if (this.dataSource != null) {
      dataSource.setScope(engine.getSharedScope());
      this.scope=DataEngineImpl.createSubscope(this.dataSource.getScriptable());
    }
 else     this.scope=DataEngineImpl.createSubscope(engine.getSharedScope());
  }
 else {
    if (this.dataSource != null) {
      dataSource.setScope(createSubscope(targetScope));
      this.scope=createSubscope(this.dataSource.getScriptable());
    }
 else     this.scope=targetScope;
  }
  openDataSource();
  this.outerResults=outerRts;
  dataSet=newDataSetRuntime();
  rowObject=new JSRowObject(dataSet);
  this.scope.put("String_Node_Str",this.scope,rowObject);
  if (dataSet != null) {
    dataSet.beforeOpen();
  }
  odiQuery=createOdiQuery();
  populateOdiQuery();
  prepareOdiQuery();
  isPrepared=true;
}
Program: 79142
Project: 79142
Buggy source:
/** 
 * Gets a ROM Script DataSource object wrapper for this object
 */
public Scriptable getScriptable(){
  if (jsObject == null) {
    jsObject=new JSDataSource(this,dataEngine.getSharedScope());
  }
  return jsObject;
}

Fixed version (ground truth):
/** 
 * Gets a ROM Script DataSource object wrapper for this object
 */
public Scriptable getScriptable(){
  assert(this.scope != null);
  if (jsObject == null) {
    jsObject=new JSDataSource(this,this.scope);
  }
  return jsObject;
}
Program: 79143
Project: 79143
Buggy source:
/** 
 * Creates and/or opens the required data source 
 */
protected void openDataSource() throws DataException {
}

Fixed version (ground truth):
/** 
 * Open the required DataSource. This method should be called after "dataSource" is initialized by findDataSource() method.
 * @throws DataException
 */
protected void openDataSource() throws DataException {
}
Program: 79144
Project: 79144
Buggy source:
/** 
 * Return the QueryResults. But the execution of query would be deferred 
 * @param outerResults If query is nested within another query, this is the outer query's query result handle.
 * @param scope The ElementState object for the report item using the query; this acts as the JS scope for evaluating script expressions.
 */
protected QueryResults doPrepare(IQueryResults outerResults,Scriptable scope) throws DataException {
  if (this.queryDefn == null) {
    DataException e=new DataException(ResourceConstants.PREPARED_QUERY_CLOSED);
    logger.logp(Level.WARNING,PreparedQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  Executor executor=newExecutor();
  if (scope == null) {
    scope=DataEngineImpl.createSubscope(getDataEngine().getSharedScope());
  }
  logger.finer("String_Node_Str");
  executor.prepareExecution(outerResults,scope);
  logger.finer("String_Node_Str");
  return new QueryResults(getDataSourceQuery(),this,executor);
}

Fixed version (ground truth):
/** 
 * Return the QueryResults. But the execution of query would be deferred 
 * @param outerResults If query is nested within another query, this is the outer query's query result handle.
 * @param scope The ElementState object for the report item using the query; this acts as the JS scope for evaluating script expressions.
 */
protected QueryResults doPrepare(IQueryResults outerResults,Scriptable scope) throws DataException {
  if (this.queryDefn == null) {
    DataException e=new DataException(ResourceConstants.PREPARED_QUERY_CLOSED);
    logger.logp(Level.WARNING,PreparedQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  Executor executor=newExecutor();
  logger.finer("String_Node_Str");
  executor.prepareExecution(outerResults,scope);
  logger.finer("String_Node_Str");
  return new QueryResults(getDataSourceQuery(),this,executor);
}
Program: 79145
Project: 79145
Buggy source:
private void prepareExecution(IQueryResults outerRts,Scriptable scope) throws DataException {
}

Fixed version (ground truth):
private void prepareExecution(IQueryResults outerRts,Scriptable targetScope) throws DataException {
  if (isPrepared)   return;
  dataSource=findDataSource();
  if (targetScope == null) {
    if (this.dataSource != null) {
      dataSource.setScope(engine.getSharedScope());
      this.scope=DataEngineImpl.createSubscope(this.dataSource.getScriptable());
    }
 else     this.scope=DataEngineImpl.createSubscope(engine.getSharedScope());
  }
 else {
    if (this.dataSource != null) {
      dataSource.setScope(targetScope);
      this.scope=DataEngineImpl.createSubscope(this.dataSource.getScriptable());
    }
 else     this.scope=targetScope;
  }
  openDataSource();
  this.outerResults=outerRts;
  dataSet=newDataSetRuntime();
  rowObject=new JSRowObject(dataSet);
  this.scope.put("String_Node_Str",this.scope,rowObject);
  if (dataSet != null) {
    dataSet.beforeOpen();
  }
  odiQuery=createOdiQuery();
  populateOdiQuery();
  prepareOdiQuery();
  isPrepared=true;
}
Program: 79146
Project: 79146
Buggy source:
/** 
 * Selects rows
 * @param numbers
 */
public void selectRow(int[] numbers){
  if (numbers == null || numbers.length == 0) {
    return;
  }
  ArrayList list=new ArrayList();
  int size=numbers.length;
  int height=0;
  int minRownumber=numbers[0];
  for (int i=0; i < size; i++) {
    if (minRownumber > numbers[i]) {
      minRownumber=numbers[i];
    }
    height=height + TableUtil.caleVisualHeight(this,getRow(numbers[i]));
    list.add(new DummyRowEditPart(getRow(numbers[i])));
  }
  for (int i=0; i < size; i++) {
    int columnNumber=getTableAdapter().getColumnCount();
    for (int j=0; j < columnNumber; j++) {
      TableCellEditPart part=getCell(numbers[i],j + 1);
      if (part != null) {
        list.add(part);
      }
    }
  }
  int y=TableUtil.caleY(this,minRownumber);
  Rectangle rect=new Rectangle(0,y,getFigure().getBounds().width - (getFigure().getInsets().left + getFigure().getInsets().right),height);
  setSelectRowAndColumnRect(rect);
  getViewer().setSelection(new StructuredSelection(list));
  setSelectRowAndColumnRect(null);
}

Fixed version (ground truth):
/** 
 * Selects rows
 * @param numbers
 */
public void selectRow(int[] numbers){
  if (numbers == null || numbers.length == 0) {
    return;
  }
  ArrayList list=new ArrayList();
  int size=numbers.length;
  int height=0;
  int minRownumber=numbers[0];
  for (int i=0; i < size; i++) {
    if (minRownumber > numbers[i]) {
      minRownumber=numbers[i];
    }
    height=height + TableUtil.caleVisualHeight(this,getRow(numbers[i]));
    list.add(new DummyRowEditPart(getRow(numbers[i])));
  }
  for (int i=0; i < size; i++) {
    int columnNumber=getTableAdapter().getColumnCount();
    for (int j=0; j < columnNumber; j++) {
      TableCellEditPart part=getCell(numbers[i],j + 1);
      if (part != null) {
        list.add(part);
      }
    }
  }
  int y=TableUtil.caleY(this,minRownumber);
  Rectangle rect=new Rectangle(0,y,TableUtil.getTableContentsWidth(this),height);
  setSelectRowAndColumnRect(rect);
  getViewer().setSelection(new StructuredSelection(list));
  setSelectRowAndColumnRect(null);
}
Program: 79147
Project: 79147
Buggy source:
/** 
 * Selects the columns
 * @param numbers
 */
public void selectColumn(int[] numbers){
  if (numbers == null || numbers.length == 0) {
    return;
  }
  ArrayList list=new ArrayList();
  int size=numbers.length;
  int width=0;
  int minColumnnumber=numbers[0];
  for (int i=0; i < size; i++) {
    if (minColumnnumber > numbers[i]) {
      minColumnnumber=numbers[i];
    }
    width=width + TableUtil.caleVisualWidth(this,getColumn(numbers[i]));
    list.add(new DummyColumnEditPart(getColumn(numbers[i])));
  }
  for (int i=0; i < size; i++) {
    int rowNumber=getTableAdapter().getRowCount();
    for (int j=0; j < rowNumber; j++) {
      TableCellEditPart part=getCell(j + 1,numbers[i]);
      if (part != null) {
        list.add(part);
      }
    }
  }
  int x=TableUtil.caleX(this,minColumnnumber);
  Rectangle rect=new Rectangle(x,0,width,getFigure().getBounds().height - (getFigure().getInsets().top + getFigure().getInsets().bottom));
  setSelectRowAndColumnRect(rect);
  getViewer().setSelection(new StructuredSelection(list));
  setSelectRowAndColumnRect(null);
}

Fixed version (ground truth):
/** 
 * Selects the columns
 * @param numbers
 */
public void selectColumn(int[] numbers){
  if (numbers == null || numbers.length == 0) {
    return;
  }
  ArrayList list=new ArrayList();
  int size=numbers.length;
  int width=0;
  int minColumnnumber=numbers[0];
  for (int i=0; i < size; i++) {
    if (minColumnnumber > numbers[i]) {
      minColumnnumber=numbers[i];
    }
    width=width + TableUtil.caleVisualWidth(this,getColumn(numbers[i]));
    list.add(new DummyColumnEditPart(getColumn(numbers[i])));
  }
  for (int i=0; i < size; i++) {
    int rowNumber=getTableAdapter().getRowCount();
    for (int j=0; j < rowNumber; j++) {
      TableCellEditPart part=getCell(j + 1,numbers[i]);
      if (part != null) {
        list.add(part);
      }
    }
  }
  int x=TableUtil.caleX(this,minColumnnumber);
  Rectangle rect=new Rectangle(x,0,width,TableUtil.getTableContentsHeight(this));
  setSelectRowAndColumnRect(rect);
  getViewer().setSelection(new StructuredSelection(list));
  setSelectRowAndColumnRect(null);
}
Program: 79148
Project: 79148
Buggy source:
public void run(){
  if (getOwner().getViewer().getControl().isVisible()) {
    if (getOwner().getViewer() instanceof DeferredGraphicalViewer)     ((DeferredGraphicalViewer)getOwner().getViewer()).setSelection(new StructuredSelection(list),false);
  }
}

Fixed version (ground truth):
public void run(){
  UIUtil.resetViewSelection(getOwner().getViewer(),false);
}