Hi,
This regards a bug (?) in v2.0 alpha that'll affect only the case of storing a sorted
set (e.g. TreeSet) in PojoCache. Now, the documentation specifies that "The Set
interface maps to java.util.HashSet implementation", but does that mean the user
should never store i.e. TreeSets (e.g., as a data member) in the PojoCache ?
If not, this probably is a bug:
CollectionClassHandler.checkSetRecursion() does a remove() to the Set with itslef.
However, since a SortedSet looks for a member using comparisons and will cast the given
key (for removal) to Comparable. and a SortedSet does not implement Comparable, a
ClassCastException will occur and escape the Cache code.
Using a custom "ComparableSortedSet" which inherits from SortedSet and adds an
implementation for Comaprable, everything seems to work.
I think this can be pretty easily handled in the PojoCache code. Do you agree? Should I
file a bug?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989948#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...