Пример #1
0
  /**
   * When plugin.xml has changed re-read our data and perhaps clear cached data in the
   * JavaModelManager and RequirePluginsClasspathContainer.
   */
  void reload() {
    this.hasChanges = true;

    HashMap<String, HashSet<String>> oldForcedExports = this.base2forcedExports;
    HashMap<String, HashSet<String>> oldTeamBindings = this.team2basePlugins;
    // clear internal storage:
    this.team2basePlugins =
        null; // be sure to initialize new sets if needed, so we can compare sets using
              // mapHasChanged
    this.base2forcedExports = null;
    this.adaptationInfos
        .clear(); // these two are created by default (and no need to compare old/new)
    this.teamsAdaptingSelf.clear();

    if (!this.readAspectBindings(this.iProject, getSaxParserFactory())) {
      OTDTPlugin.getDefault()
          .getLog()
          .log(
              new Status(
                  Status.ERROR,
                  OTDTPlugin.PLUGIN_ID,
                  "Unable to re-read plugin.xml!;")); //$NON-NLS-1$
      return;
    }

    // remove cached data if forced exports or team bindings have changed:
    if (mapHasChanged(oldForcedExports, this.base2forcedExports)
        || mapHasChanged(oldTeamBindings, this.team2basePlugins)) {
      resetRequiredPluginsClasspathContainer(this.iProject);
    }
  }