Skip to content

Commit

Permalink
FindBugs -> SpotBugs renamings; URLs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
amaembo committed Apr 6, 2020
1 parent ff7150d commit a3faf09
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void setProblemGroup(@Nullable final ProblemGroup problemgroup) {

@Override
public String getProblemName() {
return "FindBugs-IDEA";
return "SpotBugs";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void startImpl(final boolean justCompiled) {

final ToolWindow toolWindow = ToolWindowPanel.getWindow(project);
if (toolWindow == null) {
throw new IllegalStateException("No FindBugs ToolWindow");
throw new IllegalStateException("No SpotBugs ToolWindow");
}
/*
* Important: Make sure the tool window is initialized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,24 @@ private PluginVersionChecker() {
static String getLatestVersion(@NotNull final ProgressIndicator indicator) throws IOException {
final String url = getLatestReleaseUrl();
indicator.setText(ResourcesLoader.getString("error.submitReport.retrieve", url));
final RequestBuilder request = HttpRequests
final RequestBuilder builder = HttpRequests
.request(url)
.accept("application/vnd.github.v2+json");
return request.connect(new HttpRequests.RequestProcessor<String>() {
@Override
public String process(@NotNull final HttpRequests.Request request) throws IOException {
final Reader reader = request.getReader();
try {
LatestRelease latestRelease = new GsonBuilder().create().fromJson(reader, LatestRelease.class);
return latestRelease.name;
} finally {
IoUtil.safeClose(reader);
}
return builder.connect(request -> {
final Reader reader = request.getReader();
try {
LatestRelease latestRelease = new GsonBuilder().create().fromJson(reader, LatestRelease.class);
return latestRelease.name;
} finally {
IoUtil.safeClose(reader);
}
});
}

@NotNull
private static String getLatestReleaseUrl() {
// https support only
return "https://api.github.com/repos/andrepdo/findbugs-idea/releases/latest";
return "https://api.github.com/repos/JetBrains/spotbugs-intellij-plugin/releases/latest";
}

private static class LatestRelease {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void actionPerformed(@NotNull final AnActionEvent e) {
ResourcesLoader.getString("settings.export.title"),
ResourcesLoader.getString("settings.export.description"),
XmlFileType.DEFAULT_EXTENSION
), settingsPane).save(null, "FindBugs-IDEA");
), settingsPane).save(null, "SpotBugs");
if (wrapper == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ private static File findAccessibleFindBugsIdeaPluginPath(@NotNull final IdeaPlug
// PathManager.getSystemPath() may return relative path
final File pluginsPath = new File(PathManager.getPluginsPath()).getAbsoluteFile();
if (!pluginsPath.isDirectory() || !pluginsPath.canWrite()) {
throw new IllegalStateException("No accessible FindBugs-IDEA plugin directory found. Tested candidates:\n" +
throw new IllegalStateException("No accessible SpotBugs plugin directory found. Tested candidates:\n" +
"'" + ret.getAbsolutePath() + "': isDirectory=" + ret.isDirectory() + ", canWrite=" + ret.canWrite() + "\n" +
"'" + pluginsPath.getAbsolutePath() + "': isDirectory=" + pluginsPath.isDirectory() + ", canWrite=" + pluginsPath.canWrite());
}
ret = new File(pluginsPath, "FindBugs-IDEA");
ret = new File(pluginsPath, "spotbugs-idea");
if (!ret.isDirectory()) {
if (!ret.mkdirs()) {
throw new IllegalStateException("Could not create alternative FindBugs-IDEA plugin directory: " + ret.getAbsolutePath());
throw new IllegalStateException("Could not create alternative SpotBugs plugin directory: " + ret.getAbsolutePath());
}
}
}
Expand All @@ -105,7 +105,7 @@ public static File getDirectory(@NotNull final IdeaPluginDescriptor pluginDescri
final File dir = new File(homeDir, "customPlugins");
if (!dir.isDirectory()) {
if (!dir.mkdirs()) {
throw new IllegalStateException("Could not create FindBugs-IDEA custom plugins directory: " + dir.getAbsolutePath());
throw new IllegalStateException("Could not create SpotBugs custom plugins directory: " + dir.getAbsolutePath());
}
}
return dir;
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@
<projectService serviceImplementation="org.jetbrains.plugins.spotbugs.core.WorkspaceSettings"/>
<projectService serviceImplementation="org.jetbrains.plugins.spotbugs.core.ProjectSettings"/>
<projectService serviceImplementation="org.jetbrains.plugins.spotbugs.gui.preferences.LegacyProjectSettings"/>
<projectConfigurable provider="org.jetbrains.plugins.spotbugs.core.ProjectConfigurableProvider"
displayName="IntelliJ SpotBugs"/>
<projectConfigurable groupId="tools" provider="org.jetbrains.plugins.spotbugs.core.ProjectConfigurableProvider"
displayName="SpotBugs"/>
<search.optionContributor implementation="org.jetbrains.plugins.spotbugs.gui.settings.SearchableOptionContributorImpl"/>

<moduleService serviceImplementation="org.jetbrains.plugins.spotbugs.core.ModuleSettings"/>
<moduleService serviceImplementation="org.jetbrains.plugins.spotbugs.gui.preferences.LegacyModuleSettings"/>
<moduleConfigurable provider="org.jetbrains.plugins.spotbugs.core.ModuleConfigurableProvider"
displayName="IntelliJ SpotBugs"/>
displayName="SpotBugs"/>
<checkinHandlerFactory implementation="org.jetbrains.plugins.spotbugs.core.CheckinHandlerFactoryImpl"/>
</extensions>
<extensions defaultExtensionNs="com.intellij">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ settings.action.import.description=Import Settings from file
settings.action.export.title=Export
settings.action.export.description=Export Settings to file
settings.export.title=Target File
settings.export.description=Export FindBugs-IDEA settings to
settings.export.description=Export SpotBugs plugin settings to
settings.export.success.title=Export complete
settings.export.success.text=Your settings have been successfully exported.
settings.module.overrideProjectSettings=Override FindBugs-IDEA project settings
settings.module.overrideProjectSettings=Override SpotBugs project settings
settings.module.reset.text=Do you want to reset the settings to the default?
settings.module.loadProject.title=Project settings
settings.module.loadProject.text=Do you want to load the project settings?

settings.choose.title=Setting File Location
settings.choose.description=Choose FindBugs-IDEA or Sonar setting file
settings.choose.description=Choose SpotBugs plugin or Sonar setting file

general.compileBeforeAnalyze.title=Compile affected files before analyze
general.analyzeAfterCompile.title=Analyze affected files after compile
Expand Down Expand Up @@ -111,13 +111,13 @@ annotate.textRange.text=Enable editor TextRange markup & Suppress bug pattern fe

share.description=This setting file will be imported before the analyze is started. \
The current settings will be overwritten. \
Sonar and FindBugs-IDEA setting file format is supported. \
Sonar and SpotBugs plugin setting file format is supported. \
This might primarily be a good solution to share Sonar setting file. \
In case of FindBugs-IDEA setting file it could be better to share the 'findbugs-idea.xml' (within .idea project directory) \
In case of SpotBugs plugin setting file it could be better to share the 'findbugs-idea.xml' (within .idea project directory) \
with the official solution:

share.file.title=FindBugs-IDEA or Sonar setting file
share.url=https://www.jetbrains.com/help/idea/2016.1/synchronizing-and-sharing-settings.html
share.file.title=SpotBugs plugin or Sonar setting file
share.url=https://www.jetbrains.com/help/idea/2020.1/sharing-your-ide-settings.html

export.title=Export bug collection
export.directory.label=Export bug collection to directory
Expand All @@ -141,10 +141,10 @@ analysis.noOutputPaths=No compiler output path(s) found. Maybe the module(s) mus
analysis.includeTests.title=Test sources
analysis.includeTests.text=Do you want to include test sources for the analysis?
analysis.error.importSettings.title=Import FindBugs Settings
analysis.error.importSettings.notExists=Specified \"FindBugs-IDEA or Sonar setting file\" ({0}) not exists
analysis.error.importSettings.noFile=Specified \"FindBugs-IDEA or Sonar setting file\" ({0}) is not a file
analysis.error.importSettings.notReadable=Specified \"FindBugs-IDEA or Sonar setting file\" ({0}) is not readable
analysis.error.importSettings.fatal=Fatal error while import the specified \"FindBugs-IDEA or Sonar setting file\" ({0}): {1} \
analysis.error.importSettings.notExists=Specified \"SpotBugs plugin or Sonar setting file\" ({0}) not exists
analysis.error.importSettings.noFile=Specified \"SpotBugs plugin or Sonar setting file\" ({0}) is not a file
analysis.error.importSettings.notReadable=Specified \"SpotBugs plugin or Sonar setting file\" ({0}) is not readable
analysis.error.importSettings.fatal=Fatal error while import the specified \"SpotBugs plugin or Sonar setting file\" ({0}): {1} \
<br>See logs for more details/stack
edit.settings=Edit settings

Expand All @@ -167,10 +167,10 @@ error.file.type=Path \"{0}\" is not a file.
error.directory.type=Path \"{0}\" is not a directory.
error.customPlugins.title=Error while loading custom FindBugs plugins
error.submitReport.title=Copy error to clipboard and open page
error.submitReport.checkVersion=Check FindBugs-IDEA plugin version
error.submitReport.checkVersion=Check SpotBugs plugin version
error.submitReport.retrieve=Retrieve infos from {0}
error.submitReport.old.title=Old FindBugs-IDEA version
error.submitReport.old.text=<html>FindBugs-IDEA plugin is out of date. Please consider to update the plugin.<br> \
error.submitReport.old.title=Old SpotBugs plugin version
error.submitReport.old.text=<html>SpotBugs plugin is out of date. Please consider to update the plugin.<br> \
Your version: <b>{0}</b><br> \
Latest available version: <b>{1}</b><br><br> \
Do you want to continue reporting this issue?</html>
Expand Down

0 comments on commit a3faf09

Please sign in to comment.