Returns a method in the call stack at the given depth. Depth 0 will return the method that called this getMethodName, depth 1 the method that called it, etc... @param depth @return method name as String
(final int depth)
| 110 | * @return method name as String |
| 111 | */ |
| 112 | protected String getMethodName(final int depth) { |
| 113 | final StackTraceElement[] ste = Thread.currentThread().getStackTrace(); |
| 114 | int index; |
| 115 | if (Utils.isVendorIBM()) { |
| 116 | index = 3 + depth; |
| 117 | } else { |
| 118 | index = 2 + depth; |
| 119 | } |
| 120 | return ste[index].getMethodName(); |
| 121 | } |
| 122 | } |