Skip to content

Commit

Permalink
Downgrade to language level 8 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaembo committed Jun 4, 2020
1 parent 2fa42a8 commit ca18ca4
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ apply plugin: 'org.jetbrains.intellij'
apply plugin: 'maven-publish'
apply plugin: 'java'

sourceCompatibility = 1.11
targetCompatibility = 1.11
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenLocal()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
# If not, see <http://www.gnu.org/licenses/>.
#

version=1.1.1
version=1.2.0
ijVersion=2019.3
48 changes: 48 additions & 0 deletions src/main/java/icons/InitIcons.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2020 SpotBugs plugin contributors
*
* This file is part of IntelliJ SpotBugs plugin.
*
* IntelliJ SpotBugs plugin is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* IntelliJ SpotBugs plugin is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IntelliJ SpotBugs plugin.
* If not, see <http://www.gnu.org/licenses/>.
*/

package icons;

import javax.swing.*;
import java.util.*;

import static icons.PluginIcons.*;

class InitIcons {
static Map<String, Icon> initGroupByRankIconsMap() {
Map<String, Icon> iconMap = new HashMap<>();
iconMap.put("SCARIEST", GROUP_BY_RANK_SCARIEST_ICON);
iconMap.put("SCARY", GROUP_BY_RANK_SCARY_ICON);
iconMap.put("TROUBLING", GROUP_BY_RANK_TROUBLING_ICON);
iconMap.put("OF_CONCERN", GROUP_BY_RANK_OF_CONCERN_ICON);
iconMap.put("OF CONCERN", GROUP_BY_RANK_OF_CONCERN_ICON);
return Collections.unmodifiableMap(iconMap);
}

static Map<String, Icon> initGroupByPriorityIconsMap() {
Map<String, Icon> iconMap = new HashMap<>();
iconMap.put("Low", GROUP_BY_PRIORITY_LOW_ICON);
iconMap.put("Medium", GROUP_BY_PRIORITY_MEDIUM_ICON);
iconMap.put("High", GROUP_BY_PRIORITY_HIGH_ICON);
iconMap.put("Exp", GROUP_BY_PRIORITY_EXP_ICON);
iconMap.put("Ignore", GROUP_BY_PRIORITY_IGNORE_ICON);
return Collections.unmodifiableMap(iconMap);
}
}
20 changes: 4 additions & 16 deletions src/main/java/icons/PluginIcons.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.jetbrains.plugins.spotbugs.resources.ResourcesLoader;

import javax.swing.*;
import java.util.Map;
import java.util.*;

public interface PluginIcons {

Expand Down Expand Up @@ -91,35 +91,23 @@ public interface PluginIcons {
ResourcesLoader.loadIcon("actions/groupByTemplate.svg")
);

Map<String, Icon> GROUP_BY_RANK_ICONS = Map.of(
"SCARIEST", GROUP_BY_RANK_SCARIEST_ICON,
"SCARY", GROUP_BY_RANK_SCARY_ICON,
"TROUBLING", GROUP_BY_RANK_TROUBLING_ICON,
"OF_CONCERN", GROUP_BY_RANK_OF_CONCERN_ICON,
"OF CONCERN", GROUP_BY_RANK_OF_CONCERN_ICON
);
Map<String, Icon> GROUP_BY_RANK_ICONS = InitIcons.initGroupByRankIconsMap();

Icon GROUP_BY_PRIORITY_HIGH_ICON = ResourcesLoader.loadIcon("priority/priorityHigh.png");
Icon GROUP_BY_PRIORITY_MEDIUM_ICON = ResourcesLoader.loadIcon("priority/priorityMedium.png");
Icon GROUP_BY_PRIORITY_LOW_ICON = ResourcesLoader.loadIcon("priority/priorityLow.png");
Icon GROUP_BY_PRIORITY_EXP_ICON = ResourcesLoader.loadIcon("priority/priorityExp.png");
Icon GROUP_BY_PRIORITY_IGNORE_ICON = ResourcesLoader.loadIcon("priority/priorityIgnore.png");

Map<String, Icon> GROUP_BY_PRIORITY_ICONS = Map.of(
"Low", GROUP_BY_PRIORITY_LOW_ICON,
"Medium", GROUP_BY_PRIORITY_MEDIUM_ICON,
"High", GROUP_BY_PRIORITY_HIGH_ICON,
"Exp", GROUP_BY_PRIORITY_EXP_ICON,
"Ignore", GROUP_BY_PRIORITY_IGNORE_ICON
);
Map<String, Icon> GROUP_BY_PRIORITY_ICONS = InitIcons.initGroupByPriorityIconsMap();

/**
* --------------------------------------------------------------------------------------------------
* Priority icons
*/
Icon HIGH_PRIORITY_ICON = ResourcesLoader.loadIcon("priority/bugHigh.svg");
Icon NORMAL_PRIORITY_ICON = ResourcesLoader.loadIcon("priority/bugNormal.svg");
Icon LOW_PRIORITY_ICON = ResourcesLoader.loadIcon("priority/bugLow.svg");
Icon LOW_PRIORITY_ICON = ResourcesLoader.loadIcon("priority/bugLow.svg");
Icon EXP_PRIORITY_ICON = ResourcesLoader.loadIcon("priority/bugExp.svg");

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -163,7 +163,11 @@ private SubmittedReportInfo openBrowser(

@NotNull
private static String encode(@NotNull final String value) {
return URLEncoder.encode(value, StandardCharsets.UTF_8);
try {
return URLEncoder.encode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new InternalError("UTF-8 is not available");
}
}

@NotNull
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
</description>
<change-notes>
<![CDATA[<html>
<h3>1.2.0</h3>
<ul>
<li>Fixes issue #13: SpotBugs plugin cannot start on Java 8 boot JDK</li>
<li>Cosmetic changes</li>
</ul>
<h3>1.1.1</h3>
<ul>
<li>Updated SpotBugs to version 4.0.3 to avoid installing SecurityManager during analysis.
Expand Down

0 comments on commit ca18ca4

Please sign in to comment.