Ignore:
Timestamp:
2016-08-26T19:59:23+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13318 - fix bug report (patch by michael2402) - gsoc-core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java

    r10899 r10902  
    186186     */
    187187    public static String getCallingMethod(int offset) {
    188         String className = BugReport.class.getName();
    189         String methodName = "getCallingMethod";
    190         StackTraceElement found = getCallingMethod(offset, className, methodName::equals);
     188        StackTraceElement found = getCallingMethod(offset + 1, BugReport.class.getName(), "getCallingMethod"::equals);
    191189        if (found != null) {
    192190            return found.getClassName().replaceFirst(".*\\.", "") + '#' + found.getMethodName();
     
    199197     * Find the method that called the given method on the current stack trace.
    200198     * @param offset
    201      *           How many methods to look back in the stack trace. 1 gives the method calling this method, 0 gives you getCallingMethod().
     199     *           How many methods to look back in the stack trace.
     200     *           1 gives the method calling this method, 0 gives you the method with the given name..
    202201     * @param className The name of the class to search for
    203202     * @param methodName The name of the method to search for
     
    209208            StackTraceElement element = stackTrace[i];
    210209            if (className.equals(element.getClassName()) && methodName.test(element.getMethodName())) {
    211                 StackTraceElement toReturn = stackTrace[i + offset];
    212                 return toReturn;
     210                return stackTrace[i + offset];
    213211            }
    214212        }
Note: See TracChangeset for help on using the changeset viewer.