Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.Plugin


    }

    private void addDetectorInfo(StringBuilder text) {
        DetectorFactory factory = bug.getDetectorFactory();
        if (factory != null) {
            Plugin plugin = factory.getPlugin();
            if (!plugin.isCorePlugin()) {
                text.append("<p><small><i>Reported by: ").append(factory.getFullName());
                text.append("<br>Contributed by plugin: ").append(plugin.getPluginId());
                text.append("<br>Provider: ").append(plugin.getProvider());
                String website = plugin.getWebsite();
                if (website != null && website.length() > 0) {
                    text.append(" (<a href=\"").append(website).append("\">");
                    text.append(website).append("</a>)");
                }
                text.append("</i></small>");
View Full Code Here


            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;
View Full Code Here

                e.printStackTrace();
            }
            return new ValidationStatus(IStatus.ERROR,
                    "Invalid FindBugs plugin archive: " + e.getMessage(), sum, e);
        }
        Plugin loadedPlugin = Plugin.getByPluginId(sum.id);
        URI uri = file.toURI();
        if(loadedPlugin != null && !uri.equals(loadedPlugin.getPluginLoader().getURI())
                && loadedPlugin.isGloballyEnabled()) {
            return new ValidationStatus(IStatus.ERROR, "Duplicated FindBugs plugin: " + sum.id + ", already loaded from: "
                    + loadedPlugin.getPluginLoader().getURI(), sum, null);
        }
        return new ValidationStatus(IStatus.OK, Status.OK_STATUS.getMessage(), sum, null);
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.Plugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.