Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] [NEWBIE] Return type for the method is missing

Thanks for the hint.

Sorry for mailing the wrong group.

Sri

-----Original Message-----
From: Wes Isberg [mailto:wes@xxxxxxxxxxxxxx] 
Sent: Tuesday, February 10, 2004 3:10 PM
To: aspectj-dev@xxxxxxxxxxx
Subject: Re: [aspectj-dev] [NEWBIE] Return type for the method is missing


Welcome to AspectJ...

This is a question for aspectj-users@xxxxxxxxxxx,
where people discuss how to write AspectJ programs.

The compiler error message here is not helpful,
but here's the problem:

from: after : logEntry() {
   to: after () : logEntry() {

When starting, I recommend keeping the two-page
quick reference and the language semantic appendix
at your side; once you've gotten the syntax, errors
like this jump out at you, and it becomes easy to
write code.

Wes

P.S. - There's a bug on point:
   https://bugs.eclipse.org/bugs/show_bug.cgi?id=42660


Sri Sankaran wrote:

> Using: AspectJ v1.1.1 (as reported by ajc -version)
>  
> OK, so I am just starting out with AOP and AspectJ.
> 
> I have a simple ol' Java class:
>  
> public class MainClass {
>   public void wasteTime(int duration) {
>     try {
>       Thread.sleep(duration*1000);
>     } catch (InterruptedException e) {
>       System.out.println("Sleep interrupted");
>     }
>   }
> }
>  
> I then wrote an aspect with a a couple of pointcuts and a few advices.  
> Upon compilation these generate all kinds of errors. I have whittled 
> it down to one pointcut and one advice.
> 
> public aspect Timer {
> 
>   pointcut logEntry() : call(* MainClass.wasteTime(..));
> 
>   after : logEntry() {
>     System.out.println("foo");
>   }
> }
> 
> This generates 3 errors:
> Timer.java:18 Return type for the method is missing
> pointcut logEntry() : call(* MainClass.wasteTime(..));
>                       ^^^^
> 
> Timer.java:21 Syntax error on token ":", "(" expected
> after : logEntry() {
>       ^
> 
> Timer.java:21 Return type for the method is missing
> after : logEntry() {
>         ^^^^^^^^^^
> 
> Can you help?
> 
> Sri
> j?^r??z?X??X???)y?cu??rX???+?m???z?*lz???f??f??X??)ߣ??-?ׯ

_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx http://dev.eclipse.org/mailman/listinfo/aspectj-dev

Back to the top