Java generics do not support reification (i.e. access at runtime). They are there as a compile-time support mechanism to help you only while you code and compile.
Because of the reification issue, Shiro doesn't (and couldn't) do any runtime type checking based on the declared generic type because of this lack of functionality in Java. Cheers, Les On Wed, Mar 13, 2013 at 11:55 PM, NabbleReallySucks <[email protected]> wrote: > When the Cache object is called from within Shiro. Does it look at the type > in the generics for Key to make sure it checks to see if the type is the > same??? > > I actually think I have a work-around since I had created that > ThreadLocalDelegatingCache object. That does have it implement Cache as > Cache<Serializable, Serializable>. Which if Shiro looks at the types, but > just check that it is Serializable and not String like I have in the real > cache that ThreadLocalDelegatingCache is decorating/wrapping. > > Mark > > > > -- > View this message in context: > http://shiro-user.582556.n2.nabble.com/There-might-be-something-wrong-with-the-Cache-interface-tp7578385p7578386.html > Sent from the Shiro User mailing list archive at Nabble.com.
