RFR 8029891 : Deadlock detected in java/lang/ClassLoader/deadlock/GetResource.java
Paul Sandoz
paul.sandoz at oracle.com
Wed May 13 08:45:21 UTC 2015
On May 12, 2015, at 10:49 PM, Mandy Chung <mandy.chung at oracle.com> wrote:
>>
>> Ah, I understand Mandy now. You are talking about using special Properties implementation just for system properties. Unfortunately, this is currently valid code:
>>
>> Properties props = new Properties();
>> ...
>> System.setProperties(props);
>> ...
>> props.setProperty(key, value);
>> assert System.getProperty(key).equals(value);
>>
>
>
> How likely does existing code do this? A proper way is to call System.setProperty. One pattern I found on System.setProperties is like this to add a system property of key/value pair:
>
> Properties props = System.getProperties();
> props.put(key, value);
> System.setProperties(props);
>
> More investigation needs to be done (e.g. look at System.setProperties and other system property related APIs and any spec change is needed to be made and the compatibility implication) if we agree that it worths keeping this change local to system properties.
>
FWIW you can see some usages here:
http://grepcode.com/search/usages?type=method&id=repository.grepcode.com%24java%24root@jdk%24openjdk@7u40-b43@java%24lang@System@setProperties%28java.util.Properties%29&k=u
Paul.
More information about the core-libs-dev
mailing list