RFR: 801427: Remove ObjectClosure as base class for BoolObjectClosure

Bengt Rutisson bengt.rutisson at oracle.com
Wed May 15 10:29:35 UTC 2013


Erik,

Looks good.

Bengt

On 5/14/13 5:46 PM, Erik Helin wrote:
> All,
>
> I have updated the change based on feedback from Bengt:
> - Added Closure a base class for BoolObjectClosure
>
> Please see new webrev at:
> http://cr.openjdk.java.net/~ehelin/8014277/webrev.01/
>
> Thanks,
> Erik
>
> On 05/10/2013 04:11 PM, Erik Helin wrote:
>> Hi all,
>>
>> this change remove ObjectClosure as the base class for 
>> BoolObjectClosure.
>>
>> There is no good reason for BoolObjectClosure to derive from
>> ObjectClosure, since all the users of a BoolObjectClosure will call the
>> method do_object_b and not the method do_object (which is inherited from
>> ObjectClosure). In fact, all classes deriving from BoolObjectClosure
>> implements do_object by calling ShouldNotReachHere() or assert(false,
>> "Call do_object_b instead") or something similar.
>>
>> If there is need for a closure to be both an ObjectClosure and a
>> BoolObjectClosure (there is no such closure in the code today), then
>> that class can use multiple inheritance and derive from both
>> ObjectClosure and BoolObjectClosure.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~ehelin/8014277/webrev.00/
>>
>> Bug:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014277
>>
>> Testing:
>> JPRT
>>
>> Thanks,
>> Erik
>




More information about the hotspot-gc-dev mailing list