Ignore:
Timestamp:
2013-12-16T00:22:44+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9434 - Robustness in hash URLs parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r6471 r6474  
    212212     */
    213213    public static int logLevel = 3;
    214    
     214
    215215    /**
    216216     * Prints an error message if logging is on.
     
    223223        System.err.println(tr("ERROR: {0}", msg));
    224224    }
    225    
     225
    226226    /**
    227227     * Prints a warning message if logging is on.
     
    233233        System.err.println(tr("WARNING: {0}", msg));
    234234    }
    235    
     235
    236236    /**
    237237     * Prints an informational message if logging is on.
     
    243243        System.out.println(tr("INFO: {0}", msg));
    244244    }
    245    
     245
    246246    /**
    247247     * Prints a debug message if logging is on.
     
    253253        System.out.println(tr("DEBUG: {0}", msg));
    254254    }
    255    
     255
    256256    /**
    257257     * Prints a formated error message if logging is on. Calls {@link MessageFormat#format}
     
    264264        error(MessageFormat.format(msg, objects));
    265265    }
    266    
     266
    267267    /**
    268268     * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format}
     
    274274        warn(MessageFormat.format(msg, objects));
    275275    }
    276    
     276
    277277    /**
    278278     * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format}
     
    284284        info(MessageFormat.format(msg, objects));
    285285    }
    286    
     286
    287287    /**
    288288     * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format}
     
    294294        debug(MessageFormat.format(msg, objects));
    295295    }
    296    
     296
    297297    /**
    298298     * Prints an error message for the given Throwable.
     
    303303        error(getErrorMessage(t));
    304304    }
    305    
     305
    306306    /**
    307307     * Prints a warning message for the given Throwable.
     
    312312        warn(getErrorMessage(t));
    313313    }
    314    
     314
    315315    private static String getErrorMessage(Throwable t) {
    316316        StringBuilder sb = new StringBuilder(t.getClass().getName());
     
    318318        if (msg != null) {
    319319            sb.append(": ").append(msg.trim());
     320        }
     321        Throwable cause = t.getCause();
     322        if (cause != null && !cause.equals(t)) {
     323            sb.append(". ").append(tr("Cause: ")).append(getErrorMessage(cause));
    320324        }
    321325        return sb.toString();
Note: See TracChangeset for help on using the changeset viewer.