Ticket #17112: 17112-v2.patch

File 17112-v2.patch, 1.5 KB (added by GerdP, 7 years ago)
  • src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java

     
    20082008                    return false;
    20092009                }
    20102010            };
    2011         } catch (ParseException e) {
     2011        } catch (ParseException | IllegalArgumentException e) {
    20122012            throw new SearchParseError(tr("Failed to parse MapCSS selector"), e);
    20132013        }
    20142014    }
  • test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java

     
    500500    }
    501501
    502502    /**
     503     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17112">Bug #17112</a>.
     504     * @throws SearchParseError always
     505     */
     506    @Test(expected = SearchParseError.class)
     507    public void testTicket17112() throws SearchParseError {
     508        SearchSetting setting = new SearchSetting();
     509        setting.mapCSSSearch = true;
     510        setting.text = "w"; // partial input
     511        SearchCompiler.compile(setting);
     512    }
     513
     514    /**
    503515     * Test empty values.
    504516     * @throws SearchParseError never
    505517     */