Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ M3a: compile error but donot know what's wrong

There's nothing wrong with your code. I tried to reproduce this
problem with the latest AspectJ compiler, but was unable to do so. 
What version are you using when you compiled via Ant?

What does Subject look like in your application? I used an empty
interface for my tests...
The behaviour in AJDT looks like it could be related to some kind of
incremental compilation issue. If you do a full build of your project
and the problem goes away then I am even more suspicious of that. 
Anyway, please raise a bug report and we can try and diagnose what's
going on there.

Thanks, Adrian.

On 06/09/05, Guofeng Zhang <guofeng@xxxxxxxxxxxxx> wrote:
> The following is the AspectJ code that use Inter-type declarations:
> 
> public abstract aspect ObserverProtocol{
>   private Collection Subject.observers=new ArrayList();
>  .....
>   public Collection Subject.getObservers()
>   {
>    return observers;    //line 39
>   }
> }
> 
> The following is the output of the compiler.
>      [iajc] D:\workdir\DPsample\main\src\com\designpattern\observer\ObserverProt
> ocol.aj:39 [error] Type mismatch: cannot convert from Collection to Collection
>      [iajc] return observers;
>      [iajc]        ^^^^^
> 
> What is wrong with the above code?
> 
> In AJDT1.3.0.20050905154239, this line is also marked as x in red. I change this line to
>        return null ;
> the marker disappear, then I change it to
>      return observers;
> again. AJDT still shows that this line is correct, and the program run correctly.
> 
> I think maybe this is a bug in M3a.
> 
> thanks
> 
> guofeng
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


-- 
-- Adrian
adrian.colyer@xxxxxxxxx


Back to the top