Problems with HelloWorld example with eclipse 3.0M8 [message #35516] |
Mon, 10 May 2004 14:40 |
Eclipse User |
|
|
|
Originally posted by: Michael-Scharf.gmx.de
Hello,
I am trying AJDT with eclipse 3.0M8. I followed the tutorial and
I have problems with the HelloWorld example.
- aspectj compiler version 1.2rc1
- aspectj plugin version 0.6.8
When I create the aspect "World.aj" or "World.java" I get the following problems:
01 public class World {
02 pointcut greeting(): execution(* HelloWorld.sayHello(..));
03 after() : greeting() {
04 System.out.println("Hello to you too...")
05 }
06 }
Syntax error on token ";", invalid PseudoToken World.java aspectj line 2
Syntax error, insert ";" to complete ClassBodyDeclarations World.java aspectj line 3
Syntax error, insert ";" to complete BlockStatements World.java aspectj line 3
I use the aspectj editor. The syntax highlight highlights the aspectj keywords
correctly.
Any help or hints on what I am doing wrong?
Michael
|
|
|
Re: Problems with HelloWorld example with eclipse 3.0M8 [message #35548 is a reply to message #35516] |
Mon, 10 May 2004 17:55 |
Eclipse User |
|
|
|
Originally posted by: Michael-Scharf.gmx.de
Hi,
I found the problem :-D, my fault!
I wrote "class" instead of "aspect"
> Hello,
>
> I am trying AJDT with eclipse 3.0M8. I followed the tutorial and
> I have problems with the HelloWorld example.
>
> - aspectj compiler version 1.2rc1
> - aspectj plugin version 0.6.8
>
> When I create the aspect "World.aj" or "World.java" I get the following
> problems:
>
> 01 public class World {
This is the real problem: i wrote "class"instead of "aspect"...
> 02 pointcut greeting(): execution(* HelloWorld.sayHello(..));
> 03 after() : greeting() {
> 04 System.out.println("Hello to you too...")
> 05 }
> 06 }
>
>
> Syntax error on token ";", invalid PseudoToken World.java
> aspectj line 2
> Syntax error, insert ";" to complete ClassBodyDeclarations
> World.java aspectj line 3
> Syntax error, insert ";" to complete BlockStatements World.java
> aspectj line 3
>
> I use the aspectj editor. The syntax highlight highlights the aspectj
> keywords
> correctly.
>
> Any help or hints on what I am doing wrong?
>
> Michael
|
|
|
Re: Problems with HelloWorld example with eclipse 3.0M8 [message #35616 is a reply to message #35548] |
Thu, 13 May 2004 07:32 |
Eclipse User |
|
|
|
Originally posted by: clemas.uk.ibm.com
Hi Michael,
Just a quick word of warning - that might not have been your fault!!
1.1.8 does offer some code assist but the mechanism is a bit shaky. When
you press Ctrl+Space whilst in an aspect, we transform the word 'aspect'
to 'class ' and ask the normal JDT code to work out possible completions.
When it has worked them out, we switch it back from 'class ' to 'aspect'.
Sometimes switching it back doesn't quite work (I dont know why) and it
stays as 'class '. The reason it looks like this is what happened in your
case:
> > 01 public class World {
is that you have an extra space between class and World which is just how
it looks if the switch back to 'aspect' doesn't work !
Andy.
---
AJDT Dev.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03317 seconds