Several issues with

Chris Hegarty chris.hegarty at
Tue Nov 18 11:38:20 UTC 2014

On 17/11/14 23:27, Pavel Rappo wrote:
> Hi everyone,
> I've been working with the URLConnection class for some time now and have noticed several interesting things.
> 1. Unsafe publication of static field (it looks very similar to [1])
> 2. Benign race condition in on static field
> 3. Handlers produced by factory are not cached in the handlers field (I don't know whether it was done deliberately or not, but I couldn't find any explanation on it in the javadoc. Moreover the behaviour of the factory in the URL class is different. It caches whatever is produced by the factory there).
> So which of these do you think are real issues worth fixing?

1 and 2 : Yes.
3 needs a little more consideration, but my gut feeling is that we 
should do it unless there is a good reason not to.


> ------------------------------------------------------------
> [1] The same thing was noticed by Peter Levart here:
> -Pavel

More information about the core-libs-dev mailing list