Changeset 6472 in josm
- Timestamp:
- 2013-12-11T20:56:11+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r6370 r6472 63 63 64 64 /** 65 * 66 * A OSM data validator 65 * A OSM data validator. 67 66 * 68 67 * @author Francisco R. Santos <frsantos@gmail.com> … … 117 116 OpeningHourTest.class // 2901 .. 2999 118 117 }; 118 119 private static Map<String, Test> allTestsMap; 120 static { 121 allTestsMap = new HashMap<String, Test>(); 122 for (Class<Test> testClass : allAvailableTests) { 123 try { 124 allTestsMap.put(testClass.getSimpleName(), testClass.newInstance()); 125 } catch (Exception e) { 126 Main.error(e); 127 continue; 128 } 129 } 130 } 119 131 120 132 /** … … 133 145 * @return The directory of the plugin 134 146 */ 135 public static String getValidatorDir() 136 { 147 public static String getValidatorDir() { 137 148 return Main.pref.getPreferencesDir() + "validator/"; 138 149 } … … 202 213 } 203 214 204 /** Gets a map from simple names to all tests. */ 215 /** 216 * Gets a map from simple names to all tests. 217 * @return A map of all tests, indexed by the simple name of their Java class 218 */ 205 219 public static Map<String, Test> getAllTestsMap() { 206 Map<String, Test> tests = new HashMap<String, Test>(); 207 for (Class<Test> testClass : allAvailableTests) { 208 try { 209 Test test = testClass.newInstance(); 210 tests.put(testClass.getSimpleName(), test); 211 } catch (Exception e) { 212 e.printStackTrace(); 213 continue; 214 } 215 } 216 applyPrefs(tests, false); 217 applyPrefs(tests, true); 218 return tests; 220 applyPrefs(allTestsMap, false); 221 applyPrefs(allTestsMap, true); 222 return new HashMap<String, Test>(allTestsMap); 219 223 } 220 224
Note:
See TracChangeset
for help on using the changeset viewer.