RFR: 801427: Remove ObjectClosure as base class for BoolObjectClosure
erik.helin at oracle.com
Fri May 10 14:11:49 UTC 2013
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