Skip to main content

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

On Thursday 12 April 2007 14:55:33 Bartlomiej Zdanowski AutoGuard Ltd. wrote:
> Gijs, thank you for your response. I appreciate that.
>
> Gijs Peek napisaƂ(a):
> > 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.
>
> You mean, did I use "privileged" aspect? I did.

No, I mean that when you add a private field to a class from an aspect, the 
field will only be accessible from within the aspect, not from within the 
class. The resulting bytecode for the class will probably not contain the 
private field.

>
> >  * 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.
>
> So I cannot solve this problem. :( And what is the point to display the
> warning when I cannot weave-in proper serialVersionUID?

I think the warning meant that the compiler found no any-access-modifier final 
static serialVersionUID, while it did require one.

> And what do you mean by "inter-type"? English is not my native language.
> I understand it as a declaration of serialVersionUID field for a few
> types (classes) in one aspect. I want to add this field to each class
> separately but defining
> ClassName.serialVersionUID

An inter-type declaration is just what you have made. See 
http://www.eclipse.org/aspectj/doc/released/progguide/starting-aspectj.html#inter-type-declarations
for a better explanation.

regards,
 - Gijs Peek

Attachment: pgpr63Cb7_0KN.pgp
Description: PGP signature


Back to the top