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


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

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: FindBugs complaining about non-serializable field although everything looks Serializable
Date Thu, 12 Jan 2012 12:04:52 -0500
Organization A noiseless patient Spider
Lines 85
Message-ID <jen3e5$vms$1@dont-email.me> (permalink)
References <a3ed0747-5eb5-4da1-9f7f-c6ebdc8cbafd@v13g2000yqc.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 12 Jan 2012 16:57:42 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="qwFw1g9RsQ6TkML5yezG9A"; logging-data="32476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EakpGqvKVQpqrB7JU2Kv7Z9Xp0f9nfXc="
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111110 Icedove/3.0.11
In-Reply-To <a3ed0747-5eb5-4da1-9f7f-c6ebdc8cbafd@v13g2000yqc.googlegroups.com>
Cancel-Lock sha1:WjAFuWKALx987b7iSlwQRjquQI0=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11279

Show key headers only | View raw


On 01/12/2012 11: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

?<http://findbugs.sourceforge.net/bugDescriptions.html#SE_BAD_FIELD>

> 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 {
> 	/**
> 	 * For serializable classes.
> 	 */
> 	private static final long serialVersionUID = 1L;
>
> 	/**
> 	 * Unique id
> 	 */
> 	private long id;
> 	/**
> 	 * Node Name
> 	 */
> 	private String name;
> 	/**
> 	 * Node value
> 	 */
> 	private String value = "";
> 	/**
> 	 * Child nodes
> 	 */
> 	private List<Node>  children;
> 	/**
> 	 * Parent node
> 	 */
> 	private Node parent;
> 	/**
> 	 * Node attributes
> 	 */
> 	private List<Attribute>  attributes;
>
>
> I have a public, no-argument constructor and getter/setter methods for
> all the fields you see (except serialVersionUID).  Any ideas why
> FindBugs is complaining about the field "children" or how I can
> troubleshoot this further?
>
> The above references a class, "Attribute".  The relevant parts are
> below.  Same thing -- a public, no-argument constructor and getter/
> setter methods present.
>
>
>      public class Attribute implements Serializable, Cloneable {
>
> 	/**
> 	 * For serializable classes.
> 	 */
> 	private static final long serialVersionUID = 1L;
>
> 	/**
> 	 * Attribute Name
> 	 */
> 	private String name;
> 	/**
> 	 * Attribute value, can be local or inherited
> 	 */
> 	private String value;
> 	/**
> 	 * Node having this attribute
> 	 */
> 	private Node node;
>
>
> Thanks, - Dave

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