Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Fighting AJDT
Fighting AJDT [message #59795] Fri, 23 December 2005 16:47 Go to next message
Eclipse UserFriend
Originally posted by: as851.columbia.edu

I am fighting the latest AJDT for a couple of hours now. So decided to
just make sure it is not me ... here is the aspect that just would not
let me live :-)

public abstract aspect AbstractPrettyPrintAspect {

protected abstract pointcut toStringMethod(java.lang.Object
targetObject)


;

around (Object targetObject) : toStringMethod(targetObject) {
String result = (String) proceed(targetObject);
if (shouldOverwrite(result,targetObject))
result = "overwrite";
return result;
}

....

}

is there anything wrong with it. I am getting an error form AJDT on the
line that declares the abstract pointcut. Eclipse complains "Syntax
error on token ";", Type expected after this token"

I can not see what is wrong here. The funny part is that I have an
aspect in different project that has a declaration of the pointcut that
matches one-to-one but names and it works just fine.

Any advice?

I am running:
Version: 1.3.0
Build id: 20051220093604
AspectJ version: 1.5.0
Re: Fighting AJDT [message #59822 is a reply to message #59795] Fri, 23 December 2005 16:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: as851.columbia.edu

sorry for the noise, the around needs return type which I do not have on
the next line. I guess the line that AJDT was pointing to threw me off
the track.

I am good now. No need to call 911 :-)

a.shneyderman wrote:
> I am fighting the latest AJDT for a couple of hours now. So decided to
> just make sure it is not me ... here is the aspect that just would not
> let me live :-)
>
> public abstract aspect AbstractPrettyPrintAspect {
>
> protected abstract pointcut toStringMethod(java.lang.Object
> targetObject)
>
>
> ;
>
> around (Object targetObject) : toStringMethod(targetObject) {
> String result = (String) proceed(targetObject);
> if (shouldOverwrite(result,targetObject))
> result = "overwrite";
> return result;
> }
>
> ....
>
> }
>
> is there anything wrong with it. I am getting an error form AJDT on the
> line that declares the abstract pointcut. Eclipse complains "Syntax
> error on token ";", Type expected after this token"
>
> I can not see what is wrong here. The funny part is that I have an
> aspect in different project that has a declaration of the pointcut that
> matches one-to-one but names and it works just fine.
>
> Any advice?
>
> I am running:
> Version: 1.3.0
> Build id: 20051220093604
> AspectJ version: 1.5.0
Re: Fighting AJDT [message #59846 is a reply to message #59795] Fri, 23 December 2005 17:01 Go to previous message
Didier Villevalois is currently offline Didier VillevaloisFriend
Messages: 86
Registered: July 2009
Member
Hi!

The problem comes from your around advice. It should have a return type
specified before the "around" keyword! (here String!)

So this makes:

public abstract aspect AbstractPrettyPrintAspect {

protected abstract pointcut toStringMethod(java.lang.Object
targetObject)


;

String around (Object targetObject) : toStringMethod(targetObject) {
String result = (String) proceed(targetObject);
if (shouldOverwrite(result,targetObject))
result = "overwrite";
return result;
}

....

}

Didier.

a.shneyderman wrote:
> public abstract aspect AbstractPrettyPrintAspect {
>
> protected abstract pointcut toStringMethod(java.lang.Object
> targetObject)
>
>
> ;
>
> around (Object targetObject) : toStringMethod(targetObject) {
> String result = (String) proceed(targetObject);
> if (shouldOverwrite(result,targetObject))
> result = "overwrite";
> return result;
> }
>
> ....
>
> }
Re: Fighting AJDT [message #591464 is a reply to message #59795] Fri, 23 December 2005 16:59 Go to previous message
Eclipse UserFriend
Originally posted by: as851.columbia.edu

sorry for the noise, the around needs return type which I do not have on
the next line. I guess the line that AJDT was pointing to threw me off
the track.

I am good now. No need to call 911 :-)

a.shneyderman wrote:
> I am fighting the latest AJDT for a couple of hours now. So decided to
> just make sure it is not me ... here is the aspect that just would not
> let me live :-)
>
> public abstract aspect AbstractPrettyPrintAspect {
>
> protected abstract pointcut toStringMethod(java.lang.Object
> targetObject)
>
>
> ;
>
> around (Object targetObject) : toStringMethod(targetObject) {
> String result = (String) proceed(targetObject);
> if (shouldOverwrite(result,targetObject))
> result = "overwrite";
> return result;
> }
>
> ....
>
> }
>
> is there anything wrong with it. I am getting an error form AJDT on the
> line that declares the abstract pointcut. Eclipse complains "Syntax
> error on token ";", Type expected after this token"
>
> I can not see what is wrong here. The funny part is that I have an
> aspect in different project that has a declaration of the pointcut that
> matches one-to-one but names and it works just fine.
>
> Any advice?
>
> I am running:
> Version: 1.3.0
> Build id: 20051220093604
> AspectJ version: 1.5.0
Re: Fighting AJDT [message #591473 is a reply to message #59795] Fri, 23 December 2005 17:01 Go to previous message
Didier Villevalois is currently offline Didier VillevaloisFriend
Messages: 86
Registered: July 2009
Member
Hi!

The problem comes from your around advice. It should have a return type
specified before the "around" keyword! (here String!)

So this makes:

public abstract aspect AbstractPrettyPrintAspect {

protected abstract pointcut toStringMethod(java.lang.Object
targetObject)


;

String around (Object targetObject) : toStringMethod(targetObject) {
String result = (String) proceed(targetObject);
if (shouldOverwrite(result,targetObject))
result = "overwrite";
return result;
}

....

}

Didier.

a.shneyderman wrote:
> public abstract aspect AbstractPrettyPrintAspect {
>
> protected abstract pointcut toStringMethod(java.lang.Object
> targetObject)
>
>
> ;
>
> around (Object targetObject) : toStringMethod(targetObject) {
> String result = (String) proceed(targetObject);
> if (shouldOverwrite(result,targetObject))
> result = "overwrite";
> return result;
> }
>
> ....
>
> }
Previous Topic:Fighting AJDT
Next Topic:CompilationUnit from AspectJ source file?
Goto Forum:
  


Current Time: Sat Nov 09 05:15:44 GMT 2024

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

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

Back to the top