Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Cannot weave serialVersionUID

Hi Bartlomiej,

Your code does not work for two reasons:
 * A private inter-type declaration is a private field in realtion to the 
aspect, not for the class(es) it is declared upon.
 * Final static constant fields are not treated as such (see bug #52105, 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=52105). This means unfortunately 
you cannot use an inter-type declaration for the declaration of a 
serialVersionUID field until this bug is fixed, even if you would increase 
the visibility to public.

regards,
 - Gijs Peek

On Thursday 12 April 2007 13:04:48 Bartlomiej Zdanowski AutoGuard Ltd. wrote:
> Hello all.
> I got some autogenerated classes. I have to add some new methods but
> without modifying autogenerated code. I use AspectJ to weave new
> methods. Autogenerated classes does not have serialVersionUID  field.
> Everything works great but I got (and similar for all aspect-altered
> classes) warning:
>
> [WARNING] serialVersionUID of type pl.autoguard.ac2.ws.types.DeviceType
> needs to be set because of added non-private method getSetsContainer
> [Xlint:needsSerialVersionUIDField]
>
> even though I've added serialVersionUID field for all classes.
> Aspect I use to try to weave serialVersionUID field:
> <code>
>     private static final long DeviceType.serialVersionUID =
> -13223451234512257L;
> </code>
>
> Why does I get these warnings? Please give me some advice.
> Best regards


-- 
>>> Internal error in fortune program:
>>>	fnum=2987  n=45  flag=1  goose_level=-232323
>>> Please write down these values and notify fortune program administrator.

Attachment: pgpTHjZDL5yeU.pgp
Description: PGP signature


Back to the top