You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/08/04 11:10:39 UTC

small things on LinkedList

Hi to all,
on LinkedList i got two bugs, marked with High Priority:

 - Class org.apache.pivot.collections.LinkedList defines non-transient
non-serializable instance field first
and the same also for the field last ...

I think it's because the inner class Node is not Serializable, but
have to be (with a default serialVersionUID) ?
Or two fields have to be declared transient ?

Bye

Re: small things on LinkedList

Posted by Greg Brown <gk...@mac.com>.
> Now Findbugs tell me another problem with this (but with a Normal  
> Priority):
>
> This Serializable class is an inner class. Any attempt to serialize it
> will also serialize the associated outer instance.

Since Node is a private inner class, the only way it could ever be  
serialized is by the outer class. So this is OK. We could make it a  
static inner class, but it's not really necessary.



Re: small things on LinkedList

Posted by Sandro Martini <sa...@gmail.com>.
Done, this was bug Pivot-204 , and I've just made the commit.

Now Findbugs tell me another problem with this (but with a Normal Priority):

This Serializable class is an inner class. Any attempt to serialize it
will also serialize the associated outer instance. The outer instance
is serializable, so this won't fail, but it might serialize a lot more
data than intended. If possible, making the inner class a static inner
class (also known as a nested class) should solve the problem.

Maybe we can see this later ... in this case the change is more
complex and we have to speak.

Bye

Re: small things on LinkedList

Posted by Todd Volkert <tv...@gmail.com>.
Yep.  In your commit message, put the name of the Jira issue (PIVOT-XXX),
and it'll link your commit to the issue as a patch.

Thanks!
-T

On Tue, Aug 4, 2009 at 7:56 AM, Sandro Martini <sa...@gmail.com>wrote:

> Right, so another time i learn to show problems :-) .
>
> Now I'll open the ticket and fix it.
>
> Making the inner class Node Serializable (and adding the
> serialVersionUID to it), right ?
>
> Bye
>

Re: small things on LinkedList

Posted by Sandro Martini <sa...@gmail.com>.
Right, so another time i learn to show problems :-) .

Now I'll open the ticket and fix it.

Making the inner class Node Serializable (and adding the
serialVersionUID to it), right ?

Bye

Re: small things on LinkedList

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tue, Aug 4, 2009 at 7:32 PM, Todd Volkert<tv...@gmail.com> wrote:
> That's a valid bug - can you create a ticket and assign to Greg, or feel
> free to tackle it yourself!

I suggest "tackle it yourself"... As some Incubator PMC members are
concerned that committers don't commit enough code ;-)


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

Re: small things on LinkedList

Posted by Todd Volkert <tv...@gmail.com>.
That's a valid bug - can you create a ticket and assign to Greg, or feel
free to tackle it yourself!

-T

On Tue, Aug 4, 2009 at 5:10 AM, Sandro Martini <sa...@gmail.com>wrote:

> Hi to all,
> on LinkedList i got two bugs, marked with High Priority:
>
>  - Class org.apache.pivot.collections.LinkedList defines non-transient
> non-serializable instance field first
> and the same also for the field last ...
>
> I think it's because the inner class Node is not Serializable, but
> have to be (with a default serialVersionUID) ?
> Or two fields have to be declared transient ?
>
> Bye
>