Menu

#6 isAssignableFrom is misused

open
nobody
Core (6)
5
2003-02-13
2003-02-13
Anonymous
No

ControllerFactory.createController tests to see if a controller
implements ContollerSingleton. if so, it calls init() on the
controller.

The test looks like this:

if (cls.isAssignableFrom(ControllerSingleton.class)) {

that is wrong. it should be:

if (ControllerSingleton.class.isAssignableFrom(cls))
{

or something along those lines. otherwise the test will essentially
never be true.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB