Program: 69231
Project: 69231
Buggy source:
/** 
 * Reloads the library with the given library file path. If the library already is included directly or indirectly(that is, the reload path could be the path of grandson of this module), reload it. If the library is not included, exception will be thrown. <p> Call this method cautiously ONLY on the condition that the library file is REALLY changed outside. After reload successfully, the command stack is cleared.
 * @param reloadPath this is supposed to be an absolute path, not in url form.
 * @throws SemanticException if error is encountered when handling <code>IncludeLibrary </code> structure list. Or it maybe because that the given library is not found in the design. Or that the library has descedents in the current module
 * @throws DesignFileException if the library file is not found, or has fatal error.
 */
public void reloadLibrary(String reloadPath) throws SemanticException, DesignFileException {
  if (StringUtil.isEmpty(reloadPath))   return;
  URL url=ModelUtil.getURLPresentation(reloadPath);
  String path=null;
  if (url != null)   path=url.toExternalForm();
  if (path == 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);
  }
  List<Library> libs=module.getLibrariesByLocation(path,IAccessControl.ARBITARY_LEVEL);
  Map<String,Library> reloadLibs=new HashMap();
  for (int i=0; i < libs.size(); i++) {
    LibraryCommand command=new LibraryCommand(module);
    Library lib=libs.get(i);
    command.reloadLibrary(lib,null,reloadLibs);
  }
  ModuleOption options=module.getOptions();
  if (options == null || options.useSemanticCheck())   checkReport();
}

Fixed version (ground truth):
/** 
 * Reloads the library with the given library file path. If the library already is included directly or indirectly(that is, the reload path could be the path of grandson of this module), reload it. If the library is not included, exception will be thrown. <p> Call this method cautiously ONLY on the condition that the library file is REALLY changed outside. After reload successfully, the command stack is cleared.
 * @param reloadPath this is supposed to be an absolute path, not in url form.
 * @throws SemanticException if error is encountered when handling <code>IncludeLibrary </code> structure list. Or it maybe because that the given library is not found in the design. Or that the library has descedents in the current module
 * @throws DesignFileException if the library file is not found, or has fatal error.
 */
public void reloadLibrary(String reloadPath) throws SemanticException, DesignFileException {
  if (StringUtil.isEmpty(reloadPath))   return;
  URL url=ModelUtil.getURLPresentation(reloadPath);
  String path=null;
  if (url != null)   path=url.toExternalForm();
  if (path == null) {
    DesignParserException ex=new DesignParserException(new String[]{reloadPath},DesignParserException.DESIGN_EXCEPTION_FILE_NOT_FOUND);
    List exceptionList=new ArrayList();
    exceptionList.add(ex);
    throw new DesignFileException(path,exceptionList);
  }
  List<Library> libs=module.getLibrariesByLocation(path,IAccessControl.ARBITARY_LEVEL);
  Map<String,Library> reloadLibs=new HashMap();
  for (int i=0; i < libs.size(); i++) {
    LibraryCommand command=new LibraryCommand(module);
    Library lib=libs.get(i);
    command.reloadLibrary(lib,null,reloadLibs);
  }
  ModuleOption options=module.getOptions();
  if (options == null || options.useSemanticCheck())   checkReport();
}