Changeset 13317 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r13251 r13317 420 420 JOptionPane.showMessageDialog( 421 421 Main.parent, 422 tr("Search expression is not valid: \n\n {0}", e.getMessage()), 422 "<html>" + tr("Search expression is not valid: \n\n {0}", 423 e.getMessage().replace("<html>", "").replace("</html>", "")).replace("\n", "<br>") + 424 "</html>", 423 425 tr("Invalid search expression"), 424 426 JOptionPane.ERROR_MESSAGE); -
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r12666 r13317 201 201 return new TimestampRange(minDate, maxDate); 202 202 } else { 203 throw new SearchParseError("<html>" + tr("Expecting {0} after {1}", "<i>min</i>/<i>max</i>", "<i>timestamp</i>")); 203 throw new SearchParseError("<html>" + tr("Expecting {0} after {1}", "<i>min</i>/<i>max</i>", "<i>timestamp</i>") 204 + "</html>"); 204 205 } 205 206 } 206 207 } else { 207 throw new SearchParseError("<html>" + tr("Expecting {0} after {1}", "<code>:</code>", "<i>" + keyword + "</i>") );208 throw new SearchParseError("<html>" + tr("Expecting {0} after {1}", "<code>:</code>", "<i>" + keyword + "</i>") + "</html>"); 208 209 } 209 210 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
r12659 r13317 18 18 import org.junit.Rule; 19 19 import org.junit.Test; 20 import org.junit.rules.ExpectedException; 20 21 import org.openstreetmap.josm.TestUtils; 21 22 import org.openstreetmap.josm.data.coor.LatLon; … … 55 56 public JOSMTestRules test = new JOSMTestRules().preferences(); 56 57 58 /** 59 * Rule to assert exception message. 60 */ 61 @Rule 62 public ExpectedException expectedEx = ExpectedException.none(); 63 57 64 private static final class SearchContext { 58 65 final DataSet ds = new DataSet(); … … 686 693 } 687 694 } 695 696 /** 697 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/15755">Bug #15755</a>. 698 * @throws SearchParseError always 699 */ 700 @Test 701 public void testTicket15755() throws SearchParseError { 702 expectedEx.expect(SearchParseError.class); 703 expectedEx.expectMessage("<html>Expecting <code>:</code> after <i>type</i></html>"); 704 SearchCompiler.compile("public_transport=stop_area -type"); 705 } 688 706 }
Note: See TracChangeset
for help on using the changeset viewer.