Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java	(revision 6387)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java	(revision 6388)
@@ -64,5 +64,5 @@
 	{
 		PreferenceEditor.importOldPreferences();
-        initializeTests( getAllTests() );
+        initializeTests( getTests() );
 	}
 	
@@ -129,58 +129,46 @@
 			}
 		}
+		applyPrefs(tests, false);
+		applyPrefs(tests, true);
 		return tests;
 	}
 
-	/** Gets a collection of all tests. */
-	public static Collection<Test> getAllTests() {
-		return getAllTestsMap().values();
-	}
-
-	/**
-	 * Gets a collection with the available tests
-	 * 
-	 * @param enabled if false, don't get enabled tests
-	 * @param enabledBeforeUpload if false, don't get tests enabled before upload
-	 * @return A collection with the available tests
-	 */
-	public static Collection<Test> getTests(boolean enabled, boolean enabledBeforeUpload)
-	{
-		Set<Test> tests = new HashSet<Test>();
-		Map<String, Test> enabledTests = getAllTestsMap();
-
+	private static void applyPrefs(Map<String, Test> tests, boolean beforeUpload) {
 		Pattern regexp = Pattern.compile("(\\w+)=(true|false),?");
-		Matcher m = regexp.matcher(Main.pref.get(PreferenceEditor.PREF_TESTS));
+		Matcher m = regexp.matcher(Main.pref.get(beforeUpload
+			? PreferenceEditor.PREF_TESTS_BEFORE_UPLOAD
+			: PreferenceEditor.PREF_TESTS));
 		int pos = 0;
 		while( m.find(pos) )
 		{
 			String testName = m.group(1);
-			Test test = enabledTests.get(testName);
+			Test test = tests.get(testName);
 			if( test != null )
 			{
-				test.enabled = Boolean.valueOf(m.group(2));
-				if( enabled && test.enabled )
-					tests.add(test );
+				boolean enabled = Boolean.valueOf(m.group(2));
+				System.err.println(beforeUpload + " " + testName + " " + enabled);
+				if (beforeUpload) {
+					test.testBeforeUpload = enabled;
+				} else {
+					test.enabled = enabled;
+				}
 			}
 			pos = m.end();
 		}
-
-		m = regexp.matcher(Main.pref.get( PreferenceEditor.PREF_TESTS_BEFORE_UPLOAD ));
-		pos = 0;
-		while( m.find(pos) )
-		{
-			String testName = m.group(1);
-			Test test = enabledTests.get(testName);
-			if( test != null )
-			{
-				test.testBeforeUpload = Boolean.valueOf(m.group(2));
-				if( enabledBeforeUpload && test.testBeforeUpload)
-					tests.add(test );
-			}
-			pos = m.end();
-		}
-		
-		return tests;
-	}
-	
+	}
+
+	public static Collection<Test> getTests() {
+		return getAllTestsMap().values();
+	}
+
+	public static Collection<Test> getEnabledTests(boolean beforeUpload) {
+		Collection<Test> enabledTests = getTests();
+		for (Test t : new ArrayList<Test>(enabledTests)) {
+			if (beforeUpload ? t.testBeforeUpload : t.enabled) continue;
+			enabledTests.remove(t);
+		}
+		return enabledTests;
+	}
+
     /**
      * Gets the list of all available test classes
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java	(revision 6387)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java	(revision 6388)
@@ -46,10 +46,9 @@
         testPanel.add( new JLabel(), GBC.std() );
         testPanel.add( new JLabel("On upload"), GBC.eop() );
-        
-		allTests = OSMValidatorPlugin.getAllTests();
+
+		allTests = OSMValidatorPlugin.getTests();
 		for(Test test: allTests) 
 		{
             test.addGui(testPanel);
-            test.setGuiEnabled(test.enabled || test.testBeforeUpload);
 		}
 		
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java	(revision 6387)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java	(revision 6388)
@@ -142,28 +142,10 @@
 		checkEnabled = new JCheckBox(name, enabled);
 		checkEnabled.setToolTipText(description);
-        checkEnabled.addActionListener(new ActionListener(){
-            public void actionPerformed(ActionEvent e) {
-                setGuiEnabled(checkEnabled.isSelected() || checkBeforeUpload.isSelected() );
-            }
-        });
 		testPanel.add(checkEnabled, GBC.std().insets(20,0,0,0));
 		
         checkBeforeUpload = new JCheckBox();
         checkBeforeUpload.setSelected(testBeforeUpload);
-        checkBeforeUpload.addActionListener(new ActionListener(){
-            public void actionPerformed(ActionEvent e) {
-                setGuiEnabled(checkEnabled.isSelected() || checkBeforeUpload.isSelected() );
-            }
-        });
         testPanel.add(checkBeforeUpload, GBC.eop().insets(20,0,0,0));
 	}
-
-    /**
-     * Enables or disables the test in the preferences gui
-     * @param enabled
-     */
-    public void setGuiEnabled(boolean enabled)
-    {
-    }   
 
 	/**
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateAction.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateAction.java	(revision 6387)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateAction.java	(revision 6388)
@@ -58,5 +58,5 @@
             return;
         
-		Collection<Test> tests = OSMValidatorPlugin.getTests(true, false);
+		Collection<Test> tests = OSMValidatorPlugin.getEnabledTests(false);
 		if( tests.isEmpty() )
 			return;
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateUploadHook.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateUploadHook.java	(revision 6387)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateUploadHook.java	(revision 6388)
@@ -32,5 +32,5 @@
     public boolean checkUpload(Collection<OsmPrimitive> add, Collection<OsmPrimitive> update, Collection<OsmPrimitive> delete)
     {
-        Collection<Test> tests = OSMValidatorPlugin.getTests(false, true);
+        Collection<Test> tests = OSMValidatorPlugin.getEnabledTests(true);
         if( tests.isEmpty() )
             return true;
@@ -43,7 +43,4 @@
         for(Test test : tests) 
         {
-            if( !test.testBeforeUpload() )
-                continue;
-
             test.setBeforeUpload(true);
             test.setPartialSelection(true);
