mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8204565: (spec) Document java.{vm.}?specification.version system properties' relation to $FEATURE
Reviewed-by: mchung
This commit is contained in:
parent
4ad2957dd0
commit
ea01772a00
3 changed files with 18 additions and 13 deletions
|
@ -607,8 +607,9 @@ public final class System {
|
||||||
* <tr><th scope="row">{@code java.home}</th>
|
* <tr><th scope="row">{@code java.home}</th>
|
||||||
* <td>Java installation directory</td></tr>
|
* <td>Java installation directory</td></tr>
|
||||||
* <tr><th scope="row">{@code java.vm.specification.version}</th>
|
* <tr><th scope="row">{@code java.vm.specification.version}</th>
|
||||||
* <td>Java Virtual Machine specification version which may be
|
* <td>Java Virtual Machine specification version, whose value is the
|
||||||
* interpreted as a {@link Runtime.Version}</td></tr>
|
* {@linkplain Runtime.Version#feature feature} element of the
|
||||||
|
* {@linkplain Runtime#version() runtime version}</td></tr>
|
||||||
* <tr><th scope="row">{@code java.vm.specification.vendor}</th>
|
* <tr><th scope="row">{@code java.vm.specification.vendor}</th>
|
||||||
* <td>Java Virtual Machine specification vendor</td></tr>
|
* <td>Java Virtual Machine specification vendor</td></tr>
|
||||||
* <tr><th scope="row">{@code java.vm.specification.name}</th>
|
* <tr><th scope="row">{@code java.vm.specification.name}</th>
|
||||||
|
@ -621,8 +622,9 @@ public final class System {
|
||||||
* <tr><th scope="row">{@code java.vm.name}</th>
|
* <tr><th scope="row">{@code java.vm.name}</th>
|
||||||
* <td>Java Virtual Machine implementation name</td></tr>
|
* <td>Java Virtual Machine implementation name</td></tr>
|
||||||
* <tr><th scope="row">{@code java.specification.version}</th>
|
* <tr><th scope="row">{@code java.specification.version}</th>
|
||||||
* <td>Java Runtime Environment specification version which may be
|
* <td>Java Runtime Environment specification version, whose value is
|
||||||
* interpreted as a {@link Runtime.Version}</td></tr>
|
* the {@linkplain Runtime.Version#feature feature} element of the
|
||||||
|
* {@linkplain Runtime#version() runtime version}</td></tr>
|
||||||
* <tr><th scope="row">{@code java.specification.vendor}</th>
|
* <tr><th scope="row">{@code java.specification.vendor}</th>
|
||||||
* <td>Java Runtime Environment specification vendor</td></tr>
|
* <td>Java Runtime Environment specification vendor</td></tr>
|
||||||
* <tr><th scope="row">{@code java.specification.name}</th>
|
* <tr><th scope="row">{@code java.specification.name}</th>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test Test6981737.java
|
* @test Test6981737.java
|
||||||
* @bug 6981737
|
* @bug 6981737 8204565
|
||||||
* @summary check for correct vm properties
|
* @summary check for correct vm properties
|
||||||
* @run main Test6981737
|
* @run main Test6981737
|
||||||
* @author kamg
|
* @author kamg
|
||||||
|
@ -33,13 +33,12 @@ public class Test6981737 {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the 'vendor' properties and java.vm.specification.version property.
|
* Check the 'vendor' properties and java.vm.specification.version property.
|
||||||
* In jdk9 onwards they should be "Oracle..." and "<major_version>"
|
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
String vendor_re = "Oracle Corporation";
|
String vendor_re = "Oracle Corporation";
|
||||||
int major_version = Runtime.version().major();
|
int feature_version = Runtime.version().feature();
|
||||||
String vm_spec_version_re = Integer.toString(major_version);
|
String vm_spec_version_re = Integer.toString(feature_version);
|
||||||
|
|
||||||
verifyProperty("java.vm.specification.vendor", vendor_re);
|
verifyProperty("java.vm.specification.vendor", vendor_re);
|
||||||
verifyProperty("java.specification.vendor", vendor_re);
|
verifyProperty("java.specification.vendor", vendor_re);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @bug 4989690 6259855 6706299
|
* @bug 4989690 6259855 6706299 8204565
|
||||||
* @summary Check that version-related system property invariants hold.
|
* @summary Check that version-related system property invariants hold.
|
||||||
* @author Martin Buchholz
|
* @author Martin Buchholz
|
||||||
*/
|
*/
|
||||||
|
@ -72,13 +72,17 @@ public class Versions {
|
||||||
public static void main(String [] args) throws Exception {
|
public static void main(String [] args) throws Exception {
|
||||||
String classVersion = getProperty("java.class.version");
|
String classVersion = getProperty("java.class.version");
|
||||||
String javaVersion = getProperty("java.version");
|
String javaVersion = getProperty("java.version");
|
||||||
String VMVersion = getProperty("java.vm.version");
|
|
||||||
String runtimeVersion = getProperty("java.runtime.version");
|
String runtimeVersion = getProperty("java.runtime.version");
|
||||||
String specVersion = getProperty("java.specification.version");
|
String specVersion = getProperty("java.specification.version");
|
||||||
|
String vmSpecVersion = getProperty("java.vm.specification.version");
|
||||||
|
String featureVersion = Integer.toString(Runtime.version().feature());
|
||||||
|
|
||||||
if (! (javaVersion.startsWith(specVersion) &&
|
if (! (javaVersion.startsWith(specVersion) &&
|
||||||
runtimeVersion.startsWith(specVersion)))
|
runtimeVersion.startsWith(specVersion) &&
|
||||||
|
specVersion.equals(featureVersion) &&
|
||||||
|
vmSpecVersion.equals(featureVersion))) {
|
||||||
throw new Exception("Invalid version-related system properties");
|
throw new Exception("Invalid version-related system properties");
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// Check that java.class.version is correct.
|
// Check that java.class.version is correct.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue