Yesterday, I had a strange exception that the class cannot be abandoned on its own, which took several hours to solve the problem.
In short, the reason is that my EJB service returns a RandomAccessSubList for some cases that (after checking the source) I noticed that it is not Serializable.
Of course, I understand that the guys who created this are probably much smarter than me, but I could not help but think that this is not a very good design decision.
I understand that not all List implementations are Serializable, but why then does the subList method not take care of this by providing a SubList instance that implements Serializable for parents who also implement Serializable? This certainly provides this for the RandomAccess interface.
Or why not just mark RandomAccessSubList as Serializable and let the original implementation (which RandomAccessSubList refers to) worry about serialization?
source
share