Hi
The error I am getting is:
warning no match for this type name: o [Xlint:invalidAbsoluteTypeName]
which I guess refers to this:
@AfterReturning("newInstans() && this(o)") <<<-----
private void afterReturningNew(Object o)
{
instances.put(o,true);
}
So how do I get from :
after(Object o) returning() : execution(new(..)) && this(o) {
instances.put(o,true);
}
to an annotated version of it like this:
@AfterReturning("newInstans() && this(o)")
private void afterReturningNew(Object o)
{
instances.put(o,true);
}
Hermod
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, May 24, 2007 10:59 AM
To: [email protected]
Subject: [aspectj-users] Annotations question
Hi
I am trying to convert a trackingaspect .aj version into a Java5 annotated
version. But there must be somthing that I am not getting right because it does
di what it is supposed to do.
the .aj version is
public aspect InstanceTracking pertypewithin(*..*) {
private Map<Object,Boolean> instances = new
WeakHashMap<Object,Boolean>();
after(Object o) returning() : execution(new(..)) && this(o) {
instances.put(o,true);
}
public Set<?> getInstances() {
return instances.keySet();
}
}
And my attempt at annontations:
@Aspect("pertypewithin(*..*)")
public class InstanceTracking {
private Map<Object,Boolean> instances = new WeakHashMap<Object,Boolean>();
@SuppressWarnings("unused")
@Pointcut("execution(new(..))")
private void newInstans(){}
@SuppressWarnings("unused")
@AfterReturning("newInstans() && this(o)")
private void afterReturningNew(Object o)
{
instances.put(o,true);
}
public Set<?> getInstances() {
return instances.keySet();
}
}
Hermod
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.
This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.
This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users