RFR: 801427: Remove ObjectClosure as base class for BoolObjectClosure

Erik Helin 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.
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8014277/webrev.00/
> Bug:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014277
> Testing:
> Thanks,
> Erik

More information about the hotspot-gc-dev mailing list