Hi Yasumasa,

On 4/5/20 11:56 PM, Yasumasa Suenaga wrote:
Hi Chris,

On 2020/04/06 15:46, Chris Plummer wrote:
Hi Yasumasa,

I'm not sure what you mean by "conflict some keys". Can you explain?

System properties stores in ConcurrentHashMap. `next` field would be used when hashcode of key string is conflicted.
Yes, but are referring to how System Properties are stored, which is determined by the implementation of java.lang.System. SA cannot control that, but it must mimic the java.lang.System implementation. That means when SA fetches the System::_props field, it needs to know what type of data structure it points to. It thought it pointed to a hash table that used a rehash function (which maybe it did at one point), but it actually points to a hash table that uses chains (link lists) instead of rehashing.
I think it would be better if we can add key strings which are different and have same hashcode.
That's what it does. The property Nodes are chained when more than one property hashes to the same hast table index. The problem was that SA didn't realize they were chained so only saw the first property in the chain.

thanks,

Chris


Thanks,

Yasumasa


thanks,

Chris

On 4/5/20 11:41 PM, Yasumasa Suenaga wrote:
Hi Chris,

Almost your change looks good, but I have a question in TestSysProps.java. Can we conflict some keys in sysprops always? It is better if we can do so, but it is very difficult.


Thanks,

Yasumasa


On 2020/04/06 14:49, Chris Plummer wrote:
Hello,

Please help review the following:

https://bugs.openjdk.java.net/browse/JDK-8242165
http://cr.openjdk.java.net/~cjplummer/8242165/webrev.03

Please see the CR for an explanation of the bug and the fix. If you need some help with the SA code, let me know and I'll provide some details. It was pretty much all new to me, so I tried to put the needed details in the CR.

For the test, I compare the list of properties dumped using 3 different methods to make sure the same set is dumped for each:

1. jhsdb jinfo --sysprops
2. jinfo -sysprops
3. Simple app (LingeredAppSysProps) that calls System.getProperties().list(System.out)

The app output is considered the master list that is compared against the others, and I also make sure each list has the same number of properties.

thanks,

Chris


Reply via email to