don't understand serialVersionUID related warning [message #589290] |
Sat, 09 July 2005 17:11 |
Michael Moser Messages: 914 Registered: July 2009 |
Senior Member |
|
|
Hi, I am using an aspect to make a class implement an additional
interface i.e.
public aspect XYZ {
declare parent: <foo> implements <bar>.
(... adding the additionally required methods here...)
}
Compiling my project I am getting the following warning:
Severity Description Resource In Folder Location Creation Time
1 serialVersionUID of type <foo> needs to be set because of added
interface <bar> [Xlint:needsSerialVersionUIDField] XYZ.aj <package-here>
line 13 July 9, 2005 6:51:51 PM
I have troubles understanding this warning: what exactly does that mean
and what am I supposed to do or fix here?
I already tried the following:
1.) I tried to define a new, different serialVersionUID, i..e. I added:
...
private static final long <foo>.serialVersionUID = ... ;
...
to the aspect, but apparently static inter-type fields are not supported
(why?).
2.) I tried adding a non-static field, i.e.:
...
private final long <foo>.serialVersionUID = ... ;
...
but then the warning re-appeared (and IMHO this wouldn't satisfy the
serializiation requirement anyway).
3.) I also tried the above two without the <foo>-prefix (i.e. making the
serialVersionUID a member of the aspect rather than of the advised
class):
private static final long serialVersionUID = ... ;
and
private final long serialVersionUID = ... ;
But in both cases the warning remained (which also seems to make sense
to me, because in my understanding the aspect here is like an additional
superclass of the class <foo> and thus the already existing
<foo>.serialVersionUID in the normal class <foo> would override the
field I define here).
But thus my puzzled question: what am I supposed to do here or how can I
fix this and get rid of the warning?
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.02821 seconds