1 Reply Latest reply: Jul 3, 2012 7:43 AM by gimbal2 RSS

    Method reference of the currently executed method

    Carlo A
      Hello,
      is there a way (i think using reflection) to have a reference to a Method object of the currently executed method?
      class A {
           void foo() {
                java.lang.reflect.Method m = ???     // would be a reference to the foo() method
           }
      
           void foo(int i) {
                java.lang.reflect.Method m = ???     // would be a reference to the foo(int i) method
           }
      }
      Thanks in advance for any answer