Community
Participate
Working Groups
Hi, When i'm compiling the following example, i'm getting this errors: TestAspect.aj:21 [error] incompatible return type applying to field-get (java.util.Set com.mprv.secsph.Test.intsSet) Test.java:18 [error] incompatible return type applying to field-get (java.util.Set com.mprv.secsph.Test.intsSet) Here is the example ------------------- Java Code: package com; public class Test { Set<Integer> intsSet; public Set<Integer> foo() { 18: return intsSet; } } Aspect: public privileged aspect TestAspect { pointcut gettingMember(Test t) : target(t) && get(!public Set<Integer> com.*.*) && !within(TestAspect); 21: Set<Integer> around(Test t) : gettingMemberCollection(t) { Set s = proceed(t); return s; } } I've tried many kinds of workarounds, and the only thing which worked, is defining the member field without using generics (regular Set) ... One more disturbing is, that this fiture worked(!) in M2 release. This is an example of the functionality that worked in my project (with M2), but now, also reports the same error: Java code is the same, Aspect is: public privileged aspect TestAspect { pointcut gettingMember(Test t) : target(t) && get(!public Set com.*.*) && !within(TestAspect); Set around(Test t) : gettingMemberCollection(t) { Set s = proceed(t); return s; } } Is it a bug? Or am i doing something wrong? Thanks! Misha.
Doesnt look like you are doing anything wrong. And I am not surprised it worked in M2 and fails now, M2 was not generics aware and it would have been working 'by accident'. Now the whole compiler/weaver is much more aware of generics and this kind of thing is going to happen whilst we get it right.
I can see why this is failing, fix almost ready.
Fix checked in, waiting on build before closing. As suspected it was that the system was more generics aware ... apart from in one place ;)
(In reply to comment #3) > Fix checked in, waiting on build before closing. As suspected it was that the > system was more generics aware ... apart from in one place ;) Thanks! I'll download the build as soon as it will be there ...
fix available in the latest dev build from the AJ download page.