Index: trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java	(revision 6822)
+++ trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java	(revision 6823)
@@ -16,16 +16,18 @@
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.regex.Pattern;
+
 import org.openstreetmap.josm.tools.Utils;
 
 /**
  * TagCollection is a collection of tags which can be used to manipulate
- * tags managed by {@link OsmPrimitive}s.
+ * tags managed by {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s.
  *
  * A TagCollection can be created:
  * <ul>
- *  <li>from the tags managed by a specific {@link OsmPrimitive} with {@link #from(Tagged)}</li>
- *  <li>from the union of all tags managed by a collection of {@link OsmPrimitive}s with {@link #unionOfAllPrimitives(Collection)}</li>
- *  <li>from the union of all tags managed by a {@link DataSet} with {@link #unionOfAllPrimitives(DataSet)}</li>
- *  <li>from the intersection of all tags managed by a collection of primitives with {@link #commonToAllPrimitives(Collection)}</li>
+ *  <li>from the tags managed by a specific {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with {@link #from(org.openstreetmap.josm.data.osm.Tagged)}</li>
+ *  <li>from the union of all tags managed by a collection of {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s with {@link #unionOfAllPrimitives(java.util.Collection)}</li>
+ *  <li>from the union of all tags managed by a {@link org.openstreetmap.josm.data.osm.DataSet} with {@link #unionOfAllPrimitives(org.openstreetmap.josm.data.osm.DataSet)}</li>
+ *  <li>from the intersection of all tags managed by a collection of primitives with {@link #commonToAllPrimitives(java.util.Collection)}</li>
  * </ul>
  *
@@ -33,6 +35,6 @@
  *
  * Basic set operations allow to create the union, the intersection and  the difference
- * of tag collections, see {@link #union(TagCollection)}, {@link #intersect(TagCollection)},
- * and {@link #minus(TagCollection)}.
+ * of tag collections, see {@link #union(org.openstreetmap.josm.data.osm.TagCollection)}, {@link #intersect(org.openstreetmap.josm.data.osm.TagCollection)},
+ * and {@link #minus(org.openstreetmap.josm.data.osm.TagCollection)}.
  *
  *
@@ -42,10 +44,10 @@
     /**
      * Creates a tag collection from the tags managed by a specific
-     * {@link OsmPrimitive}. If <code>primitive</code> is null, replies
+     * {@link org.openstreetmap.josm.data.osm.OsmPrimitive}. If <code>primitive</code> is null, replies
      * an empty tag collection.
      *
      * @param primitive  the primitive
      * @return a tag collection with the tags managed by a specific
-     * {@link OsmPrimitive}
+     * {@link org.openstreetmap.josm.data.osm.OsmPrimitive}
      */
     public static TagCollection from(Tagged primitive) {
@@ -590,5 +592,5 @@
 
     /**
-     * Applies this tag collection to an {@link OsmPrimitive}. Does nothing if
+     * Applies this tag collection to an {@link org.openstreetmap.josm.data.osm.OsmPrimitive}. Does nothing if
      * primitive is null
      *
@@ -611,5 +613,5 @@
 
     /**
-     * Applies this tag collection to a collection of {@link OsmPrimitive}s. Does nothing if
+     * Applies this tag collection to a collection of {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s. Does nothing if
      * primitives is null
      *
@@ -628,5 +630,5 @@
 
     /**
-     * Replaces the tags of an {@link OsmPrimitive} by the tags in this collection . Does nothing if
+     * Replaces the tags of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} by the tags in this collection . Does nothing if
      * primitive is null
      *
@@ -646,5 +648,5 @@
 
     /**
-     * Replaces the tags of a collection of{@link OsmPrimitive}s by the tags in this collection.
+     * Replaces the tags of a collection of{@link org.openstreetmap.josm.data.osm.OsmPrimitive}s by the tags in this collection.
      * Does nothing if primitives is null
      *
@@ -716,4 +718,6 @@
     }
 
+    private static final Pattern SPLIT_VALUES_PATTERN = Pattern.compile(";\\s*");
+
     /**
      * Replies the concatenation of all tag values (concatenated by a semicolon)
@@ -732,5 +736,5 @@
         Map<String, Collection<String>> originalSplitValues = new LinkedHashMap<String, Collection<String>>();
         for (String v : originalValues) {
-            List<String> vs = Arrays.asList(v.split(";\\s*"));
+            List<String> vs = Arrays.asList(SPLIT_VALUES_PATTERN.split(v));
             originalSplitValues.put(v, vs);
             values.addAll(vs);
Index: trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 6822)
+++ trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 6823)
@@ -157,5 +157,5 @@
     private Map<String, String> parseParameterList(String pref) throws ProjectionConfigurationException {
         Map<String, String> parameters = new HashMap<String, String>();
-        String[] parts = pref.trim().split("\\s+");
+        String[] parts = Utils.WHITE_SPACES_PATTERN.split(pref.trim());
         if (pref.trim().isEmpty()) {
             parts = new String[0];
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java	(revision 6822)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java	(revision 6823)
@@ -7,4 +7,5 @@
 import java.util.HashSet;
 import java.util.Map.Entry;
+import java.util.regex.Pattern;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -32,4 +33,5 @@
     protected static final int NAME_MISSING = 1501;
     protected static final int NAME_TRANSLATION_MISSING = 1502;
+    private static final Pattern NAME_SPLIT_PATTERN = Pattern.compile(" - ");
 
     /**
@@ -86,5 +88,5 @@
         Check if this is the case. */
 
-        String[] splitNames = name.split(" - ");
+        String[] splitNames = NAME_SPLIT_PATTERN.split(name);
         if (splitNames.length == 1) {
             /* The name is not composed of multiple parts. Complain. */
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 6822)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 6823)
@@ -669,7 +669,11 @@
         }
 
-        public String getData(String str) {
-            Matcher m = Pattern.compile(" *# *([^#]+) *$").matcher(str);
-            str = m.replaceFirst("").trim();
+        private static final Pattern CLEAN_STR_PATTERN = Pattern.compile(" *# *([^#]+) *$");
+        private static final Pattern SPLIT_TRIMMED_PATTERN = Pattern.compile(" *: *");
+        private static final Pattern SPLIT_ELEMENTS_PATTERN = Pattern.compile(" *&& *");
+
+        public String getData(final String str) {
+            Matcher m = CLEAN_STR_PATTERN.matcher(str);
+            String trimmed = m.replaceFirst("").trim();
             try {
                 description = m.group(1);
@@ -680,5 +684,5 @@
                 description = null;
             }
-            String[] n = str.split(" *: *", 3);
+            String[] n = SPLIT_TRIMMED_PATTERN.split(trimmed, 3);
             if (n[0].equals("way")) {
                 type = OsmPrimitiveType.WAY;
@@ -705,5 +709,5 @@
             } else
                 return tr("Could not find warning level");
-            for (String exp: n[2].split(" *&& *")) {
+            for (String exp: SPLIT_ELEMENTS_PATTERN.split(n[2])) {
                 try {
                     data.add(new CheckerElement(exp));
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6822)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6823)
@@ -41,4 +41,5 @@
 import java.util.List;
 import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.ZipFile;
@@ -53,4 +54,6 @@
  */
 public final class Utils {
+
+    public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+");
 
     private Utils() {
@@ -318,5 +321,5 @@
      * @param in The source file
      * @param out The destination file
-     * @throws IOException If any I/O error occurs
+     * @throws java.io.IOException If any I/O error occurs
      */
     public static void copyFile(File in, File out) throws IOException  {
@@ -365,5 +368,5 @@
 
     /**
-     * <p>Utility method for closing a {@link Closeable} object.</p>
+     * <p>Utility method for closing a {@link java.io.Closeable} object.</p>
      *
      * @param c the closeable object. May be null.
@@ -379,5 +382,5 @@
 
     /**
-     * <p>Utility method for closing a {@link ZipFile}.</p>
+     * <p>Utility method for closing a {@link java.util.zip.ZipFile}.</p>
      *
      * @param zip the zip file. May be null.
@@ -577,5 +580,5 @@
     /**
      * Transforms the collection {@code c} into an unmodifiable collection and
-     * applies the {@link Function} {@code f} on each element upon access.
+     * applies the {@link org.openstreetmap.josm.tools.Utils.Function} {@code f} on each element upon access.
      * @param <A> class of input collection
      * @param <B> class of transformed collection
@@ -619,5 +622,5 @@
     /**
      * Transforms the list {@code l} into an unmodifiable list and
-     * applies the {@link Function} {@code f} on each element upon access.
+     * applies the {@link org.openstreetmap.josm.tools.Utils.Function} {@code f} on each element upon access.
      * @param <A> class of input collection
      * @param <B> class of transformed collection
@@ -644,13 +647,15 @@
     }
 
+    private static final Pattern HTTP_PREFFIX_PATTERN = Pattern.compile("https?");
+
     /**
      * Opens a HTTP connection to the given URL and sets the User-Agent property to JOSM's one.
      * @param httpURL The HTTP url to open (must use http:// or https://)
      * @return An open HTTP connection to the given URL
-     * @throws IOException if an I/O exception occurs.
+     * @throws java.io.IOException if an I/O exception occurs.
      * @since 5587
      */
     public static HttpURLConnection openHttpConnection(URL httpURL) throws IOException {
-        if (httpURL == null || !httpURL.getProtocol().matches("https?")) {
+        if (httpURL == null || !HTTP_PREFFIX_PATTERN.matcher(httpURL.getProtocol()).matches()) {
             throw new IllegalArgumentException("Invalid HTTP url");
         }
@@ -665,5 +670,5 @@
      * @param url The url to open
      * @return An stream for the given URL
-     * @throws IOException if an I/O exception occurs.
+     * @throws java.io.IOException if an I/O exception occurs.
      * @since 5867
      */
@@ -711,5 +716,5 @@
      * @param url The url to open
      * @return An buffered stream reader for the given URL (using UTF-8)
-     * @throws IOException if an I/O exception occurs.
+     * @throws java.io.IOException if an I/O exception occurs.
      * @since 5868
      */
@@ -736,5 +741,5 @@
      * @param keepAlive whether not to set header {@code Connection=close}
      * @return An open HTTP connection to the given URL
-     * @throws IOException if an I/O exception occurs.
+     * @throws java.io.IOException if an I/O exception occurs.
      * @since 5587
      */
