Ignore:
Timestamp:
2016-01-10T13:48:42+01:00 (8 years ago)
Author:
simon04
Message:

Refactoring: introduce UncheckedParseException

In addition, DateUtils#fromString does no longer return "now" when
date cannot be parsed, but throws an UncheckedParseException instead.

File:
1 edited

Legend:

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

    r8855 r9385  
    2424    private static OverpassTurboQueryWizard instance;
    2525    private final ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
    26 
    27     /**
    28      * An exception to indicate a failed parse.
    29      */
    30     public static class ParseException extends RuntimeException {
    31     }
    3226
    3327    /**
     
    6054     * @param search the {@link org.openstreetmap.josm.actions.search.SearchAction} like query
    6155     * @return an Overpass QL query
    62      * @throws ParseException when the parsing fails
     56     * @throws UncheckedParseException when the parsing fails
    6357     */
    64     public String constructQuery(String search) throws ParseException {
     58    public String constructQuery(String search) throws UncheckedParseException {
    6559        try {
    6660            final Object result = ((Invocable) engine).invokeFunction("construct_query", search);
    6761            if (result == Boolean.FALSE) {
    68                 throw new ParseException();
     62                throw new UncheckedParseException();
    6963            }
    7064            String query = (String) result;
Note: See TracChangeset for help on using the changeset viewer.