[icedtea-web] RFC: move TimedHashMap to netx
Omair Majid
omajid at redhat.com
Tue Feb 15 08:02:57 PST 2011
On 02/15/2011 08:20 AM, Dr Andrew John Hughes wrote:
> On 18:44 Mon 14 Feb , Omair Majid wrote:
>> On 02/14/2011 05:42 PM, Dr Andrew John Hughes wrote:
>>> On 16:33 Mon 14 Feb , Omair Majid wrote:
>>>> Hi,
>>>>
>>>> The attached patch moves TimeHashMap from
>>>> plugin/icedteanp/java/sun/applet/PluginProxySelector.java to
>>>> netx/net/sourceforge/jnlp/util/TimedHashMap.java, so other
>>>> ProxySelectors can also use it. My patch for adding proxy auto config
>>>> support will be using this new class.
>>>>
>>>> Other than the movement, there are a few minor changes to it:
>>>> - It no longer extends HashMap. TimedHashMap did not override all the
>>>> HashMap methods and it was possible to see inconsistent data. By
>>>> reducing the interface, this should not be a problem any more (the
>>>> plugin code still compiles fine).
>>>> - The use of Date has been replaced by System.nanoTime(). This should
>>>> give us a more monotonic clock and be less susceptible to clock
>>>> changes (especially to moving the clock backwards).
>>>>
>>>> Any thoughts or concerns?
>>>>
>>>
>>> Could you do the move in a separate patch to the other changes?
>>> Otherwise, the changes are unclear as the file appears new.
>>>
>>
>> Good point. I have split it into two patches. part1 contains all the
>> changes necessary to move TimedHashMap and make it compile (including
>> the PluginDebug changes). part2 contains the actual changes in
>> TimedHashMap (not extending HashMap and using System.nanoTime()).
>>
>> Any other comments?
>>
>> Cheers,
>> Omair
>
> The changes look fine now. I like how wrapping instead of extending
> HashMap means we can now have a more typesafe get method.
Thanks for the review. I have pushed changes.
Cheers,
Omair
More information about the distro-pkg-dev
mailing list