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.

Driver.java 824B

1234567891011121314151617181920212223242526272829303132333435
  1. //Bugzilla Bug 36046
  2. // inter-type declaration bug with abstract classes
  3. public class Driver {
  4. public static void main(String args[]) {
  5. Derived generator = new Derived();
  6. System.out.println(generator.getExecutions("processEvents"));
  7. }
  8. static aspect MonitorBase {
  9. declare parents: Base implements ExecutionMonitor.MonitoredItem;
  10. }
  11. }
  12. class Derived extends Base {
  13. public String getName() {
  14. return null;
  15. }
  16. }
  17. abstract class Base {
  18. abstract public String getName();
  19. }
  20. aspect ExecutionMonitor {
  21. /** marker interface to indicate the execution monitor should track calls
  22. and executions on this class. */
  23. public interface MonitoredItem {
  24. int getExecutions(String methodName);
  25. }
  26. /** a Map of events to mutable integers */
  27. public int MonitoredItem.getExecutions(String methodName) {
  28. return 0;
  29. }
  30. }