You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829
  1. import org.aspectj.lang.NoAspectBoundException;
  2. interface IP {}
  3. /** @testcase PR83645 pertypewithin on interface */
  4. public class PR83645 implements IP {
  5. public static void main(String[] args) {
  6. try {
  7. boolean hasAspect = PT.hasAspect(IP.class);
  8. if (hasAspect) throw new Error("Shouldn't have an instance for an interface");
  9. boolean yes = (PT.aspectOf(IP.class) instanceof PT);
  10. throw new Error("expected NoAspectBoundException, got instance?: " + yes);
  11. } catch (NoAspectBoundException e) {
  12. // ok
  13. }
  14. }
  15. }
  16. aspect PT pertypewithin(IP+) {
  17. static int INDEX;
  18. final int index = INDEX++;
  19. public PT() {}
  20. public String toString() {
  21. return "me " + index;
  22. }
  23. }