Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11283

Re: FindBugs complaining about non-serializable field although everything looks Serializable

From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
Newsgroups comp.lang.java.programmer
Subject Re: FindBugs complaining about non-serializable field although everything looks Serializable
References <a3ed0747-5eb5-4da1-9f7f-c6ebdc8cbafd@v13g2000yqc.googlegroups.com>
Message-ID <e5FPq.74066$ed2.40342@newsfe05.iad> (permalink)
Date 2012-01-12 09:52 -0800

Show all headers | View raw


On 1/12/12 8:40 AM, laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using Java 1.6.  My FindBugs tool is giving me this error ...
>
>
>      Non-transient non-serializable instance field in serializable
> class
>      Class com.myco.clearing.common.xml.Node defines non-transient non-
> serializable instance field children
>
>
> The class and its private fields that Findbugs is complaining about
> are below ...
>
>
>      public class Node implements Serializable, Comparable<Node>,
> Cloneable {
<snip>
  	private List<Node>  children;
> 	/**
> 	 * Parent node
> 	 */
> 	private Node parent;
> 	/**
> 	 * Node attributes
> 	 */
> 	private List<Attribute>  attributes;
>
I'm assuming that "List" is the java.util.List interface, which does not 
extend Serializable.  Many implementations *are* serializable, but the 
interface itself is not.  FindBugs is warning you that it is possible to 
set the "children" and "attributes" fields to List implementations that 
are not serializable.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

FindBugs complaining about non-serializable field although everything looks Serializable "laredotornado@zipmail.com" <laredotornado@gmail.com> - 2012-01-12 08:40 -0800
  Re: FindBugs complaining about non-serializable field although everything looks Serializable Jeff Higgins <jeff@invalid.invalid> - 2012-01-12 12:04 -0500
    Re: FindBugs complaining about non-serializable field although everything looks Serializable "laredotornado@zipmail.com" <laredotornado@gmail.com> - 2012-01-12 09:48 -0800
      Re: FindBugs complaining about non-serializable field although everything looks Serializable Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-01-12 09:52 -0800
  Re: FindBugs complaining about non-serializable field although everything looks Serializable Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-01-12 09:52 -0800
  Re: FindBugs complaining about non-serializable field although everything looks Serializable Ian Shef <invalid@avoiding.spam> - 2012-01-12 19:29 +0000
    Re: FindBugs complaining about non-serializable field although everything looks Serializable Lew <noone@lewscanon.com> - 2012-01-12 21:10 -0800
      Re: FindBugs complaining about non-serializable field although everything looks Serializable Lew <noone@lewscanon.com> - 2012-01-12 21:11 -0800
      Re: FindBugs complaining about non-serializable field although everything looks Serializable Arne Vajhøj <arne@vajhoej.dk> - 2012-01-14 23:23 -0500
        Re: FindBugs complaining about non-serializable field although everything looks Serializable Lew <noone@lewscanon.com> - 2012-01-15 10:18 -0800

csiph-web