Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 6471)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 6472)
@@ -63,6 +63,5 @@
 
 /**
- *
- * A OSM data validator
+ * A OSM data validator.
  *
  * @author Francisco R. Santos <frsantos@gmail.com>
@@ -117,4 +116,17 @@
         OpeningHourTest.class // 2901 .. 2999
     };
+    
+    private static Map<String, Test> allTestsMap;
+    static {
+        allTestsMap = new HashMap<String, Test>();
+        for (Class<Test> testClass : allAvailableTests) {
+            try {
+                allTestsMap.put(testClass.getSimpleName(), testClass.newInstance());
+            } catch (Exception e) {
+                Main.error(e);
+                continue;
+            }
+        }
+    }
 
     /**
@@ -133,6 +145,5 @@
      * @return The directory of the plugin
      */
-    public static String getValidatorDir()
-    {
+    public static String getValidatorDir() {
         return Main.pref.getPreferencesDir() + "validator/";
     }
@@ -202,19 +213,12 @@
     }
 
-    /** Gets a map from simple names to all tests. */
+    /** 
+     * Gets a map from simple names to all tests. 
+     * @return A map of all tests, indexed by the simple name of their Java class 
+     */
     public static Map<String, Test> getAllTestsMap() {
-        Map<String, Test> tests = new HashMap<String, Test>();
-        for (Class<Test> testClass : allAvailableTests) {
-            try {
-                Test test = testClass.newInstance();
-                tests.put(testClass.getSimpleName(), test);
-            } catch (Exception e) {
-                e.printStackTrace();
-                continue;
-            }
-        }
-        applyPrefs(tests, false);
-        applyPrefs(tests, true);
-        return tests;
+        applyPrefs(allTestsMap, false);
+        applyPrefs(allTestsMap, true);
+        return new HashMap<String, Test>(allTestsMap);
     }
 
