Hi,

please review this patch to clean up and remove volatile from a number of lazily initialized fields in java.net.URI. This is safe as long as the fields are always accessed through their accessors and the accessors return the local result of the calculation.

Since initialization was done with no synchronization, there was never any guarantee that different Strings couldn't escape from concurrent calls to these getters. So even if this becomes more likely by dropping volatile, this should be of no real consequence.

Bug: https://bugs.openjdk.java.net/browse/JDK-8145862
Webrev: http://cr.openjdk.java.net/~redestad/8145862/webrev.01

Thanks!

/Claes

Reply via email to