Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Can't get AJDT to work...
Can't get AJDT to work... [message #41442] Fri, 01 October 2004 23:45 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Hi,
I recently upgraded to Eclipse 3.0.1 & AJDT 1.1.12 but I can't get
this combination to work at all.

I have boiled things down to a minimalistic project that contains a
single class:

package test;

class Test
{
Test() {
System.out.println("Test()");
}

public static void main(String[] args) {
System.out.println("main(...)");
new Test();
}
}

I then used the "Convert to AspectJ Project" command and added the
following aspect:

package test;

public aspect DetectSystemOutErrorUsage
{
pointcut allSystemOutAndSystemErrAccesses():
(get(* System.out) || get(* System.err));

declare warning:
allSystemOutAndSystemErrAccesses()
&& !adviceexecution()
: "Warning: use of System.out or System.err - consider logging
instead!";
}

I can execute the Test.main() and get the expected output, so things
are being built, but there are NO warnings issued and also the
visualizer shows no location nor match as if the aspect would not get
compiled at all.

I am puzzled! What am I missing here?

Michael

PS.: I have been using earlier versions of AspectJ/AJDT and those used
to work...
Re: Can't get AJDT to work... [message #41484 is a reply to message #41442] Fri, 01 October 2004 23:53 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Things are getting odder and odder:

When I rename the file containing the aspect from
DetectSystemOutErrorUsage.aj to DetectSystemOutErrorUsage.java the
aspect seems to be compiled and I now see two markers with the
expected warnings in front of the two lines where System.out is used.
Strange enough these two warnings are NOT displayed in the Problems
view!

Furthermore, after renaming the aspect file, I am now getting red
wiggles (syntax warnings) all over the place in the aspect file (e.g.
at the keyword aspect, under the semicolons, under the "*", after
"warnings", etc.

I thought, AJDT now finally supports the .aj file extension as well as
AspectJ syntax in the editor. Doesn't it?

Michael
Re: Can't get AJDT to work... [message #41508 is a reply to message #41484] Sat, 02 October 2004 00:38 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
OK - I think I got it: The locations of compile time errors and
warnings are obviously NOT displayed in the Visualizer. Other advices
(e.g. call or execution) are woven in, get executed and are also
displayed in the visualizer. My problem had nothing to do with .aj vs.
..java extensions.

BTW: aspect-introduced compile errors and warnings definitely need to
make it into the Problems view or else they are almost useless. Esp.
warnings that are only displayed in the decorator column IMHO don't
make much sense!

Michael
Re: Can't get AJDT to work... [message #41536 is a reply to message #41508] Sat, 02 October 2004 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: newsserver_mails.bodden.de

On Sat, 2 Oct 2004 02:38:34 +0200, Michael Moser wrote:

> OK - I think I got it: The locations of compile time errors and
> warnings are obviously NOT displayed in the Visualizer. Other advices
> (e.g. call or execution) are woven in, get executed and are also
> displayed in the visualizer. My problem had nothing to do with .aj vs.
> .java extensions.
>
> BTW: aspect-introduced compile errors and warnings definitely need to
> make it into the Problems view or else they are almost useless. Esp.
> warnings that are only displayed in the decorator column IMHO don't
> make much sense!
Actually such contibuted errors and warning should show up in your problems
view (as they always do), not just as decorators. The convention for the
visualizer always was - AFAIK - that only pointcuts that have an advice
attached, are displayed, and since declare statements haven't, they aren't.
However I see your point. Maybe you could file a feature request and see
what other people think about it.

Eric

--
Eric Bodden, ICQ: 12656220, http://www.bodden.de, PGP: BB465582
How to remove incorrectly marked bad secotrs on NTFS...
http://bodden.de/misc/ntfsrecovery/
Re: Can't get AJDT to work... [message #41629 is a reply to message #41536] Sat, 02 October 2004 09:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mchapman.uk.ibm.com

No need for a feature, we've already done it :)
The development version of the visualiser shows declare errors and
warnings in the default eclipse colours for errors and warnings. They
are shown by default and there are toggles on the visualiser menu to turn
them off.

Regarding the other issue, indeed such warnings should show up in the
problems view. AJDT 1.1.12 came out before Eclipse 3.0.1, so that's not a
well tested combination, but of course 3.0.1 is a small change over 3.0.0
so it should be okay. I've just tried it, and it worked fine for me.
Michael, could you double-check your filters setting of the problem view,
to make sure AspectJ problems are enabled there. Others have noticed them
disabled - I think sometimes if you make a change to the filters before
installing AJDT, the AspectJ problems can become disabled.

Regards,

Matt.

On Sat, 02 Oct 2004 10:28:58 +0200, Eric Bodden wrote:
> Actually such contibuted errors and warning should show up in your problems
> view (as they always do), not just as decorators. The convention for the
> visualizer always was - AFAIK - that only pointcuts that have an advice
> attached, are displayed, and since declare statements haven't, they aren't.
> However I see your point. Maybe you could file a feature request and see
> what other people think about it.
>
> Eric
Re: Can't get AJDT to work... [message #41646 is a reply to message #41629] Mon, 04 October 2004 07:37 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Hi Matt,

"Matt Chapman" <mchapman@uk.ibm.com> wrote in message
news:pan.2004.10.02.09.23.14.691044@uk.ibm.com...
>
> No need for a feature, we've already done it :)
Great!

> ..
> Michael, could you double-check your filters setting of the problem
view,
> to make sure AspectJ problems are enabled there.

indeed - they were just filtered and now AspectJ warnings are
displayed as expected! Thanks for the hint!

> ... Others have noticed them
> disabled - I think sometimes if you make a change to the filters
before
> installing AJDT, the AspectJ problems can become disabled.

I'm afraid this assumption is not fully correct. Before today I hadn't
even been aware, that there IS such a filter option for the problem
view, so I am definitely sure that I never have fiddled with these
setting before.

Thanks again and regards,
Michael
Re: Can't get AJDT to work... [message #583501 is a reply to message #41442] Fri, 01 October 2004 23:53 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Things are getting odder and odder:

When I rename the file containing the aspect from
DetectSystemOutErrorUsage.aj to DetectSystemOutErrorUsage.java the
aspect seems to be compiled and I now see two markers with the
expected warnings in front of the two lines where System.out is used.
Strange enough these two warnings are NOT displayed in the Problems
view!

Furthermore, after renaming the aspect file, I am now getting red
wiggles (syntax warnings) all over the place in the aspect file (e.g.
at the keyword aspect, under the semicolons, under the "*", after
"warnings", etc.

I thought, AJDT now finally supports the .aj file extension as well as
AspectJ syntax in the editor. Doesn't it?

Michael
Re: Can't get AJDT to work... [message #583515 is a reply to message #41484] Sat, 02 October 2004 00:38 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
OK - I think I got it: The locations of compile time errors and
warnings are obviously NOT displayed in the Visualizer. Other advices
(e.g. call or execution) are woven in, get executed and are also
displayed in the visualizer. My problem had nothing to do with .aj vs.
..java extensions.

BTW: aspect-introduced compile errors and warnings definitely need to
make it into the Problems view or else they are almost useless. Esp.
warnings that are only displayed in the decorator column IMHO don't
make much sense!

Michael
Re: Can't get AJDT to work... [message #583530 is a reply to message #41508] Sat, 02 October 2004 08:28 Go to previous message
Eric Bodden is currently offline Eric BoddenFriend
Messages: 32
Registered: July 2009
Member
On Sat, 2 Oct 2004 02:38:34 +0200, Michael Moser wrote:

> OK - I think I got it: The locations of compile time errors and
> warnings are obviously NOT displayed in the Visualizer. Other advices
> (e.g. call or execution) are woven in, get executed and are also
> displayed in the visualizer. My problem had nothing to do with .aj vs.
> .java extensions.
>
> BTW: aspect-introduced compile errors and warnings definitely need to
> make it into the Problems view or else they are almost useless. Esp.
> warnings that are only displayed in the decorator column IMHO don't
> make much sense!
Actually such contibuted errors and warning should show up in your problems
view (as they always do), not just as decorators. The convention for the
visualizer always was - AFAIK - that only pointcuts that have an advice
attached, are displayed, and since declare statements haven't, they aren't.
However I see your point. Maybe you could file a feature request and see
what other people think about it.

Eric

--
Eric Bodden, ICQ: 12656220, http://www.bodden.de, PGP: BB465582
How to remove incorrectly marked bad secotrs on NTFS...
http://bodden.de/misc/ntfsrecovery/
Re: Can't get AJDT to work... [message #583551 is a reply to message #41536] Sat, 02 October 2004 09:23 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
No need for a feature, we've already done it :)
The development version of the visualiser shows declare errors and
warnings in the default eclipse colours for errors and warnings. They
are shown by default and there are toggles on the visualiser menu to turn
them off.

Regarding the other issue, indeed such warnings should show up in the
problems view. AJDT 1.1.12 came out before Eclipse 3.0.1, so that's not a
well tested combination, but of course 3.0.1 is a small change over 3.0.0
so it should be okay. I've just tried it, and it worked fine for me.
Michael, could you double-check your filters setting of the problem view,
to make sure AspectJ problems are enabled there. Others have noticed them
disabled - I think sometimes if you make a change to the filters before
installing AJDT, the AspectJ problems can become disabled.

Regards,

Matt.

On Sat, 02 Oct 2004 10:28:58 +0200, Eric Bodden wrote:
> Actually such contibuted errors and warning should show up in your problems
> view (as they always do), not just as decorators. The convention for the
> visualizer always was - AFAIK - that only pointcuts that have an advice
> attached, are displayed, and since declare statements haven't, they aren't.
> However I see your point. Maybe you could file a feature request and see
> what other people think about it.
>
> Eric
Re: Can't get AJDT to work... [message #583561 is a reply to message #41629] Mon, 04 October 2004 07:37 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Hi Matt,

"Matt Chapman" <mchapman@uk.ibm.com> wrote in message
news:pan.2004.10.02.09.23.14.691044@uk.ibm.com...
>
> No need for a feature, we've already done it :)
Great!

> ..
> Michael, could you double-check your filters setting of the problem
view,
> to make sure AspectJ problems are enabled there.

indeed - they were just filtered and now AspectJ warnings are
displayed as expected! Thanks for the hint!

> ... Others have noticed them
> disabled - I think sometimes if you make a change to the filters
before
> installing AJDT, the AspectJ problems can become disabled.

I'm afraid this assumption is not fully correct. Before today I hadn't
even been aware, that there IS such a filter option for the problem
view, so I am definitely sure that I never have fiddled with these
setting before.

Thanks again and regards,
Michael
Previous Topic:Can't get AJDT to work...
Next Topic:AJDT fiddling with the Java Build path?
Goto Forum:
  


Current Time: Tue Mar 19 05:52:03 GMT 2024

Powered by FUDForum. Page generated in 0.01781 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top