From 6bb15a7a392e5da7c0e81ad3faf9d643c6dd1cc5 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 4 Dec 2019 13:04:53 +0100 Subject: [PATCH] SONAR-12770 Do not let people think that a Java version > 11 is officially supported --- .../src/main/java/org/sonar/application/App.java | 6 ++---- .../java/org/sonar/scanner/bootstrap/GlobalContainer.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index c37aff811d4..92f8881abbd 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -32,6 +32,7 @@ import org.sonar.core.extension.ServiceLoaderWrapper; import org.sonar.process.System2; import org.sonar.process.SystemExit; +import static com.google.common.base.Preconditions.checkState; import static org.sonar.application.config.SonarQubeVersionHelper.getSonarqubeVersion; import static org.sonar.process.ProcessProperties.Property.CLUSTER_NAME; @@ -88,10 +89,7 @@ public class App { if (MetadataLoader.loadEdition(org.sonar.api.utils.System2.INSTANCE) == SonarEdition.SONARCLOUD) { return; } - - if (!javaVersion.isAtLeastJava11()) { - throw new IllegalStateException("SonarQube requires Java 11+ to run"); - } + checkState(javaVersion.isAtLeastJava11(), "SonarQube requires Java 11 to run"); } public static void main(String[] args) throws Exception { diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java index 87f69aad2a8..8be6fb7cef7 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java @@ -83,7 +83,7 @@ public class GlobalContainer extends ComponentContainer { try { String.class.getMethod("isBlank"); } catch (NoSuchMethodException e) { - LOG.warn("SonarScanner will require Java 11+ to run starting in SonarQube 8.x"); + LOG.warn("SonarScanner will require Java 11 to run starting in SonarQube 8.x"); } } -- 2.39.5