Program: 78241
Project: 78241
Buggy source:
/** 
 * Reloads the library with the given file path. After reloading, acticity stack is cleared.
 * @param location the URL file path of the library file.
 * @throws DesignFileException if the file does no exist.
 * @throws SemanticException if the library is not included in the current module.
 */
public void reloadLibrary(String location) throws DesignFileException, SemanticException {
  Library library=module.getLibraryByLocation(location);
  if (!module.getLibraries().contains(library)) {
    throw new LibraryException(library,new String[]{library == null ? null : library.getNamespace()},LibraryException.DESIGN_EXCEPTION_LIBRARY_NOT_FOUND);
  }
  String namespace=library.getNamespace();
  IncludedLibrary includedItem=module.findIncludedLibrary(namespace);
  String path=includedItem.getFileName();
  URL url=module.findResource(path,IResourceLocator.LIBRARY);
  if (url == null) {
    DesignParserException ex=new DesignParserException(new String[]{path},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(path,exceptionList);
  }
  Map overriddenValues=null;
  ActivityStack activityStack=getActivityStack();
  activityStack.startFilterEventTrans(null);
  try {
    overriddenValues=dealAllElementDecendents(library,RELOAD_ACTION);
    doDropLibrary(library);
    doAddLibrary(path,namespace,RELOAD_ACTION,overriddenValues);
  }
 catch (  SemanticException e) {
    activityStack.rollback();
    throw e;
  }
catch (  DesignFileException e) {
    activityStack.rollback();
    throw e;
  }
  activityStack.commit();
  activityStack.flush();
  LibraryEvent event=new LibraryEvent(module.getLibraryByLocation(location),LibraryEvent.RELOAD);
  module.broadcast(event);
}

Fixed version (ground truth):
/** 
 * Reloads the library with the given file path. After reloading, acticity stack is cleared.
 * @param location the URL file path of the library file.
 * @throws DesignFileException if the file does no exist.
 * @throws SemanticException if the library is not included in the current module.
 */
public void reloadLibrary(String location) throws DesignFileException, SemanticException {
  Library library=module.getLibraryByLocation(location);
  if (!module.getLibraries().contains(library)) {
    throw new LibraryException(library,new String[]{library == null ? null : library.getNamespace()},LibraryException.DESIGN_EXCEPTION_LIBRARY_NOT_FOUND);
  }
  String namespace=library.getNamespace();
  IncludedLibrary includedItem=module.findIncludedLibrary(namespace);
  String path=includedItem.getFileName();
  URL url=module.findResource(path,IResourceLocator.LIBRARY);
  if (url == null) {
    DesignParserException ex=new DesignParserException(new String[]{path},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(path,exceptionList);
  }
  Map overriddenValues=null;
  ActivityStack activityStack=getActivityStack();
  activityStack.startSilentTrans();
  try {
    overriddenValues=dealAllElementDecendents(library,RELOAD_ACTION);
    doDropLibrary(library);
    doAddLibrary(path,namespace,RELOAD_ACTION,overriddenValues);
  }
 catch (  SemanticException e) {
    activityStack.rollback();
    throw e;
  }
catch (  DesignFileException e) {
    activityStack.rollback();
    throw e;
  }
  activityStack.commit();
  activityStack.flush();
  LibraryEvent event=new LibraryEvent(module.getLibraryByLocation(location),LibraryEvent.RELOAD);
  module.broadcast(event);
}