RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove

Mike Duigou mike.duigou at oracle.com
Mon Jul 1 16:42:46 UTC 2013


+1



On 2013-07-01, at 1:43, Shi Jun Zhang <zhangshj at linux.vnet.ibm.com> wrote:

> On 6/29/2013 12:05 AM, Shi Jun Zhang wrote:
>> On 6/28/2013 9:02 PM, Alan Bateman wrote:
>>> On 27/06/2013 22:13, Remi Forax wrote:
>>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote:
>>>>> Hi,
>>>>> 
>>>>> There are some isEmpty() check added into get/remove methods since 8011200 to return directly if HashMap is empty. However isEmpty is a non-final public method which can be overridden by subclass. If the subclass defines isEmpty differently from HashMap, it would cause problem while getting or removing elements.
>>>> 
>>>> yes, it's a bug.
>>>> Could you report it ?
>>>> 
>>>> Rémi
>>> I've created a bug to track this:
>>> 
>>> 8019381: HashMap.isEmpty is non-final, potential issues for get/remove
>>> 
>>> -Alan
>> Thanks, Alan.
>> 
>> I'm quite busy today and do not have time to report it until now. Thanks for your help.
>> 
>> I will provide a webrev next Monday for review.
> Hi,
> 
> Here is the webrev
> 
> http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/
> 
> -- 
> Regards,
> 
> Shi Jun Zhang
> 



More information about the core-libs-dev mailing list