nus-yam/ex-repair huggingface dataset:
Program: 66400
Project: 66400
Buggy source:
/** 
 * @param aggrIndex
 * @throws OLAPException
 * @throws IOException
 * @throws DataException
 */
public boolean synchronizedWithEdge(int aggrIndex,String aggrName,Map valueMap) throws OLAPException, IOException, DataException {
  IAggregationResultSet rs=this.resultSet.getMeasureResult()[aggrIndex].getQueryResultSet();
  if (rs == null || rs.length() <= 0)   return false;
  if (valueMap == null)   return true;
  CalculatedMember member=this.view.getAggregationRegisterTable().getCalculatedMember(aggrName);
  List memberList=member.getCubeAggrDefn().getAggrLevelsInAggregationResult();
  if (Arrays.deepEquals(rs.getAllLevels(),member.getCubeAggrDefn().getAggrLevelsInDefinition().toArray())) {
    return findValueMatcher(rs,memberList,valueMap,aggrIndex);
  }
 else {
    return findValueMatcherOneByOne(rs,memberList,valueMap,aggrIndex);
  }
}

Fixed version (ground truth):
/** 
 * @param aggrIndex
 * @throws OLAPException
 * @throws IOException
 * @throws DataException
 */
private boolean synchronizedWithEdge(int index,IAggregationResultSet rs,String aggrName,Map valueMap) throws OLAPException, IOException, DataException {
  if (rs == null || rs.length() <= 0)   return false;
  if (valueMap == null)   return true;
  List memberList=Arrays.asList(rs.getAllLevels());
  CalculatedMember member=this.view.getAggregationRegisterTable().getCalculatedMember(aggrName);
  if (member != null && member.getCubeAggrDefn() instanceof CubeRunningNestAggrDefn) {
    return findValueMatcherOneByOne(rs,memberList,valueMap,index);
  }
 else {
    return findValueMatcher(rs,memberList,valueMap,index);
  }
}
Program: 66401
Project: 66401
Buggy source:
public int getAggregationIndex(String name) throws IOException {
  int index=rs1.getAggregationIndex(name);
  if (index < 0) {
    int index2=rs2.getAggregationIndex(name);
    if (index2 >= 0) {
      index+=rs1.getAggregationCount();
    }
  }
  return index;
}

Fixed version (ground truth):
public int getAggregationIndex(String name) throws IOException {
  int index=rs1.getAggregationIndex(name);
  if (index < 0) {
    index=rs2.getAggregationIndex(name);
    if (index >= 0) {
      index+=rs1.getAggregationCount();
    }
  }
  return index;
}
Program: 66402
Project: 66402
Buggy source:
public static MemberTreeNode[] createMinute(){
  MemberTreeNode[] nodes=new MemberTreeNode[60];
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createMinute(){
  MemberTreeNode[] nodes=new MemberTreeNode[60];
  calendar.clear();
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.MINUTE,i);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66403
Project: 66403
Buggy source:
public static MemberTreeNode[] createSecond(){
  MemberTreeNode[] nodes=new MemberTreeNode[60];
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createSecond(){
  MemberTreeNode[] nodes=new MemberTreeNode[60];
  calendar.clear();
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.SECOND,i);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66404
Project: 66404
Buggy source:
public static MemberTreeNode[] createQuarterMonthNode(int quarter){
  MemberTreeNode[] nodes=new MemberTreeNode[3];
switch (quarter) {
case 0:
    for (int i=1; i <= nodes.length; i++) {
      Member member=new Member();
      member.setKeyValues(new Object[]{Integer.valueOf(i)});
      nodes[i - 1]=new MemberTreeNode(member);
    }
  break;
case 1:
for (int i=4; i <= nodes.length + 3; i++) {
  Member member=new Member();
  member.setKeyValues(new Object[]{Integer.valueOf(i)});
  nodes[i - 4]=new MemberTreeNode(member);
}
break;
case 2:
for (int i=7; i <= nodes.length + 6; i++) {
Member member=new Member();
member.setKeyValues(new Object[]{Integer.valueOf(i)});
nodes[i - 7]=new MemberTreeNode(member);
}
break;
case 3:
for (int i=10; i <= nodes.length + 9; i++) {
Member member=new Member();
member.setKeyValues(new Object[]{Integer.valueOf(i)});
nodes[i - 10]=new MemberTreeNode(member);
}
break;
}
return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createQuarterMonthNode(int quarter){
  MemberTreeNode[] nodes=new MemberTreeNode[3];
  calendar.clear();
switch (quarter) {
case 0:
    for (int i=1; i <= nodes.length; i++) {
      Member member=new Member();
      member.setKeyValues(new Object[]{Integer.valueOf(i)});
      calendar.set(Calendar.MONTH,i - 1);
      member.setAttributes(new Object[]{calendar.getTime()});
      nodes[i - 1]=new MemberTreeNode(member);
    }
  break;
case 1:
for (int i=4; i <= nodes.length + 3; i++) {
  Member member=new Member();
  member.setKeyValues(new Object[]{Integer.valueOf(i)});
  calendar.set(Calendar.MONTH,i - 1);
  member.setAttributes(new Object[]{calendar.getTime()});
  nodes[i - 4]=new MemberTreeNode(member);
}
break;
case 2:
for (int i=7; i <= nodes.length + 6; i++) {
Member member=new Member();
member.setKeyValues(new Object[]{Integer.valueOf(i)});
calendar.set(Calendar.MONTH,i - 1);
member.setAttributes(new Object[]{calendar.getTime()});
;
nodes[i - 7]=new MemberTreeNode(member);
}
break;
case 3:
for (int i=10; i <= nodes.length + 9; i++) {
Member member=new Member();
member.setKeyValues(new Object[]{Integer.valueOf(i)});
calendar.set(Calendar.MONTH,i - 1);
member.setAttributes(new Object[]{calendar.getTime()});
nodes[i - 10]=new MemberTreeNode(member);
}
break;
}
return nodes;
}
Program: 66406
Project: 66406
Buggy source:
public static MemberTreeNode[] createMonthNode(){
  MemberTreeNode[] nodes=new MemberTreeNode[12];
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createMonthNode(){
  MemberTreeNode[] nodes=new MemberTreeNode[12];
  calendar.clear();
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.MONTH,i - 1);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66407
Project: 66407
Buggy source:
public static MemberTreeNode[] createDayOfWeek(){
  MemberTreeNode[] nodes=new MemberTreeNode[7];
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createDayOfWeek(){
  MemberTreeNode[] nodes=new MemberTreeNode[7];
  calendar.clear();
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.DAY_OF_WEEK,i);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66409
Project: 66409
Buggy source:
public static MemberTreeNode[] createDayOfYearNode(int year){
  int count=0;
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
    count=366;
  }
 else {
    count=365;
  }
  MemberTreeNode[] nodes=new MemberTreeNode[count];
  for (int i=1; i <= count; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createDayOfYearNode(int year){
  calendar.clear();
  int count=0;
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
    count=366;
  }
 else {
    count=365;
  }
  MemberTreeNode[] nodes=new MemberTreeNode[count];
  for (int i=1; i <= count; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.DAY_OF_YEAR,i);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66410
Project: 66410
Buggy source:
public static MemberTreeNode[] createHour(){
  MemberTreeNode[] nodes=new MemberTreeNode[24];
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createHour(){
  MemberTreeNode[] nodes=new MemberTreeNode[24];
  calendar.clear();
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.HOUR_OF_DAY,i);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66411
Project: 66411
Buggy source:
public static MemberTreeNode[] createQuarterNode(){
  MemberTreeNode[] nodes=new MemberTreeNode[4];
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}

Fixed version (ground truth):
private static MemberTreeNode[] createQuarterNode(){
  MemberTreeNode[] nodes=new MemberTreeNode[4];
  calendar.clear();
  for (int i=1; i <= nodes.length; i++) {
    Member member=new Member();
    member.setKeyValues(new Object[]{Integer.valueOf(i)});
    calendar.set(Calendar.MONTH,(i - 1) * 3);
    member.setAttributes(new Object[]{calendar.getTime()});
    nodes[i - 1]=new MemberTreeNode(member);
  }
  return nodes;
}
Program: 66415
Project: 66415
Buggy source:
static private boolean contains(String formats,String format){
  int index=formats.indexOf(format);
  if (index != -1) {
    if (index > 0) {
      if (formats.charAt(index - 1) != ',') {
        return false;
      }
    }
    int lastIndex=index + format.length();
    if (lastIndex < formats.length()) {
      if (formats.charAt(lastIndex) != ',') {
        return false;
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
static private boolean contains(String formats,String format){
  int index=0;
  int lastIndex=0;
  do {
    index=formats.indexOf(format,lastIndex);
    if (index == -1) {
      break;
    }
    lastIndex=index + format.length();
    if (index > 0) {
      if (formats.charAt(index - 1) != ',') {
        continue;
      }
    }
    if (lastIndex < formats.length()) {
      if (formats.charAt(lastIndex) != ',') {
        continue;
      }
    }
    return true;
  }
 while (index != -1);
  return false;
}
Program: 66417
Project: 66417
Buggy source:
/** 
 * @throws DataException
 */
private void prepareCurrentRow() throws DataException {
  clear();
  this.rdSaveHelper.doSaveBasic();
  if (!this.isEmpty()) {
    if (needCache()) {
      bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap,true);
      try {
        saveCurrentRow();
      }
 catch (      IOException e) {
        try {
          this.metaOutputStream.close();
          this.rowOutputStream.close();
        }
 catch (        IOException ce) {
        }
        throw new DataException(ResourceConstants.WRITE_CACHE_TEMPFILE_ERROR,e);
      }
catch (      BirtException e) {
        throw DataException.wrap(e);
      }
    }
 else {
      if (this.getRdSaveHelper().isSummaryQuery())       bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap,true);
 else       bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void prepareCurrentRow() throws DataException {
  clear();
  this.rdSaveHelper.doSaveBasic();
  if (needCache() && !this.isEmpty()) {
    bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap,true);
    try {
      saveCurrentRow();
    }
 catch (    IOException e) {
      try {
        this.metaOutputStream.close();
        this.rowOutputStream.close();
      }
 catch (      IOException ce) {
      }
      throw new DataException(ResourceConstants.WRITE_CACHE_TEMPFILE_ERROR,e);
    }
catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
 else {
    if (this.getRdSaveHelper().isSummaryQuery())     bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap,true);
 else     bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap,false);
  }
}
Program: 66420
Project: 66420
Buggy source:
public void closeReportletQueries() throws EngineException {
  for (  Query query : queries) {
    if (query.rsets != null) {
      for (      IBaseResultSet rset : query.rsets) {
        rset.close();
      }
    }
  }
  queries.clear();
}

Fixed version (ground truth):
public void closeReportletQueries() throws EngineException {
  for (  Query query : queries) {
    if (query.rsets != null) {
      for (      IBaseResultSet rset : query.rsets) {
        if (rset != null)         rset.close();
      }
    }
  }
  queries.clear();
}
Program: 66421
Project: 66421
Buggy source:
protected void doExecute() throws BirtException {
  IReportItemExecutor executor=bodyExecutor;
  IContent content=null;
  while (executor.hasNextChild()) {
    executor=executor.getNextChild();
    parentExecutors.add(executor);
    content=executor.execute();
    DocumentExtension docExt=(DocumentExtension)content.getExtension(IContent.DOCUMENT_EXTENSION);
{
      if (docExt != null) {
        if (docExt.getIndex() == offset) {
          if (content instanceof TableGroupContent || content instanceof RowContent || content instanceof CellContent|| content instanceof AbstractBandContent) {
            do {
              content=(IContent)content.getParent();
              WrappedExecutor parentExecutor=new WrappedExecutor(executor.getParent(),content,executor);
              executor=parentExecutor;
            }
 while (!(content instanceof TableContent));
          }
          bodyContent=content;
          childExecutor=executor;
          break;
        }
      }
    }
  }
  IStyle cs=bodyContent.getComputedStyle();
  IStyle is=bodyContent.getInlineStyle();
  CSSEngine engine=bodyContent.getCSSEngine();
  IStyle mergedStyle=(is != null ? is : new StyleDeclaration(engine));
  for (int i=0; i < StyleConstants.NUMBER_OF_STYLE; i++) {
    if (isNullValue(mergedStyle.getProperty(i)) && engine.isInheritedProperty(i)) {
      mergedStyle.setProperty(i,cs.getProperty(i));
    }
  }
  bodyContent.setInlineStyle(mergedStyle);
}

Fixed version (ground truth):
protected void doExecute() throws BirtException {
  IReportItemExecutor executor=bodyExecutor;
  IContent content=null;
  executor.execute();
  while (executor.hasNextChild()) {
    executor=executor.getNextChild();
    parentExecutors.add(executor);
    content=executor.execute();
    DocumentExtension docExt=(DocumentExtension)content.getExtension(IContent.DOCUMENT_EXTENSION);
{
      if (docExt != null) {
        if (docExt.getIndex() == offset) {
          if (content instanceof TableGroupContent || content instanceof RowContent || content instanceof CellContent|| content instanceof AbstractBandContent) {
            do {
              content=(IContent)content.getParent();
              WrappedExecutor parentExecutor=new WrappedExecutor(executor.getParent(),content,executor);
              executor=parentExecutor;
            }
 while (!(content instanceof TableContent));
          }
          bodyContent=content;
          childExecutor=executor;
          break;
        }
      }
    }
  }
  IStyle cs=bodyContent.getComputedStyle();
  IStyle is=bodyContent.getInlineStyle();
  CSSEngine engine=bodyContent.getCSSEngine();
  IStyle mergedStyle=(is != null ? is : new StyleDeclaration(engine));
  for (int i=0; i < StyleConstants.NUMBER_OF_STYLE; i++) {
    if (isNullValue(mergedStyle.getProperty(i)) && engine.isInheritedProperty(i)) {
      mergedStyle.setProperty(i,cs.getProperty(i));
    }
  }
  bodyContent.setInlineStyle(mergedStyle);
}
Program: 66422
Project: 66422
Buggy source:
public Object doClone(CopyPolicy policy) throws CloneNotSupportedException {
  TableItem clonedTable=(TableItem)super.doClone(policy);
  clonedTable.refreshRenderModel(table.getTable().getModule());
  return clonedTable;
}

Fixed version (ground truth):
public Object doClone(CopyPolicy policy) throws CloneNotSupportedException {
  TableItem clonedTable=(TableItem)super.doClone(policy);
  clonedTable.refreshRenderModel(table.getTable().getModule());
  clonedTable.cachedColumn=null;
  return clonedTable;
}
Program: 66423
Project: 66423
Buggy source:
public IEditorInput createEditorInput(Object file){
  if (file instanceof File) {
    File handle=(File)file;
    String fileName=handle.getAbsolutePath();
    IWorkspace space=ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root=space.getRoot();
    try {
      IFile[] resources=root.findFilesForLocationURI(new URL("String_Node_Str" + fileName).toURI());
      if (resources != null && resources.length > 0) {
        IEditorInput input=new FileEditorInput(resources[0]);
        return input;
      }
 else {
        IFileStore fileStore=EFS.getLocalFileSystem().getStore(new Path(fileName));
        IFileInfo fetchInfo=fileStore.fetchInfo();
        if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
          return new FileStoreEditorInput(fileStore);
        }
      }
    }
 catch (    Exception e) {
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
public IEditorInput createEditorInput(Object file){
  if (file instanceof File) {
    File handle=(File)file;
    String fileName=handle.getAbsolutePath();
    IWorkspace space=ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root=space.getRoot();
    try {
      IFile[] resources=root.findFilesForLocationURI(new File(fileName).toURI());
      if (resources != null && resources.length > 0) {
        IEditorInput input=new FileEditorInput(resources[0]);
        return input;
      }
 else {
        IFileStore fileStore=EFS.getLocalFileSystem().getStore(new Path(fileName));
        IFileInfo fetchInfo=fileStore.fetchInfo();
        if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
          return new FileStoreEditorInput(fileStore);
        }
      }
    }
 catch (    Exception e) {
      return null;
    }
  }
  return null;
}
Program: 66425
Project: 66425
Buggy source:
protected void updateDefaultPropertyValues(DataSetViewData[] viewDatas){
  updateDefaultAnalysisEnablement(viewDatas);
}

Fixed version (ground truth):
protected void updateDefaultPropertyValues(DataSetViewData[] viewDatas){
  updateAnalysisTypes(viewDatas,true);
}
Program: 66427
Project: 66427
Buggy source:
public void addData(int col,SheetData data){
  if (col < getColumnCount()) {
    int rowIndex=data.getRowIndex();
    columns.get(col).add(data);
    maxRowIndex=maxRowIndex > rowIndex ? maxRowIndex : rowIndex;
    BookmarkDef bookmark=data.getBookmark();
    if (bookmark == null) {
      return;
    }
    bookmark.setColumnNo(col + 1);
    bookmark.setRowNo(rowIndex);
  }
}

Fixed version (ground truth):
public void addData(int col,SheetData data){
  if (col < getColumnCount()) {
    int rowIndex=data.getRowIndex();
    columns.get(col).add(data);
    maxRowIndex=maxRowIndex > rowIndex ? maxRowIndex : rowIndex;
    BookmarkDef bookmark=data.getBookmark();
    if (bookmark != null) {
      bookmark.setStartColumn(data.getStartX());
      bookmark.setStartRow(rowIndex);
    }
  }
}
Program: 66429
Project: 66429
Buggy source:
public void setDuplex(String duplex){
  options.put(OPTION_DUPLEX,duplex);
}

Fixed version (ground truth):
public void setDuplex(int duplex){
  options.put(OPTION_DUPLEX,duplex);
}
Program: 66430
Project: 66430
Buggy source:
public String getDuplex(){
  return getStringOption(OPTION_DUPLEX);
}

Fixed version (ground truth):
public int getDuplex(){
  return getIntOption(OPTION_DUPLEX,DUPLEX_SIMPLEX);
}
Program: 66433
Project: 66433
Buggy source:
public Control createContents(Composite parent){
  initColumnNames();
  viewer=new PropertyHandleTableViewer(parent,true,true,true);
  TableColumn column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[0]);
  column.setWidth(150);
  column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[1]);
  column.setWidth(100);
  column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[2]);
  column.setWidth(100);
  column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[3]);
  column.setWidth(100);
  initializeFilters();
  viewer.getViewer().setContentProvider(new IStructuredContentProvider(){
    public Object[] getElements(    Object inputElement){
      ArrayList filterList=new ArrayList(10);
      Iterator iter=filters.iterator();
      if (iter != null) {
        while (iter.hasNext()) {
          filterList.add(iter.next());
        }
      }
      return filterList.toArray();
    }
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
  }
);
  viewer.getViewer().setLabelProvider(new FilterTableProvider());
  viewer.getViewer().setInput(filters);
  addListeners();
  setToolTips();
  return viewer.getControl();
}

Fixed version (ground truth):
public Control createContents(Composite parent){
  initColumnNames();
  viewer=new PropertyHandleTableViewer(parent,true,true,true);
  TableColumn column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[0]);
  column.setWidth(150);
  column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[1]);
  column.setWidth(100);
  column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[2]);
  column.setWidth(100);
  column=new TableColumn(viewer.getViewer().getTable(),SWT.LEFT);
  column.setText(cellLabels[3]);
  column.setWidth(100);
  initializeFilters();
  viewer.getViewer().setContentProvider(new IStructuredContentProvider(){
    public Object[] getElements(    Object inputElement){
      ArrayList filterList=new ArrayList(10);
      Iterator iter=filters.iterator();
      if (iter != null) {
        while (iter.hasNext()) {
          filterList.add(iter.next());
        }
      }
      return filterList.toArray();
    }
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
  }
);
  viewer.getViewer().setLabelProvider(new FilterTableProvider());
  viewer.getViewer().setInput(filters);
  addListeners();
  setToolTips();
  ((DataSetHandle)getContainer().getModel()).addListener(this);
  return viewer.getControl();
}
Program: 66434
Project: 66434
Buggy source:
private static boolean isReferenceToLevelOrMeasure(IBaseExpression expression,List<IBinding> bindings) throws DataException {
  String measure=OlapExpressionCompiler.getReferencedScriptObject(expression,ScriptConstants.MEASURE_SCRIPTABLE);
  if (measure != null)   return true;
  String dimension=OlapExpressionCompiler.getReferencedScriptObject(expression,ScriptConstants.DIMENSION_SCRIPTABLE);
  if (dimension != null)   return true;
  List bindingNames=ExpressionCompilerUtil.extractColumnExpression(expression,ScriptConstants.DATA_BINDING_SCRIPTABLE);
  for (int i=0; i < bindingNames.size(); i++) {
    IBinding binding=getBinding((String)bindingNames.get(i),bindings);
    if (binding != null && isReferenceToLevelOrMeasure(binding.getExpression(),bindings))     return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean isReferenceToLevelOrMeasure(IBaseExpression expression,List<IBinding> bindings) throws DataException {
  String measure=OlapExpressionCompiler.getReferencedScriptObject(expression,ScriptConstants.MEASURE_SCRIPTABLE);
  if (measure != null)   return true;
  String dimension=OlapExpressionCompiler.getReferencedScriptObject(expression,ScriptConstants.DIMENSION_SCRIPTABLE);
  if (dimension != null)   return true;
  List bindingNames=ExpressionCompilerUtil.extractColumnExpression(expression,ScriptConstants.DATA_BINDING_SCRIPTABLE);
  for (int i=0; i < bindingNames.size(); i++) {
    IBinding binding=getBinding((String)bindingNames.get(i),bindings);
    if (binding == null)     return true;
    if (isReferenceToLevelOrMeasure(binding.getExpression(),bindings))     return true;
  }
  return false;
}
Program: 66436
Project: 66436
Buggy source:
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,String resolution,boolean color,int scale,boolean autoPaperSizeSelection) throws IOException {
  this.scale=scale;
  this.autoPaperSizeSelection=autoPaperSizeSelection;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,String paperTray,Object duplex,int copies,boolean collate,String resolution,boolean color,int scale,boolean autoPaperSizeSelection) throws IOException {
  this.scale=scale;
  this.autoPaperSizeSelection=autoPaperSizeSelection;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 66437
Project: 66437
Buggy source:
private void setDuplex(String duplex){
  if (duplex != null && !"String_Node_Str".equalsIgnoreCase(duplex)) {
    String duplexValue=duplex;
    String tumbleValue="String_Node_Str";
    if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
    }
 else     if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
      tumbleValue="String_Node_Str";
    }
    out.println("String_Node_Str" + duplexValue);
    out.println("String_Node_Str" + tumbleValue + "String_Node_Str");
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setDuplex(Object duplex){
  String duplexValue=null;
  boolean tumble=false;
  if (duplex instanceof String) {
    String value=(String)duplex;
    if ("String_Node_Str".equalsIgnoreCase(value)) {
      return;
    }
    if ("String_Node_Str".equalsIgnoreCase(value)) {
      duplexValue="String_Node_Str";
      tumble=false;
    }
 else     if ("String_Node_Str".equalsIgnoreCase(value)) {
      duplexValue="String_Node_Str";
      tumble=true;
    }
  }
 else   if (duplex instanceof Integer) {
    int value=(Integer)duplex;
    if (value == IPostscriptRenderOption.DUPLEX_SIMPLEX) {
      return;
    }
    if (value == IPostscriptRenderOption.DUPLEX_FLIP_ON_LONG_EDGE) {
      duplexValue="String_Node_Str";
      tumble=false;
    }
 else     if (value == IPostscriptRenderOption.DUPLEX_FLIP_ON_SHORT_EDGE) {
      duplexValue="String_Node_Str";
      tumble=true;
    }
  }
  out.println("String_Node_Str" + duplexValue);
  out.println("String_Node_Str" + tumble + "String_Node_Str");
  if (tumble) {
    out.println("String_Node_Str");
  }
  out.println("String_Node_Str");
}
Program: 66438
Project: 66438
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  boolean autoPaperSizeSelection=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_AUTO_PAPER_SIZE_SELECTION,true);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,color,scale,autoPaperSizeSelection);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  Object duplex=renderOption.getOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  boolean autoPaperSizeSelection=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_AUTO_PAPER_SIZE_SELECTION,true);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,color,scale,autoPaperSizeSelection);
}
Program: 66439
Project: 66439
Buggy source:
void setDuplex(String duplex);

Fixed version (ground truth):
void setDuplex(int duplex);
Program: 66440
Project: 66440
Buggy source:
String getDuplex();

Fixed version (ground truth):
int getDuplex();
Program: 66441
Project: 66441
Buggy source:
private void addContent(IContent content){
  if (!bufferAllContents) {
    ReportItemDesign design=getGenerateDesign(content);
    if (design != null) {
      if (design.getOnPageBreak() != null || design.getJavaClass() != null) {
        if (!contents.contains(content)) {
          contents.add(content);
        }
      }
    }
  }
 else {
    if (!contents.contains(content)) {
      contents.add(content);
    }
  }
}

Fixed version (ground truth):
private void addContent(IContent content){
  if (!bufferAllContents) {
    ReportItemDesign design=getGenerateDesign(content);
    if (design != null) {
      if (ScriptExecutor.needOnPageBreak(design,executionContext)) {
        if (!contents.contains(content)) {
          contents.add(content);
        }
      }
    }
  }
 else {
    if (!contents.contains(content)) {
      contents.add(content);
    }
  }
}
Program: 66442
Project: 66442
Buggy source:
public static void handleOnPageBreak(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnPageBreak(autoTextDesign)) {
      return;
    }
    IAutoTextInstance autoText=new AutoTextInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(autoText,autoTextDesign.getOnPageBreak(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextDesign,context);
    if (eh != null)     eh.onPageBreak(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IAutoTextContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign autoTextDesign=(ReportItemDesign)generateBy;
  try {
    if (!needOnPageBreak(autoTextDesign,context)) {
      return;
    }
    IAutoTextInstance autoText=new AutoTextInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(autoText,autoTextDesign.getOnPageBreak(),context).didRun())     return;
    IAutoTextEventHandler eh=getEventHandler(autoTextDesign,context);
    if (eh != null)     eh.onPageBreak(autoText,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,autoTextDesign.getHandle());
  }
}
Program: 66443
Project: 66443
Buggy source:
public static void handleOnPageBreak(ICellContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  if (!needOnPageBreak(cellDesign)) {
    return;
  }
  try {
    ICellInstance cell=new CellInstance(content,context,RunningState.RENDER,false);
    if (handleScript(cell,cellDesign.getOnPageBreak(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onPageBreak(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(ICellContent content,ExecutionContext context){
  Object generateBy=content.getGenerateBy();
  if (generateBy == null) {
    return;
  }
  ReportItemDesign cellDesign=(ReportItemDesign)generateBy;
  if (!needOnPageBreak(cellDesign,context)) {
    return;
  }
  try {
    ICellInstance cell=new CellInstance(content,context,RunningState.RENDER,false);
    if (handleScript(cell,cellDesign.getOnPageBreak(),context).didRun())     return;
    ICellEventHandler eh=getEventHandler(cellDesign,context);
    if (eh != null)     eh.onPageBreak(cell,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,cellDesign.getHandle());
  }
}
Program: 66444
Project: 66444
Buggy source:
public static void handleOnPageBreak(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(dataItemDesign)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(dataItem,dataItemDesign.getOnPageBreak(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onPageBreak(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IDataContent content,ExecutionContext context){
  ReportItemDesign dataItemDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(dataItemDesign,context)) {
    return;
  }
  try {
    IDataItemInstance dataItem=new DataItemInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(dataItem,dataItemDesign.getOnPageBreak(),context).didRun())     return;
    IDataItemEventHandler eh=getEventHandler(dataItemDesign,context);
    if (eh != null)     eh.onPageBreak(dataItem,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,dataItemDesign.getHandle());
  }
}
Program: 66445
Project: 66445
Buggy source:
public static void handleOnPageBreak(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(gridDesign)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(grid,gridDesign.getOnPageBreak(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onPageBreak(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(ITableContent content,ExecutionContext context){
  ReportItemDesign gridDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(gridDesign,context)) {
    return;
  }
  try {
    IGridInstance grid=new GridInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(grid,gridDesign.getOnPageBreak(),context).didRun())     return;
    IGridEventHandler eh=getEventHandler(gridDesign,context);
    if (eh != null)     eh.onPageBreak(grid,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,gridDesign.getHandle());
  }
}
Program: 66446
Project: 66446
Buggy source:
public static void handleOnPageBreak(IImageContent content,ExecutionContext context){
  ReportItemDesign imageDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(imageDesign)) {
    return;
  }
  try {
    IImageInstance image=new ImageInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(image,imageDesign.getOnPageBreak(),context).didRun())     return;
    IImageEventHandler eh=getEventHandler(imageDesign,context);
    if (eh != null)     eh.onPageBreak(image,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,imageDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IImageContent content,ExecutionContext context){
  ReportItemDesign imageDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(imageDesign,context)) {
    return;
  }
  try {
    IImageInstance image=new ImageInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(image,imageDesign.getOnPageBreak(),context).didRun())     return;
    IImageEventHandler eh=getEventHandler(imageDesign,context);
    if (eh != null)     eh.onPageBreak(image,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,imageDesign.getHandle());
  }
}
Program: 66447
Project: 66447
Buggy source:
public static void handleOnPageBreak(ILabelContent content,ExecutionContext context){
  ReportItemDesign labelDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(labelDesign)) {
    return;
  }
  try {
    ILabelInstance label=new LabelInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(label,labelDesign.getOnPageBreak(),context).didRun())     return;
    ILabelEventHandler eh=getEventHandler(labelDesign,context);
    if (eh != null)     eh.onPageBreak(label,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,labelDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(ILabelContent content,ExecutionContext context){
  ReportItemDesign labelDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(labelDesign,context)) {
    return;
  }
  try {
    ILabelInstance label=new LabelInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(label,labelDesign.getOnPageBreak(),context).didRun())     return;
    ILabelEventHandler eh=getEventHandler(labelDesign,context);
    if (eh != null)     eh.onPageBreak(label,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,labelDesign.getHandle());
  }
}
Program: 66448
Project: 66448
Buggy source:
public static void handleOnPageBreak(IListGroupContent content,ExecutionContext context){
  ReportItemDesign listGroupDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(listGroupDesign)) {
    return;
  }
  try {
    ReportElementInstance list=new ReportElementInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(list,listGroupDesign.getOnPageBreak(),context).didRun())     return;
    IListGroupEventHandler eh=getEventHandler(listGroupDesign,context);
    if (eh != null)     eh.onPageBreak(list,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,listGroupDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IListGroupContent content,ExecutionContext context){
  ReportItemDesign listGroupDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(listGroupDesign,context)) {
    return;
  }
  try {
    ReportElementInstance list=new ReportElementInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(list,listGroupDesign.getOnPageBreak(),context).didRun())     return;
    IListGroupEventHandler eh=getEventHandler(listGroupDesign,context);
    if (eh != null)     eh.onPageBreak(list,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,listGroupDesign.getHandle());
  }
}
Program: 66449
Project: 66449
Buggy source:
public static void handleOnPageBreak(IListContent content,ExecutionContext context){
  ReportItemDesign listDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(listDesign)) {
    return;
  }
  try {
    IListInstance list=new ListInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(list,listDesign.getOnPageBreak(),context).didRun())     return;
    IListEventHandler eh=getEventHandler(listDesign,context);
    if (eh != null)     eh.onPageBreak(list,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,listDesign.getHandle());
  }
}

Fixed version (ground truth):
public static void handleOnPageBreak(IListContent content,ExecutionContext context){
  ReportItemDesign listDesign=(ReportItemDesign)content.getGenerateBy();
  if (!needOnPageBreak(listDesign,context)) {
    return;
  }
  try {
    IListInstance list=new ListInstance(content,context,RunningState.PAGEBREAK);
    if (handleScript(list,listDesign.getOnPageBreak(),context).didRun())     return;
    IListEventHandler eh=getEventHandler(listDesign,context);
    if (eh != null)     eh.onPageBreak(list,context.getReportContext());
  }
 catch (  Exception e) {
    addException(context,e,listDesign.getHandle());
  }
}
Program: 66451
Project: 66451
Buggy source:
public static Set<String> getDerivedMeasureNames(List<IBinding> bindings) throws DataException {
  Set<String> directRef=new HashSet<String>();
  Set<String> all=new HashSet<String>();
  for (  IBinding binding : bindings) {
    all.add(binding.getBindingName());
    if (isDirectRerenrence(binding.getExpression(),bindings)) {
      directRef.add(binding.getBindingName());
    }
  }
  all.removeAll(directRef);
  return all;
}

Fixed version (ground truth):
public static Set<String> getDerivedMeasureNames(List<IBinding> bindings) throws DataException {
  Set<String> directRef=new HashSet<String>();
  Set<String> all=new HashSet<String>();
  for (  IBinding binding : bindings) {
    if (isReferenceToLevelOrMeasure(binding.getExpression(),bindings))     all.add(binding.getBindingName());
    if (isDirectRerenrence(binding.getExpression(),bindings)) {
      directRef.add(binding.getBindingName());
    }
  }
  all.removeAll(directRef);
  return all;
}
Program: 66452
Project: 66452
Buggy source:
private boolean isExistModelFile(){
  if (getModel() == null) {
    return true;
  }
  File file=new File(getModel().getFileName());
  if (file.exists() && file.isFile()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isExistModelFile(){
  if (getModel() == null) {
    return true;
  }
  File file=new File(getModel().getFileName());
  if (file.exists() && file.isFile()) {
    return true;
  }
  return false;
}
Program: 66453
Project: 66453
Buggy source:
/** 
 * is visit successful
 */
public boolean visit(IResourceDelta delta){
  if (delta == null || !delta.getResource().equals(getFile(getEditorInput())))   return true;
  if (delta.getKind() == IResourceDelta.REMOVED) {
    Display display=getSite().getShell().getDisplay();
    if ((IResourceDelta.MOVED_TO & delta.getFlags()) == 0) {
      display.asyncExec(new Runnable(){
        public void run(){
          if (!isDirty()) {
            closeEditor(false);
          }
 else {
            String title=DLG_SAVE_TITLE;
            String message=DLG_SAVE_CONFIRM_DELETE;
            String[] buttons={DLG_SAVE_BUTTON_SAVE,DLG_SAVE_BUTTON_CLOSE};
            MessageDialog dialog=new MessageDialog(getSite().getShell(),title,null,message,MessageDialog.QUESTION,buttons,0);
            if (dialog.open() == Dialog.OK) {
              doSaveAs();
            }
 else {
              closeEditor(false);
            }
          }
        }
      }
);
    }
 else {
      final IFile newFile=ResourcesPlugin.getWorkspace().getRoot().getFile(delta.getMovedToPath());
      display.asyncExec(new Runnable(){
        public void run(){
          FileEditorInput input=new FileEditorInput(newFile);
          setAllInput(input);
        }
      }
);
    }
  }
 else   if (delta.getKind() == IResourceDelta.CHANGED) {
  }
  return false;
}

Fixed version (ground truth):
/** 
 * is visit successful
 */
public boolean visit(IResourceDelta delta){
  if (delta == null || !delta.getResource().equals(getFile(getEditorInput())))   return true;
  if (delta.getKind() == IResourceDelta.REMOVED) {
    Display display=getSite().getShell().getDisplay();
    if ((IResourceDelta.MOVED_TO & delta.getFlags()) == 0) {
      display.asyncExec(new Runnable(){
        public void run(){
          if (!isDirty()) {
            closeEditor(false);
          }
 else {
            String title=DLG_SAVE_TITLE;
            String message=DLG_SAVE_CONFIRM_DELETE;
            String[] buttons={DLG_SAVE_BUTTON_SAVE,DLG_SAVE_BUTTON_CLOSE};
            MessageDialog dialog=new MessageDialog(getSite().getShell(),title,null,message,MessageDialog.QUESTION,buttons,0);
            if (dialog.open() == Dialog.OK) {
              doSaveAs();
              if (!isExistModelFile()) {
                closeEditor(false);
              }
            }
 else {
              closeEditor(false);
            }
          }
        }
      }
);
    }
 else {
      final IFile newFile=ResourcesPlugin.getWorkspace().getRoot().getFile(delta.getMovedToPath());
      display.asyncExec(new Runnable(){
        public void run(){
          FileEditorInput input=new FileEditorInput(newFile);
          setAllInput(input);
        }
      }
);
    }
  }
 else   if (delta.getKind() == IResourceDelta.CHANGED) {
  }
  return false;
}
Program: 66454
Project: 66454
Buggy source:
/** 
 * valid only if createInstance is already called
 * @return
 */
public static TempDir getInstance(){
  return instance;
}

Fixed version (ground truth):
/** 
 * valid only if createInstance is already called
 * @return
 */
public static TempDir getInstance(){
  if (instance == null) {
    String tempDir=System.getProperty("String_Node_Str") + "String_Node_Str" + File.separator;
    File f=new File(tempDir);
    if (f.exists()) {
      deleteDirectory(f);
    }
    instance=new TempDir(tempDir);
  }
  return instance;
}