On 7/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: mheath
Date: Sat Jul 14 11:15:52 2007
New Revision: 556316
URL: http://svn.apache.org/viewvc?view=rev&rev=556316
Log:
Fixed parameterized types on Class.
Fixed parameterized types on MessageHandler to be <? extends E> and not <? super
E> since E is not implenting MessageHandler.
<snip/>
@@ -95,8 +97,8 @@
* the specified <tt>type</tt>. <tt>null</tt> otherwise.
*/
@SuppressWarnings("unchecked")
- public <E> MessageHandler<? super E> addMessageHandler(Class<E> type,
- MessageHandler<? super E> handler) {
+ public <E> MessageHandler<? extends E> addMessageHandler(Class<E> type,
+ MessageHandler<? extends E> handler) {
findHandlerCache.clear();
return type2handler.put(type, handler);
}
Super is correct here IMO. For example, assume that there's a message
class A and B that extends A. Unless super is used here, a user
cannot call addMessageHandler(B.class, new AMessageHandler()); nor
addMessageHandler(A.class, new ObjectMessageHandler());
Please revert this change if it's correct.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6