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.

Fifteen.java 504B

12345678910111213141516171819202122
  1. import java.io.File;
  2. import java.io.FileInputStream;
  3. import java.io.IOException;
  4. // matching lock on transformed static method ( pre J5)
  5. public aspect Fifteen {
  6. public static void main(String[] args) {
  7. Blah.b();
  8. }
  9. before(): !within(Fifteen) && lock() {
  10. System.err.println("Locking occurring at "+thisJoinPoint);
  11. System.err.println(thisJoinPoint.getSourceLocation().getFileName());
  12. }
  13. }
  14. class Blah {
  15. public static synchronized void b() {
  16. System.err.println("hello");
  17. }
  18. }