Program: 4774
Project: 4774
Buggy source:
/** 
 * Ensures this contains exactly the files specified by the EXTENSIONS_TO_SEARCH_FOR and DIRECTORIES_TO_SEARCH_FOR_FILES properties. That is, clears this and loads all files with the given extensions in the given directories <i>and their children</i>.  Note that some files in this before the call will not be in this after the call, or they may have a different index.  If DIRECTORIES_TO_SEARCH_FOR_FILES contains duplicate directories, the duplicates will be ignored.  If it contains files, they will be ignored.<p> This method is thread-safe but non-blocking.  When the method returns, the directory and extension settings used by addFileIfShared() are initialized.  However, files will actually be indexed asynchronously in another thread.  This is useful because indexing may take up to 30 seconds or so if sharing many files.  If loadSettings is subsequently called before the indexing is complete, the original settings are discarded, and loading starts over immediately. Modification 8/01 - This method is still non-blocking and thread safe, but it was refactored to make for easier subclassing of FileManager. Now, a protected method called loadSettingsBlocking() is used to index the files asynchronously.  Subclasses can override or extend this method to impose their own functionality.  For example, see MetaFileManager.
 * @modifies this 
 * @param notifyOnClear if true, callback is notified via clearSharedFileswhen the previous load settings thread has been killed.
 */
public void loadSettings(boolean notifyOnClear){
synchronized (_loadThreadLock) {
    if (_loadThread != null) {
      _loadThreadInterrupted=true;
      _loadThread.interrupt();
      try {
        _loadThread.join();
      }
 catch (      InterruptedException e) {
        return;
      }
    }
    final boolean notifyOnClearFinal=notifyOnClear;
    _loadThreadInterrupted=false;
    _loadThread=new Thread("String_Node_Str"){
      public void run(){
        try {
          loadSettingsBlocking(notifyOnClearFinal);
        }
 catch (        Exception e) {
          _callback.error(e);
        }
      }
    }
;
    _loadThread.start();
  }
}

Fixed version (ground truth):
/** 
 * Ensures this contains exactly the files specified by the EXTENSIONS_TO_SEARCH_FOR and DIRECTORIES_TO_SEARCH_FOR_FILES properties. That is, clears this and loads all files with the given extensions in the given directories <i>and their children</i>.  Note that some files in this before the call will not be in this after the call, or they may have a different index.  If DIRECTORIES_TO_SEARCH_FOR_FILES contains duplicate directories, the duplicates will be ignored.  If it contains files, they will be ignored.<p> This method is thread-safe but non-blocking.  When the method returns, the directory and extension settings used by addFileIfShared() are initialized.  However, files will actually be indexed asynchronously in another thread.  This is useful because indexing may take up to 30 seconds or so if sharing many files.  If loadSettings is subsequently called before the indexing is complete, the original settings are discarded, and loading starts over immediately. Modification 8/01 - This method is still non-blocking and thread safe, but it was refactored to make for easier subclassing of FileManager. Now, a protected method called loadSettingsBlocking() is used to index the files asynchronously.  Subclasses can override or extend this method to impose their own functionality.  For example, see MetaFileManager.
 * @modifies this 
 * @param notifyOnClear if true, callback is notified via clearSharedFileswhen the previous load settings thread has been killed.
 */
public void loadSettings(boolean notifyOnClear){
synchronized (_loadThreadLock) {
    if (_loadThread != null) {
      _loadThreadInterrupted=true;
      _loadThread.interrupt();
      try {
        _loadThread.join();
      }
 catch (      InterruptedException e) {
        return;
      }
    }
    final boolean notifyOnClearFinal=notifyOnClear;
    _loadThreadInterrupted=false;
    _loadThread=new Thread("String_Node_Str"){
      public void run(){
        try {
          loadSettingsBlocking(notifyOnClearFinal);
        }
 catch (        Throwable t) {
          _callback.error(t);
        }
      }
    }
;
    _loadThread.start();
  }
}