3 Replies Latest reply on May 25, 2007 6:50 AM by Manik Surtani

    Excessive type safety warnings ...

    Elias Ross Master


      Eclipse lists over 4000 warnings for JBossCache, mostly to do with type safety.

      I started trying to fix some of the type safety warnings by adding type parameters to declarations of Cache, Node, etc. The problem is, is that classes such as NodeListener, NodeData, StateTransferGenerator, etc. do not have type parameters. To get everything to work right will require adding some type parameters.

      But for some of those classes, it doesn't really seem appropriate to have type parameters like <K, V> tied into their implementation.

      Thoughts? Or are you going to live with all those warnings ...

        • 1. Re: Excessive type safety warnings ...
          Manik Surtani Master

           


          But for some of those classes, it doesn't really seem appropriate to have type parameters like <K, V> tied into their implementation.


          Which classes are you referring to? I agree that the number of warnngs generated due to genericised interfaces may be a bit much.

          • 2. Re: Excessive type safety warnings ...
            Elias Ross Master

            The state transfer classes, notification classes, marshaling, cache loaders, interceptors which use Fqn and Node need some sort of parameters... Or perhaps maybe wildcards or something.

            So, for example, you have a CacheStoreInterceptor:

            public class CacheLoaderInterceptor extends BaseCacheLoaderInterceptor implements CacheStoreInterceptorMBean


            parameterized, needs to be something like:
            public class CacheLoaderInterceptor<K, V, F> extends BaseCacheLoaderInterceptor<K, V, F> implements CacheStoreInterceptorMBean


            Where K and V are the Node key and value, and you have to include the Fqn type as well.

            Actually, I'm not really any sort of generics expert. There might be some way to use wildcards or something to hide all this.

            • 3. Re: Excessive type safety warnings ...
              Manik Surtani Master

              Yeah I agree, should be able to reduce those warnings. JBCACHE-1074