Changeset 13298 in josm for trunk/src


Ignore:
Timestamp:
2018-01-08T00:39:56+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15582 - simplify public API for opening_hours parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r13297 r13298  
    289289    /**
    290290     * Translates and shortens the error/warning message.
    291      * @param key OSM key
    292291     * @param o error/warning message returned by {@link #getOpeningHoursErrors} or {@link #getOpeningHoursWarnings}
    293292     * @return translated/shortened error/warning message
    294      * @since 13297
    295      */
    296     public static String getErrorMessage(String key, Object o) {
    297         String msg = o.toString().trim()
     293     * @since 13298
     294     */
     295    public static String getErrorMessage(Object o) {
     296        return o.toString().trim()
    298297        .replace("Unexpected token:", tr("Unexpected token:"))
    299298        .replace("Unexpected token (school holiday parser):", tr("Unexpected token (school holiday parser):"))
     
    304303        .replace("Unexpected token in year range:", tr("Unexpected token in year range:"))
    305304        .replace("This means that the syntax is not valid at that point or it is currently not supported.", tr("Invalid/unsupported syntax."));
    306         return key + " - " + msg;
     305    }
     306
     307    /**
     308     * Translates and shortens the error/warning message.
     309     * @param key OSM key
     310     * @param o error/warning message returned by {@link #getOpeningHoursErrors} or {@link #getOpeningHoursWarnings}
     311     * @return translated/shortened error/warning message
     312     */
     313    static String getErrorMessage(String key, Object o) {
     314        return key + " - " + getErrorMessage(o);
    307315    }
    308316
Note: See TracChangeset for help on using the changeset viewer.