You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-dev@incubator.apache.org by David Holroyd <da...@badgers-in-foil.co.uk> on 2007/11/10 17:53:05 UTC

ClassCastException in DefaultFtpServerContext#dispose()

The DefaultFtpServerContext implementation of dispose() has,

    Iterator listenerIter = listeners.values().iterator();
    while (listenerIter.hasNext()) {
        Bean listenerBean = (Bean) listenerIter.next();
        listenerBean.destroyBean();
    }

However, AbstractListener is not a subclass of Bean, so the attempt to
cast e.g. MinaListener to this type fails with an exception.

Is the correct fix to change the cast (and use Listener#stop() rather
than Bean#destryBean() as currently), or should AbstractListener extend
Bean as well as implementing Listener (sounds messy)?


ta,
dave

-- 
http://david.holroyd.me.uk/