Hi All,

I'm currently playing with Maverick and it rocks. I'm actually bastardizing the controller concept a bit to add all the stuff I like from other frameworks. While doing this, I ran into a little bug where ControllerSingleton objects were not getting built propoerly.

The code is in ControllerFactory that determines if an instance is a ControllerSingleton or, which I've changed to this:

Object tempController = cls.newInstance();

if (ControllerSingleton.class.isInstance(tempController)) {
System.err.println("########## Creating a singleton Controller");
theController = (ControllerSingleton) tempController;

Apparently, Class.isAssignableFrom has problems when you deal with interfaces, but isInstance works fine. The only downside is that you have to create an instance of the object, which is slightly inneficient if it turns out to not be a ControllerSingleton.

Anyway, this is just a suggestion, but it would fix a problem. Another way to do this is to do an instanceof test on the two object references.

Talk to you later.

-----
Zed A. Shaw
http://www.zedshaw.com/



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
[INVALID FOOTER]

Reply via email to