diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-04-11 16:33:35 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-04-11 20:48:58 +0200 |
commit | 8893f0dab4f866ac9a49cf4723fb6340196560d3 (patch) | |
tree | 7126fd36caa6c61fda367b1e7021b49fb8eb51b8 /sonar-plugin-api | |
parent | 0a55cf048ee3140a83dafaf51edf6b54456d65d6 (diff) | |
download | sonarqube-8893f0dab4f866ac9a49cf4723fb6340196560d3.tar.gz sonarqube-8893f0dab4f866ac9a49cf4723fb6340196560d3.zip |
Deprecate System2#isJavaAtLeast17()
because it always returns true. Java 6 is not supported at runtime.
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java | 4 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java index ef8fa8e878d..22b1cecf794 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java @@ -126,9 +126,11 @@ public class System2 { /** * True if Java 7 or Java 8 runtime environment * @since 4.3 + * @deprecated in 6.4. Java 8+ is required, so this method always returns {@code true}. */ + @Deprecated public boolean isJavaAtLeast17() { - return SystemUtils.isJavaVersionAtLeast(1.7f); + return true; } public void println(String obj) { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java index f1e1c7b24fd..607c271d8d6 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java @@ -84,12 +84,8 @@ public class System2Test { } @Test - public void testIsJavaAtLeast17() { - if (SystemUtils.IS_JAVA_1_6) { - assertThat(System2.INSTANCE.isJavaAtLeast17()).isFalse(); - } else { - assertThat(System2.INSTANCE.isJavaAtLeast17()).isTrue(); - } + public void isJavaAtLeast17_always_returns_true() { + assertThat(System2.INSTANCE.isJavaAtLeast17()).isTrue(); } @Test |