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.

FieldFromImplementsNotFound.java 625B

123456789101112131415161718192021222324252627282930
  1. import org.aspectj.testing.Tester;
  2. import java.io.*;
  3. // PR#96
  4. interface HttpConstants {
  5. static final String s = "s";
  6. }
  7. public aspect FieldFromImplementsNotFound implements HttpConstants {
  8. public static void main(String[] args) { test(); }
  9. pointcut sendHeader():
  10. call(void LocalFile.sendHeader());
  11. static String aspectField = "t";
  12. /*static*/ before(): sendHeader() {
  13. aspectField += s;
  14. }
  15. public static void test() {
  16. new LocalFile().sendHeader();
  17. Tester.checkEqual(aspectField, "ts", "field + constant");
  18. }
  19. }
  20. class LocalFile {
  21. void sendHeader() {
  22. }
  23. }