RFR 8068887 : java.lang.Throwable could use Collections.emptyList for suppressedException
Aleksey Shipilev
aleksey.shipilev at oracle.com
Mon Oct 12 16:20:56 UTC 2015
On 10/12/2015 06:56 PM, Alan Bateman wrote:
> On 12/10/2015 16:09, Vyom Tewari wrote:
>> Bug: JDK-8068887 : java.lang.Throwable could use
>> Collections.emptyList for suppressedException
>> Webrev: http://cr.openjdk.java.net/~vtewari/8068887/webrev.00/webrev/
+1
> (Your patch makes me wonder if Collections.unmodifiableXXX should return
> emptyXXX when the collection is empty).
No, of course not :) The mere fact a collection is empty when the
unmodifiable view is acquired does not mean somebody who can access the
collection via the "modifiable" reference would not update it ;)
Thanks,
-Aleksey
More information about the core-libs-dev
mailing list