mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[java] uniform formatting of GraalVM JDK version string (IDEA-348070)
JRE version should go first, because various parsers don't expect a VM version at the beginning of the string GitOrigin-RevId: e09e269841ffe71792f30c05b18b47e3aa76737b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
185519e4ec
commit
3a571fefba
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.jps.model.java;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
@@ -69,10 +69,10 @@ public abstract class JdkVersionDetector {
|
||||
}
|
||||
|
||||
public @NotNull @NlsSafe String displayVersionString() {
|
||||
String s = "";
|
||||
var s = "";
|
||||
if (variant.displayName != null) s += variant.displayName + ' ';
|
||||
if (graalVersion != null) s += graalVersion + " - Java ";
|
||||
s += version;
|
||||
if (graalVersion != null) s += " - VM " + graalVersion;
|
||||
if (arch == CpuArch.ARM64) s += " - aarch64";
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.jps.model
|
||||
|
||||
import com.intellij.testFramework.rules.TempDirectory
|
||||
import com.intellij.util.lang.JavaVersion
|
||||
import com.intellij.util.system.CpuArch
|
||||
import org.jetbrains.jps.model.java.JdkVersionDetector
|
||||
import org.jetbrains.jps.model.java.JdkVersionDetector.Variant.*
|
||||
import org.junit.Assert.assertEquals
|
||||
@@ -328,6 +330,10 @@ class JdkVariantDetectorTest {
|
||||
@Test fun `Semeru 16`() = assertVariant(Semeru, RELEASE_SEMERU_16_0_2)
|
||||
@Test fun `Temurin 17`() = assertVariant(Temurin, RELEASE_TEMURIN_17_0_1)
|
||||
|
||||
@Test fun `GraalVM 21 - version string`() = assertEquals(
|
||||
"GraalVM CE 17.0.7 - VM 23.0.0",
|
||||
JdkVersionDetector.JdkVersionInfo(JavaVersion.parse("17.0.7"), GraalVMCE, CpuArch.X86_64, "23.0.0").displayVersionString())
|
||||
|
||||
private fun assertVariant(expectedVariant: JdkVersionDetector.Variant, releaseText: String, manifestText: String = "") {
|
||||
tempDir.newFile("release", releaseText.toByteArray())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user