if (!pluginFile.getName().endsWith(".jar")) {
continue;
}
try {
if (FindBugsCustomPluginUtil.check(pluginFile)) {
Plugin plugin = FindBugsCustomPluginUtil.loadTemporary(pluginFile);
if (plugin == null) {
handleError("Could not load plugin: " + pluginFile.getPath());
continue;
}
seenBundledPlugin(plugin);
if (!disabledBundledPluginIds.contains(plugin.getPluginId()) && enabledBundledPluginIds.contains(plugin.getPluginId())) {
enabledBundledPluginUrls.add(FindBugsCustomPluginUtil.getAsString(plugin));
}
FindBugsCustomPluginUtil.unload(plugin);
} else {
handleError("Plugin '" + pluginFile.getPath() + "' not loaded. Archive inaccessible.");
}
} catch (final Exception e) {
handleError("Could not load custom findbugs plugin: " + pluginFile.getPath(), e);
}
}
}
// 3. load user plugins and unload
final Set<String> enabledUserPluginUrls = new HashSet<String>();
for (final String pluginUrl : userPluginsUrls) {
try {
final File pluginFile = FindBugsCustomPluginUtil.getAsFile(pluginUrl);
if (FindBugsCustomPluginUtil.check(pluginFile)) {
final Plugin plugin = FindBugsCustomPluginUtil.loadTemporary(pluginUrl);
if (plugin == null) {
handleError("Could not load plugin: " + pluginUrl);
continue;
}
seenUserPlugin(plugin);
if (!disabledUserPluginIds.contains(plugin.getPluginId())) {
enabledUserPluginUrls.add(pluginUrl);
}
FindBugsCustomPluginUtil.unload(plugin);
} else {
handleError("Plugin '" + pluginUrl + "' not loaded. Archive '" + pluginFile.getPath() + "' inaccessible or not exists.");