2005-01-25 22:11:56 +01:00
|
|
|
|
|
|
|
import org.aspectj.lang.NoAspectBoundException;
|
|
|
|
|
|
|
|
interface IP {}
|
|
|
|
|
|
|
|
/** @testcase PR83645 pertypewithin on interface */
|
|
|
|
public class PR83645 implements IP {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
try {
|
2005-01-27 18:26:48 +01:00
|
|
|
boolean hasAspect = PT.hasAspect(IP.class);
|
|
|
|
if (hasAspect) throw new Error("Shouldn't have an instance for an interface");
|
2005-01-25 22:11:56 +01:00
|
|
|
boolean yes = (PT.aspectOf(IP.class) instanceof PT);
|
|
|
|
throw new Error("expected NoAspectBoundException, got instance?: " + yes);
|
|
|
|
} catch (NoAspectBoundException e) {
|
|
|
|
// ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-01-27 18:26:48 +01:00
|
|
|
|
2005-01-25 22:11:56 +01:00
|
|
|
aspect PT pertypewithin(IP+) {
|
|
|
|
static int INDEX;
|
|
|
|
final int index = INDEX++;
|
2005-01-27 18:26:48 +01:00
|
|
|
|
|
|
|
public PT() {}
|
|
|
|
|
2005-01-25 22:11:56 +01:00
|
|
|
public String toString() {
|
|
|
|
return "me " + index;
|
|
|
|
}
|
|
|
|
}
|