RFR: 8342035: jlink plugins for setting java.vendor, java.vm.vendor and java.vendor.url [v3]
Henry Jen
henryjen at openjdk.org
Wed Dec 4 06:18:38 UTC 2024
On Wed, 4 Dec 2024 06:04:09 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> 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 ...
We can, if we don't care original value. The origin build of the image would have same value in VersionProps and VM. However, VersionProps value can be altered with JLink plugin when create a new image from the built image.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21964#discussion_r1868777689
More information about the core-libs-dev
mailing list