--- old/make/autoconf/jdk-version.m4 2020-04-04 13:59:11.109712164 +0200 +++ new/make/autoconf/jdk-version.m4 2020-04-04 13:59:10.737715293 +0200 @@ -143,7 +143,9 @@ AC_MSG_ERROR([--with-vendor-url must have a value]) elif [ ! [[ $with_vendor_url =~ ^[[:print:]]*$ ]] ]; then AC_MSG_ERROR([--with-vendor-url contains non-printing characters: $with_vendor_url]) - else + elif test "x$with_vendor_url" != x; then + # Only set VENDOR_URL if '--with-vendor-url' was used and is not empty. + # Otherwise we will use the value from "version-numbers" included above. VENDOR_URL="$with_vendor_url" fi AC_SUBST(VENDOR_URL) @@ -155,7 +157,9 @@ AC_MSG_ERROR([--with-vendor-bug-url must have a value]) elif [ ! [[ $with_vendor_bug_url =~ ^[[:print:]]*$ ]] ]; then AC_MSG_ERROR([--with-vendor-bug-url contains non-printing characters: $with_vendor_bug_url]) - else + elif test "x$with_vendor_bug_url" != x; then + # Only set VENDOR_URL_BUG if '--with-vendor-bug-url' was used and is not empty. + # Otherwise we will use the value from "version-numbers" included above. VENDOR_URL_BUG="$with_vendor_bug_url" fi AC_SUBST(VENDOR_URL_BUG) --- old/make/autoconf/spec.gmk.in 2020-04-04 13:59:12.329701905 +0200 +++ new/make/autoconf/spec.gmk.in 2020-04-04 13:59:11.965704966 +0200 @@ -229,7 +229,8 @@ # Only export "VENDOR" to the build if COMPANY_NAME contains a real value. # Otherwise the default value for VENDOR, which is used to set the "java.vendor" # and "java.vm.vendor" properties is hard-coded into the source code (i.e. in - # System.c in the jdk for "vm.vendor" and vm_version.cpp in the VM for "java.vm.vendor") + # VersionProps.java.template in the jdk for "java.vendor" and + # vm_version.cpp in the VM for "java.vm.vendor") ifneq ($(COMPANY_NAME), N/A) VERSION_CFLAGS += -DVENDOR='"$(COMPANY_NAME)"' endif --- old/make/autoconf/version-numbers 2020-04-04 13:59:13.525691848 +0200 +++ new/make/autoconf/version-numbers 2020-04-04 13:59:13.161694909 +0200 @@ -44,6 +44,8 @@ JDK_RC_PLATFORM_NAME=Platform COMPANY_NAME=N/A HOTSPOT_VM_DISTRO="OpenJDK" +VENDOR_URL=https://openjdk.java.net/ +VENDOR_URL_BUG=https://bugreport.java.com/bugreport/ # Might need better names for these MACOSX_BUNDLE_NAME_BASE="OpenJDK" --- old/make/gensrc/GensrcMisc.gmk 2020-04-04 13:59:14.725681757 +0200 +++ new/make/gensrc/GensrcMisc.gmk 2020-04-04 13:59:14.357684852 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,10 @@ @@VERSION_BUILD@@ => $(VERSION_BUILD) ; \ @@VERSION_OPT@@ => $(VERSION_OPT) ; \ @@VERSION_DATE@@ => $(VERSION_DATE) ; \ - @@VENDOR_VERSION_STRING@@ => $(VENDOR_VERSION_STRING), \ + @@VENDOR_VERSION_STRING@@ => $(VENDOR_VERSION_STRING) ; \ + @@VENDOR@@ => $(COMPANY_NAME) ; \ + @@VENDOR_URL@@ => $(VENDOR_URL) ; \ + @@VENDOR_URL_BUG@@ => $(VENDOR_URL_BUG), \ )) GENSRC_JAVA_BASE += $(BUILD_VERSION_JAVA) --- old/src/java.base/share/classes/java/lang/System.java 2020-04-04 13:59:15.957671397 +0200 +++ new/src/java.base/share/classes/java/lang/System.java 2020-04-04 13:59:15.589674491 +0200 @@ -772,8 +772,11 @@ if (props == null) { props = new Properties(); initProperties(props); + System.props = props; + VersionProps.init(); + } else { + System.props = props; } - System.props = props; } /** --- old/src/java.base/share/classes/java/lang/VersionProps.java.template 2020-04-04 13:59:17.213660835 +0200 +++ new/src/java.base/share/classes/java/lang/VersionProps.java.template 2020-04-04 13:59:16.845663930 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,6 +65,15 @@ private static final String VENDOR_VERSION_STRING = "@@VENDOR_VERSION_STRING@@"; + private static final String VENDOR = + "@@VENDOR@@"; + + private static final String VENDOR_URL = + "@@VENDOR_URL@@"; + + private static final String VENDOR_URL_BUG = + "@@VENDOR_URL_BUG@@"; + private static final String vendor_version = (!VENDOR_VERSION_STRING.isEmpty() ? " " + VENDOR_VERSION_STRING : ""); @@ -80,6 +89,10 @@ System.setProperty("java.runtime.name", java_runtime_name); if (!VENDOR_VERSION_STRING.isEmpty()) System.setProperty("java.vendor.version", VENDOR_VERSION_STRING); + + System.setProperty("java.vendor", VENDOR); + System.setProperty("java.vendor.url", VENDOR_URL); + System.setProperty("java.vendor.url.bug", VENDOR_URL_BUG); } private static int parseVersionNumber(String version, int prevIndex, int index) { --- old/src/java.base/share/native/libjava/System.c 2020-04-04 13:59:18.429650610 +0200 +++ new/src/java.base/share/native/libjava/System.c 2020-04-04 13:59:18.061653705 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,8 @@ return JVM_IHashCode(env, x); } +/* VENDOR, VENDOR_URL, VENDOR_URL_BUG are set in VersionProps.java.template. */ + #define PUTPROP(props, key, val) \ if (1) { \ jstring jkey, jval; \ @@ -108,17 +110,6 @@ (*env)->DeleteLocalRef(env, jkey); \ } else ((void) 0) -/* Third party may overwrite these values. */ -#ifndef VENDOR -#define VENDOR "Oracle Corporation" -#endif -#ifndef VENDOR_URL -#define VENDOR_URL "http://java.oracle.com/" -#endif -#ifndef VENDOR_URL_BUG -#define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/" -#endif - #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */ #error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed" #else @@ -211,11 +202,6 @@ PUTPROP(props, "java.specification.vendor", JAVA_SPECIFICATION_VENDOR); - PUTPROP(props, "java.version", VERSION_SHORT); - PUTPROP(props, "java.vendor", VENDOR); - PUTPROP(props, "java.vendor.url", VENDOR_URL); - PUTPROP(props, "java.vendor.url.bug", VENDOR_URL_BUG); - jio_snprintf(buf, sizeof(buf), "%d.%d", JVM_CLASSFILE_MAJOR_VERSION, JVM_CLASSFILE_MINOR_VERSION); PUTPROP(props, "java.class.version", buf);