From 5c43e9dac336b37fa4f6f002709e0965015383aa Mon Sep 17 00:00:00 2001 From: Zhongnan Su Date: Thu, 10 Mar 2022 16:40:37 -0800 Subject: [PATCH] change to support java 8 in compile and runtime (#575) Signed-off-by: Zhongnan Su --- .../opensearch-observability-test-and-build-workflow.yml | 1 + .../org/opensearch/observability/settings/PluginSettings.kt | 4 ++-- .../kotlin/org/opensearch/observability/PluginRestTestCase.kt | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/opensearch-observability-test-and-build-workflow.yml b/.github/workflows/opensearch-observability-test-and-build-workflow.yml index 618308a33..2c33f8511 100644 --- a/.github/workflows/opensearch-observability-test-and-build-workflow.yml +++ b/.github/workflows/opensearch-observability-test-and-build-workflow.yml @@ -12,6 +12,7 @@ jobs: strategy: matrix: java: + - 8 - 11 - 14 diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt index 7782425ca..0f5d31504 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt @@ -15,7 +15,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.observability.ObservabilityPlugin.Companion.LOG_PREFIX import org.opensearch.observability.ObservabilityPlugin.Companion.PLUGIN_NAME import java.io.IOException -import java.nio.file.Path +import java.nio.file.Paths /** * settings specific to observability Plugin. @@ -246,7 +246,7 @@ internal object PluginSettings { var settings: Settings? = null val configDirName = BootstrapInfo.getSystemProperties()?.get("opensearch.path.conf")?.toString() if (configDirName != null) { - val defaultSettingYmlFile = Path.of(configDirName, PLUGIN_NAME, "observability.yml") + val defaultSettingYmlFile = Paths.get(configDirName, PLUGIN_NAME, "observability.yml") try { settings = Settings.builder().loadFromPath(defaultSettingYmlFile).build() } catch (exception: IOException) { diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt index 33afa6e80..c80e1bddd 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt @@ -38,7 +38,7 @@ import java.io.IOException import java.io.InputStreamReader import java.nio.charset.StandardCharsets import java.nio.file.Files -import java.nio.file.Path +import java.nio.file.Paths import java.security.cert.X509Certificate import javax.management.MBeanServerInvocationHandler import javax.management.ObjectName @@ -263,7 +263,7 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() { false ) proxy.getExecutionData(false)?.let { - val path = Path.of("$jacocoBuildPath/integTest.exec") + val path = Paths.get("$jacocoBuildPath/integTest.exec") Files.write(path, it) } }