Index: trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java	(revision 6494)
@@ -188,4 +188,7 @@
             }
         }
+        
+        primitivesToCheck.clear();
+        index.clear();
 
         super.endTest();
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java	(revision 6494)
@@ -30,5 +30,5 @@
 public class DeprecatedTags extends Test {
 
-    private List<DeprecationCheck> checks = new LinkedList<DeprecationCheck>();
+    private final List<DeprecationCheck> checks = new LinkedList<DeprecationCheck>();
 
     /**
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 6494)
@@ -172,5 +172,5 @@
 
     /** List of keys without useful information */
-    private Collection<String> ignoreKeys = new HashSet<String>(OsmPrimitive.getUninterestingKeys());
+    private final Set<String> ignoreKeys = new HashSet<String>(OsmPrimitive.getUninterestingKeys());
 
     /**
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 6494)
@@ -122,11 +122,11 @@
         }
 
-        for(Set<OsmPrimitive> sameway : waysNoTags.values()) {
-            if( sameway.size() > 1) {
+        for (Set<OsmPrimitive> sameway : waysNoTags.values()) {
+            if (sameway.size() > 1) {
                 //Report error only if at least some tags are different, as otherwise the error was already reported as duplicated ways
                 Map<String, String> tags0=null;
                 boolean skip=true;
 
-                for(OsmPrimitive o : sameway) {
+                for (OsmPrimitive o : sameway) {
                     if (tags0==null) {
                         tags0=o.getKeys();
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 6494)
@@ -80,4 +80,10 @@
         }
     }
+    
+    @Override
+    public void endTest() {
+        keysCheckedByAnotherTest.clear();
+        super.endTest();
+    }
 
     private List<List<Node>> joinWays(Collection<Way> ways) {
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java	(revision 6494)
@@ -106,9 +106,11 @@
      * @param selection The primitives to be tested
      */
-    @Override public void visit(Collection<OsmPrimitive> selection) {
-        for (OsmPrimitive p : selection)
+    @Override
+    public void visit(Collection<OsmPrimitive> selection) {
+        for (OsmPrimitive p : selection) {
             if (!p.isDeleted() && !p.isIncomplete()) {
                 check(p);
             }
+        }
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java	(revision 6494)
@@ -33,10 +33,12 @@
     }
 
-    @Override public void startTest(ProgressMonitor monitor) {
+    @Override
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         namesToNodes = new HashMap<String, List<Node>>();
     }
 
-    @Override public void visit(Node n) {
+    @Override
+    public void visit(Node n) {
         if (!n.isUsable()) return;
 
@@ -55,5 +57,6 @@
     }
 
-    @Override public void endTest() {
+    @Override
+    public void endTest() {
         for (List<Node> nodes : namesToNodes.values()) {
             if (nodes.size() > 1) {
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java	(revision 6494)
@@ -102,8 +102,17 @@
     }
 
+    /**
+     * An error concerning invalid syntax for an "opening_hours"-like tag.
+     */
     public class OpeningHoursTestError {
         final Severity severity;
         final String message, prettifiedValue;
 
+        /**
+         * Constructs a new {@code OpeningHoursTestError} with a known pretiffied value.
+         * @param message The error message
+         * @param severity The error severity
+         * @param prettifiedValue The prettified value
+         */
         public OpeningHoursTestError(String message, Severity severity, String prettifiedValue) {
             this.message = message;
@@ -112,8 +121,19 @@
         }
 
+        /**
+         * Constructs a new {@code OpeningHoursTestError}.
+         * @param message The error message
+         * @param severity The error severity
+         */
         public OpeningHoursTestError(String message, Severity severity) {
             this(message, severity, null);
         }
 
+        /**
+         * Returns the real test error given to JOSM validator.
+         * @param p The incriminated OSM primitive.
+         * @param key The incriminated key, used for display.
+         * @return The real test error given to JOSM validator. Can be fixable or not if a prettified values has been determined.
+         */
         public TestError getTestError(final OsmPrimitive p, final String key) {
             if (prettifiedValue == null) {
@@ -125,12 +145,24 @@
         }
 
+        /**
+         * Returns the error message.
+         * @return The error message.
+         */
         public String getMessage() {
             return message;
         }
 
+        /**
+         * Returns the prettified value.
+         * @return The prettified value.
+         */
         public String getPrettifiedValue() {
             return prettifiedValue;
         }
 
+        /**
+         * Returns the error severity.
+         * @return The error severity.
+         */
         public Severity getSeverity() {
             return severity;
@@ -172,4 +204,12 @@
     }
 
+    /**
+     * Checks for a correct usage of the opening hour syntax of the {@code value} given, in time range mode, according to
+     * <a href="https://github.com/ypid/opening_hours.js">opening_hours.js</a> and returns a list containing
+     * validation errors or an empty list. Null values result in an empty list.
+     * @param key the OSM key (should be "opening_hours", "collection_times" or "service_times"). Used in error message
+     * @param value the opening hour value to be checked.
+     * @return a list of {@link TestError} or an empty list
+     */
     public List<OpeningHoursTestError> checkOpeningHourSyntax(final String key, final String value) {
         return checkOpeningHourSyntax(key, value, CheckMode.TIME_RANGE);
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java	(revision 6494)
@@ -25,5 +25,5 @@
 
     protected static final int OVERLAPPING_AREAS = 2201;
-    protected QuadBuckets<Way> index = new QuadBuckets<Way>();
+    protected final QuadBuckets<Way> index = new QuadBuckets<Way>();
 
     /**
@@ -93,4 +93,6 @@
             }
         }
+        
+        index.clear();
 
         super.endTest();
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 6494)
@@ -64,5 +64,4 @@
     }
 
-    @SuppressWarnings("null")
     @Override
     public void endTest() {
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 6494)
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.data.validation.Test;
 import org.openstreetmap.josm.data.validation.TestError;
+import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.Geometry;
 
@@ -96,4 +97,12 @@
 
     @Override
+    public void startTest(ProgressMonitor progressMonitor) {
+        super.startTest(progressMonitor);
+        towerPoleTagMap.clear();
+        powerStations.clear();
+        potentialErrors.clear();
+    }
+
+    @Override
     public void endTest() {
         for (PowerLineError e : potentialErrors) {
@@ -103,4 +112,5 @@
             }
         }
+        potentialErrors.clear();
         super.endTest();
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 6494)
@@ -72,7 +72,9 @@
 public class TagChecker extends Test {
     
-    /** The default data files */
+    /** The default data file of tagchecker rules */
     public static final String DATA_FILE = "resource://data/validator/tagchecker.cfg";
+    /** The config file of ignored tags */
     public static final String IGNORE_FILE = "resource://data/validator/ignoretags.cfg";
+    /** The config file of dictionary words */
     public static final String SPELL_FILE = "resource://data/validator/words.cfg";
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 6494)
@@ -69,5 +69,5 @@
         mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0);
         minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0);
-        this.dsArea = Main.main.getCurrentDataSet().getDataSourceArea();
+        dsArea = Main.main.getCurrentDataSet().getDataSourceArea();
     }
 
@@ -167,4 +167,8 @@
         ways = null;
         endnodes = null;
+        endnodes_highway = null;
+        middlenodes = null;
+        othernodes = null;
+        dsArea = null;
         super.endTest();
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 6494)
@@ -24,6 +24,6 @@
  * @author frsantos
  */
-public class UntaggedWay extends Test
-{
+public class UntaggedWay extends Test {
+    
     /** Empty way error */
     protected static final int EMPTY_WAY    = 301;
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 6491)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 6494)
@@ -43,6 +43,5 @@
             }
         }
-        if(!hasway)
-        {
+        if (!hasway) {
             for (OsmPrimitive p : r) {
                 testForError(w, w.firstNode(), p);
@@ -57,5 +56,5 @@
             }
         }
-        if(!hasway) {
+        if (!hasway) {
             for (OsmPrimitive p : r) {
                 testForError(w, w.lastNode(), p);
