[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] finding static field declarations
|
- From: "Michael Nascimento" <misterm@xxxxxxxxx>
- Date: Mon, 22 Oct 2007 09:28:30 -0300
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Z7plV6k2XOy2lnjVsNdLY0M4+b4a1ycXOlaaorAobTU=; b=G+Sy4FFqCILLFXLZ1Ka/l0k9k+c2FEDhuDFLqdOxEmC1sh9lxNVy14lr8x7CTLOWONrSkOJ8xN7bR9sYTdzC30sLxP9mWuOTZRQN1u0iYIBJUUwVUxBi50rELi55a3RqryjzXcKo9x7ECvoorVCq9vtRe2blxFwo13qmyTdT3H8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bj0A52Diup6yIMCzIjgaX89uWQpAx9+nc0bOc7k65bi7JPpFn8HK2MhgaZHd6ZMymR2aODpOhK1soqzME/APgtwam7r4erIsPz/cJvIguofqQIqs9/ykk2OTPOwX+wK6cD4qM4cwtiEvAhObn6OSbcppo8P3NXpRlJBpHgGd8ek=
On 10/19/07, Mike Schneider <mikepschneider@xxxxxxxxx> wrote:
> How would I write an aspect that would restrict the use of static fields?
>
> Such that compiling something simple like this:
>
> class X {
> static int c; // bad
> int d; // ok
> }
>
>
> would result in a compiler warning/error for c, but not d.
Using hasfield pointcuts, it would be possible to at least emit a
warning/error for the class, I guess. It is an experimental feature
though:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=86818
If you like it, vote for it.
Regards,
Michael Nascimento Santos
https://genesis.dev.java.net/
https://jsr-310.dev.java.net/