Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How can I make ITD available in the code of the aspect subject?

I finally found a minute to look at this.

Unfortunately it just works for me.  I distilled it down to these two files:

==== Enroler.java ====
import java.util.ArrayList;
import java.util.Collection;

public class Enroler {
	public static Collection<? extends Role> getAllRoles() {
		ArrayList<Role> result = new ArrayList<Role>(2);
		collectAllRoles(result);
		return result;
	}
}
====

==== EnrolerHelperAspect.aj ====
public class Enroler implements org.restlet.security.Enroler {
  public final static Role USER = new Role("user", "A limited user.");
  public final static Role ADMINISTRATOR = new Role("admin", "The
system administrator.");

  public static Collection<? extends Role> getAllRoles() {
    ArrayList<Role> result = new ArrayList<Role>(2);
    collectAllRoles(result);
    return result;
  }

}
====

and they compile OK.  Few things you can check:
- are you on a recent AJDT? (a dev build? they are at this update
site: http://download.eclipse.org/tools/ajdt/37/dev/update )
- have you tried doing a project clean, does it make a difference?
- have you tried removing the generics from the ITD declaration and
making the 'result' just a Collection (this is just to see what
happens)
- do the gutter annotations appear correct, i.e. an outgoing arrow
from the aspect and an incoming arrow into the target?

Rather than me try to recreate your scenario, if you can send me a zip
file of a broken project, that would mean I am setup exactly the same
as you and I can debug a bit further.  (I don't have this type:
"org.restlet.security.Enroler" which I suppose *could* make a
difference, although it shouldn't)

cheers,
Andy


On 8 December 2011 11:40, Mark <mark.kharitonov@xxxxxxxxx> wrote:
> Please, view it on Nabble -
> http://aspectj.2085585.n4.nabble.com/How-can-I-make-ITD-available-in-the-code-of-the-aspect-subject-td4169901.html
>
> Eclipse archives seems to remove everything between the
> &lt;raw&gt;&lt;/raw&gt; tags. I will cease using them to delimit the code
> samples.
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/How-can-I-make-ITD-available-in-the-code-of-the-aspect-subject-tp4169901p4173983.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top