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.

Finalizer.java 573B

1234567891011121314151617181920212223242526
  1. // for Bug#: 30026
  2. import org.aspectj.testing.Tester;
  3. public class Finalizer {
  4. public static void main(String args[]) {
  5. Finalizer np = new Finalizer();
  6. np = null;
  7. }
  8. public void finalize() throws Throwable {
  9. }
  10. }
  11. aspect FinalizeContract {
  12. pointcut finalizeCall(Object o):
  13. this(Object+) &&
  14. this(o) &&
  15. execution(void finalize());
  16. void around(Object o) throws Throwable: finalizeCall(o) {
  17. o.finalize(); // error
  18. //((Finalizer) o).finalize(); // ok
  19. proceed(o);
  20. }
  21. }