[jboss-dev-forums] [Design of JBossCache] - Re: JBCACHE-1004 and JBCACHE-1005

manik.surtani@jboss.com do-not-reply at jboss.com
Thu Mar 15 10:07:40 EDT 2007


Well, one workaround is to use a return type rather than a cast, which is valid, e.g.:


  | 
  | Cache<Object, Object> myCache = getCache();
  | Cache injected;
  | 
  | private Cache<Object, Object> getCache()
  | {
  |    return injected;
  | }
  | 
  | 

But that's just an ugly workaround to prevent ugly compiler warnings.  One of the things we need to deal with until DI containers start supporting generics better, I suppose (Google Guice  has some support for this already).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028384#4028384

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028384



More information about the jboss-dev-forums mailing list