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