Findbugs - non-transient nonserializable instance field

When I run the code through FindBugs, to get smelly bits, I get
<B> Error: class com.MyClass defines an intransitive nonserializable instance field of someSet Pattern ID: SE_BAD_FIELD, type: Se, category: BAD_PRACTICE
I know that set does not implement serialization, but a HashSet does, and therefore it is initialized then and there. I thought it was good practice :( but apparently not

public class Myclass extends { @Transient private Set<String> someSet = new HashSet<String>(); ........... } 

Any help would be great. Low level warning, but would like to know why?

+4
source share
1 answer

Unfortunately, FindBugs is not smart enough to recognize that a field that is defined as Set is actually a HashSet. This is a drawback of findbugs. You should add the problem here http://sourceforge.net/tracker/?group_id=96405&atid=614693

+4
source

All Articles