Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] how to find the end-of-method line number?

The following turns out to be too slow:

(and probably might be incorrect with certain compiler optimizations)

 

      after(): methodUnderTestExecution() {

StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[2];

int returnLineNumber = stackTraceElement.getLineNumber();

                        …

 

Hagai


Back to the top