nus-yam/ex-repair huggingface dataset:
Program: 74994
Project: 74994
Buggy source:
/** 
 * Notify the director that the specified thread is unblocked on an I/O operation.  If the thread has not been registered with threadBlocked(), then this call is ignored.
 * @param thread The thread.
 * @param receiver The receiver handling the I/O operation,or null if it is not a specific receiver.
 * @param readOrWrite Either READ_BLOCKED or WRITE_BLOCKEDto indicate whether the thread is blocked on read or write.
 * @see #threadBlocked(Thread)
 */
public synchronized void threadUnblocked(Thread thread,ProcessReceiver receiver,boolean readOrWrite){
  if (readOrWrite == READ_BLOCKED) {
    _readBlockedQueues.remove(receiver);
  }
 else {
    _writeBlockedQueues.remove(receiver);
  }
  super.threadUnblocked(thread,receiver);
}

Fixed version (ground truth):
/** 
 * Notify the director that the specified thread is unblocked on an I/O operation.  If the thread has not been registered with threadBlocked(), then this call is ignored.
 * @param thread The thread.
 * @param receiver The receiver handling the I/O operation,or null if it is not a specific receiver.
 * @param readOrWrite Either READ_BLOCKED or WRITE_BLOCKEDto indicate whether the thread is blocked on read or write.
 * @see CompositeProcessDirector#threadUnblocked(Thread,ProcessReceiver)
 */
public synchronized void threadUnblocked(Thread thread,ProcessReceiver receiver,boolean readOrWrite){
  if (readOrWrite == READ_BLOCKED) {
    _readBlockedQueues.remove(receiver);
  }
 else {
    _writeBlockedQueues.remove(receiver);
  }
  super.threadUnblocked(thread,receiver);
}
Program: 74995
Project: 74995
Buggy source:
/** 
 * Notify the director that the specified thread is blocked on an I/O operation.
 * @param thread The thread.
 * @param receiver The receiver handling the I/O operation,or null if it is not a specific receiver.
 * @param readOrWrite Either READ_BLOCKED or WRITE_BLOCKEDto indicate whether the thread is blocked on read or write.
 * @see #threadBlocked(Thread)
 */
public synchronized void threadBlocked(Thread thread,ProcessReceiver receiver,boolean readOrWrite){
  if (readOrWrite == READ_BLOCKED) {
    _readBlockedQueues.put(receiver,thread);
  }
 else {
    _writeBlockedQueues.put(receiver,thread);
  }
  super.threadBlocked(thread,receiver);
}

Fixed version (ground truth):
/** 
 * Notify the director that the specified thread is blocked on an I/O operation.
 * @param thread The thread.
 * @param receiver The receiver handling the I/O operation,or null if it is not a specific receiver.
 * @param readOrWrite Either READ_BLOCKED or WRITE_BLOCKEDto indicate whether the thread is blocked on read or write.
 * @see CompositeProcessDirector#threadBlocked(Thread,ProcessReceiver)
 */
public synchronized void threadBlocked(Thread thread,ProcessReceiver receiver,boolean readOrWrite){
  if (readOrWrite == READ_BLOCKED) {
    _readBlockedQueues.put(receiver,thread);
  }
 else {
    _writeBlockedQueues.put(receiver,thread);
  }
  super.threadBlocked(thread,receiver);
}
Program: 74996
Project: 74996
Buggy source:
/** 
 * Read input tokens, call Thread.sleep(), and then transfer tokens from inputs to outputs, at most one token from each channel.  If fire() is called twice in a row without an intervening call to either postfire() or prefire(), then no sleep is performed, an inputs are copied to the output immediately. <p> If the width of the output port is less than that of the input port, the tokens in the extra channels are lost.
 * @exception IllegalActionException Not thrown in this base class
 */
public void fire() throws IllegalActionException {
  int inputWidth=input.getWidth();
  Token[] inputs=new Token[inputWidth];
  for (int i=0; i < inputWidth; i++) {
    if (input.hasToken(i)) {
      inputs[i]=input.get(i);
    }
  }
  if (!_wasSleepCalledInFireYet) {
    try {
      long sleepTimeValue=((LongToken)sleepTime.getToken()).longValue();
      if (_debugging) {
        _debug(getName() + "String_Node_Str" + sleepTimeValue+ "String_Node_Str");
      }
      Thread.sleep(sleepTimeValue);
    }
 catch (    InterruptedException e) {
    }
  }
  int outputWidth=output.getWidth();
  for (int i=0; i < inputWidth; i++) {
    if (inputs[i] != null) {
      if (i < outputWidth) {
        output.send(i,inputs[i]);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Read input tokens, call Thread.sleep(), and then transfer tokens from inputs to outputs, at most one token from each channel.  If fire() is called twice in a row without an intervening call to either postfire() or prefire(), then no sleep is performed, an inputs are copied to the output immediately. <p> If the width of the output port is less than that of the input port, the tokens in the extra channels are lost.
 * @exception IllegalActionException Not thrown in this base class
 */
public void fire() throws IllegalActionException {
  sleepTime.update();
  int inputWidth=input.getWidth();
  Token[] inputs=new Token[inputWidth];
  for (int i=0; i < inputWidth; i++) {
    if (input.hasToken(i)) {
      inputs[i]=input.get(i);
    }
  }
  try {
    long sleepTimeValue=((LongToken)sleepTime.getToken()).longValue();
    if (_debugging) {
      _debug(getName() + "String_Node_Str" + sleepTimeValue+ "String_Node_Str");
    }
    Thread.sleep(sleepTimeValue);
  }
 catch (  InterruptedException e) {
  }
  int outputWidth=output.getWidth();
  for (int i=0; i < inputWidth; i++) {
    if (inputs[i] != null) {
      if (i < outputWidth) {
        output.send(i,inputs[i]);
      }
    }
  }
}
Program: 74997
Project: 74997
Buggy source:
/** 
 * Wait until a deadlock is detected. Then deal with the deadlock by calling the protected method _resolveDeadlock() and return. This method is synchronized on the director.
 * @exception IllegalActionException If a derived class throws it.
 */
public void fire() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Workspace workspace=workspace();
synchronized (this) {
    while (!_areActorsDeadlocked() && !_areAllActorsStopped()) {
      if (_debugging) {
        _debug("String_Node_Str");
      }
      try {
        workspace.wait(this);
      }
 catch (      InterruptedException e) {
        stop();
        return;
      }
    }
    if (_debugging) {
      _debug("String_Node_Str");
    }
    if (_areActorsDeadlocked() && !_stopRequested) {
      if (_debugging) {
        _debug("String_Node_Str");
      }
      try {
        _notDone=_resolveDeadlock();
      }
 catch (      IllegalActionException e) {
        stop();
        throw e;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Wait until a deadlock is detected. Then deal with the deadlock by calling the protected method _resolveDeadlock() and return. This method is synchronized on the director.
 * @exception IllegalActionException If a derived class throws it.
 */
public void fire() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Workspace workspace=workspace();
synchronized (this) {
    while (!_areActorsDeadlocked() && !_areAllActorsStopped()) {
      if (_stopRequested) {
        return;
      }
      if (_debugging) {
        _debug("String_Node_Str");
      }
      try {
        workspace.wait(this);
      }
 catch (      InterruptedException e) {
        stop();
        return;
      }
    }
    if (_debugging) {
      _debug("String_Node_Str");
    }
    if (_areActorsDeadlocked() && !_stopRequested) {
      if (_debugging) {
        _debug("String_Node_Str");
      }
      try {
        _notDone=_resolveDeadlock();
      }
 catch (      IllegalActionException e) {
        stop();
        throw e;
      }
    }
  }
}
Program: 74998
Project: 74998
Buggy source:
/** 
 * End the execution of the model under the control of this director. A flag is set in all the receivers that causes each process to terminate at the earliest communication point. Prior to setting receiver flags, this method wakes up the threads if they all are stopped.  If the container is not an instance of CompositeActor, then this method does nothing. <P> This method is not synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If an error occurs whileaccessing the receivers of all actors under the control of this director.
 */
public void wrapup() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Nameable container=getContainer();
  if (container instanceof CompositeActor) {
    Iterator actors=((CompositeActor)container).deepEntityList().iterator();
    Iterator actorPorts;
    ProcessReceiver nextReceiver;
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      actorPorts=actor.inputPortList().iterator();
      while (actorPorts.hasNext()) {
        IOPort port=(IOPort)actorPorts.next();
        Receiver[][] receivers=port.getReceivers();
        for (int i=0; i < receivers.length; i++) {
          for (int j=0; j < receivers[i].length; j++) {
            nextReceiver=(ProcessReceiver)receivers[i][j];
            nextReceiver.requestFinish();
          }
        }
      }
    }
    Manager manager=((Actor)getContainer()).getManager();
synchronized (manager) {
      manager.notifyAll();
    }
synchronized (this) {
      while (_activeActorCount > 0) {
        try {
          workspace().wait(this);
        }
 catch (        InterruptedException ex) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * End the execution of the model under the control of this director. A flag is set in all the receivers that causes each process to terminate at the earliest communication point. Prior to setting receiver flags, this method wakes up the threads if they all are stopped.  If the container is not an instance of CompositeActor, then this method does nothing. <P> This method is not synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If an error occurs whileaccessing the receivers of all actors under the control of this director.
 */
public void wrapup() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  CompositeActor container=(CompositeActor)getContainer();
  _requestFinishOnReceivers();
  Manager manager=container.getManager();
synchronized (manager) {
    manager.notifyAll();
  }
synchronized (this) {
    while (_activeActorCount > 0) {
      try {
        workspace().wait(this);
      }
 catch (      InterruptedException ex) {
      }
    }
  }
}
Program: 74999
Project: 74999
Buggy source:
/** 
 * Request that the director cease execution altogether. This causes a call to stop() on all actors contained by the container of this director, and a call to stopThread() on each of the process threads that contain actors controlled by this director. This also sets a flag so that the next call to postfire() returns false.
 */
public void stop(){
  if (_debugging) {
    _debug("String_Node_Str" + _activeActorCount);
  }
  _stopRequested=true;
  _stopFireRequested=true;
  if (_actorThreadList != null) {
    Iterator threads=_actorThreadList.iterator();
    while (threads.hasNext()) {
      ProcessThread thread=(ProcessThread)threads.next();
      try {
        thread.getActor().stop();
        thread.interrupt();
      }
 catch (      Exception ex) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Request that the director cease execution altogether. This causes a call to stop() on all actors contained by the container of this director, and a call to stopThread() on each of the process threads that contain actors controlled by this director. This also sets a flag so that the next call to postfire() returns false.
 */
public void stop(){
  if (_debugging) {
    _debug("String_Node_Str" + _activeActorCount);
  }
  _stopRequested=true;
  _stopFireRequested=true;
  if (_actorThreadList != null) {
    Iterator threads=_actorThreadList.iterator();
    while (threads.hasNext()) {
      ProcessThread thread=(ProcessThread)threads.next();
      try {
        thread.getActor().stop();
        thread.interrupt();
      }
 catch (      Exception ex) {
      }
    }
  }
  _requestFinishOnReceivers();
  Thread notifyThread=new Thread(){
    public void run(){
synchronized (ProcessDirector.this) {
        ProcessDirector.this.notifyAll();
      }
    }
  }
;
  notifyThread.start();
}
Program: 75000
Project: 75000
Buggy source:
/** 
 * Set the line width. The existing stroke will be removed, but the dash array will be preserved if possible.
 */
public void setLineWidth(float lineWidth){
  repaint();
  if (_stroke instanceof BasicStroke) {
    _stroke=new BasicStroke(lineWidth,((BasicStroke)_stroke).getEndCap(),((BasicStroke)_stroke).getLineJoin(),((BasicStroke)_stroke).getMiterLimit(),((BasicStroke)_stroke).getDashArray(),0.0f);
  }
 else {
    new BasicStroke(lineWidth,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER,10.0f,null,0.0f);
  }
  repaint();
}

Fixed version (ground truth):
/** 
 * Set the line width. The existing stroke will be removed, but the dash array will be preserved if possible.
 */
public void setLineWidth(float lineWidth){
  repaint();
  _lineWidth=lineWidth;
  if (_stroke instanceof BasicStroke) {
    _stroke=new BasicStroke(lineWidth,((BasicStroke)_stroke).getEndCap(),((BasicStroke)_stroke).getLineJoin(),((BasicStroke)_stroke).getMiterLimit(),((BasicStroke)_stroke).getDashArray(),0.0f);
  }
 else {
    new BasicStroke(lineWidth,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER,10.0f,_dashArray,0.0f);
  }
  repaint();
}
Program: 75001
Project: 75001
Buggy source:
/** 
 * Set the dash array of the stroke. The existing stroke will be removed, but the line width will be preserved if possible.
 */
public void setDashArray(float[] dashArray){
  repaint();
  if (_stroke instanceof BasicStroke) {
    _stroke=new BasicStroke(((BasicStroke)_stroke).getLineWidth(),((BasicStroke)_stroke).getEndCap(),((BasicStroke)_stroke).getLineJoin(),((BasicStroke)_stroke).getMiterLimit(),dashArray,0.0f);
  }
 else {
    _stroke=new BasicStroke(1.0f,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER,10.0f,dashArray,0.0f);
  }
  repaint();
}

Fixed version (ground truth):
/** 
 * Set the dash array of the stroke. The existing stroke will be removed, but the line width will be preserved if possible.
 */
public void setDashArray(float[] dashArray){
  repaint();
  _dashArray=dashArray;
  if (_stroke instanceof BasicStroke) {
    _stroke=new BasicStroke(((BasicStroke)_stroke).getLineWidth(),((BasicStroke)_stroke).getEndCap(),((BasicStroke)_stroke).getLineJoin(),((BasicStroke)_stroke).getMiterLimit(),dashArray,0.0f);
  }
 else {
    _stroke=new BasicStroke(_lineWidth,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER,10.0f,dashArray,0.0f);
  }
  repaint();
}
Program: 75005
Project: 75005
Buggy source:
/** 
 * Assuming the contents of the clipboard is MoML code, paste it into the current model by issuing a change request.
 */
public void paste(){
  Clipboard clipboard=java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
  Transferable transferable=clipboard.getContents(this);
  GraphModel model=_getGraphModel();
  if (transferable == null) {
    return;
  }
  try {
    NamedObj container=(NamedObj)model.getRoot();
    StringBuffer moml=new StringBuffer();
    moml.append("String_Node_Str");
    moml.append(offsetPastedMomlLocation((String)transferable.getTransferData(DataFlavor.stringFlavor),10,10));
    moml.append("String_Node_Str");
    MoMLChangeRequest change=new MoMLChangeRequest(this,container,moml.toString());
    change.setUndoable(true);
    container.requestChange(change);
  }
 catch (  Exception ex) {
    MessageHandler.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Assuming the contents of the clipboard is MoML code, paste it into the current model by issuing a change request.
 */
public void paste(){
  Clipboard clipboard=java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
  Transferable transferable=clipboard.getContents(this);
  GraphModel model=_getGraphModel();
  if (transferable == null) {
    return;
  }
  try {
    NamedObj container=(NamedObj)model.getRoot();
    StringBuffer moml=new StringBuffer();
    moml.append("String_Node_Str");
    moml.append(_offsetPastedMomlLocation((String)transferable.getTransferData(DataFlavor.stringFlavor),10,10));
    moml.append("String_Node_Str");
    MoMLChangeRequest change=new MoMLChangeRequest(this,container,moml.toString());
    change.setUndoable(true);
    container.requestChange(change);
  }
 catch (  Exception ex) {
    MessageHandler.error("String_Node_Str",ex);
  }
}
Program: 75006
Project: 75006
Buggy source:
/** 
 * This method, which is required by the ImageObserver interface, is called if something has changed in a background loading of the image.  It simply calls repaint().
 * @param image The image being observed.
 * @param infoflags The bitwise inclusive OR of the following flags:WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT.
 * @param x The x coordinate of the image.
 * @param y The y coordinate of the image.
 * @param width The width of the image.
 * @param height The height of the image.
 * @return False if the infoflags indicate that the image iscompletely loaded; true otherwise.
 */
public boolean imageUpdate(Image image,int infoflags,int x,int y,int width,int height){
  if ((infoflags & (ImageObserver.HEIGHT | ImageObserver.WIDTH)) != 0) {
    _height=height;
    _width=width;
    _image.getWidth(this);
    _image.getHeight(this);
    return true;
  }
  if ((infoflags & (ImageObserver.PROPERTIES | ImageObserver.SOMEBITS)) != 0) {
    _image.getWidth(this);
    _image.getHeight(this);
    return true;
  }
  if ((infoflags & ImageObserver.ALLBITS) != 0) {
    repaint();
    return false;
  }
  _image.getWidth(this);
  _image.getHeight(this);
  return true;
}

Fixed version (ground truth):
/** 
 * This method, which is required by the ImageObserver interface, is called if something has changed in a background loading of the image.  It simply calls repaint().
 * @param image The image being observed.
 * @param infoflags The bitwise inclusive OR of the following flags:WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT.
 * @param x The x coordinate of the image.
 * @param y The y coordinate of the image.
 * @param width The width of the image.
 * @param height The height of the image.
 * @return False if the infoflags indicate that the image iscompletely loaded; true otherwise.
 */
public boolean imageUpdate(Image image,int infoflags,int x,int y,int width,int height){
  if ((infoflags & (ImageObserver.ERROR | ImageObserver.ABORT)) != 0) {
    URL url=getClass().getResource("String_Node_Str");
    Toolkit tk=Toolkit.getDefaultToolkit();
    _image=tk.getImage(url);
    return true;
  }
  if ((infoflags & (ImageObserver.HEIGHT | ImageObserver.WIDTH)) != 0) {
    _height=height;
    _width=width;
    _image.getWidth(this);
    _image.getHeight(this);
    return true;
  }
  if ((infoflags & (ImageObserver.PROPERTIES | ImageObserver.SOMEBITS)) != 0) {
    _image.getWidth(this);
    _image.getHeight(this);
    return true;
  }
  if ((infoflags & ImageObserver.ALLBITS) != 0) {
    repaint();
    return false;
  }
  _image.getWidth(this);
  _image.getHeight(this);
  return true;
}
Program: 75011
Project: 75011
Buggy source:
/** 
 * Clear the schedule cache, cache keys and cache for external rates of this scheduler.
 */
public void clearCaches(){
  _scheduleKeyList.clear();
  _scheduleCache.clear();
  _externalRatesCache.clear();
  _mostRecentRates="String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Clear the schedule cache, cache keys and cache for external rates of this scheduler.
 */
public void clearCaches(){
  if (_cacheSize > 0) {
    _scheduleKeyList.clear();
  }
  _scheduleCache.clear();
  _externalRatesCache.clear();
  _mostRecentRates="String_Node_Str";
}
Program: 75013
Project: 75013
Buggy source:
/** 
 * Construct the caches of this scheduler with the given cache size.
 * @param cacheSize The given cache sie.
 */
public void constructCaches(int cacheSize){
  _scheduleCache=new HashMap();
  _scheduleKeyList=new ArrayList(cacheSize);
  _externalRatesCache=new TreeMap();
  _cacheSize=cacheSize;
}

Fixed version (ground truth):
/** 
 * Construct the caches of this scheduler with the given cache size.
 * @param cacheSize The given cache sie.
 */
public void constructCaches(int cacheSize){
  _scheduleCache=new HashMap();
  if (cacheSize > 0) {
    _scheduleKeyList=new ArrayList(cacheSize);
  }
  _externalRatesCache=new TreeMap();
  _cacheSize=cacheSize;
}
Program: 75015
Project: 75015
Buggy source:
/** 
 * Add a handler (@link AssignmentTransformer) to the type analyzer. The handler refactors the AST while the type analyzer traverses it.
 * @param analyzer The type analyzer.
 * @param root The root of the AST.
 */
public void beforeTraverse(TypeAnalyzer analyzer,CompilationUnit root){
  AssignmentTransformer assignmentTransformer=new AssignmentTransformer();
  ConstructorTransformer constructorTransformer=new ConstructorTransformer();
  _handlers.add(assignmentTransformer);
  _handlers.add(constructorTransformer);
  analyzer.getHandlers().addAliasHandler(assignmentTransformer);
  analyzer.getHandlers().addAssignmentHandler(assignmentTransformer);
  analyzer.getHandlers().addClassHandler(assignmentTransformer);
  analyzer.getHandlers().addCrossAnalysisHandler(assignmentTransformer);
  analyzer.getHandlers().addMethodDeclarationHandler(assignmentTransformer);
  analyzer.getHandlers().addClassHandler(constructorTransformer);
  analyzer.getHandlers().addConstructorHandler(constructorTransformer);
  analyzer.getHandlers().addCrossAnalysisHandler(constructorTransformer);
  analyzer.getHandlers().addMethodDeclarationHandler(constructorTransformer);
}

Fixed version (ground truth):
/** 
 * Add a handler (@link AssignmentTransformer) to the type analyzer. The handler refactors the AST while the type analyzer traverses it.
 * @param analyzer The type analyzer.
 * @param root The root of the AST.
 */
public void beforeTraverse(TypeAnalyzer analyzer,CompilationUnit root){
  AssignmentTransformer assignmentTransformer=new AssignmentTransformer();
  ConstructorTransformer constructorTransformer=new ConstructorTransformer();
  _handlers.add(assignmentTransformer);
  _handlers.add(constructorTransformer);
  analyzer.getHandlers().addAliasHandler(assignmentTransformer);
  analyzer.getHandlers().addAssignmentHandler(assignmentTransformer);
  analyzer.getHandlers().addClassHandler(assignmentTransformer);
  analyzer.getHandlers().addCrossAnalysisHandler(assignmentTransformer);
  analyzer.getHandlers().addFieldDeclarationHandler(assignmentTransformer);
  analyzer.getHandlers().addMethodDeclarationHandler(assignmentTransformer);
  analyzer.getHandlers().addClassHandler(constructorTransformer);
  analyzer.getHandlers().addConstructorHandler(constructorTransformer);
  analyzer.getHandlers().addCrossAnalysisHandler(constructorTransformer);
  analyzer.getHandlers().addMethodDeclarationHandler(constructorTransformer);
}
Program: 75019
Project: 75019
Buggy source:
private void _setupPreviewPage(){
  int pageIndex=1;
  IFile file=(IFile)getEditorInput().getAdapter(IFile.class);
  try {
    CompilationUnit compilationUnit=_getCompilationUnit();
    String packageName=null;
    if (compilationUnit.getPackage() != null)     packageName=compilationUnit.getPackage().getName().toString();
    IPath refactoredFile=Environment.getRefactoredFile(file.getLocation().toOSString(),packageName);
    IFile previewFile=Environment.getContainer(refactoredFile).getFile(null);
    _preview=new CompilationUnitEditor();
    _preview.init(_editor.getEditorSite(),new FileEditorInput(previewFile){
      public boolean exists(){
        return true;
      }
    }
);
  }
 catch (  Exception e) {
    OutputConsole.outputError(e.getMessage());
  }
}

Fixed version (ground truth):
private void _setupPreviewPage(){
  int pageIndex=1;
  _preview=new CompilationUnitEditor();
  IFile previewFile=_getPreviewFile();
  if (previewFile != null) {
    try {
      _preview.init(_editor.getEditorSite(),new FileEditorInput(previewFile){
        public boolean exists(){
          return true;
        }
      }
);
    }
 catch (    Exception e) {
      OutputConsole.outputError(e.getMessage());
    }
  }
}
Program: 75021
Project: 75021
Buggy source:
public void createPartControl(Composite parent){
  _container=_createContainer(parent);
  _createPages();
  _preview.createPartControl((Composite)_container.getItem(1).getControl());
  super.createPartControl((Composite)_container.getItem(0).getControl());
  ISourceViewer sourceViewer=getSourceViewer();
  if (sourceViewer == null)   return;
  IDocument document=sourceViewer.getDocument();
  if (document != null)   document.addDocumentListener(new IDocumentListener(){
    public void documentAboutToBeChanged(    DocumentEvent event){
    }
    public void documentChanged(    DocumentEvent event){
      _needRefactoring=true;
    }
  }
);
  _setActivePage(0);
}

Fixed version (ground truth):
public void createPartControl(Composite parent){
  _container=_createContainer(parent);
  _createPages();
  _preview.createPartControl((Composite)_container.getItem(1).getControl());
  super.createPartControl((Composite)_container.getItem(0).getControl());
  ISourceViewer sourceViewer=getSourceViewer();
  if (sourceViewer == null)   return;
  IDocument document=sourceViewer.getDocument();
  if (document != null)   document.addDocumentListener(new IDocumentListener(){
    public void documentAboutToBeChanged(    DocumentEvent event){
    }
    public void documentChanged(    DocumentEvent event){
      _needRefactoring=true;
    }
  }
);
  _setActivePage(0);
  IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
  store.addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      String property=event.getProperty();
      if (property == PreferenceConstants.BACKTRACK_ROOT || property == PreferenceConstants.BACKTRACK_PREFIX) {
        try {
          IFile previewFile=_getPreviewFile();
          _preview.setInput(new FileEditorInput(previewFile));
        }
 catch (        Exception e) {
          OutputConsole.outputError(e.getMessage());
        }
      }
    }
  }
);
}
Program: 75022
Project: 75022
Buggy source:
private void _createSection2(){
  Composite composite=_createSection("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  Composite currentComposite=_newComposite(composite);
  _root=new DirectoryFieldEditor(PreferenceConstants.BACKTRACK_ROOT,"String_Node_Str",currentComposite);
  GridData gridData=new GridData();
  gridData.widthHint=0;
  gridData.horizontalAlignment=SWT.FILL;
  gridData.grabExcessHorizontalSpace=true;
  _root.getTextControl(currentComposite).setLayoutData(gridData);
  _setParent(_root,currentComposite);
  addField(_root);
  currentComposite=_newComposite(composite);
  _prefix=new StringFieldEditor(PreferenceConstants.BACKTRACK_PREFIX,"String_Node_Str",currentComposite);
  _setParent(_prefix,currentComposite);
  addField(_prefix);
}

Fixed version (ground truth):
private void _createSection2(){
  Composite composite=_createSection("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  Composite currentComposite=_newComposite(composite);
  _root=new DirectoryFieldEditor(PreferenceConstants.BACKTRACK_ROOT,"String_Node_Str",currentComposite);
  _root.setCanBeEmpty(true);
  GridData gridData=new GridData();
  gridData.widthHint=0;
  gridData.horizontalAlignment=SWT.FILL;
  gridData.grabExcessHorizontalSpace=true;
  _root.getTextControl(currentComposite).setLayoutData(gridData);
  _setParent(_root,currentComposite);
  addField(_root);
  currentComposite=_newComposite(composite);
  _prefix=new StringFieldEditor(PreferenceConstants.BACKTRACK_PREFIX,"String_Node_Str",currentComposite);
  _setParent(_prefix,currentComposite);
  addField(_prefix);
}
Program: 75024
Project: 75024
Buggy source:
private boolean _updateSources(){
  String fileName=_sourceList.getStringValue();
  File sourceListFile=new File(fileName);
  File sourceListPath=sourceListFile.getParentFile();
  List list=_sources.getListControl(_getParent(_sources));
  list.removeAll();
  try {
    BufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
    String line;
    while ((line=reader.readLine()) != null) {
      File file=new File(sourceListPath,line);
      if (!file.exists()) {
        MessageDialog.openError(getShell(),"String_Node_Str","String_Node_Str" + line + "String_Node_Str");
        throw new FileNotFoundException();
      }
      list.add(line);
    }
    reader.close();
    return true;
  }
 catch (  Exception e) {
    list.removeAll();
    return false;
  }
}

Fixed version (ground truth):
private boolean _updateSources(){
  String fileName=_sourceList.getStringValue();
  List list=_sources.getListControl(_getParent(_sources));
  list.removeAll();
  if (fileName.equals("String_Node_Str"))   return true;
  File sourceListFile=new File(fileName);
  File sourceListPath=sourceListFile.getParentFile();
  try {
    BufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
    String line;
    while ((line=reader.readLine()) != null) {
      File file=new File(sourceListPath,line);
      if (!file.exists()) {
        MessageDialog.openError(getShell(),"String_Node_Str","String_Node_Str" + line + "String_Node_Str");
        throw new FileNotFoundException();
      }
      list.add(line);
    }
    reader.close();
    return true;
  }
 catch (  Exception e) {
    list.removeAll();
    return false;
  }
}
Program: 75025
Project: 75025
Buggy source:
protected boolean checkState(){
  boolean superResult=super.checkState();
  if (!getTextControl(_getParent(this)).isEnabled())   return superResult;
  if (getStringValue().equals(_lastString)) {
    if (superResult)     return true;
  }
 else {
    _lastString=getStringValue();
    _sourcesModified=false;
    if (superResult)     return _updateSources();
  }
  List list=_sources.getListControl(_getParent(_sources));
  list.removeAll();
  return false;
}

Fixed version (ground truth):
protected boolean checkState(){
  if (Environment.getPtolemyHome() == null)   return true;
  String currentValue=getStringValue();
  boolean superResult=super.checkState();
  if (!getTextControl(_getParent(this)).isEnabled())   return superResult;
  if (getStringValue().equals(_lastString)) {
    if (superResult)     return true;
  }
 else {
    _lastString=currentValue;
    _sourcesModified=false;
    if (superResult || currentValue.equals("String_Node_Str"))     return _updateSources();
  }
  List list=_sources.getListControl(_getParent(_sources));
  list.removeAll();
  return false;
}
Program: 75026
Project: 75026
Buggy source:
protected String createList(String[] items){
  StringBuffer path=new StringBuffer("String_Node_Str");
  for (int i=0; i < items.length; i++) {
    path.append(items[i]);
    path.append(File.pathSeparator);
  }
  return path.toString();
}

Fixed version (ground truth):
protected String createList(String[] items){
  return Strings.encodeFileNames(items);
}
Program: 75027
Project: 75027
Buggy source:
protected String[] parseString(String stringList){
  StringTokenizer st=new StringTokenizer(stringList,File.pathSeparator + "String_Node_Str");
  ArrayList v=new ArrayList();
  while (st.hasMoreElements()) {
    v.add(st.nextElement());
  }
  return (String[])v.toArray(new String[v.size()]);
}

Fixed version (ground truth):
protected String[] parseString(String stringList){
  return Strings.decodeFileNames(stringList);
}
Program: 75028
Project: 75028
Buggy source:
public void initializeDefaultPreferences(){
  IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
  IProject ptIIProject=ResourcesPlugin.getWorkspace().getRoot().getProject("String_Node_Str");
  if (ptIIProject.exists()) {
    store.setDefault(PreferenceConstants.PTII,ptIIProject.getFullPath().toOSString());
    IFile sourceList=ptIIProject.getFile("String_Node_Str");
    if (sourceList.exists())     store.setDefault(PreferenceConstants.BACKTRACK_SOURCE_LIST,sourceList.getLocation().toOSString());
 else     store.setDefault(PreferenceConstants.BACKTRACK_SOURCE_LIST,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_ROOT,ptIIProject.getFullPath().toOSString());
    store.setDefault(PreferenceConstants.BACKTRACK_GENERATE_CONFIGURATION,true);
    IFile configuration=ptIIProject.getFile("String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_CONFIGURATION,configuration.getLocation().toOSString());
  }
 else {
    store.setDefault(PreferenceConstants.PTII,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_SOURCE_LIST,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_ROOT,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_GENERATE_CONFIGURATION,false);
    store.setDefault(PreferenceConstants.BACKTRACK_CONFIGURATION,"String_Node_Str");
  }
  store.setDefault(PreferenceConstants.BACKTRACK_PREFIX,"String_Node_Str");
  store.setDefault(PreferenceConstants.BACKTRACK_OVERWRITE,false);
}

Fixed version (ground truth):
public void initializeDefaultPreferences(){
  IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
  IProject ptIIProject=ResourcesPlugin.getWorkspace().getRoot().getProject("String_Node_Str");
  if (ptIIProject.exists()) {
    store.setDefault(PreferenceConstants.PTII,ptIIProject.getLocation().toOSString());
    IFile sourceList=ptIIProject.getFile("String_Node_Str");
    if (sourceList.exists())     store.setDefault(PreferenceConstants.BACKTRACK_SOURCE_LIST,sourceList.getLocation().toOSString());
 else     store.setDefault(PreferenceConstants.BACKTRACK_SOURCE_LIST,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_ROOT,ptIIProject.getFullPath().toOSString());
    store.setDefault(PreferenceConstants.BACKTRACK_GENERATE_CONFIGURATION,true);
    IFile configuration=ptIIProject.getFile("String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_CONFIGURATION,configuration.getLocation().toOSString());
  }
 else {
    store.setDefault(PreferenceConstants.PTII,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_SOURCE_LIST,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_ROOT,"String_Node_Str");
    store.setDefault(PreferenceConstants.BACKTRACK_GENERATE_CONFIGURATION,false);
    store.setDefault(PreferenceConstants.BACKTRACK_CONFIGURATION,"String_Node_Str");
  }
  store.setDefault(PreferenceConstants.BACKTRACK_PREFIX,"String_Node_Str");
  store.setDefault(PreferenceConstants.BACKTRACK_OVERWRITE,false);
}
Program: 75029
Project: 75029
Buggy source:
public Object open(){
  Shell parent=getParent();
  _shell=new Shell(parent,SWT.MODELESS | SWT.APPLICATION_MODAL);
  _shell.setText(getText());
  _shell.setLayout(new FillLayout());
  Label logo=new Label(_shell,SWT.NULL);
  ImageDescriptor descriptor=ImageDescriptor.createFromFile(EclipsePlugin.class,"String_Node_Str");
  Image image=descriptor.createImage();
  logo.setImage(image);
  int width=image.getBounds().width;
  int height=image.getBounds().height;
  Display display=parent.getDisplay();
  Rectangle displayBounds=display.getBounds();
  Rectangle bounds=new Rectangle((displayBounds.width - width) / 2,(displayBounds.height - height) / 2 - 80,width,height);
  _shell.setBounds(bounds);
  _shell.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if (e.keyCode == SWT.CR || e.keyCode == SWT.ESC)       _shell.close();
    }
  }
);
  logo.addMouseListener(new MouseListener(){
    public void mouseDoubleClick(    MouseEvent e){
    }
    public void mouseDown(    MouseEvent e){
    }
    public void mouseUp(    MouseEvent e){
      if (e.button == 1)       _shell.close();
    }
  }
);
  _shell.open();
  while (!_shell.isDisposed()) {
    if (!display.readAndDispatch())     display.sleep();
  }
  return result;
}

Fixed version (ground truth):
public Object open(){
  Shell parent=getParent();
  _shell=new Shell(parent,SWT.MODELESS | SWT.APPLICATION_MODAL);
  _shell.setText(getText());
  _shell.setLayout(new FillLayout());
  Label logo=new Label(_shell,SWT.NULL);
  ImageDescriptor descriptor=EclipsePlugin.getImageDescriptor("String_Node_Str");
  Image image=descriptor.createImage();
  logo.setImage(image);
  int width=image.getBounds().width;
  int height=image.getBounds().height;
  Display display=parent.getDisplay();
  Rectangle displayBounds=display.getBounds();
  Rectangle bounds=new Rectangle((displayBounds.width - width) / 2,(displayBounds.height - height) / 2 - 80,width,height);
  _shell.setBounds(bounds);
  _shell.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if (e.keyCode == SWT.CR || e.keyCode == SWT.ESC)       _shell.close();
    }
  }
);
  logo.addMouseListener(new MouseListener(){
    public void mouseDoubleClick(    MouseEvent e){
    }
    public void mouseDown(    MouseEvent e){
    }
    public void mouseUp(    MouseEvent e){
      if (e.button == 1)       _shell.close();
    }
  }
);
  _shell.open();
  while (!_shell.isDisposed()) {
    if (!display.readAndDispatch())     display.sleep();
  }
  return result;
}
Program: 75030
Project: 75030
Buggy source:
/** 
 * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.
 */
public void createFieldEditors(){
  Composite parent=getFieldEditorParent();
  DirectoryFieldEditor directoryFieldEditor=new DirectoryFieldEditor(PreferenceConstants.PTII,"String_Node_Str",getFieldEditorParent()){
    protected void fireValueChanged(    String property,    Object oldValue,    Object newValue){
      if (property == VALUE && isValid()) {
        String PTII=getStringValue();
        File sourceList=new File(PTII + "String_Node_Str");
        if (sourceList.exists()) {
          IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
          store.setValue(PreferenceConstants.BACKTRACK_SOURCE_LIST,sourceList.getPath());
        }
      }
      super.fireValueChanged(property,oldValue,newValue);
    }
  }
;
  addField(directoryFieldEditor);
  Label space=new Label(parent,0);
  GridData gridData=new GridData();
  gridData.horizontalSpan=3;
  gridData.grabExcessVerticalSpace=true;
  space.setLayoutData(gridData);
  Label logo=new Label(parent,0);
  gridData=new GridData();
  gridData.horizontalSpan=3;
  gridData.horizontalAlignment=SWT.CENTER;
  logo.setLayoutData(gridData);
  ImageDescriptor descriptor=ImageDescriptor.createFromFile(EclipsePlugin.class,"String_Node_Str");
  logo.setImage(descriptor.createImage());
}

Fixed version (ground truth):
/** 
 * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.
 */
public void createFieldEditors(){
  Composite parent=getFieldEditorParent();
  DirectoryFieldEditor directoryFieldEditor=new DirectoryFieldEditor(PreferenceConstants.PTII,"String_Node_Str",getFieldEditorParent()){
    protected void fireValueChanged(    String property,    Object oldValue,    Object newValue){
      if (property == VALUE && isValid()) {
        String PTII=getStringValue();
        File sourceList=new File(PTII + "String_Node_Str");
        if (sourceList.exists()) {
          IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
          store.setValue(PreferenceConstants.BACKTRACK_SOURCE_LIST,sourceList.getPath());
        }
      }
      super.fireValueChanged(property,oldValue,newValue);
    }
  }
;
  addField(directoryFieldEditor);
  Label space=new Label(parent,0);
  GridData gridData=new GridData();
  gridData.horizontalSpan=3;
  gridData.grabExcessVerticalSpace=true;
  space.setLayoutData(gridData);
  Label logo=new Label(parent,0);
  gridData=new GridData();
  gridData.horizontalSpan=3;
  gridData.horizontalAlignment=SWT.CENTER;
  logo.setLayoutData(gridData);
  ImageDescriptor descriptor=EclipsePlugin.getImageDescriptor("String_Node_Str");
  logo.setImage(descriptor.createImage());
}
Program: 75031
Project: 75031
Buggy source:
/** 
 * Leave a class declaration. The current class is set back to the last current class (the class on the top of the previous class stack).
 * @see #enterClass(Class)
 */
public void leaveClass(){
  _currentClass=(Class)_previousClasses.pop();
  _anonymousCounts.pop();
  _loader.setCurrentClass(_currentClass,false);
}

Fixed version (ground truth):
/** 
 * Leave a class declaration. The current class is set back to the last current class (the class on the top of the previous class stack).
 * @see #enterClass(Class)
 */
public void leaveClass(){
  int i=_previousClasses.size() - 1;
  while (i >= 0 && !(_previousClasses.get(i) instanceof Class))   i--;
  _currentClass=i >= 0 ? (Class)_previousClasses.get(i) : null;
  _previousClasses.pop();
  _anonymousCounts.pop();
  _loader.setCurrentClass(_currentClass,false);
}
Program: 75032
Project: 75032
Buggy source:
/** 
 * @param root
 */
public void afterTraverse(TypeAnalyzer analyzer,CompilationUnit root){
  PackageDeclaration declaration=root.getPackage();
  AST ast=root.getAST();
  if (_prefix != null && _prefix.length() > 0)   root.accept(new Renamer(analyzer.getState()));
}

Fixed version (ground truth):
/** 
 * @param root
 */
public void afterTraverse(TypeAnalyzer analyzer,CompilationUnit root){
  if (_prefix != null && _prefix.length() > 0) {
    root.accept(new Renamer(analyzer.getState()));
    PackageDeclaration packageDeclaration=root.getPackage();
    AST ast=root.getAST();
    if (packageDeclaration == null) {
      packageDeclaration=ast.newPackageDeclaration();
      packageDeclaration.setName(AbstractTransformer.createName(ast,_prefix));
      root.setPackage(packageDeclaration);
    }
  }
}
Program: 75033
Project: 75033
Buggy source:
public void run(){
  try {
    if (_file.exists())     _file.setContents(_inputStream,true,false,null);
 else     _file.create(_inputStream,true,null);
  }
 catch (  Exception e) {
    OutputConsole.outputError(e.getMessage());
  }
 finally {
    try {
      _inputStream.close();
    }
 catch (    Exception e) {
      OutputConsole.outputError(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Transformer.transform(_fileName,_compilationUnit,_writer,_classPaths,_crossAnalyzedTypes);
  }
 catch (  Exception e) {
    e.printStackTrace();
    OutputConsole.outputError(e.getMessage());
  }
}
Program: 75035
Project: 75035
Buggy source:
private void _createRawPage(){
  int pageIndex=0;
  Composite composite=new Composite(_container,_getOrientation(this));
  composite.setLayout(new FillLayout());
  super.createPartControl(composite);
  _editor=this;
  _createItem(pageIndex,composite).setText("String_Node_Str");
}

Fixed version (ground truth):
private void _createRawPage(){
  int pageIndex=0;
  Composite composite=new Composite(_container,_getOrientation(this));
  composite.setLayout(new FillLayout());
  _editor=this;
  _createItem(pageIndex,composite).setText("String_Node_Str");
}
Program: 75036
Project: 75036
Buggy source:
private void _setupPreviewPage(){
  int pageIndex=1;
  IFile file=(IFile)getEditorInput().getAdapter(IFile.class);
  try {
    CompilationUnit compilationUnit=_getCompilationUnit();
    String packageName=null;
    if (compilationUnit.getPackage() != null)     packageName=compilationUnit.getPackage().getName().toString();
    IPath refactoredFile=Environment.getRefactoredFile(file.getLocation().toOSString(),packageName);
    IFile previewFile=Environment.getContainer(refactoredFile).getFile(null);
    _preview=new CompilationUnitEditor();
    _preview.init(_editor.getEditorSite(),new FileEditorInput(previewFile){
      public boolean exists(){
        return true;
      }
    }
);
    _preview.createPartControl((Composite)_container.getItem(pageIndex).getControl());
  }
 catch (  Exception e) {
    OutputConsole.outputError(e.getMessage());
  }
}

Fixed version (ground truth):
private void _setupPreviewPage(){
  int pageIndex=1;
  IFile file=(IFile)getEditorInput().getAdapter(IFile.class);
  try {
    CompilationUnit compilationUnit=_getCompilationUnit();
    String packageName=null;
    if (compilationUnit.getPackage() != null)     packageName=compilationUnit.getPackage().getName().toString();
    IPath refactoredFile=Environment.getRefactoredFile(file.getLocation().toOSString(),packageName);
    IFile previewFile=Environment.getContainer(refactoredFile).getFile(null);
    _preview=new CompilationUnitEditor();
    _preview.init(_editor.getEditorSite(),new FileEditorInput(previewFile){
      public boolean exists(){
        return true;
      }
    }
);
  }
 catch (  Exception e) {
    OutputConsole.outputError(e.getMessage());
  }
}
Program: 75037
Project: 75037
Buggy source:
public void createPartControl(Composite parent){
  _container=_createContainer(parent);
  _createPages();
  ISourceViewer sourceViewer=getSourceViewer();
  if (sourceViewer == null)   return;
  IDocument document=sourceViewer.getDocument();
  if (document != null)   document.addDocumentListener(new IDocumentListener(){
    public void documentAboutToBeChanged(    DocumentEvent event){
    }
    public void documentChanged(    DocumentEvent event){
      _needRefactoring=true;
    }
  }
);
  _setActivePage(0);
}

Fixed version (ground truth):
public void createPartControl(Composite parent){
  _container=_createContainer(parent);
  _createPages();
  _preview.createPartControl((Composite)_container.getItem(1).getControl());
  super.createPartControl((Composite)_container.getItem(0).getControl());
  ISourceViewer sourceViewer=getSourceViewer();
  if (sourceViewer == null)   return;
  IDocument document=sourceViewer.getDocument();
  if (document != null)   document.addDocumentListener(new IDocumentListener(){
    public void documentAboutToBeChanged(    DocumentEvent event){
    }
    public void documentChanged(    DocumentEvent event){
      _needRefactoring=true;
    }
  }
);
  _setActivePage(0);
}
Program: 75038
Project: 75038
Buggy source:
public void resourceChanged(final IResourceChangeEvent event){
  if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        IWorkbenchPage[] pages=getSite().getWorkbenchWindow().getPages();
        for (int i=0; i < pages.length; i++) {
          if (((FileEditorInput)_editor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
            IEditorPart editorPart=pages[i].findEditor(_editor.getEditorInput());
            pages[i].closeEditor(editorPart,true);
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void resourceChanged(final IResourceChangeEvent event){
  if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        IWorkbenchPage[] pages=getSite().getWorkbenchWindow().getPages();
        for (int i=0; i < pages.length; i++) {
          if (((IFileEditorInput)_editor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
            IEditorPart editorPart=pages[i].findEditor(_editor.getEditorInput());
            pages[i].closeEditor(editorPart,true);
          }
        }
      }
    }
);
  }
}
Program: 75041
Project: 75041
Buggy source:
protected String getNewInputObject(){
  FileDialog dialog=new FileDialog(getShell());
  dialog.setText("String_Node_Str");
  String file=dialog.open();
  if (file != null) {
    file=file.trim();
    if (file.length() == 0)     return null;
  }
  return file;
}

Fixed version (ground truth):
protected String getNewInputObject(){
  String sourceList=_sourceList.getStringValue();
  String sourceListPath=new File(sourceList).getParent();
  FileDialog dialog=new FileDialog(getShell());
  dialog.setText("String_Node_Str");
  dialog.setFilterPath(sourceListPath);
  dialog.setFilterExtensions(new String[]{"String_Node_Str"});
  String file=dialog.open();
  if (file != null) {
    file=file.trim();
    if (file.length() == 0)     return null;
  }
  return file;
}