aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-29 10:11:27 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-29 10:11:27 +0100
commit74e26bd277d246d91a08cd7d51f11bff916ee221 (patch)
treeaf7c712b02e2834f98a5d473b5eb8878019b1762 /sonar-core
parent6efaff4f7669025ba44d53974be4e301512c3098 (diff)
downloadsonarqube-74e26bd277d246d91a08cd7d51f11bff916ee221.tar.gz
sonarqube-74e26bd277d246d91a08cd7d51f11bff916ee221.zip
Fix quality flaws
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/IssueType.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/util/DefaultHttpDownloader.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/util/HttpsTrust.java4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java6
4 files changed, 10 insertions, 4 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/IssueType.java b/sonar-core/src/main/java/org/sonar/core/issue/IssueType.java
index 32a20a80891..19c1bf35b42 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/IssueType.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/IssueType.java
@@ -51,5 +51,5 @@ public enum IssueType {
throw new IllegalArgumentException(format("Unsupported value for db column ISSUES.ISSUE_TYPE: %d", dbConstant));
}
- public static List<String> ALL_NAMES = Lists.transform(Lists.newArrayList(values()), Enums.stringConverter(IssueType.class).reverse());
+ public static final List<String> ALL_NAMES = Lists.transform(Lists.newArrayList(values()), Enums.stringConverter(IssueType.class).reverse());
}
diff --git a/sonar-core/src/main/java/org/sonar/core/util/DefaultHttpDownloader.java b/sonar-core/src/main/java/org/sonar/core/util/DefaultHttpDownloader.java
index a1572554d86..13e27f72a43 100644
--- a/sonar-core/src/main/java/org/sonar/core/util/DefaultHttpDownloader.java
+++ b/sonar-core/src/main/java/org/sonar/core/util/DefaultHttpDownloader.java
@@ -207,7 +207,7 @@ public class DefaultHttpDownloader extends HttpDownloader {
return Joiner.on(", ").join(descriptions);
}
- private void registerProxyCredentials(Map<String, String> settings) {
+ private static void registerProxyCredentials(Map<String, String> settings) {
Authenticator.setDefault(new ProxyAuthenticator(
settings.get(HTTP_PROXY_USER),
settings.get(HTTP_PROXY_PASSWORD)));
diff --git a/sonar-core/src/main/java/org/sonar/core/util/HttpsTrust.java b/sonar-core/src/main/java/org/sonar/core/util/HttpsTrust.java
index 895ebea175e..4946b0a9874 100644
--- a/sonar-core/src/main/java/org/sonar/core/util/HttpsTrust.java
+++ b/sonar-core/src/main/java/org/sonar/core/util/HttpsTrust.java
@@ -66,7 +66,7 @@ class HttpsTrust {
/**
* Trust all certificates
*/
- private SSLSocketFactory createSocketFactory(Ssl context) {
+ private static SSLSocketFactory createSocketFactory(Ssl context) {
try {
return context.newFactory(new AlwaysTrustManager());
} catch (Exception e) {
@@ -77,7 +77,7 @@ class HttpsTrust {
/**
* Trust all hosts
*/
- private HostnameVerifier createHostnameVerifier() {
+ private static HostnameVerifier createHostnameVerifier() {
return new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java b/sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java
index 57bd07483e6..a02bc77c728 100644
--- a/sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java
@@ -47,4 +47,10 @@ public class IssueTypeTest {
public void test_ALL_NAMES() {
assertThat(IssueType.ALL_NAMES).containsOnly("BUG", "VULNERABILITY", "CODE_SMELL");
}
+
+ @Test
+ public void ALL_NAMES_is_immutable() {
+ expectedException.expect(UnsupportedOperationException.class);
+ IssueType.ALL_NAMES.add("foo");
+ }
}