docs: public static List<IPathElement> getPluginElements(UserPreferences userPreferences) {
          DetectorValidator validator = new DetectorValidator();
          final List<IPathElement> newPaths = new ArrayList<>();
          Map<String, Boolean> pluginPaths = userPreferences.getCustomPlugins();
  
          Set<String> disabledSystemPlugins = new HashSet<>();
          Set<URI> customPlugins = new HashSet<>();
          Set<Entry<String,Boolean>> entrySet = pluginPaths.entrySet();
          for (Entry<String, Boolean> entry : entrySet) {
              String idOrPath = entry.getKey();
              if(new Path(idOrPath).segmentCount() == 1) {
                  PathElement element = new PathElement(new Path(idOrPath), Status.OK_STATUS);
                  element.setSystem(true);
                  if (!entry.getValue().booleanValue()) {
                      element.setEnabled(false);
                      // this is not a path => this is a disabled plugin id
                      disabledSystemPlugins.add(idOrPath);
                      newPaths.add(element);
                  } else {
                      element.setEnabled(true);
                  }
                  continue;
              }
  
              // project is not supported (propertyPage.getProject() == null for workspace prefs).
              IPath pluginPath = FindBugsWorker.getFilterPath(idOrPath, null);
              URI uri = pluginPath.toFile().toURI();
              customPlugins.add(uri);
              ValidationStatus status = validator.validate(pluginPath.toOSString());
              PathElement element = new PathElement(pluginPath, status);
              Plugin plugin = Plugin.getByPluginId(status.getSummary().id);
              if(plugin != null && !uri.equals(plugin.getPluginLoader().getURI())) {
                  // disable contribution if the plugin is already there
                  // but loaded from different location
                  element.setEnabled(false);
              } else {
                  element.setEnabled(entry.getValue().booleanValue());
              }
              newPaths.add(element);
          }
  
          Map<URI, Plugin> allPlugins = Plugin.getAllPluginsMap();
  
          // List of plugins contributed by Eclipse
          SortedMap<String, String> contributedDetectors = DetectorsExtensionHelper.getContributedDetectors();
          for (Entry<String, String> entry : contributedDetectors.entrySet()) {
              String pluginId = entry.getKey();
              URI uri = new Path(entry.getValue()).toFile().toURI();
              Plugin plugin = allPlugins.get(uri);
              if(plugin != null && !isEclipsePluginDisabled(pluginId, allPlugins)) {
                  PluginElement element = new PluginElement(plugin, true);
                  newPaths.add(0, element);
                  customPlugins.add(uri);
              }
          }
  
          // Remaining plugins contributed by FB itself
          for (Plugin plugin : allPlugins.values()) {
              PluginElement element = new PluginElement(plugin, false);
              if(!customPlugins.contains(plugin.getPluginLoader().getURI())) {
                  newPaths.add(0, element);
                  if(disabledSystemPlugins.contains(plugin.getPluginId())) {
                      element.setEnabled(false);
                  }
              }
          }
          return newPaths;
      }