[1] RFR(XXS): 8197927: Can't set mandatory 'java.vendor.version' property to empty string

mark.reinhold at oracle.com mark.reinhold at oracle.com
Fri Feb 16 19:17:59 UTC 2018

2018/2/16 10:59:57 -0800, volker.simonis at gmail.com:
> On Fri, Feb 16, 2018 at 7:02 PM, mark.reinhold at oracle.com wrote:
>> Of course it's possible.  The specification need merely say that
>> `java.vendor.version` is a standard system property that may, or may
>> not, have a value.  (Or, if you like, whose value may be `null`.)
> Sorry but I still don't get it. Do you agree that you can't assign NULL to
> a system property because you'll get a NPE?

I agree that `System.setProperty("java.vendor.version", null)` will
throw an NPE, but I don't see how this fact is relevant.

> You could of course not assign it at all (as it is done now) in which case
> System.getProperty("java.vendor.version") would return NULL. But that means
> "it is not defined" which is different from "is has no value".

Let's not get caught up in fine philosophical distinctions between "not
defined", "has no value", and `null`.  Either `System::getProperty`
returns a non-`null` value, or it doesn't.  That's all that matters.

>                                                                You can
> still call System.getProperties().containsKey​("java.vendor.version") and
> it would return false which violates that specification because it mandates
> that a property with the "java.vendor.version" exists.

The current specification mandates this.  That's precisely the bug here.
We can revise it so that it doesn't.

- Mark

More information about the core-libs-dev mailing list