Skip to content

Commit

Permalink
Merge pull request #5041 from JasonFengJ9/javavendor
Browse files Browse the repository at this point in the history
Separate java.vendor and java.vm.vendor
  • Loading branch information
pshipton authored Mar 9, 2019
2 parents 4bc1ee1 + e6df663 commit f0820b5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion jcl/src/java.base/share/classes/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ private static void ensureProperties(boolean isInitialization) {
java.lang.VersionProps.init(initializedProperties);
/* VersionProps.init(systemProperties) above sets java.specification.version value which is used to set java.vm.specification.version. */
initializedProperties.put("java.vm.specification.version", initializedProperties.get("java.specification.version")); //$NON-NLS-1$ //$NON-NLS-2$
initializedProperties.put("java.vm.vendor", initializedProperties.get("java.vendor")); //$NON-NLS-1$ //$NON-NLS-2$
/*[ELSE]
/* VersionProps.init requires systemProperties to be set */
systemProperties = initializedProperties;
Expand Down
6 changes: 4 additions & 2 deletions runtime/include/vendor_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@

#define VENDOR_SHORT_NAME "OpenJ9"

#define JAVA_VM_VENDOR "Eclipse OpenJ9"

#if JAVA_SPEC_VERSION < 12
/* Pre-JDK12 version use following defines to set system properties
* java.vendor, java.vendor.url and java.vm.vendor within vmprop.c:initializeSystemProperties(vm).
/* Pre-JDK12 versions use following defines to set system properties
* java.vendor and java.vendor.url within vmprop.c:initializeSystemProperties(vm).
* JDK12 (assuming future versions as well) sets these properties via java.lang.VersionProps.init(systemProperties)
* and following settings within System.ensureProperties().
*/
Expand Down
9 changes: 5 additions & 4 deletions runtime/vm/vmprops.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,14 @@ initializeSystemProperties(J9JavaVM * vm)
goto fail;
}

rc = addSystemProperty(vm, "java.vm.vendor", JAVA_VENDOR, 0);
if (J9SYSPROP_ERROR_NONE != rc) {
goto fail;
}
}
#endif /* JAVA_SPEC_VERSION < 12 */

rc = addSystemProperty(vm, "java.vm.vendor", JAVA_VM_VENDOR, 0);
if (J9SYSPROP_ERROR_NONE != rc) {
goto fail;
}

rc = addSystemProperty(vm, "com.ibm.oti.vm.library.version", J9_DLL_VERSION_STRING, 0);
if (J9SYSPROP_ERROR_NONE != rc) {
goto fail;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.openj9.test.support;

/*******************************************************************************
* Copyright (c) 2010, 2018 IBM Corp. and others
* Copyright (c) 2010, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -140,7 +140,7 @@ private static String[] getJavaCommand(File copiedVMDir, String[] args,
String[] classpath) {
int baseArgs = 0;
String[] execArgs = null;
String vendor = System.getProperty("java.vendor");
String vendor = System.getProperty("java.vm.vendor");
boolean onUnix = File.separatorChar == '/';
String classPathString = "";
if (classpath != null)
Expand Down

0 comments on commit f0820b5

Please sign in to comment.