Hi Max,
On 6/4/2018 11:41 AM, Wang Weijun wrote:
Not a native English speaker, so my feeling might be incorrect.
Will someone interpret this as that System.getProperty() will return a cached
value?
I don't think so, it should be clear that the values are cached at
initialization or first use.
I would say “Although getProperty() always returns the last value set by setProperty() (I
assume this is the current behavior), it is not uncommon that consumers of a system
property may read it once and cache the value it for later use, which means setting the
property <strong>may not have the desired effect</strong>”.
The purpose of the change is to clarify the behavior of the java.base
module internal access to the properties.
How applications handle properties is beyond the intended scope.
I also don’t think it’s worth listing the 4 property names in the spec. Quite
some other system properties are also cached. Listing them there could further
suggests that calling getProperty() on them will return the cached value.
It seemed worthwhile to highlight the specific properties affected and
the release note should be specific.
I moved them to an implNote as Alan suggested.
Thanks, Roger
Thanks
Max
在 2018年6月4日,下午9:32,Roger Riggs <roger.ri...@oracle.com> 写道:
Please review a change to make the values of java.home, user.home, user.dir,
and user.name
effectively read-only for internal use. The values are cached during
initialization and the
cached values are used.
Webrev:
http://cr.openjdk.java.net/~rriggs/webrev-static-property-8066709/
Issue:
https://bugs.openjdk.java.net/browse/JDK-8066709
CSR:
https://bugs.openjdk.java.net/browse/JDK-8204235
Thanks, Roger