Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

decwStrings.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class WarningSample {
  2. public void method() {}
  3. public void anotherMethod() {
  4. this.method();
  5. }
  6. }
  7. aspect WarningAspect {
  8. pointcut illegalCall(): call(* WarningSample.method())
  9. && within(WarningSample);
  10. // the same thing happens with declare error
  11. declare warning: illegalCall() : "Hey, don't " +
  12. "do that, that is not nice. You should do something else";
  13. public void e1() {}
  14. declare warning: execution(* e1(..)): "hello " + /* comment */ "world";
  15. public void e2() {}
  16. declare warning: execution(* e2(..)): "hello " /* comment */ + "world";
  17. public void e3() {}
  18. declare warning: execution(* e3(..)): "hello " + // commenthere
  19. // comment here too
  20. "world";
  21. public void e4() {}
  22. declare warning: execution(* e4()): "hello " //xxx
  23. + "world";
  24. public void e5() {}
  25. declare warning: execution(* e5()): "hello " //xxx
  26. /* here */
  27. + "world";
  28. public void e6() {}
  29. declare warning: execution(* e6()): "abc" +
  30. "def" + // def was here
  31. "ghijklmnopqrstuv" /* silly
  32. place
  33. for a
  34. comment */ +
  35. /* oops */
  36. "wxyz";
  37. }