Changeset 11929 in josm
- Timestamp:
- 2017-04-16T14:50:24+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java
r10378 r11929 95 95 condition = parseExpression(CONDITION_WITH_APOSTROPHES_END_TOKENS); 96 96 check(TokenType.APOSTROPHE); 97 if (searchExpression.getText().trim().isEmpty()) { 97 String searchText = searchExpression.getText().trim(); 98 if (searchText.isEmpty()) { 98 99 result.getEntries().add(condition); 99 100 } else { 100 101 try { 101 102 result.getEntries().add(new SearchExpressionCondition( 102 SearchCompiler.compile(search Expression.getText()), condition));103 SearchCompiler.compile(searchText), condition)); 103 104 } catch (SearchCompiler.ParseError e) { 104 105 throw new ParseError(searchExpression.getPosition(), e); … … 125 126 check(TokenType.APOSTROPHE); 126 127 ContextSwitchTemplate result; 127 if (searchExpression.getText().trim().isEmpty()) 128 String searchText = searchExpression.getText().trim(); 129 if (searchText.isEmpty()) 128 130 throw new ParseError(tr("Expected search expression")); 129 131 else { 130 132 try { 131 Match match = SearchCompiler.compile(search Expression.getText());133 Match match = SearchCompiler.compile(searchText); 132 134 result = new ContextSwitchTemplate(match, template, searchExpression.getPosition()); 133 135 } catch (SearchCompiler.ParseError e) { -
trunk/tools/pmd/josm-ruleset.xml
r11746 r11929 32 32 <exclude name="StringToString"/> 33 33 <exclude name="UselessStringValueOf"/> 34 <exclude name="InefficientEmptyStringCheck"/> 34 35 </rule> 35 36 <rule ref="rulesets/java/typeresolution.xml">
Note:
See TracChangeset
for help on using the changeset viewer.