Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r18208 r18291 2129 2129 if (!tokenizer.readIfEqual(Token.RIGHT_PARENT)) 2130 2130 throw new SearchParseError(Token.RIGHT_PARENT, tokenizer.nextToken()); 2131 return expression ;2131 return expression != null ? expression : Always.INSTANCE; 2132 2132 } else if (tokenizer.readIfEqual(Token.NOT)) { 2133 2133 return new Not(parseFactor(tr("Missing operator for NOT"))); -
trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
r18195 r18291 841 841 assertThrows(SearchParseError.class, () -> SearchCompiler.compile(searchString)); 842 842 } 843 844 /** 845 * Non-regression test for JOSM #21463 846 */ 847 @Test 848 void testNonRegression21463() throws SearchParseError { 849 final SearchCompiler.Match c = SearchCompiler.compile("foo () () () bar"); 850 assertTrue(c.match(OsmUtils.createPrimitive("node foo=bar"))); 851 assertFalse(c.match(OsmUtils.createPrimitive("node name=bar"))); 852 } 843 853 }
Note:
See TracChangeset
for help on using the changeset viewer.