Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DominatesTypePatternCE.java 600B

123456789101112131415161718192021
  1. import org.aspectj.testing.Tester;
  2. /** @testcase subtype pattern in dominates should pick out aspect subtypes */
  3. public class DominatesTypePatternCE {
  4. public static void main (String[] args) {
  5. String s = new C().method();
  6. Tester.check("pass".equals(s),
  7. "\"pass\".equals(\"" + s + "\")");
  8. }
  9. }
  10. class C {}
  11. // works if A is specified explicitly
  12. abstract aspect AA { declare precedence: AA, AA+; // CE, AA is matched by both pieces
  13. public String C.method() { return "pass"; }
  14. }
  15. aspect A extends AA {
  16. public String C.method() { return "fail"; }
  17. }