RFR: 801427: Remove ObjectClosure as base class for BoolObjectClosure
erik.helin at oracle.com
Tue May 14 15:46:39 UTC 2013
I have updated the change based on feedback from Bengt:
- Added Closure a base class for BoolObjectClosure
Please see new webrev at:
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.
More information about the hotspot-gc-dev