RFR: 8342035: jlink plugins for setting java.vendor, java.vm.vendor and java.vendor.url [v3]

David Holmes dholmes at openjdk.org
Wed Dec 4 06:06:38 UTC 2024


On Wed, 4 Dec 2024 05:59:31 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Henry Jen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Set java.vm.vendor from VersionProps.java
>
> src/hotspot/share/runtime/abstract_vm_version.cpp line 132:
> 
>> 130: 
>> 131: static const char vm_vendor_string[sizeof(VENDOR) < VENDOR_PADDING ? VENDOR_PADDING : sizeof(VENDOR)] = VENDOR;
>> 132: const char* Abstract_VM_Version::_vendor_branding_override = nullptr;
> 
> Can't we just have:
> 
> const char* Abstract_VM_Version::_vm_vendor = vm_vendor_string; // Default unless overridden from VersionProps
> const char* Abstract_VM_Version::vm_vendor() { return _vm_vendor; }
> void Abstract_VM_Version::set_vm_vendor(const char* vm_vendor) {
>   _vm_vendor = ...
> }
> 
> ???

Or are you assuming/expecting the VersionProps value is null unless being overridden? You could initialize the VersionProps value to be the same as what VENDOR is at build time and always use it to set the Abstract_VM_Version field ... though I'm not sure if we really need it in Abstract_VM_Version ...

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21964#discussion_r1868768746


More information about the core-libs-dev mailing list