Ticket #24553: 24553.patch
| File 24553.patch, 1.3 KB (added by , 3 days ago) |
|---|
-
src/org/openstreetmap/josm/gui/widgets/OsmIdTextField.java
6 6 import java.util.ArrayList; 7 7 import java.util.List; 8 8 import java.util.StringTokenizer; 9 import java.util.regex.Pattern; 9 10 10 11 import javax.swing.text.JTextComponent; 11 12 … … 20 21 * @author Matthias Julius 21 22 */ 22 23 public class OsmIdTextField extends AbstractIdTextField<OsmIdTextField.OsmIdValidator> { 24 private static final Pattern UNWANTED_NON_PRINTING_CONTROL_CHARACTERS = Pattern.compile( 25 "[\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F\\u200e-\\u200f\\u202a-\\u202e]"); 23 26 24 27 /** 25 28 * Constructs a new {@link OsmIdTextField} … … 98 101 return false; 99 102 } 100 103 ids.clear(); 101 StringTokenizer st = new StringTokenizer(value, ",.+/ \t\n"); 104 String stripped = UNWANTED_NON_PRINTING_CONTROL_CHARACTERS.matcher(value).replaceAll(""); 105 StringTokenizer st = new StringTokenizer(stripped, ",.+/ \t\n"); 102 106 String s; 103 107 while (st.hasMoreTokens()) { 104 108 s = st.nextToken();
