Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java	(revision 30348)
@@ -1,17 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* File created on 24.10.2010 */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -57,763 +43,705 @@
  *
  */
-
 public class AddressEditContainer implements Visitor, DataSetListener, IAddressEditContainerListener, IProblemVisitor, IAllKnowingTrashHeap {
 
-	private Collection<? extends OsmPrimitive> workingSet;
-	/** The street dictionary collecting all streets to a set of unique street names. */
-	private HashMap<String, OSMStreet> streetDict = new HashMap<String, OSMStreet>(100);
-
-	/** The unresolved (addresses without valid street name) addresses list. */
-	private List<OSMAddress> unresolvedAddresses = new ArrayList<OSMAddress>(100);
-
-	/** The incomplete addresses list. */
-	private List<OSMAddress> incompleteAddresses = new ArrayList<OSMAddress>(100);
-
-	/** The shadow copy to assemble the street dict during update. */
-	private HashMap<String, OSMStreet> shadowStreetDict = new HashMap<String, OSMStreet>(100);
-	/** The shadow copy to assemble the unresolved addresses during update. */
-	private List<OSMAddress> shadowUnresolvedAddresses = new ArrayList<OSMAddress>(100);
-	/** The shadow copy to assemble the incomplete addresses during update. */
-	private List<OSMAddress> shadowIncompleteAddresses = new ArrayList<OSMAddress>(100);
-
-	/** The visited nodes cache to increase iteration speed. */
-	private HashSet<Node> visitedNodes = new HashSet<Node>();
-	/** The visited ways cache to increase iteration speed. */
-	private HashSet<Way> visitedWays = new HashSet<Way>();
-	/** The tag list used within the data area. */
-	private HashSet<String> tags = new HashSet<String>();
-	/** The tag list used within the data area. */
-	private HashMap<String, String> values = new HashMap<String, String>();
-
-	/** The list containing the problems */
-	private List<IProblem> problems = new ArrayList<IProblem>();
-
-	/** The change listeners. */
-	private List<IAddressEditContainerListener> listeners = new ArrayList<IAddressEditContainerListener>();
-
-	/**
-	 * Creates an empty container.
-	 */
-	public AddressEditContainer() {
-		OSMEntityBase.addChangedListener(this);
-	}
-
-	/**
-	 * Gets the working set used by the container. This can by either the complete or just
-	 * a subset of the current data layer.
-	 *
-	 * @return the workingSet
-	 */
-	protected Collection<? extends OsmPrimitive> getWorkingSet() {
-		return workingSet;
-	}
-
-	/**
-	 * Adds a change listener.
-	 * @param listener
-	 */
-	public void addChangedListener(IAddressEditContainerListener listener) {
-		listeners.add(listener);
-	}
-
-	/**
-	 * Removes a change listener.
-	 * @param listener
-	 */
-	public void removeChangedListener(IAddressEditContainerListener listener) {
-		listeners.remove(listener);
-	}
-
-	/**
-	 * Notifies clients that the address container changed.
-	 */
-	protected void fireContainerChanged() {
-		List<IAddressEditContainerListener> shadowListeners =
-			new ArrayList<IAddressEditContainerListener>(listeners);
-
-		for (IAddressEditContainerListener listener : shadowListeners) {
-			listener.containerChanged(this);
-		}
-	}
-
-	/**
-	 * Notifies clients that an entity within the address container changed.
-	 */
-	protected void fireEntityChanged(IOSMEntity entity) {
-		if (entity == null) throw new RuntimeException("Entity must not be null");
-
-		List<IAddressEditContainerListener> shadowListeners =
-			new ArrayList<IAddressEditContainerListener>(listeners);
-
-		for (IAddressEditContainerListener listener : shadowListeners) {
-			listener.entityChanged(entity);
-		}
-	}
-
-	/**
-	 * Marks an OSM node as visited.
-	 *
-	 * @param n the node to mark.
-	 */
-	private void markNodeAsVisited(Node n) {
-		visitedNodes.add(n);
-	}
-
-	/**
-	 * Checks a node for been visited.
-	 *
-	 * @param n the n
-	 * @return true, if node has been visited
-	 */
-	private boolean hasBeenVisited(Node n) {
-		return visitedNodes.contains(n);
-	}
-
-	/**
-	 * Marks a way as visited.
-	 *
-	 * @param w the way to mark
-	 */
-	private void markWayAsVisited(Way w) {
-		visitedWays.add(w);
-	}
-
-	/**
-	 * Checks a way for been visited.
-	 *
-	 * @param w the w to check
-	 * @return true, if way has been visited
-	 */
-	private boolean hasBeenVisited(Way w) {
-		return visitedWays.contains(w);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Node)
-	 */
-	@Override
-	public void visit(Node n) {
-		if (hasBeenVisited(n)) {
-			return;
-		}
-
-		OSMAddress aNode = null;
-		// Address nodes are recycled in order to keep instance variables like guessed names
-		aNode = OsmFactory.createNode(n);
-
-		if (aNode != null) {
-			addAndClassifyAddress(aNode);
-			aNode.visit(this, this);
-		}
-		markNodeAsVisited(n);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Way)
-	 */
-	@Override
-	public void visit(Way w) {
-		// This doesn't matter, we just need the street name
-		//if (w.isIncomplete()) return;
-
-		if (hasBeenVisited(w)) {
-			return;
-		}
-
-		createNodeFromWay(w);
-		markWayAsVisited(w);
-	}
-
-	/**
-	 * Adds and classify an address node according to completeness.
-	 *
-	 * @param aNode the address node to add and check
-	 */
-	private void addAndClassifyAddress(OSMAddress aNode) {
-		if (!assignAddressToStreet(aNode)) {
-			// Assignment failed: Street is not known (yet) -> add to 'unresolved' list
-			shadowUnresolvedAddresses.add(aNode);
-		}
-
-		if (!aNode.isComplete()) {
-			shadowIncompleteAddresses.add(aNode);
-		}
-	}
-
-	/**
-	 * Creates the node from an OSM way instance.
-	 *
-	 * @param w the way to create the entity from
-	 */
-	private void createNodeFromWay(Way w) {
-		IOSMEntity ne = OsmFactory.createNodeFromWay(w);
-
-		if (!processNode(ne, w)) {
-			// Look also into nodes for addresses (unlikely, but at least they
-			// get marked as visited).
-			for (Node n : w.getNodes()) {
-				visit(n);
-			}
-
-			for (String key : w.keySet()) {
-				if (!tags.contains(key)) {
-					tags.add(key);
-				}
-
-				String v = w.get(key);
-				if (!values.containsKey(v)) {
-					values.put(v, key);
-				}
-			}
-		} // else: node has been processed, no need to look deeper
-	}
-
-	/**
-	 * Process an entity node depending on the type. A street segment is added as a child to the
-	 * corresponding street dictionary while an address is added to the incomplete/unresolved list
-	 * depending of it's properties.
-	 *
-	 * @param ne the entity node.
-	 * @param w the corresponding OSM way
-	 * @return true, if node has been processed
-	 */
-	private boolean processNode(IOSMEntity ne, Way w) {
-		if (ne != null) {
-			// Node is a street (segment)
-			if (ne instanceof OSMStreetSegment) {
-				OSMStreetSegment newSegment = (OSMStreetSegment) ne;
-
-				if (newSegment != null) {
-					String name = newSegment.getName();
-					if (StringUtils.isNullOrEmpty(name)) return false;
-
-					OSMStreet sNode = null;
-					if (shadowStreetDict.containsKey(name)) { // street exists?
-						sNode = shadowStreetDict.get(name);
-					} else { // new street name -> add to dict
-						sNode = new OSMStreet(w);
-						shadowStreetDict.put(name, sNode);
-					}
-
-					if (sNode != null) {
-						// TODO: Check if segment really belongs to the street, even if the
-						// names are the same. Then the streets should be split up...
-						sNode.addStreetSegment(newSegment);
-						return true;
-					} else {
-						throw new RuntimeException("Street node is null!");
-					}
-				}
-			}
-
-			// Node is an address
-			if (ne instanceof OSMAddress) {
-				OSMAddress aNode = (OSMAddress) ne;
-				addAndClassifyAddress(aNode);
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Relation)
-	 */
-	@Override
-	public void visit(Relation e) {
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Changeset)
-	 */
-	@Override
-	public void visit(Changeset cs) {
-	}
-
-	/**
-	 * Gets the dictionary contains the collected streets.
-	 * @return
-	 */
-	public HashMap<String, OSMStreet> getStreetDict() {
-		return streetDict;
-	}
-
-	/**
-	 * Gets the unresolved (addresses without valid street name) addresses.
-	 *
-	 * @return the unresolved addresses
-	 */
-	public List<OSMAddress> getUnresolvedAddresses() {
-		return unresolvedAddresses;
-	}
-
-	/**
-	 * Gets the list with incomplete addresses.
-	 *
-	 * @return the incomplete addresses
-	 */
-	public List<OSMAddress> getIncompleteAddresses() {
-		return incompleteAddresses;
-	}
-
-	/**
-	 * Gets the street list.
-	 *
-	 * @return the street list
-	 */
-	public List<OSMStreet> getStreetList() {
-		ArrayList<OSMStreet> sortedList = new ArrayList<OSMStreet>(streetDict.values());
-		Collections.sort(sortedList);
-		return sortedList;
-	}
-
-	/**
-	 * Gets all addresses without valid street.
-	 * @return
-	 */
-	public List<OSMAddress> getUnresolvedItems() {
-		return unresolvedAddresses;
-	}
-
-	/**
-	 * Gets the tags used in the data layer.
-	 * @return
-	 */
-	public HashSet<String> getTags() {
-		return tags;
-	}
-
-	/**
-	 * @return the values
-	 */
-	protected HashMap<String, String> getValues() {
-		return values;
-	}
-
-	/**
-	 * Gets the number of streets in the container.
-	 * @return
-	 */
-	public int getNumberOfStreets() {
-		return streetDict != null ? streetDict.size() : 0;
-	}
-
-	/**
-	 * Get the number of incomplete addresses.
-	 * @return
-	 */
-	public int getNumberOfIncompleteAddresses() {
-		return incompleteAddresses != null ? incompleteAddresses.size() : 0;
-	}
-
-	/**
-	 * Gets the number of unresolved addresses.
-	 * @return
-	 */
-	public int getNumberOfUnresolvedAddresses() {
-		return unresolvedAddresses != null ? unresolvedAddresses.size() : 0;
-	}
-
-	/**
-	 * Gets the number of invalid (unresolved and/or incomplete) addresses.
-	 *
-	 * @return the number of invalid addresses
-	 */
-	public int getNumberOfInvalidAddresses() {
-		return getNumberOfIncompleteAddresses() + getNumberOfUnresolvedAddresses();
-	}
-
-	/**
-	 * Gets the number of guessed tags.
-	 * @return
-	 */
-	public int getNumberOfGuesses() {
-		int sum = 0;
-
-		for (OSMAddress aNode : getAllAddressesToFix()) {
-			if (aNode.hasGuesses()) {
-				sum++;
-			}
-		}
-		return sum;
-	}
-
-	/**
-	 * Gets all (incomplete and/or unresolved) address nodes to fix.
-	 * @return
-	 */
-	public List<OSMAddress> getAllAddressesToFix() {
-		List<OSMAddress> all = new ArrayList<OSMAddress>(incompleteAddresses);
-
-		for (OSMAddress aNode : unresolvedAddresses) {
-			if (!all.contains(aNode)) {
-				all.add(aNode);
-			}
-		}
-
-		return all;
-	}
-
-	/**
-	 * @return the problems
-	 */
-	protected List<IProblem> getProblems() {
-		return problems;
-	}
-
-	/**
-	 * Clears the problem list.
-	 */
-	protected void clearProblems() {
-		problems.clear();
-	}
-
-	/**
-	 * Tries to assign an address to a street.
-	 * @param aNode
-	 */
-	private boolean assignAddressToStreet(OSMAddress aNode) {
-		String streetName = aNode.getStreetName();
-
-		// street name via relation -> implicitly resolved (see TRAC #8336)
-		if (aNode.isPartOfRelation()) {
-		    return true;
-		}
-		
-		if (streetName != null && shadowStreetDict.containsKey(streetName)) {
-			OSMStreet sNode = shadowStreetDict.get(streetName);
-			sNode.addAddress(aNode);
-			return true;
-		}
-
-		return false;
-	}
-
-	/**
-	 * Walks through the list of unassigned addresses and tries to assign them to streets.
-	 */
-	public void resolveAddresses() {
-		List<OSMAddress> resolvedAddresses = new ArrayList<OSMAddress>();
-		for (OSMAddress node : shadowUnresolvedAddresses) {
-			if (assignAddressToStreet(node)) {
-				resolvedAddresses.add(node);
-			}
-		}
-
-		/* Remove all resolves nodes from unresolved list */
-		for (OSMAddress resolved : resolvedAddresses) {
-			shadowUnresolvedAddresses.remove(resolved);
-		}
-	}
-
-	/**
-	 * Rebuilds the street and address lists using the data set given
-	 * in  {@link AddressEditContainer#attachToDataSet(Collection)} or the
-	 * full data set of the current data layer {@link Main#getCurrentDataSet()}.
-	 */
-	public void invalidate() {
-		if (workingSet != null) {
-			invalidate(workingSet);
-		} else {
-			if (Main.main.getCurrentDataSet() != null) {
-				invalidate(Main.main.getCurrentDataSet().allPrimitives());
-			}
-		}
-	}
-
-	/**
-	 * Invalidate using the given data collection.
-	 *
-	 * @param osmData the collection containing the osm data to work on.
-	 */
-	public void invalidate(final Collection<? extends OsmPrimitive> osmData) {
-		if (osmData == null || osmData.isEmpty())
-			return;
-
-		synchronized (this) {
-			clearData();
-			clearProblems();
-			// visit data set for problems...
-			for (OsmPrimitive osmPrimitive : osmData) {
-				if (osmPrimitive.isUsable()) {
-					osmPrimitive.accept(this);
-				}
-			}
-			
-			// match streets with addresses...
-			resolveAddresses();
-			// sort problem lists
-			Collections.sort(shadowIncompleteAddresses);
-			Collections.sort(shadowUnresolvedAddresses);
-
-			// put results from shadow copy into real lists
-			incompleteAddresses = new ArrayList<OSMAddress>(shadowIncompleteAddresses);
-			unresolvedAddresses = new ArrayList<OSMAddress>(shadowUnresolvedAddresses);
-			streetDict = new HashMap<String, OSMStreet>(shadowStreetDict);
-			// remove temp data
-			shadowStreetDict.clear();
-			shadowUnresolvedAddresses.clear();
-			shadowIncompleteAddresses.clear();
-
-			// update clients
-			fireContainerChanged();
-		}
-	}
-
-	/**
-	 * Clears the shadowed lists data and resets the 'visited' flag for every OSM object.
-	 */
-	private void clearData() {
-		shadowStreetDict.clear();
-		shadowUnresolvedAddresses.clear();
-		shadowIncompleteAddresses.clear();
-		visitedNodes.clear();
-		visitedWays.clear();
-	}
-
-	/**
-	 * Connects the listener to the given data set and revisits the data. This method should
-	 * be called immediately after an edit session finished.
-	 *
-	 * If the given data set is not null, calls of {@link AddressEditContainer#invalidate()} will
-	 * only consider the data given within this set. This can be useful to keep out unimportant
-	 * areas. However, a side-effect could be that some streets are not included and leads to
-	 * false alarms regarding unresolved addresses.
-	 *
-	 * Calling {@link AddressEditContainer#detachFromDataSet()} drops the explicit data set and uses
-	 * the full data set on subsequent updates.<p>
-	 *
-	 * <b>Example</b><br>
-	 * <code>
-	 * attachToDataSet(osmDataSetToWorkOn); // osmDataSetToWorkOn = selected items<br>
-	 * //... launch dialog or whatever<br>
-	 * detachFromDataSet();
-	 * </code>
-	 *
-	 * @param osmDataToWorkOn the data to examine
-	 */
-	public void attachToDataSet(Collection<? extends OsmPrimitive> osmDataToWorkOn) {
-		if (osmDataToWorkOn != null && !osmDataToWorkOn.isEmpty()) {
-			workingSet = new ArrayList<OsmPrimitive>(osmDataToWorkOn);
-		} else {
-			detachFromDataSet(); // drop old stuff, if present
-		}
-		invalidate(); // start our investigation...
-	}
-
-	/**
-	 * Disconnects the listener from the data set. This method should
-	 * be called immediately before an edit session started in order to
-	 * prevent updates caused by e. g. a selection change within the map view.
-	 */
-	public void detachFromDataSet() {
-		//Main.main.getCurrentDataSet().removeDataSetListener(this);
-		if (workingSet != null) {
-			workingSet.clear();
-			workingSet = null;
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#dataChanged(org.openstreetmap.josm.data.osm.event.DataChangedEvent)
-	 */
-	@Override
-	public void dataChanged(DataChangedEvent event) {
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#nodeMoved(org.openstreetmap.josm.data.osm.event.NodeMovedEvent)
-	 */
-	@Override
-	public void nodeMoved(NodeMovedEvent event) {
-
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#otherDatasetChange(org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent)
-	 */
-	@Override
-	public void otherDatasetChange(AbstractDatasetChangedEvent event) {
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#primitivesAdded(org.openstreetmap.josm.data.osm.event.PrimitivesAddedEvent)
-	 */
+    private Collection<? extends OsmPrimitive> workingSet;
+    /** The street dictionary collecting all streets to a set of unique street names. */
+    private HashMap<String, OSMStreet> streetDict = new HashMap<String, OSMStreet>(100);
+
+    /** The unresolved (addresses without valid street name) addresses list. */
+    private List<OSMAddress> unresolvedAddresses = new ArrayList<OSMAddress>(100);
+
+    /** The incomplete addresses list. */
+    private List<OSMAddress> incompleteAddresses = new ArrayList<OSMAddress>(100);
+
+    /** The shadow copy to assemble the street dict during update. */
+    private HashMap<String, OSMStreet> shadowStreetDict = new HashMap<String, OSMStreet>(100);
+    /** The shadow copy to assemble the unresolved addresses during update. */
+    private List<OSMAddress> shadowUnresolvedAddresses = new ArrayList<OSMAddress>(100);
+    /** The shadow copy to assemble the incomplete addresses during update. */
+    private List<OSMAddress> shadowIncompleteAddresses = new ArrayList<OSMAddress>(100);
+
+    /** The visited nodes cache to increase iteration speed. */
+    private HashSet<Node> visitedNodes = new HashSet<Node>();
+    /** The visited ways cache to increase iteration speed. */
+    private HashSet<Way> visitedWays = new HashSet<Way>();
+    /** The tag list used within the data area. */
+    private HashSet<String> tags = new HashSet<String>();
+    /** The tag list used within the data area. */
+    private HashMap<String, String> values = new HashMap<String, String>();
+
+    /** The list containing the problems */
+    private List<IProblem> problems = new ArrayList<IProblem>();
+
+    /** The change listeners. */
+    private List<IAddressEditContainerListener> listeners = new ArrayList<IAddressEditContainerListener>();
+
+    /**
+     * Creates an empty container.
+     */
+    public AddressEditContainer() {
+        OSMEntityBase.addChangedListener(this);
+    }
+
+    /**
+     * Gets the working set used by the container. This can by either the complete or just
+     * a subset of the current data layer.
+     *
+     * @return the workingSet
+     */
+    protected Collection<? extends OsmPrimitive> getWorkingSet() {
+        return workingSet;
+    }
+
+    /**
+     * Adds a change listener.
+     * @param listener
+     */
+    public void addChangedListener(IAddressEditContainerListener listener) {
+        listeners.add(listener);
+    }
+
+    /**
+     * Removes a change listener.
+     * @param listener
+     */
+    public void removeChangedListener(IAddressEditContainerListener listener) {
+        listeners.remove(listener);
+    }
+
+    /**
+     * Notifies clients that the address container changed.
+     */
+    protected void fireContainerChanged() {
+        List<IAddressEditContainerListener> shadowListeners =
+            new ArrayList<IAddressEditContainerListener>(listeners);
+
+        for (IAddressEditContainerListener listener : shadowListeners) {
+            listener.containerChanged(this);
+        }
+    }
+
+    /**
+     * Notifies clients that an entity within the address container changed.
+     */
+    protected void fireEntityChanged(IOSMEntity entity) {
+        if (entity == null) throw new RuntimeException("Entity must not be null");
+
+        List<IAddressEditContainerListener> shadowListeners =
+            new ArrayList<IAddressEditContainerListener>(listeners);
+
+        for (IAddressEditContainerListener listener : shadowListeners) {
+            listener.entityChanged(entity);
+        }
+    }
+
+    /**
+     * Marks an OSM node as visited.
+     *
+     * @param n the node to mark.
+     */
+    private void markNodeAsVisited(Node n) {
+        visitedNodes.add(n);
+    }
+
+    /**
+     * Checks a node for been visited.
+     *
+     * @param n the n
+     * @return true, if node has been visited
+     */
+    private boolean hasBeenVisited(Node n) {
+        return visitedNodes.contains(n);
+    }
+
+    /**
+     * Marks a way as visited.
+     *
+     * @param w the way to mark
+     */
+    private void markWayAsVisited(Way w) {
+        visitedWays.add(w);
+    }
+
+    /**
+     * Checks a way for been visited.
+     *
+     * @param w the w to check
+     * @return true, if way has been visited
+     */
+    private boolean hasBeenVisited(Way w) {
+        return visitedWays.contains(w);
+    }
+
+    @Override
+    public void visit(Node n) {
+        if (hasBeenVisited(n)) {
+            return;
+        }
+
+        OSMAddress aNode = null;
+        // Address nodes are recycled in order to keep instance variables like guessed names
+        aNode = OsmFactory.createNode(n);
+
+        if (aNode != null) {
+            addAndClassifyAddress(aNode);
+            aNode.visit(this, this);
+        }
+        markNodeAsVisited(n);
+    }
+
+    @Override
+    public void visit(Way w) {
+        // This doesn't matter, we just need the street name
+        //if (w.isIncomplete()) return;
+
+        if (hasBeenVisited(w)) {
+            return;
+        }
+
+        createNodeFromWay(w);
+        markWayAsVisited(w);
+    }
+
+    /**
+     * Adds and classify an address node according to completeness.
+     *
+     * @param aNode the address node to add and check
+     */
+    private void addAndClassifyAddress(OSMAddress aNode) {
+        if (!assignAddressToStreet(aNode)) {
+            // Assignment failed: Street is not known (yet) -> add to 'unresolved' list
+            shadowUnresolvedAddresses.add(aNode);
+        }
+
+        if (!aNode.isComplete()) {
+            shadowIncompleteAddresses.add(aNode);
+        }
+    }
+
+    /**
+     * Creates the node from an OSM way instance.
+     *
+     * @param w the way to create the entity from
+     */
+    private void createNodeFromWay(Way w) {
+        IOSMEntity ne = OsmFactory.createNodeFromWay(w);
+
+        if (!processNode(ne, w)) {
+            // Look also into nodes for addresses (unlikely, but at least they
+            // get marked as visited).
+            for (Node n : w.getNodes()) {
+                visit(n);
+            }
+
+            for (String key : w.keySet()) {
+                if (!tags.contains(key)) {
+                    tags.add(key);
+                }
+
+                String v = w.get(key);
+                if (!values.containsKey(v)) {
+                    values.put(v, key);
+                }
+            }
+        } // else: node has been processed, no need to look deeper
+    }
+
+    /**
+     * Process an entity node depending on the type. A street segment is added as a child to the
+     * corresponding street dictionary while an address is added to the incomplete/unresolved list
+     * depending of it's properties.
+     *
+     * @param ne the entity node.
+     * @param w the corresponding OSM way
+     * @return true, if node has been processed
+     */
+    private boolean processNode(IOSMEntity ne, Way w) {
+        if (ne != null) {
+            // Node is a street (segment)
+            if (ne instanceof OSMStreetSegment) {
+                OSMStreetSegment newSegment = (OSMStreetSegment) ne;
+
+                if (newSegment != null) {
+                    String name = newSegment.getName();
+                    if (StringUtils.isNullOrEmpty(name)) return false;
+
+                    OSMStreet sNode = null;
+                    if (shadowStreetDict.containsKey(name)) { // street exists?
+                        sNode = shadowStreetDict.get(name);
+                    } else { // new street name -> add to dict
+                        sNode = new OSMStreet(w);
+                        shadowStreetDict.put(name, sNode);
+                    }
+
+                    if (sNode != null) {
+                        // TODO: Check if segment really belongs to the street, even if the
+                        // names are the same. Then the streets should be split up...
+                        sNode.addStreetSegment(newSegment);
+                        return true;
+                    } else {
+                        throw new RuntimeException("Street node is null!");
+                    }
+                }
+            }
+
+            // Node is an address
+            if (ne instanceof OSMAddress) {
+                OSMAddress aNode = (OSMAddress) ne;
+                addAndClassifyAddress(aNode);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public void visit(Relation e) {
+    }
+
+    @Override
+    public void visit(Changeset cs) {
+    }
+
+    /**
+     * Gets the dictionary contains the collected streets.
+     * @return
+     */
+    public HashMap<String, OSMStreet> getStreetDict() {
+        return streetDict;
+    }
+
+    /**
+     * Gets the unresolved (addresses without valid street name) addresses.
+     *
+     * @return the unresolved addresses
+     */
+    public List<OSMAddress> getUnresolvedAddresses() {
+        return unresolvedAddresses;
+    }
+
+    /**
+     * Gets the list with incomplete addresses.
+     *
+     * @return the incomplete addresses
+     */
+    public List<OSMAddress> getIncompleteAddresses() {
+        return incompleteAddresses;
+    }
+
+    /**
+     * Gets the street list.
+     *
+     * @return the street list
+     */
+    public List<OSMStreet> getStreetList() {
+        ArrayList<OSMStreet> sortedList = new ArrayList<OSMStreet>(streetDict.values());
+        Collections.sort(sortedList);
+        return sortedList;
+    }
+
+    /**
+     * Gets all addresses without valid street.
+     * @return
+     */
+    public List<OSMAddress> getUnresolvedItems() {
+        return unresolvedAddresses;
+    }
+
+    /**
+     * Gets the tags used in the data layer.
+     * @return
+     */
+    public HashSet<String> getTags() {
+        return tags;
+    }
+
+    /**
+     * @return the values
+     */
+    protected HashMap<String, String> getValues() {
+        return values;
+    }
+
+    /**
+     * Gets the number of streets in the container.
+     * @return
+     */
+    public int getNumberOfStreets() {
+        return streetDict != null ? streetDict.size() : 0;
+    }
+
+    /**
+     * Get the number of incomplete addresses.
+     * @return
+     */
+    public int getNumberOfIncompleteAddresses() {
+        return incompleteAddresses != null ? incompleteAddresses.size() : 0;
+    }
+
+    /**
+     * Gets the number of unresolved addresses.
+     * @return
+     */
+    public int getNumberOfUnresolvedAddresses() {
+        return unresolvedAddresses != null ? unresolvedAddresses.size() : 0;
+    }
+
+    /**
+     * Gets the number of invalid (unresolved and/or incomplete) addresses.
+     *
+     * @return the number of invalid addresses
+     */
+    public int getNumberOfInvalidAddresses() {
+        return getNumberOfIncompleteAddresses() + getNumberOfUnresolvedAddresses();
+    }
+
+    /**
+     * Gets the number of guessed tags.
+     * @return
+     */
+    public int getNumberOfGuesses() {
+        int sum = 0;
+
+        for (OSMAddress aNode : getAllAddressesToFix()) {
+            if (aNode.hasGuesses()) {
+                sum++;
+            }
+        }
+        return sum;
+    }
+
+    /**
+     * Gets all (incomplete and/or unresolved) address nodes to fix.
+     * @return
+     */
+    public List<OSMAddress> getAllAddressesToFix() {
+        List<OSMAddress> all = new ArrayList<OSMAddress>(incompleteAddresses);
+
+        for (OSMAddress aNode : unresolvedAddresses) {
+            if (!all.contains(aNode)) {
+                all.add(aNode);
+            }
+        }
+
+        return all;
+    }
+
+    /**
+     * @return the problems
+     */
+    protected List<IProblem> getProblems() {
+        return problems;
+    }
+
+    /**
+     * Clears the problem list.
+     */
+    protected void clearProblems() {
+        problems.clear();
+    }
+
+    /**
+     * Tries to assign an address to a street.
+     * @param aNode
+     */
+    private boolean assignAddressToStreet(OSMAddress aNode) {
+        String streetName = aNode.getStreetName();
+
+        // street name via relation -> implicitly resolved (see TRAC #8336)
+        if (aNode.isPartOfRelation()) {
+            return true;
+        }
+        
+        if (streetName != null && shadowStreetDict.containsKey(streetName)) {
+            OSMStreet sNode = shadowStreetDict.get(streetName);
+            sNode.addAddress(aNode);
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Walks through the list of unassigned addresses and tries to assign them to streets.
+     */
+    public void resolveAddresses() {
+        List<OSMAddress> resolvedAddresses = new ArrayList<OSMAddress>();
+        for (OSMAddress node : shadowUnresolvedAddresses) {
+            if (assignAddressToStreet(node)) {
+                resolvedAddresses.add(node);
+            }
+        }
+
+        /* Remove all resolves nodes from unresolved list */
+        for (OSMAddress resolved : resolvedAddresses) {
+            shadowUnresolvedAddresses.remove(resolved);
+        }
+    }
+
+    /**
+     * Rebuilds the street and address lists using the data set given
+     * in  {@link AddressEditContainer#attachToDataSet(Collection)} or the
+     * full data set of the current data layer {@link Main#getCurrentDataSet()}.
+     */
+    public void invalidate() {
+        if (workingSet != null) {
+            invalidate(workingSet);
+        } else {
+            if (Main.main.getCurrentDataSet() != null) {
+                invalidate(Main.main.getCurrentDataSet().allPrimitives());
+            }
+        }
+    }
+
+    /**
+     * Invalidate using the given data collection.
+     *
+     * @param osmData the collection containing the osm data to work on.
+     */
+    public void invalidate(final Collection<? extends OsmPrimitive> osmData) {
+        if (osmData == null || osmData.isEmpty())
+            return;
+
+        synchronized (this) {
+            clearData();
+            clearProblems();
+            // visit data set for problems...
+            for (OsmPrimitive osmPrimitive : osmData) {
+                if (osmPrimitive.isUsable()) {
+                    osmPrimitive.accept(this);
+                }
+            }
+            
+            // match streets with addresses...
+            resolveAddresses();
+            // sort problem lists
+            Collections.sort(shadowIncompleteAddresses);
+            Collections.sort(shadowUnresolvedAddresses);
+
+            // put results from shadow copy into real lists
+            incompleteAddresses = new ArrayList<OSMAddress>(shadowIncompleteAddresses);
+            unresolvedAddresses = new ArrayList<OSMAddress>(shadowUnresolvedAddresses);
+            streetDict = new HashMap<String, OSMStreet>(shadowStreetDict);
+            // remove temp data
+            shadowStreetDict.clear();
+            shadowUnresolvedAddresses.clear();
+            shadowIncompleteAddresses.clear();
+
+            // update clients
+            fireContainerChanged();
+        }
+    }
+
+    /**
+     * Clears the shadowed lists data and resets the 'visited' flag for every OSM object.
+     */
+    private void clearData() {
+        shadowStreetDict.clear();
+        shadowUnresolvedAddresses.clear();
+        shadowIncompleteAddresses.clear();
+        visitedNodes.clear();
+        visitedWays.clear();
+    }
+
+    /**
+     * Connects the listener to the given data set and revisits the data. This method should
+     * be called immediately after an edit session finished.
+     *
+     * If the given data set is not null, calls of {@link AddressEditContainer#invalidate()} will
+     * only consider the data given within this set. This can be useful to keep out unimportant
+     * areas. However, a side-effect could be that some streets are not included and leads to
+     * false alarms regarding unresolved addresses.
+     *
+     * Calling {@link AddressEditContainer#detachFromDataSet()} drops the explicit data set and uses
+     * the full data set on subsequent updates.<p>
+     *
+     * <b>Example</b><br>
+     * <code>
+     * attachToDataSet(osmDataSetToWorkOn); // osmDataSetToWorkOn = selected items<br>
+     * //... launch dialog or whatever<br>
+     * detachFromDataSet();
+     * </code>
+     *
+     * @param osmDataToWorkOn the data to examine
+     */
+    public void attachToDataSet(Collection<? extends OsmPrimitive> osmDataToWorkOn) {
+        if (osmDataToWorkOn != null && !osmDataToWorkOn.isEmpty()) {
+            workingSet = new ArrayList<OsmPrimitive>(osmDataToWorkOn);
+        } else {
+            detachFromDataSet(); // drop old stuff, if present
+        }
+        invalidate(); // start our investigation...
+    }
+
+    /**
+     * Disconnects the listener from the data set. This method should
+     * be called immediately before an edit session started in order to
+     * prevent updates caused by e. g. a selection change within the map view.
+     */
+    public void detachFromDataSet() {
+        //Main.main.getCurrentDataSet().removeDataSetListener(this);
+        if (workingSet != null) {
+            workingSet.clear();
+            workingSet = null;
+        }
+    }
+
+    @Override
+    public void dataChanged(DataChangedEvent event) {
+    }
+
+    @Override
+    public void nodeMoved(NodeMovedEvent event) {
+
+    }
+
+    @Override
+    public void otherDatasetChange(AbstractDatasetChangedEvent event) {
+    }
+
+    @Override
+    public void primitivesAdded(PrimitivesAddedEvent event) {
+        invalidate();
+    }
+
+    @Override
+    public void primitivesRemoved(PrimitivesRemovedEvent event) {
+        invalidate();
+    }
+
+    @Override
+    public void relationMembersChanged(RelationMembersChangedEvent event) {
+    }
+
+    @Override
+    public void tagsChanged(TagsChangedEvent event) {
+        invalidate();
+    }
+
+    @Override
+    public void wayNodesChanged(WayNodesChangedEvent event) {
+    }
+
+    @Override
+    public void containerChanged(AddressEditContainer container) {
+        invalidate();
+    }
+
+    @Override
+    public void entityChanged(IOSMEntity entity) {
+        fireEntityChanged(entity);
+    }
+
+    @Override
+    public void addProblem(IProblem problem) {
+        problems.add(problem);
+    }
+
+    @Override
+    public void removeProblemsOfSource(IOSMEntity entity) {
+        CheckParameterUtil.ensureParameterNotNull(entity, "entity");
+
+        List<IProblem> problemsToRemove = new ArrayList<IProblem>();
+        for (IProblem problem : problems) {
+            if (problem.getSource() == entity) {
+                problemsToRemove.add(problem);
+            }
+        }
+
+        for (IProblem iProblem : problemsToRemove) {
+            problems.remove(iProblem);
+        }
+    }
+
+    @Override
+    public String getClosestStreetName(String name) {
+        List<String> matches = getClosestStreetNames(name, 1);
+
+        if (matches != null && matches.size() > 0) {
+            return matches.get(0);
+        }
+
+        return null;
+    }
+
+    @Override
+    public List<String> getClosestStreetNames(String name, int maxEntries) {
+        CheckParameterUtil.ensureParameterNotNull(name, "name");
+
+        // ensure right number of entries
+        if (maxEntries < 1) maxEntries = 1;
+
+        List<StreetScore> scores = new ArrayList<StreetScore>();
+        List<String> matches = new ArrayList<String>();
+
+        // Find the longest common sub string
+        for (String streetName : streetDict.keySet()) {
+            int score = StringUtils.lcsLength(name, streetName);
+
+            if (score > 3) { // reasonable value?
+                StreetScore sc = new StreetScore(streetName, score);
+                scores.add(sc);
+            }
+        }
+
+        // sort by score
+        Collections.sort(scores);
+
+        // populate result list
+        int n = Math.min(maxEntries, scores.size());
+        for (int i = 0; i < n; i++) {
+            matches.add(scores.get(i).getName());
+        }
+
+        return matches;
+    }
+
+    @Override
+    public boolean isValidStreetName(String name) {
+        if (streetDict == null) return false;
+
+        return streetDict.containsKey(name);
+    }
+
+    /**
+     * Internal class to handle results of {@link AddressEditContainer#getClosestStreetNames(String, int)}.
+     */
+    private class StreetScore implements Comparable<StreetScore> {
+        private String name;
+        private int score;
+
+        /**
+         * @param name Name of the street.
+         * @param score Score of the street (length of longest common substring)
+         */
+        public StreetScore(String name, int score) {
+            super();
+            this.name = name;
+            this.score = score;
+        }
+
+        /**
+         * @return the name of the street.
+         */
+        protected String getName() {
+            return name;
+        }
+
+        /**
+         * @return the score of the street.
+         */
+        @SuppressWarnings("unused")
+        // TODO: Implement properly
+        protected int getScore() {
+            return score;
+        }
+
         @Override
-	public void primitivesAdded(PrimitivesAddedEvent event) {
-		invalidate();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#primitivesRemoved(org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent)
-	 */
-        @Override
-	public void primitivesRemoved(PrimitivesRemovedEvent event) {
-		invalidate();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#relationMembersChanged(org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent)
-	 */
-	@Override
-	public void relationMembersChanged(RelationMembersChangedEvent event) {
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#tagsChanged(org.openstreetmap.josm.data.osm.event.TagsChangedEvent)
-	 */
-	@Override
-	public void tagsChanged(TagsChangedEvent event) {
-		invalidate();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.event.DataSetListener#wayNodesChanged(org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent)
-	 */
-	@Override
-	public void wayNodesChanged(WayNodesChangedEvent event) {
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#containerChanged(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void containerChanged(AddressEditContainer container) {
-		invalidate();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
-	 */
-	@Override
-	public void entityChanged(IOSMEntity entity) {
-		fireEntityChanged(entity);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblemVisitor#addProblem(org.openstreetmap.josm.plugins.fixAddresses.IProblem)
-	 */
-	@Override
-	public void addProblem(IProblem problem) {
-		problems.add(problem);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblemVisitor#removeProblemsOfSource(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
-	 */
-	@Override
-	public void removeProblemsOfSource(IOSMEntity entity) {
-		CheckParameterUtil.ensureParameterNotNull(entity, "entity");
-
-		List<IProblem> problemsToRemove = new ArrayList<IProblem>();
-		for (IProblem problem : problems) {
-			if (problem.getSource() == entity) {
-				problemsToRemove.add(problem);
-			}
-		}
-
-		for (IProblem iProblem : problemsToRemove) {
-			problems.remove(iProblem);
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAllKnowingTrashHeap#getClosestStreetName(java.lang.String)
-	 */
-	@Override
-	public String getClosestStreetName(String name) {
-		List<String> matches = getClosestStreetNames(name, 1);
-
-		if (matches != null && matches.size() > 0) {
-			return matches.get(0);
-		}
-
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAllKnowingTrashHeap#getClosestStreetNames(java.lang.String, int)
-	 */
-	@Override
-	public List<String> getClosestStreetNames(String name, int maxEntries) {
-		CheckParameterUtil.ensureParameterNotNull(name, "name");
-
-		// ensure right number of entries
-		if (maxEntries < 1) maxEntries = 1;
-
-		List<StreetScore> scores = new ArrayList<StreetScore>();
-		List<String> matches = new ArrayList<String>();
-
-		// Find the longest common sub string
-		for (String streetName : streetDict.keySet()) {
-			int score = StringUtils.lcsLength(name, streetName);
-
-			if (score > 3) { // reasonable value?
-				StreetScore sc = new StreetScore(streetName, score);
-				scores.add(sc);
-			}
-		}
-
-		// sort by score
-		Collections.sort(scores);
-
-		// populate result list
-		int n = Math.min(maxEntries, scores.size());
-		for (int i = 0; i < n; i++) {
-			matches.add(scores.get(i).getName());
-		}
-
-		return matches;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAllKnowingTrashHeap#isValidStreetName(java.lang.String)
-	 */
-	@Override
-	public boolean isValidStreetName(String name) {
-		if (streetDict == null) return false;
-
-		return streetDict.containsKey(name);
-	}
-
-	/**
-	 * Internal class to handle results of {@link AddressEditContainer#getClosestStreetNames(String, int)}.
-	 */
-	private class StreetScore implements Comparable<StreetScore> {
-		private String name;
-		private int score;
-
-		/**
-		 * @param name Name of the street.
-		 * @param score Score of the street (length of longest common substring)
-		 */
-		public StreetScore(String name, int score) {
-			super();
-			this.name = name;
-			this.score = score;
-		}
-
-		/**
-		 * @return the name of the street.
-		 */
-		protected String getName() {
-			return name;
-		}
-
-		/**
-		 * @return the score of the street.
-		 */
-		@SuppressWarnings("unused")
-		// TODO: Implement properly
-		protected int getScore() {
-			return score;
-		}
-
-		@Override
-		public int compareTo(StreetScore arg0) {
-			if (arg0 == null) return 1;
-
-			return new Integer(score).compareTo(new Integer(arg0.score));
-		}
-	}
+        public int compareTo(StreetScore arg0) {
+            if (arg0 == null) return 1;
+
+            return new Integer(score).compareTo(new Integer(arg0.score));
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressProblem.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressProblem.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressProblem.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -20,130 +8,106 @@
 
 public class AddressProblem implements IProblem {
-	private List<ISolution> solutions = null;
-	private String description;
-	private ProblemType type;
-	private IOSMEntity source;
+    private List<ISolution> solutions = null;
+    private String description;
+    private ProblemType type;
+    private IOSMEntity source;
 
-	/**
-	 * Instantiates a new problem.
-	 *
-	 * @param source the source
-	 * @param description The problem description.
-	 * @param solutions This list of solutions.
-	 * @param type the type
-	 */
-	public AddressProblem(IOSMEntity source, String description,
-			List<ISolution> solutions, ProblemType type) {
-		super();
-		this.source = source;
-		this.description = description;
-		this.solutions = solutions;
-		this.type = type;
-	}
+    /**
+     * Instantiates a new problem.
+     *
+     * @param source the source
+     * @param description The problem description.
+     * @param solutions This list of solutions.
+     * @param type the type
+     */
+    public AddressProblem(IOSMEntity source, String description,
+            List<ISolution> solutions, ProblemType type) {
+        super();
+        this.source = source;
+        this.description = description;
+        this.solutions = solutions;
+        this.type = type;
+    }
 
-	/**
-	 * Instantiates a new problem with type 'warning'.
-	 *
-	 * @param source the source
-	 * @param description The problem description.
-	 * @param solutions This list of solutions.
-	 */
-	public AddressProblem(IOSMEntity source, String description, List<ISolution> solutions) {
-		this(source, description, solutions, ProblemType.Warning);
-	}
+    /**
+     * Instantiates a new problem with type 'warning'.
+     *
+     * @param source the source
+     * @param description The problem description.
+     * @param solutions This list of solutions.
+     */
+    public AddressProblem(IOSMEntity source, String description, List<ISolution> solutions) {
+        this(source, description, solutions, ProblemType.Warning);
+    }
 
-	/**
-	 * Instantiates a new problem with type 'warning' and without solutions.
-	 *
-	 * @param source the source
-	 * @param description The problem description.
-	 */
-	public AddressProblem(IOSMEntity source, String description) {
-		this(source, description, null, ProblemType.Warning);
-	}
+    /**
+     * Instantiates a new problem with type 'warning' and without solutions.
+     *
+     * @param source the source
+     * @param description The problem description.
+     */
+    public AddressProblem(IOSMEntity source, String description) {
+        this(source, description, null, ProblemType.Warning);
+    }
 
-	/**
-	 * Creates the solution list, if necessary.
-	 */
-	private void lazyCreateSolutions() {
-		if (solutions == null) {
-			solutions = new ArrayList<ISolution>();
-		}
-	}
+    /**
+     * Creates the solution list, if necessary.
+     */
+    private void lazyCreateSolutions() {
+        if (solutions == null) {
+            solutions = new ArrayList<ISolution>();
+        }
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#addSolution(org.openstreetmap.josm.plugins.fixAddresses.ISolution)
-	 */
-	@Override
-	public void addSolution(ISolution solution) {
-		CheckParameterUtil.ensureParameterNotNull(solution, "solution");
+    @Override
+    public void addSolution(ISolution solution) {
+        CheckParameterUtil.ensureParameterNotNull(solution, "solution");
 
-		lazyCreateSolutions();
-		solutions.add(solution);
-	}
+        lazyCreateSolutions();
+        solutions.add(solution);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#applySolution(org.openstreetmap.josm.plugins.fixAddresses.ISolution)
-	 */
-	@Override
-	public void applySolution(ISolution solution) {
-		CheckParameterUtil.ensureParameterNotNull(solution, "solution");
+    @Override
+    public void applySolution(ISolution solution) {
+        CheckParameterUtil.ensureParameterNotNull(solution, "solution");
 
-		solution.solve();
-	}
+        solution.solve();
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#clearSolutions()
-	 */
-	@Override
-	public void clearSolutions() {
-		if (solutions == null) return;
+    @Override
+    public void clearSolutions() {
+        if (solutions == null) return;
 
-		solutions.clear();
-	}
+        solutions.clear();
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#getDescription()
-	 */
-	@Override
-	public String getDescription() {
-		return description;
-	}
+    @Override
+    public String getDescription() {
+        return description;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#getSolutions()
-	 */
-	@Override
-	public List<ISolution> getSolutions() {
-		return solutions;
-	}
+    @Override
+    public List<ISolution> getSolutions() {
+        return solutions;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#getType()
-	 */
-	@Override
-	public ProblemType getType() {
-		return type;
-	}
+    @Override
+    public ProblemType getType() {
+        return type;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#removeSolution(org.openstreetmap.josm.plugins.fixAddresses.ISolution)
-	 */
-	@Override
-	public void removeSolution(ISolution solution) {
-		if (solutions == null ) throw new RuntimeException("Solution list is null");
-		if (solutions.size() == 0) throw new RuntimeException("Solution list is empty");
+    @Override
+    public void removeSolution(ISolution solution) {
+        if (solutions == null ) throw new RuntimeException("Solution list is null");
+        if (solutions.size() == 0) throw new RuntimeException("Solution list is empty");
 
-		CheckParameterUtil.ensureParameterNotNull(solution, "solution");
-		solutions.remove(solution);
-	}
+        CheckParameterUtil.ensureParameterNotNull(solution, "solution");
+        solutions.remove(solution);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IProblem#getSource()
-	 */
-	@Override
-	public IOSMEntity getSource() {
-		return source;
-	}
+    @Override
+    public IOSMEntity getSource() {
+        return source;
+    }
 
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressSolution.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressSolution.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressSolution.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -20,39 +8,39 @@
  */
 public class AddressSolution implements ISolution {
-	private JosmAction action;
-	private String description;
-	private SolutionType type;
+    private JosmAction action;
+    private String description;
+    private SolutionType type;
 
-	/**
-	 * @param description The solution description.
-	 * @param action The action to execute to solve the problem.
-	 * @param type The solution type.
-	 */
-	public AddressSolution(String description, JosmAction action,
-			SolutionType type) {
-		super();
-		this.description = description;
-		this.action = action;
-		this.type = type;
-	}
+    /**
+     * @param description The solution description.
+     * @param action The action to execute to solve the problem.
+     * @param type The solution type.
+     */
+    public AddressSolution(String description, JosmAction action,
+            SolutionType type) {
+        super();
+        this.description = description;
+        this.action = action;
+        this.type = type;
+    }
 
-	@Override
-	public JosmAction getAction() {
-		return action;
-	}
+    @Override
+    public JosmAction getAction() {
+        return action;
+    }
 
-	@Override
-	public String getDescription() {
-		return description;
-	}
+    @Override
+    public String getDescription() {
+        return description;
+    }
 
-	@Override
-	public SolutionType getType() {
-		return type;
-	}
+    @Override
+    public SolutionType getType() {
+        return type;
+    }
 
-	@Override
-	public void solve() {
-		// TODO: Remove??
-	}
+    @Override
+    public void solve() {
+        // TODO: Remove??
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesMapMode.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesMapMode.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesMapMode.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -21,15 +9,12 @@
 import org.openstreetmap.josm.gui.MapFrame;
 
-
 @SuppressWarnings("serial")
 public class FixAddressesMapMode extends MapMode {
 
-	public FixAddressesMapMode(MapFrame mapFrame) {
-		super(tr("Fix addresses"), "incompleteaddress_24",
-				tr("Show dialog with incomplete addresses"),
-				mapFrame,
-				Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
-
-
+    public FixAddressesMapMode(MapFrame mapFrame) {
+        super(tr("Fix addresses"), "incompleteaddress_24",
+                tr("Show dialog with incomplete addresses"),
+                mapFrame,
+                Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPlugin.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPlugin.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPlugin.java	(revision 30348)
@@ -1,15 +1,3 @@
-/**
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -28,50 +16,47 @@
  */
 public class FixAddressesPlugin extends Plugin {
-	private static FixAddressesPreferences preferences;
+    private static FixAddressesPreferences preferences;
 
-	/**
-	 * Constructor for the AddressEdit plugin. Called by JOSM when loading the plugin.
-	 * @param info Context information of the plugin.
-	 */
-	public FixAddressesPlugin(PluginInformation info) {
-		super(info);
+    /**
+     * Constructor for the AddressEdit plugin. Called by JOSM when loading the plugin.
+     * @param info Context information of the plugin.
+     */
+    public FixAddressesPlugin(PluginInformation info) {
+        super(info);
 
-		// Create actions...
-		FixUnresolvedStreetsAction action = new FixUnresolvedStreetsAction();
-		SelectIncompleteAddressesAction incAddrAction = new SelectIncompleteAddressesAction();
+        // Create actions...
+        FixUnresolvedStreetsAction action = new FixUnresolvedStreetsAction();
+        SelectIncompleteAddressesAction incAddrAction = new SelectIncompleteAddressesAction();
 
-		// ... and add them to the tools menu in main
+        // ... and add them to the tools menu in main
                 MainMenu.add(Main.main.menu.toolsMenu, action, false, 0);
-		MainMenu.add(Main.main.menu.toolsMenu, incAddrAction);
+        MainMenu.add(Main.main.menu.toolsMenu, incAddrAction);
 
-		// create preferences instance
-		preferences = (FixAddressesPreferences) new FixAddressesPreferences.Factory().createPreferenceSetting();
-	}
+        // create preferences instance
+        preferences = (FixAddressesPreferences) new FixAddressesPreferences.Factory().createPreferenceSetting();
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.Plugin#mapFrameInitialized(org.openstreetmap.josm.gui.MapFrame, org.openstreetmap.josm.gui.MapFrame)
-	 */
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (newFrame != null) {
-			FixAddressesMapMode faMode = new FixAddressesMapMode(Main.map);
-			IconToggleButton faModeButton = new IconToggleButton(faMode);
-			faModeButton.setVisible(true);
-			newFrame.addToggleDialog(new IncompleteAddressesDialog());
-		}
-	}
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (newFrame != null) {
+            FixAddressesMapMode faMode = new FixAddressesMapMode(Main.map);
+            IconToggleButton faModeButton = new IconToggleButton(faMode);
+            faModeButton.setVisible(true);
+            newFrame.addToggleDialog(new IncompleteAddressesDialog());
+        }
+    }
 
-	@Override
-	public PreferenceSetting getPreferenceSetting() {
-		return getPreferences();
-	}
+    @Override
+    public PreferenceSetting getPreferenceSetting() {
+        return getPreferences();
+    }
 
-	/**
-	 * Gets the preferences instance for this plugin.
-	 *
-	 * @return the preferences
-	 */
-	public static FixAddressesPreferences getPreferences() {
-		return preferences;
-	}
+    /**
+     * Gets the preferences instance for this plugin.
+     *
+     * @return the preferences
+     */
+    public static FixAddressesPreferences getPreferences() {
+        return preferences;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -26,95 +14,89 @@
 
 public class FixAddressesPreferences extends DefaultTabPreferenceSetting {
-	private static final String FIX_ADDRESSES_IGNORE_POST_CODE_KEY = "fixAddresses.ignorePostCode";
-	private static final String FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY = "fixAddresses.selectGuessedObjects";
-	
-	private JCheckBox cbSelectGuessedObjects = new JCheckBox(tr("Include objects used for guesses"));
-	private JCheckBox cbIgnorePostCode = new JCheckBox();
+    private static final String FIX_ADDRESSES_IGNORE_POST_CODE_KEY = "fixAddresses.ignorePostCode";
+    private static final String FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY = "fixAddresses.selectGuessedObjects";
+    
+    private JCheckBox cbSelectGuessedObjects = new JCheckBox(tr("Include objects used for guesses"));
+    private JCheckBox cbIgnorePostCode = new JCheckBox();
 
-	/**
-	 * Internal factory class. Call <code>FixAddressesPreferences.Factory().createPreferenceSetting()</code> to
-	 * create the preference setting instance. 
-	 */
-	public static class Factory implements PreferenceSettingFactory {
-		public PreferenceSetting createPreferenceSetting() {
-			return new FixAddressesPreferences();
-		}
-	}
-	
-	/**
-	 * Internal constructor.
-	 */
-	private FixAddressesPreferences() {
-		loadFromPrefs();
-	}
-	
-	/**
-	 * Loads the (initial) preference settings.
-	 */
-	private void loadFromPrefs() {
-		setSelectGuessedObjects(Main.pref.getBoolean(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, false));
-		setIgnorePostCode(Main.pref.getBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, false));
-	}
-	
-	/**
-	 * Save the preference settings.
-	 */
-	private void saveToPrefs() {
-		Main.pref.put(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, isSelectGuessedObjects());
-		Main.pref.put(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, isIgnorePostCode());
-	}
+    /**
+     * Internal factory class. Call <code>FixAddressesPreferences.Factory().createPreferenceSetting()</code> to
+     * create the preference setting instance. 
+     */
+    public static class Factory implements PreferenceSettingFactory {
+        public PreferenceSetting createPreferenceSetting() {
+            return new FixAddressesPreferences();
+        }
+    }
+    
+    /**
+     * Internal constructor.
+     */
+    private FixAddressesPreferences() {
+        loadFromPrefs();
+    }
+    
+    /**
+     * Loads the (initial) preference settings.
+     */
+    private void loadFromPrefs() {
+        setSelectGuessedObjects(Main.pref.getBoolean(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, false));
+        setIgnorePostCode(Main.pref.getBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, false));
+    }
+    
+    /**
+     * Save the preference settings.
+     */
+    private void saveToPrefs() {
+        Main.pref.put(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, isSelectGuessedObjects());
+        Main.pref.put(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, isIgnorePostCode());
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.preferences.PreferenceSetting#addGui(org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane)
-	 */
-	@Override
-	public void addGui(PreferenceTabbedPane gui) {
-		// Import settings
+    @Override
+    public void addGui(PreferenceTabbedPane gui) {
+        // Import settings
         ButtonGroup fixAddrOptions = new ButtonGroup();
         fixAddrOptions.add(cbSelectGuessedObjects);
         fixAddrOptions.add(cbIgnorePostCode);
-	}
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.preferences.PreferenceSetting#ok()
-	 */
-	@Override
-	public boolean ok() {
-		saveToPrefs();
-		loadFromPrefs();
-		return false;
-	}
+    @Override
+    public boolean ok() {
+        saveToPrefs();
+        loadFromPrefs();
+        return false;
+    }
 
-	/**
-	 * Checks if option "select guessed objects" is set. If yes, every selection
-	 * includes also the objects used for guessing the address tags.
-	 * Otherwise only the address itself is selected.
-	 *
-	 * @return the selectGuessedObjects
-	 */
-	public boolean isSelectGuessedObjects() {
-		return cbSelectGuessedObjects.isSelected();
-	}
+    /**
+     * Checks if option "select guessed objects" is set. If yes, every selection
+     * includes also the objects used for guessing the address tags.
+     * Otherwise only the address itself is selected.
+     *
+     * @return the selectGuessedObjects
+     */
+    public boolean isSelectGuessedObjects() {
+        return cbSelectGuessedObjects.isSelected();
+    }
 
-	/**
-	 * Sets the select guessed objects.
-	 *
-	 * @param selectGuessedObjects the selectGuessedObjects to set
-	 */
-	void setSelectGuessedObjects(boolean selectGuessedObjects) {
-		cbSelectGuessedObjects.setSelected(selectGuessedObjects);
-	}
+    /**
+     * Sets the select guessed objects.
+     *
+     * @param selectGuessedObjects the selectGuessedObjects to set
+     */
+    void setSelectGuessedObjects(boolean selectGuessedObjects) {
+        cbSelectGuessedObjects.setSelected(selectGuessedObjects);
+    }
 
-	/**
-	 * Checks if invalid post codes should be ignored. If yes, post codes are neither
-	 * checked for existence nor for correctness.
-	 * @return
-	 */
-	public boolean isIgnorePostCode() {
-		return cbIgnorePostCode.isSelected();
-	}
+    /**
+     * Checks if invalid post codes should be ignored. If yes, post codes are neither
+     * checked for existence nor for correctness.
+     * @return
+     */
+    public boolean isIgnorePostCode() {
+        return cbIgnorePostCode.isSelected();
+    }
 
-	public void setIgnorePostCode(boolean ignorePostCode) {
-		cbIgnorePostCode.setSelected(ignorePostCode);
-	}
+    public void setIgnorePostCode(boolean ignorePostCode) {
+        cbIgnorePostCode.setSelected(ignorePostCode);
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java	(revision 30348)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -20,124 +21,113 @@
  * @author Oliver Wieland <oliver.wieland@online.de>
  */
-
 @SuppressWarnings("serial")
 public class FixUnresolvedStreetsAction extends JosmAction implements SelectionChangedListener {
-	private AddressEditContainer addressEditContainer;
-	private Collection<? extends OsmPrimitive> newSelection;
+    private AddressEditContainer addressEditContainer;
+    private Collection<? extends OsmPrimitive> newSelection;
 
-	public FixUnresolvedStreetsAction() {
-		super(tr("Fix street addresses"), "fixstreets_24",
-				tr("Find and fix addresses without (valid) streets."),
-				Shortcut.registerShortcut("tools:AddressEdit", tr("Tool: {0}",
-				tr("Address Edit")), KeyEvent.VK_X, Shortcut.CTRL_SHIFT), false);
+    public FixUnresolvedStreetsAction() {
+        super(tr("Fix street addresses"), "fixstreets_24",
+                tr("Find and fix addresses without (valid) streets."),
+                Shortcut.registerShortcut("tools:AddressEdit", tr("Tool: {0}",
+                tr("Address Edit")), KeyEvent.VK_X, Shortcut.CTRL_SHIFT), false);
 
-		setEnabled(false);
-		addressEditContainer = new AddressEditContainer();
-		DataSet.addSelectionListener(this);
-	}
+        setEnabled(false);
+        addressEditContainer = new AddressEditContainer();
+        DataSet.addSelectionListener(this);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.SelectionChangedListener#selectionChanged(java.util.Collection)
-	 */
-	@Override
-	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-		/* remember new selection for actionPerformed */
-		this.newSelection = newSelection;
-	}
+    @Override
+    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+        /* remember new selection for actionPerformed */
+        this.newSelection = newSelection;
+    }
 
-	/* (non-Javadoc)
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
-	@Override
-	public void actionPerformed(ActionEvent arg0) {
-		if (addressEditContainer != null) {
-			addressEditContainer.attachToDataSet(newSelection);
-			try {
-				//generateTagCode(addressEditContainer);
-				AddressEditDialog dlg = new AddressEditDialog(addressEditContainer);
-				dlg.setVisible(true);
-			} finally {
-				addressEditContainer.detachFromDataSet();
-			}
-		}
-	}
+    @Override
+    public void actionPerformed(ActionEvent arg0) {
+        if (addressEditContainer != null) {
+            addressEditContainer.attachToDataSet(newSelection);
+            try {
+                //generateTagCode(addressEditContainer);
+                AddressEditDialog dlg = new AddressEditDialog(addressEditContainer);
+                dlg.setVisible(true);
+            } finally {
+                addressEditContainer.detachFromDataSet();
+            }
+        }
+    }
 
+    @Override
+    protected void updateEnabledState() {
+        setEnabled(getCurrentDataSet() != null);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState()
-	 */
-	@Override
-	protected void updateEnabledState() {
-		setEnabled(getCurrentDataSet() != null);
-	}
+    @Override
+    protected void updateEnabledState(
+            Collection<? extends OsmPrimitive> selection) {
+        // Enable button if there is either a selection or at least a data set
+        setEnabled( selection != null && !selection.isEmpty() ||
+                    (getCurrentDataSet() != null));
+    }
 
-	@Override
-	protected void updateEnabledState(
-			Collection<? extends OsmPrimitive> selection) {
-		// Enable button if there is either a selection or at least a data set
-		setEnabled( selection != null && !selection.isEmpty() ||
-					(getCurrentDataSet() != null));
-	}
+    /* This code is abused to generate tag utility code */
 
-	/* This code is abused to generate tag utility code */
+    @SuppressWarnings("unused")
+    private void generateTagCode(AddressEditContainer addrVisitor) {
 
-	@SuppressWarnings("unused")
-	private void generateTagCode(AddressEditContainer addrVisitor) {
+        for (String tag : addrVisitor.getTags()) {
+            String methodName = createMethodName(tag);
+            System.out
+            .println(String
+                    .format(
+                            "/** Check if OSM primitive has a tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static boolean has%sTag(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.hasKey(%s_TAG) : false;\n}\n",
+                            tag, methodName, tag.toUpperCase()
+                            .replaceAll(":", "_")));
+            System.out
+            .println(String
+                    .format(
+                            "/** Gets the value of tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static String get%sValue(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.get(%s_TAG) : null;\n}\n",
+                            tag, methodName, tag.toUpperCase()
+                            .replaceAll(":", "_")));
+        }
 
-		for (String tag : addrVisitor.getTags()) {
-			String methodName = createMethodName(tag);
-			System.out
-			.println(String
-					.format(
-							"/** Check if OSM primitive has a tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static boolean has%sTag(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.hasKey(%s_TAG) : false;\n}\n",
-							tag, methodName, tag.toUpperCase()
-							.replaceAll(":", "_")));
-			System.out
-			.println(String
-					.format(
-							"/** Gets the value of tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static String get%sValue(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.get(%s_TAG) : null;\n}\n",
-							tag, methodName, tag.toUpperCase()
-							.replaceAll(":", "_")));
-		}
+        for (String tag : addrVisitor.getTags()) {
+            System.out.println(String.format(
+                    "public static final String %s_TAG = \"%s\";", tag
+                    .toUpperCase().replaceAll(":", "_"), tag));
+        }
 
-		for (String tag : addrVisitor.getTags()) {
-			System.out.println(String.format(
-					"public static final String %s_TAG = \"%s\";", tag
-					.toUpperCase().replaceAll(":", "_"), tag));
-		}
+        for (String value : addrVisitor.getValues().keySet()) {
+            String tag = addrVisitor.getValues().get(value);
 
-		for (String value : addrVisitor.getValues().keySet()) {
-			String tag = addrVisitor.getValues().get(value);
+            String tags = tag.toUpperCase().replaceAll(":", "_");
+            String values = value.toUpperCase().replaceAll(":", "_");
+            System.out.println(String.format(
+                    "public static final String %s_%s_VALUE = \"%s\";", tags, values
+                    , value));
+        }
+    }
 
-			String tags = tag.toUpperCase().replaceAll(":", "_");
-			String values = value.toUpperCase().replaceAll(":", "_");
-			System.out.println(String.format(
-					"public static final String %s_%s_VALUE = \"%s\";", tags, values
-					, value));
-		}
-	}
+    private String createMethodName(String osmName) {
+        StringBuffer result = new StringBuffer(osmName.length());
+        boolean nextUp = false;
+        for (int i = 0; i < osmName.length(); i++) {
+            char c = osmName.charAt(i);
+            if (i == 0) {
+                result.append(Character.toUpperCase(c));
+                continue;
+            }
+            if (c == '_' || c == ':') {
+                nextUp = true;
+            } else {
+                if (nextUp) {
+                    result.append(Character.toUpperCase(c));
+                    nextUp = false;
+                } else {
+                    result.append(c);
+                }
+            }
+        }
 
-	private String createMethodName(String osmName) {
-		StringBuffer result = new StringBuffer(osmName.length());
-		boolean nextUp = false;
-		for (int i = 0; i < osmName.length(); i++) {
-			char c = osmName.charAt(i);
-			if (i == 0) {
-				result.append(Character.toUpperCase(c));
-				continue;
-			}
-			if (c == '_' || c == ':') {
-				nextUp = true;
-			} else {
-				if (nextUp) {
-					result.append(Character.toUpperCase(c));
-					nextUp = false;
-				} else {
-					result.append(c);
-				}
-			}
-		}
-
-		return result.toString();
-	}
+        return result.toString();
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessAddressRunnable.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessAddressRunnable.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessAddressRunnable.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -36,224 +24,209 @@
  */
 public class GuessAddressRunnable extends PleaseWaitRunnable {
-	private List<OSMAddress> addressesToGuess;
-	private List<IProgressMonitorFinishedListener> finishListeners = new ArrayList<IProgressMonitorFinishedListener>();
-	private boolean isRunning = false;
-	private boolean canceled;
-
-	private GuessedValueHandler[] wayGuessers = new GuessedValueHandler[]{new GuessStreetValueHandler(TagUtils.ADDR_STREET_TAG)}; 
-	private GuessedValueHandler[] nodeGuessers = new GuessedValueHandler[]{
-			new GuessedValueHandler(TagUtils.ADDR_POSTCODE_TAG, 500.0),
-			new GuessedValueHandler(TagUtils.ADDR_CITY_TAG, 5000.0),
-			new GuessedValueHandler(TagUtils.ADDR_STATE_TAG, 5000.0),
-			new GuessedValueHandler(TagUtils.ADDR_COUNTRY_TAG, 5000.0),
-			new GuessedValueHandler(TagUtils.ADDR_CITY_TAG, 2000.0)
-	};
-
-	/**
-	 * Instantiates a new guess address runnable.
-	 *
-	 * @param addresses the addresses to guess the values for
-	 * @param title the title of progress monitor
-	 */
-	public GuessAddressRunnable(List<OSMAddress> addresses, String title) {
-		super(title != null ? title : tr("Searching"));
-		setAddressEditContainer(addresses);
-	}
-
-	/**
-	 * Sets the address edit container.
-	 *
-	 * @param nodes the new address edit container
-	 */
-	public void setAddressEditContainer(List<OSMAddress> nodes) {
-		if (isRunning) {
-			throw new ConcurrentModificationException();
-		}
-		this.addressesToGuess = nodes;
-	}
-
-	/**
-	 * Gets the addresses to guess.
-	 *
-	 * @return the addresses to guess
-	 */
-	public List<OSMAddress> getAddressesToGuess() {
-		return addressesToGuess;
-	}
-	/**
-	 * @return the isRunning
-	 */
-	public boolean isRunning() {
-		return isRunning;
-	}
-
-	/**
-	 * Adds a finish listener.
-	 *
-	 * @param l the listener to add
-	 */
-	public void addFinishListener(IProgressMonitorFinishedListener l) {
-		finishListeners.add(l);
-	}
-
-	/**
-	 * Removes a finish listener.
-	 *
-	 * @param l the listener to remove
-	 */
-	public void removeFinishListener(IProgressMonitorFinishedListener l) {
-		finishListeners.remove(l);
-	}
-
-	/**
-	 * Fires the 'finished' event after the thread has done his work.
-	 */
-	protected void fireFinished() {
-		for (IProgressMonitorFinishedListener l : finishListeners) {
-			l.finished();			
-		}
-		// this event is fired only once, then we disconnect all listeners
-		finishListeners.clear();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.PleaseWaitRunnable#cancel()
-	 */
-	@Override
-	protected void cancel() {
-		canceled = true;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.PleaseWaitRunnable#finish()
-	 */
-	@Override
-	protected void finish() {
-		// nothing to do yet
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.PleaseWaitRunnable#realRun()
-	 */
-	@Override
-	protected void realRun() throws SAXException, IOException,
-	OsmTransferException {
-
-		if (Main.main.getCurrentDataSet() == null || addressesToGuess == null) return;
-
-		isRunning = true;
-		canceled = false;
-
-		// Start progress monitor to guess address values
-		progressMonitor.subTask(tr("Searching") + "...");
-
-		try {
-			progressMonitor.setTicksCount(addressesToGuess.size());
-
-			List<OSMAddress> shadowCopy = new ArrayList<OSMAddress>(addressesToGuess);
-			for (OSMAddress aNode : shadowCopy) {
-				if (!aNode.needsGuess()) { // nothing to do
-					progressMonitor.worked(1);
-					continue;
-				}
-
-				// check for cancel
-				if (canceled) {
-					break;
-				}
-
-				// Update progress monitor
-				progressMonitor.subTask(tr("Guess values for ") + aNode);
-
-				// Run way-related guessers
-				for (int i = 0; i < wayGuessers.length; i++) {
-					GuessedValueHandler guesser = wayGuessers[i];
-					
-					guesser.setAddressNode(aNode);
-
-					// visit osm data
-					for (Way way : Main.main.getCurrentDataSet().getWays()) {
-						if (canceled) {
-							break;
-						}
-						way.accept(guesser);						
-					}
-					
-					String guessedVal = guesser.getCurrentValue();
-					if (guessedVal != null) {
-						aNode.setGuessedValue(guesser.getTag(), guessedVal, guesser.getSourceNode());
-					}
-				}
-				
-				// Run node-related guessers
-				for (int i = 0; i < nodeGuessers.length; i++) {
-					GuessedValueHandler guesser = nodeGuessers[i];
-					
-					guesser.setAddressNode(aNode);
-
-					// visit osm data
-					for (Node node : Main.main.getCurrentDataSet().getNodes()) {
-						if (canceled) {
-							break;
-						}
-						node.accept(guesser);						
-					}
-					
-					String guessedVal = guesser.getCurrentValue();
-					if (guessedVal != null) {
-						aNode.setGuessedValue(guesser.getTag(), guessedVal, guesser.getSourceNode());
-					}
-				}
-
-				// report progress
-				progressMonitor.worked(1);
-			}
-		} finally {
-			isRunning = false;
-			fireFinished();
-		}
-	}
-
-	// TODO: Put in separate file
-	private class GuessStreetValueHandler extends GuessedValueHandler {
-		public GuessStreetValueHandler(String tag) {
-			this(tag, null);
-		}
-
-		public GuessStreetValueHandler(String tag, OSMAddress aNode) {
-			super(tag, aNode, 200.0);
-		}
-
-		/* (non-Javadoc)
-		 * @see org.openstreetmap.josm.plugins.fixAddresses.GuessedValueHandler#visit(org.openstreetmap.josm.data.osm.Node)
-		 */
-		@Override
-		public void visit(Node n) {
-			// do nothing
-		}
-
-		/* (non-Javadoc)
-		 * @see org.openstreetmap.josm.plugins.fixAddresses.GuessedValueHandler#visit(org.openstreetmap.josm.data.osm.Way)
-		 */
-		@Override
-		public void visit(Way w) {
-			if (TagUtils.isStreetSupportingHousenumbers(w)) {
-				OSMAddress aNode = getAddressNode();
-				String newVal = TagUtils.getNameValue(w);
-				
-				if (newVal != null) {
-					double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w);
-					
-					if (dist < minDist && dist < getMaxDistance()) {
-						minDist = dist;
-						currentValue = newVal;
-						srcNode = w;
-						//aNode.setGuessedValue(getTag(), currentValue, w);
-					} else {
-						//System.out.println(String.format("Skipped %s: %4.2f m", TagUtils.getNameValue(w), dist));
-					}
-				}
-			}
-		}
-	}
+    private List<OSMAddress> addressesToGuess;
+    private List<IProgressMonitorFinishedListener> finishListeners = new ArrayList<IProgressMonitorFinishedListener>();
+    private boolean isRunning = false;
+    private boolean canceled;
+
+    private GuessedValueHandler[] wayGuessers = new GuessedValueHandler[]{new GuessStreetValueHandler(TagUtils.ADDR_STREET_TAG)}; 
+    private GuessedValueHandler[] nodeGuessers = new GuessedValueHandler[]{
+            new GuessedValueHandler(TagUtils.ADDR_POSTCODE_TAG, 500.0),
+            new GuessedValueHandler(TagUtils.ADDR_CITY_TAG, 5000.0),
+            new GuessedValueHandler(TagUtils.ADDR_STATE_TAG, 5000.0),
+            new GuessedValueHandler(TagUtils.ADDR_COUNTRY_TAG, 5000.0),
+            new GuessedValueHandler(TagUtils.ADDR_CITY_TAG, 2000.0)
+    };
+
+    /**
+     * Instantiates a new guess address runnable.
+     *
+     * @param addresses the addresses to guess the values for
+     * @param title the title of progress monitor
+     */
+    public GuessAddressRunnable(List<OSMAddress> addresses, String title) {
+        super(title != null ? title : tr("Searching"));
+        setAddressEditContainer(addresses);
+    }
+
+    /**
+     * Sets the address edit container.
+     *
+     * @param nodes the new address edit container
+     */
+    public void setAddressEditContainer(List<OSMAddress> nodes) {
+        if (isRunning) {
+            throw new ConcurrentModificationException();
+        }
+        this.addressesToGuess = nodes;
+    }
+
+    /**
+     * Gets the addresses to guess.
+     *
+     * @return the addresses to guess
+     */
+    public List<OSMAddress> getAddressesToGuess() {
+        return addressesToGuess;
+    }
+    /**
+     * @return the isRunning
+     */
+    public boolean isRunning() {
+        return isRunning;
+    }
+
+    /**
+     * Adds a finish listener.
+     *
+     * @param l the listener to add
+     */
+    public void addFinishListener(IProgressMonitorFinishedListener l) {
+        finishListeners.add(l);
+    }
+
+    /**
+     * Removes a finish listener.
+     *
+     * @param l the listener to remove
+     */
+    public void removeFinishListener(IProgressMonitorFinishedListener l) {
+        finishListeners.remove(l);
+    }
+
+    /**
+     * Fires the 'finished' event after the thread has done his work.
+     */
+    protected void fireFinished() {
+        for (IProgressMonitorFinishedListener l : finishListeners) {
+            l.finished();            
+        }
+        // this event is fired only once, then we disconnect all listeners
+        finishListeners.clear();
+    }
+
+    @Override
+    protected void cancel() {
+        canceled = true;
+    }
+
+    @Override
+    protected void finish() {
+        // nothing to do yet
+    }
+
+    @Override
+    protected void realRun() throws SAXException, IOException,
+    OsmTransferException {
+
+        if (Main.main.getCurrentDataSet() == null || addressesToGuess == null) return;
+
+        isRunning = true;
+        canceled = false;
+
+        // Start progress monitor to guess address values
+        progressMonitor.subTask(tr("Searching") + "...");
+
+        try {
+            progressMonitor.setTicksCount(addressesToGuess.size());
+
+            List<OSMAddress> shadowCopy = new ArrayList<OSMAddress>(addressesToGuess);
+            for (OSMAddress aNode : shadowCopy) {
+                if (!aNode.needsGuess()) { // nothing to do
+                    progressMonitor.worked(1);
+                    continue;
+                }
+
+                // check for cancel
+                if (canceled) {
+                    break;
+                }
+
+                // Update progress monitor
+                progressMonitor.subTask(tr("Guess values for ") + aNode);
+
+                // Run way-related guessers
+                for (int i = 0; i < wayGuessers.length; i++) {
+                    GuessedValueHandler guesser = wayGuessers[i];
+                    
+                    guesser.setAddressNode(aNode);
+
+                    // visit osm data
+                    for (Way way : Main.main.getCurrentDataSet().getWays()) {
+                        if (canceled) {
+                            break;
+                        }
+                        way.accept(guesser);                        
+                    }
+                    
+                    String guessedVal = guesser.getCurrentValue();
+                    if (guessedVal != null) {
+                        aNode.setGuessedValue(guesser.getTag(), guessedVal, guesser.getSourceNode());
+                    }
+                }
+                
+                // Run node-related guessers
+                for (int i = 0; i < nodeGuessers.length; i++) {
+                    GuessedValueHandler guesser = nodeGuessers[i];
+                    
+                    guesser.setAddressNode(aNode);
+
+                    // visit osm data
+                    for (Node node : Main.main.getCurrentDataSet().getNodes()) {
+                        if (canceled) {
+                            break;
+                        }
+                        node.accept(guesser);                        
+                    }
+                    
+                    String guessedVal = guesser.getCurrentValue();
+                    if (guessedVal != null) {
+                        aNode.setGuessedValue(guesser.getTag(), guessedVal, guesser.getSourceNode());
+                    }
+                }
+
+                // report progress
+                progressMonitor.worked(1);
+            }
+        } finally {
+            isRunning = false;
+            fireFinished();
+        }
+    }
+
+    // TODO: Put in separate file
+    private class GuessStreetValueHandler extends GuessedValueHandler {
+        public GuessStreetValueHandler(String tag) {
+            this(tag, null);
+        }
+
+        public GuessStreetValueHandler(String tag, OSMAddress aNode) {
+            super(tag, aNode, 200.0);
+        }
+
+        @Override
+        public void visit(Node n) {
+            // do nothing
+        }
+
+        @Override
+        public void visit(Way w) {
+            if (TagUtils.isStreetSupportingHousenumbers(w)) {
+                OSMAddress aNode = getAddressNode();
+                String newVal = TagUtils.getNameValue(w);
+                
+                if (newVal != null) {
+                    double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w);
+                    
+                    if (dist < minDist && dist < getMaxDistance()) {
+                        minDist = dist;
+                        currentValue = newVal;
+                        srcNode = w;
+                        //aNode.setGuessedValue(getTag(), currentValue, w);
+                    } else {
+                        //System.out.println(String.format("Skipped %s: %4.2f m", TagUtils.getNameValue(w), dist));
+                    }
+                }
+            }
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -30,193 +18,181 @@
 public class GuessedValueHandler implements Visitor {
 
-	/** Default maximum distance (100m) */
-	private static final double DEFAULT_MAX_DIST = 100.0;
+    /** Default maximum distance (100m) */
+    private static final double DEFAULT_MAX_DIST = 100.0;
 
-	private String tag;
-	protected double minDist;
-	protected String currentValue;
-	private OSMAddress aNode;
-	private double maxDist = DEFAULT_MAX_DIST;
-	protected OsmPrimitive srcNode;
+    private String tag;
+    protected double minDist;
+    protected String currentValue;
+    private OSMAddress aNode;
+    private double maxDist = DEFAULT_MAX_DIST;
+    protected OsmPrimitive srcNode;
 
-	/**
-	 * Instantiates a new guessed value handler without node and default maximum distance.
-	 *
-	 * @param tag the tag to find the guessed value for.
-	 */
-	public GuessedValueHandler(String tag) {
-		this(tag, null, DEFAULT_MAX_DIST);
-	}
-	
-	/**
-	 * Instantiates a new guessed value handler without node.
-	 *
-	 * @param tag the tag to find the guessed value for.
-	 * @param maxDist the maximum distance for a node/way to be considered as guessed value.
-	 */
-	public GuessedValueHandler(String tag, double maxDist) {
-		this(tag, null, maxDist);
-	}
-	
-	/**
-	 * Instantiates a new guessed value handler.
-	 *
-	 * @param tag the tag to find the guessed value for.
-	 * @param aNode the address node to guess the values for.
-	 * @param maxDist the maximum distance for a node/way to be considered as guessed value.
-	 */
-	public GuessedValueHandler(String tag, OSMAddress aNode) {
-		this(tag, aNode, DEFAULT_MAX_DIST);
-	}
+    /**
+     * Instantiates a new guessed value handler without node and default maximum distance.
+     *
+     * @param tag the tag to find the guessed value for.
+     */
+    public GuessedValueHandler(String tag) {
+        this(tag, null, DEFAULT_MAX_DIST);
+    }
+    
+    /**
+     * Instantiates a new guessed value handler without node.
+     *
+     * @param tag the tag to find the guessed value for.
+     * @param maxDist the maximum distance for a node/way to be considered as guessed value.
+     */
+    public GuessedValueHandler(String tag, double maxDist) {
+        this(tag, null, maxDist);
+    }
+    
+    /**
+     * Instantiates a new guessed value handler.
+     *
+     * @param tag the tag to find the guessed value for.
+     * @param aNode the address node to guess the values for.
+     * @param maxDist the maximum distance for a node/way to be considered as guessed value.
+     */
+    public GuessedValueHandler(String tag, OSMAddress aNode) {
+        this(tag, aNode, DEFAULT_MAX_DIST);
+    }
 
-	/**
-	 * Instantiates a new guessed value handler.
-	 *
-	 * @param tag the tag to find the guessed value for.
-	 * @param aNode the address node to guess the values for.
-	 * @param maxDist the maximum distance for a node/way to be considered as guessed value.
-	 */
-	public GuessedValueHandler(String tag, OSMAddress aNode, double maxDist) {
-		super();
+    /**
+     * Instantiates a new guessed value handler.
+     *
+     * @param tag the tag to find the guessed value for.
+     * @param aNode the address node to guess the values for.
+     * @param maxDist the maximum distance for a node/way to be considered as guessed value.
+     */
+    public GuessedValueHandler(String tag, OSMAddress aNode, double maxDist) {
+        super();
 
-		if (StringUtils.isNullOrEmpty(tag)) {
-			throw new RuntimeException("Tag must not be empty or null!");
-		}
+        if (StringUtils.isNullOrEmpty(tag)) {
+            throw new RuntimeException("Tag must not be empty or null!");
+        }
 
-		if (maxDist < 1.0) { // clip value
-			maxDist = 1.0;
-		}
-		
-		this.tag = tag;
-		this.maxDist = maxDist;
-		setAddressNode(aNode);		
-	}
+        if (maxDist < 1.0) { // clip value
+            maxDist = 1.0;
+        }
+        
+        this.tag = tag;
+        this.maxDist = maxDist;
+        setAddressNode(aNode);        
+    }
 
-	/**
-	 * Gets the address node to make the guess for.
-	 *
-	 * @return the aNode
-	 */
-	protected OSMAddress getAddressNode() {
-		return aNode;
-	}
-	
+    /**
+     * Gets the address node to make the guess for.
+     *
+     * @return the aNode
+     */
+    protected OSMAddress getAddressNode() {
+        return aNode;
+    }
+    
 
-	/**
-	 * Sets the address node to make the guess for.
-	 * @param aNode
-	 */
-	public void setAddressNode(OSMAddress aNode) {		
-		this.aNode = aNode;
-		// reset search results
-		minDist = Double.MAX_VALUE;
-		srcNode = null;
-		currentValue = null;		
-	}
+    /**
+     * Sets the address node to make the guess for.
+     * @param aNode
+     */
+    public void setAddressNode(OSMAddress aNode) {        
+        this.aNode = aNode;
+        // reset search results
+        minDist = Double.MAX_VALUE;
+        srcNode = null;
+        currentValue = null;        
+    }
 
-	/**
-	 * Gets the max distance allowed to consider a node as guess.
-	 * If the distance of the node is greater than maxDist, the
-	 * node/way will be ignored.
-	 *
-	 * @return the maxDist
-	 */
-	protected double getMaxDistance() {
-		return maxDist;
-	}
+    /**
+     * Gets the max distance allowed to consider a node as guess.
+     * If the distance of the node is greater than maxDist, the
+     * node/way will be ignored.
+     *
+     * @return the maxDist
+     */
+    protected double getMaxDistance() {
+        return maxDist;
+    }
 
-	/**
-	 * Gets the tag name to use as guess.
-	 *
-	 * @return the tag
-	 */
-	protected String getTag() {
-		return tag;
-	}
+    /**
+     * Gets the tag name to use as guess.
+     *
+     * @return the tag
+     */
+    protected String getTag() {
+        return tag;
+    }
 
-	/**
-	 * Gets the distance of the node/way which has been used for the guessed value.
-	 *
-	 * @return the minDist
-	 */
-	protected double getMinimumDist() {
-		return minDist;
-	}
+    /**
+     * Gets the distance of the node/way which has been used for the guessed value.
+     *
+     * @return the minDist
+     */
+    protected double getMinimumDist() {
+        return minDist;
+    }
 
-	/**
-	 * Gets the current guessed value or null, if no guess has been possible (so far).
-	 *
-	 * @return the currentValue
-	 */
-	public String getCurrentValue() {
-		return currentValue;
-	}
-	
-	
-	/**
-	 * Gets the node/way which has been selected for the guess.
-	 * @return The source node or null; if no appropriate source primitive has been found
-	 */
-	public OsmPrimitive getSourceNode() {
-		return srcNode;
-	}
+    /**
+     * Gets the current guessed value or null, if no guess has been possible (so far).
+     *
+     * @return the currentValue
+     */
+    public String getCurrentValue() {
+        return currentValue;
+    }
+    
+    
+    /**
+     * Gets the node/way which has been selected for the guess.
+     * @return The source node or null; if no appropriate source primitive has been found
+     */
+    public OsmPrimitive getSourceNode() {
+        return srcNode;
+    }
 
-	/**
-	 * Check if we need to visit the OSM data
-	 *
-	 * @return true, if successful
-	 */
-	public boolean needsGuess() {
-		return aNode.needsGuessedValue(tag);
-	}
+    /**
+     * Check if we need to visit the OSM data
+     *
+     * @return true, if successful
+     */
+    public boolean needsGuess() {
+        return aNode.needsGuessedValue(tag);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Node)
-	 */
-	@Override
-	public void visit(Node n) {
-		assert aNode != null;
-		
-		if (n.hasKey(tag)) {
-			double dist = n.getCoor().greatCircleDistance(aNode.getCoor());
-			if (dist < minDist && dist < maxDist) {
-				minDist = dist;
-				currentValue = n.get(tag);
-				srcNode = n;
-			}
-		}
-	}
+    @Override
+    public void visit(Node n) {
+        assert aNode != null;
+        
+        if (n.hasKey(tag)) {
+            double dist = n.getCoor().greatCircleDistance(aNode.getCoor());
+            if (dist < minDist && dist < maxDist) {
+                minDist = dist;
+                currentValue = n.get(tag);
+                srcNode = n;
+            }
+        }
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Way)
-	 */
-	@Override
-	public void visit(Way w) {
-		assert aNode != null;
-		
-		if (w.hasKey(tag)) {
-			double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w);
-			if (dist < minDist && dist < maxDist) {
-				minDist = dist;
-				currentValue = w.get(tag);
-				srcNode = w;
-			}
-		}
-	}
+    @Override
+    public void visit(Way w) {
+        assert aNode != null;
+        
+        if (w.hasKey(tag)) {
+            double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w);
+            if (dist < minDist && dist < maxDist) {
+                minDist = dist;
+                currentValue = w.get(tag);
+                srcNode = w;
+            }
+        }
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Relation)
-	 */
-	@Override
-	public void visit(Relation e) {
-		// nothing to do (yet)
-	}
+    @Override
+    public void visit(Relation e) {
+        // nothing to do (yet)
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.data.osm.visitor.Visitor#visit(org.openstreetmap.josm.data.osm.Changeset)
-	 */
-	@Override
-	public void visit(Changeset cs) {
-		// nothing to do (yet)
-	}
+    @Override
+    public void visit(Changeset cs) {
+        // nothing to do (yet)
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java	(revision 30348)
@@ -1,28 +1,15 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
+public interface IAddressEditContainerListener {
+    /**
+     * Notifies clients that the container has been changed.
+     * @param container
+     */
+    public void containerChanged(AddressEditContainer container);
 
-public interface IAddressEditContainerListener {
-	/**
-	 * Notifies clients that the container has been changed.
-	 * @param container
-	 */
-	public void containerChanged(AddressEditContainer container);
-
-	/**
-	 * Notifies clients that an entity has been changed.
-	 */
-	public void entityChanged(IOSMEntity node);
+    /**
+     * Notifies clients that an entity has been changed.
+     */
+    public void entityChanged(IOSMEntity node);
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAllKnowingTrashHeap.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAllKnowingTrashHeap.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAllKnowingTrashHeap.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -18,27 +6,27 @@
 public interface IAllKnowingTrashHeap {
 
-	/**
-	 * Gets the list containing the best matching (closest) street names.
-	 *
-	 * @param name the name of the street to find the matches for.
-	 * @param maxEntries the maximum number of matches.
-	 * @return the closest street names
-	 */
-	public List<String> getClosestStreetNames(String name, int maxEntries);
+    /**
+     * Gets the list containing the best matching (closest) street names.
+     *
+     * @param name the name of the street to find the matches for.
+     * @param maxEntries the maximum number of matches.
+     * @return the closest street names
+     */
+    public List<String> getClosestStreetNames(String name, int maxEntries);
 
-	/**
-	 * Gets the closest street name to the given name.
-	 *
-	 * @param name the name of the street to find a match for.
-	 * @return the closest street name
-	 */
-	public String getClosestStreetName(String name);
+    /**
+     * Gets the closest street name to the given name.
+     *
+     * @param name the name of the street to find a match for.
+     * @return the closest street name
+     */
+    public String getClosestStreetName(String name);
 
-	/**
-	 * Checks if the given street name is valid.
-	 *
-	 * @param name the name of the street to check.
-	 * @return true, if street name is valid; otherwise false.
-	 */
-	public boolean isValidStreetName(String name);
+    /**
+     * Checks if the given street name is valid.
+     *
+     * @param name the name of the street to check.
+     * @return true, if street name is valid; otherwise false.
+     */
+    public boolean isValidStreetName(String name);
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -17,10 +5,10 @@
 
 public interface ICommandListener {
-	/**
-	 * Called by a node entity if a command has been created. Clients may collect
-	 * these commands to define a sequence command.
-	 * @param entity The entity which created/used the command.
-	 * @param command The command instance to process by the enclosing command listener.
-	 */
-	public void commandIssued(IOSMEntity entity, Command command);
+    /**
+     * Called by a node entity if a command has been created. Clients may collect
+     * these commands to define a sequence command.
+     * @param entity The entity which created/used the command.
+     * @param command The command instance to process by the enclosing command listener.
+     */
+    public void commandIssued(IOSMEntity entity, Command command);
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -25,58 +13,57 @@
  *
  */
+public interface IOSMEntity extends Comparable<IOSMEntity> {
+    /**
+     * Gets the underlying OSM object.
+     * @return
+     */
+    public OsmPrimitive getOsmObject();
 
-public interface IOSMEntity extends Comparable<IOSMEntity> {
-	/**
-	 * Gets the underlying OSM object.
-	 * @return
-	 */
-	public OsmPrimitive getOsmObject();
+    /**
+     * Checks if underlying OSM object has a name.
+     * @return
+     */
+    public boolean hasName();
 
-	/**
-	 * Checks if underlying OSM object has a name.
-	 * @return
-	 */
-	public boolean hasName();
+    /**
+     * Gets the name of the entity node.
+     * @return
+     */
+    public String getName();
 
-	/**
-	 * Gets the name of the entity node.
-	 * @return
-	 */
-	public String getName();
+    /**
+     * Gets the children of the entity node.
+     * @return
+     */
+    public List<IOSMEntity> getChildren();
 
-	/**
-	 * Gets the children of the entity node.
-	 * @return
-	 */
-	public List<IOSMEntity> getChildren();
+    /**
+     * Gets the coordinate of the node. If the underlying object is a
+     * node, it just returns the node coordinate. For ways and areas, this
+     * method returns the coordinate of the center (balance point).
+     * @return
+     */
+    public LatLon getCoor();
 
-	/**
-	 * Gets the coordinate of the node. If the underlying object is a
-	 * node, it just returns the node coordinate. For ways and areas, this
-	 * method returns the coordinate of the center (balance point).
-	 * @return
-	 */
-	public LatLon getCoor();
+    /**
+     * Adds a command listener.
+     * @param listener
+     */
+    public void addCommandListener(ICommandListener listener);
 
-	/**
-	 * Adds a command listener.
-	 * @param listener
-	 */
-	public void addCommandListener(ICommandListener listener);
+    /**
+     * Removes a command listener.
+     * @param listener
+     */
+    public void removeCommandListener(ICommandListener listener);
 
-	/**
-	 * Removes a command listener.
-	 * @param listener
-	 */
-	public void removeCommandListener(ICommandListener listener);
+    /**
+     * Collects problems and possible solutions.
+     *
+     * @param trashHeap the trash heap to ask for possible solutions
+     * @param visitor the problem visitor
+     */
+    public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor);
 
-	/**
-	 * Collects problems and possible solutions.
-	 *
-	 * @param trashHeap the trash heap to ask for possible solutions
-	 * @param visitor the problem visitor
-	 */
-	public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor);
-
-	int compareTo(IOSMEntity o);
+    int compareTo(IOSMEntity o);
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblem.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblem.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblem.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -18,56 +6,56 @@
 public interface IProblem {
 
-	/**
-	 * Gets the OSM entity which causes the problem.
-	 *
-	 * @return the source
-	 */
-	public IOSMEntity getSource();
+    /**
+     * Gets the OSM entity which causes the problem.
+     *
+     * @return the source
+     */
+    public IOSMEntity getSource();
 
-	/**
-	 * Gets the problem description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription();
+    /**
+     * Gets the problem description.
+     *
+     * @return the description
+     */
+    public String getDescription();
 
-	/**
-	 * Gets the problem type.
-	 *
-	 * @return the type
-	 */
-	public ProblemType getType();
+    /**
+     * Gets the problem type.
+     *
+     * @return the type
+     */
+    public ProblemType getType();
 
-	/**
-	 * Gets the available solutions for this problem.
-	 *
-	 * @return the solutions
-	 */
-	public List<ISolution> getSolutions();
+    /**
+     * Gets the available solutions for this problem.
+     *
+     * @return the solutions
+     */
+    public List<ISolution> getSolutions();
 
-	/**
-	 * Adds a possible solution to the problem.
-	 *
-	 * @param solution the solution
-	 */
-	public void addSolution(ISolution solution);
+    /**
+     * Adds a possible solution to the problem.
+     *
+     * @param solution the solution
+     */
+    public void addSolution(ISolution solution);
 
-	/**
-	 * Removes a solution from this problem.
-	 *
-	 * @param solution the solution
-	 */
-	public void removeSolution(ISolution solution);
+    /**
+     * Removes a solution from this problem.
+     *
+     * @param solution the solution
+     */
+    public void removeSolution(ISolution solution);
 
-	/**
-	 * Removes all solutions from this problem.
-	 */
-	public void clearSolutions();
+    /**
+     * Removes all solutions from this problem.
+     */
+    public void clearSolutions();
 
-	/**
-	 * Applies a {@link ISolution} instance on the problem.
-	 *
-	 * @param solution the solution
-	 */
-	public void applySolution(ISolution solution);
+    /**
+     * Applies a {@link ISolution} instance on the problem.
+     *
+     * @param solution the solution
+     */
+    public void applySolution(ISolution solution);
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblemVisitor.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblemVisitor.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblemVisitor.java	(revision 30348)
@@ -1,29 +1,16 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
+public interface IProblemVisitor {
+    /**
+     * Adds a problem without solution.
+     *
+     * @param problem the problem to add
+     */
+    public void addProblem(IProblem problem);
 
-public interface IProblemVisitor {
-	/**
-	 * Adds a problem without solution.
-	 *
-	 * @param problem the problem to add
-	 */
-	public void addProblem(IProblem problem);
-
-	/**
-	 * Removes the problems of the given source.
-	 */
-	public void removeProblemsOfSource(IOSMEntity entity);
+    /**
+     * Removes the problems of the given source.
+     */
+    public void removeProblemsOfSource(IOSMEntity entity);
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProgressMonitorFinishedListener.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProgressMonitorFinishedListener.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProgressMonitorFinishedListener.java	(revision 30348)
@@ -1,18 +1,6 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
 public interface IProgressMonitorFinishedListener {
-	public void finished();
+    public void finished();
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ISolution.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ISolution.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ISolution.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -18,28 +6,28 @@
 public interface ISolution {
 
-	/**
-	 * Gets the description of the solution.
-	 *
-	 * @return the description
-	 */
-	public String getDescription();
+    /**
+     * Gets the description of the solution.
+     *
+     * @return the description
+     */
+    public String getDescription();
 
-	/**
-	 * Gets the action to execute for solving the problem.
-	 *
-	 * @return the action
-	 */
-	public JosmAction getAction();
+    /**
+     * Gets the action to execute for solving the problem.
+     *
+     * @return the action
+     */
+    public JosmAction getAction();
 
-	/**
-	 * Gets the solution type.
-	 *
-	 * @return the type
-	 */
-	public SolutionType getType();
+    /**
+     * Gets the solution type.
+     *
+     * @return the type
+     */
+    public SolutionType getType();
 
-	/**
-	 * Executes one or more actions to solve a problem.
-	 */
-	public void solve();
+    /**
+     * Executes one or more actions to solve a problem.
+     */
+    public void solve();
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMAddress.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMAddress.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMAddress.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -46,21 +34,14 @@
 
     public OSMAddress(OsmPrimitive osmObject) {
-	super(osmObject);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.openstreetmap.josm.plugins.addressEdit.NodeEntityBase#setOsmObject
-     * (org.openstreetmap.josm.data.osm.OsmPrimitive)
-     */
+    super(osmObject);
+    }
+
     @Override
     public void setOsmObject(OsmPrimitive osmObject) {
-	super.setOsmObject(osmObject);
-
-	isPartOfInterpolation = OsmUtils
-		.getValuesFromAddressInterpolation(this);
-	isPartOfAssocStreetRel = OsmUtils.getValuesFromRelation(this);
+    super.setOsmObject(osmObject);
+
+    isPartOfInterpolation = OsmUtils
+        .getValuesFromAddressInterpolation(this);
+    isPartOfAssocStreetRel = OsmUtils.getValuesFromRelation(this);
     }
 
@@ -72,19 +53,19 @@
      */
     public boolean isComplete() {
-	boolean isComplete = hasCity() && hasHouseNumber() && hasCity()
-		&& hasStreetName();
-
-	// Check, if "addr:state" is required (US and AU)
-	if (TagUtils.isStateRequired()) {
-	    isComplete = isComplete && hasState();
-	}
-
-	// Check, if user checked "ignore post code"
-	if (!FixAddressesPlugin.getPreferences().isIgnorePostCode()) {
-	    isComplete = isComplete && hasPostalCode()
-		    && PostalCodeChecker.hasValidPostalCode(this);
-	}
-
-	return isComplete;
+    boolean isComplete = hasCity() && hasHouseNumber() && hasCity()
+        && hasStreetName();
+
+    // Check, if "addr:state" is required (US and AU)
+    if (TagUtils.isStateRequired()) {
+        isComplete = isComplete && hasState();
+    }
+
+    // Check, if user checked "ignore post code"
+    if (!FixAddressesPlugin.getPreferences().isIgnorePostCode()) {
+        isComplete = isComplete && hasPostalCode()
+            && PostalCodeChecker.hasValidPostalCode(this);
+    }
+
+    return isComplete;
     }
 
@@ -95,5 +76,5 @@
      */
     public String getStreetName() {
-	return getTagValueWithGuess(TagUtils.ADDR_STREET_TAG);
+    return getTagValueWithGuess(TagUtils.ADDR_STREET_TAG);
     }
 
@@ -108,26 +89,26 @@
      */
     private String getTagValueWithGuess(String tag) {
-	if (StringUtils.isNullOrEmpty(tag))
-	    return MISSING_TAG;
-	if (osmObject == null)
-	    return MISSING_TAG;
-
-	if (!osmObject.hasKey(tag)
-		|| StringUtils.isNullOrEmpty(osmObject.get(tag))) {
-	    if (!hasDerivedValue(tag)) {
-		// object does not have this tag -> check for guess
-		if (hasGuessedValue(tag)) {
-		    return "*" + getGuessedValue(tag);
-		} else {
-		    // give up
-		    return MISSING_TAG;
-		}
-	    } else { // ok, use derived value known via associated relation or
-		     // way
-		return getDerivedValue(tag);
-	    }
-	} else { // get existing tag value
-	    return osmObject.get(tag);
-	}
+    if (StringUtils.isNullOrEmpty(tag))
+        return MISSING_TAG;
+    if (osmObject == null)
+        return MISSING_TAG;
+
+    if (!osmObject.hasKey(tag)
+        || StringUtils.isNullOrEmpty(osmObject.get(tag))) {
+        if (!hasDerivedValue(tag)) {
+        // object does not have this tag -> check for guess
+        if (hasGuessedValue(tag)) {
+            return "*" + getGuessedValue(tag);
+        } else {
+            // give up
+            return MISSING_TAG;
+        }
+        } else { // ok, use derived value known via associated relation or
+             // way
+        return getDerivedValue(tag);
+        }
+    } else { // get existing tag value
+        return osmObject.get(tag);
+    }
     }
 
@@ -138,5 +119,5 @@
      */
     public boolean hasStreetName() {
-	return hasTag(TagUtils.ADDR_STREET_TAG) || isPartOfRelation();
+    return hasTag(TagUtils.ADDR_STREET_TAG) || isPartOfRelation();
     }
 
@@ -147,5 +128,5 @@
      */
     public String getGuessedStreetName() {
-	return getGuessedValue(TagUtils.ADDR_STREET_TAG);
+    return getGuessedValue(TagUtils.ADDR_STREET_TAG);
     }
 
@@ -159,6 +140,6 @@
      */
     public void setGuessedStreetName(String guessedStreetName,
-	    OsmPrimitive srcObj) {
-	setGuessedValue(TagUtils.ADDR_STREET_TAG, guessedStreetName, srcObj);
+        OsmPrimitive srcObj) {
+    setGuessedValue(TagUtils.ADDR_STREET_TAG, guessedStreetName, srcObj);
     }
 
@@ -169,5 +150,5 @@
      */
     public boolean hasGuessedStreetName() {
-	return hasGuessedValue(TagUtils.ADDR_STREET_TAG);
+    return hasGuessedValue(TagUtils.ADDR_STREET_TAG);
     }
 
@@ -176,5 +157,5 @@
      */
     public String getGuessedPostalCode() {
-	return getGuessedValue(TagUtils.ADDR_POSTCODE_TAG);
+    return getGuessedValue(TagUtils.ADDR_POSTCODE_TAG);
     }
 
@@ -188,5 +169,5 @@
      */
     public void setGuessedPostalCode(String guessedPostCode, OsmPrimitive srcObj) {
-	setGuessedValue(TagUtils.ADDR_POSTCODE_TAG, guessedPostCode, srcObj);
+    setGuessedValue(TagUtils.ADDR_POSTCODE_TAG, guessedPostCode, srcObj);
     }
 
@@ -197,5 +178,5 @@
      */
     public boolean hasGuessedPostalCode() {
-	return hasGuessedValue(TagUtils.ADDR_POSTCODE_TAG);
+    return hasGuessedValue(TagUtils.ADDR_POSTCODE_TAG);
     }
 
@@ -204,5 +185,5 @@
      */
     public String getGuessedCity() {
-	return getGuessedValue(TagUtils.ADDR_CITY_TAG);
+    return getGuessedValue(TagUtils.ADDR_CITY_TAG);
     }
 
@@ -216,5 +197,5 @@
      */
     public void setGuessedCity(String guessedCity, OsmPrimitive srcObj) {
-	setGuessedValue(TagUtils.ADDR_CITY_TAG, guessedCity, srcObj);
+    setGuessedValue(TagUtils.ADDR_CITY_TAG, guessedCity, srcObj);
     }
 
@@ -225,5 +206,5 @@
      */
     public boolean hasGuessedCity() {
-	return hasGuessedValue(TagUtils.ADDR_CITY_TAG);
+    return hasGuessedValue(TagUtils.ADDR_CITY_TAG);
     }
 
@@ -234,5 +215,5 @@
      */
     public boolean hasGuesses() {
-	return guessedValues.size() > 0;
+    return guessedValues.size() > 0;
     }
 
@@ -241,11 +222,11 @@
      */
     public void applyAllGuesses() {
-	for (String tag : guessedValues.keySet()) {
-	    applyGuessForTag(tag);
-	}
-
-	// Clear all guesses
-	guessedValues.clear();
-	guessedObjects.clear();
+    for (String tag : guessedValues.keySet()) {
+        applyGuessForTag(tag);
+    }
+
+    // Clear all guesses
+    guessedValues.clear();
+    guessedObjects.clear();
     }
 
@@ -257,10 +238,10 @@
      */
     public void applyGuessForTag(String tag) {
-	if (guessedValues.containsKey(tag)) {
-	    String val = guessedValues.get(tag);
-	    if (!StringUtils.isNullOrEmpty(val)) {
-		setOSMTag(tag, val);
-	    }
-	}
+    if (guessedValues.containsKey(tag)) {
+        String val = guessedValues.get(tag);
+        if (!StringUtils.isNullOrEmpty(val)) {
+        setOSMTag(tag, val);
+        }
+    }
     }
 
@@ -271,11 +252,11 @@
      */
     public String getPostalCode() {
-	String pc = getTagValueWithGuess(TagUtils.ADDR_POSTCODE_TAG);
-
-	if (!MISSING_TAG.equals(pc)
-		&& !PostalCodeChecker.hasValidPostalCode(getCountry(), pc)) {
-	    pc = "(!)" + pc;
-	}
-	return pc;
+    String pc = getTagValueWithGuess(TagUtils.ADDR_POSTCODE_TAG);
+
+    if (!MISSING_TAG.equals(pc)
+        && !PostalCodeChecker.hasValidPostalCode(getCountry(), pc)) {
+        pc = "(!)" + pc;
+    }
+    return pc;
     }
 
@@ -286,5 +267,5 @@
      */
     public boolean hasValidPostalCode() {
-	return PostalCodeChecker.hasValidPostalCode(this);
+    return PostalCodeChecker.hasValidPostalCode(this);
     }
 
@@ -295,5 +276,5 @@
      */
     public boolean hasPostalCode() {
-	return hasTag(TagUtils.ADDR_POSTCODE_TAG);
+    return hasTag(TagUtils.ADDR_POSTCODE_TAG);
     }
 
@@ -304,12 +285,12 @@
      */
     public String getHouseNumber() {
-	if (!TagUtils.hasAddrHousenumberTag(osmObject)) {
-	    if (!isPartOfInterpolation) {
-		return MISSING_TAG;
-	    } else {
-		return INTERPOLATION_TAG;
-	    }
-	}
-	return TagUtils.getAddrHousenumberValue(osmObject);
+    if (!TagUtils.hasAddrHousenumberTag(osmObject)) {
+        if (!isPartOfInterpolation) {
+        return MISSING_TAG;
+        } else {
+        return INTERPOLATION_TAG;
+        }
+    }
+    return TagUtils.getAddrHousenumberValue(osmObject);
     }
 
@@ -320,20 +301,15 @@
      */
     public boolean hasHouseNumber() {
-	return TagUtils.hasAddrHousenumberTag(osmObject)
-		|| isPartOfInterpolation;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.openstreetmap.josm.plugins.fixAddresses.OSMEntityBase#getName()
-     */
+    return TagUtils.hasAddrHousenumberTag(osmObject)
+        || isPartOfInterpolation;
+    }
+
     public String getName() {
-	String name = TagUtils.getNameValue(osmObject);
-	if (!StringUtils.isNullOrEmpty(name)) {
-	    return TagUtils.getAddrHousenameValue(osmObject);
-	}
-
-	return "";
+    String name = TagUtils.getNameValue(osmObject);
+    if (!StringUtils.isNullOrEmpty(name)) {
+        return TagUtils.getAddrHousenameValue(osmObject);
+    }
+
+    return "";
     }
 
@@ -344,5 +320,5 @@
      */
     protected boolean isPartOfInterpolation() {
-	return isPartOfInterpolation;
+    return isPartOfInterpolation;
     }
 
@@ -353,5 +329,5 @@
      */
     protected boolean isPartOfRelation() {
-	return isPartOfAssocStreetRel;
+    return isPartOfAssocStreetRel;
     }
 
@@ -362,5 +338,5 @@
      */
     public String getCity() {
-	return getTagValueWithGuess(TagUtils.ADDR_CITY_TAG);
+    return getTagValueWithGuess(TagUtils.ADDR_CITY_TAG);
     }
 
@@ -371,5 +347,5 @@
      */
     public boolean hasCity() {
-	return hasTag(TagUtils.ADDR_CITY_TAG);
+    return hasTag(TagUtils.ADDR_CITY_TAG);
     }
 
@@ -380,5 +356,5 @@
      */
     public String getState() {
-	return getTagValueWithGuess(TagUtils.ADDR_STATE_TAG);
+    return getTagValueWithGuess(TagUtils.ADDR_STATE_TAG);
     }
 
@@ -389,5 +365,5 @@
      */
     public boolean hasState() {
-	return hasTag(TagUtils.ADDR_STATE_TAG);
+    return hasTag(TagUtils.ADDR_STATE_TAG);
     }
 
@@ -398,5 +374,5 @@
      */
     public String getCountry() {
-	return getTagValueWithGuess(TagUtils.ADDR_COUNTRY_TAG);
+    return getTagValueWithGuess(TagUtils.ADDR_COUNTRY_TAG);
     }
 
@@ -407,5 +383,5 @@
      */
     public boolean hasCountry() {
-	return hasTag(TagUtils.ADDR_COUNTRY_TAG);
+    return hasTag(TagUtils.ADDR_COUNTRY_TAG);
     }
 
@@ -414,10 +390,10 @@
      */
     public void removeAllAddressTags() {
-	removeOSMTag(TagUtils.ADDR_CITY_TAG);
-	removeOSMTag(TagUtils.ADDR_COUNTRY_TAG);
-	removeOSMTag(TagUtils.ADDR_POSTCODE_TAG);
-	removeOSMTag(TagUtils.ADDR_HOUSENUMBER_TAG);
-	removeOSMTag(TagUtils.ADDR_STATE_TAG);
-	removeOSMTag(TagUtils.ADDR_STREET_TAG);
+    removeOSMTag(TagUtils.ADDR_CITY_TAG);
+    removeOSMTag(TagUtils.ADDR_COUNTRY_TAG);
+    removeOSMTag(TagUtils.ADDR_POSTCODE_TAG);
+    removeOSMTag(TagUtils.ADDR_HOUSENUMBER_TAG);
+    removeOSMTag(TagUtils.ADDR_STATE_TAG);
+    removeOSMTag(TagUtils.ADDR_STREET_TAG);
     }
 
@@ -431,67 +407,60 @@
      */
     public boolean hasTag(String tag) {
-	if (StringUtils.isNullOrEmpty(tag))
-	    return false;
-
-	return TagUtils.hasTag(osmObject, tag) || hasDerivedValue(tag);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.openstreetmap.josm.plugins.addressEdit.NodeEntityBase#compareTo(org
-     * .openstreetmap.josm.plugins.addressEdit.INodeEntity)
-     */
+    if (StringUtils.isNullOrEmpty(tag))
+        return false;
+
+    return TagUtils.hasTag(osmObject, tag) || hasDerivedValue(tag);
+    }
+
     @Override
     public int compareTo(IOSMEntity o) {
-	if (o == null || !(o instanceof OSMAddress)) {
-	    return -1;
-	}
-	OSMAddress other = (OSMAddress) o;
-
-	if (this.equals(other))
-	    return 0;
-
-	int cc = 0;
-	cc = this.getCountry().compareTo(other.getCountry());
-	if (cc == 0) {
-	    cc = this.getState().compareTo(other.getState());
-	    if (cc == 0) {
-		cc = this.getCity().compareTo(other.getCity());
-		if (cc == 0) {
-		    cc = this.getStreetName().compareTo(other.getStreetName());
-		    if (cc == 0) {
-			if (hasGuessedStreetName()) {
-			    if (other.hasStreetName()) {
-				// Compare guessed name with the real name
-				String gsm = this.getGuessedStreetName();
-				cc = this.getGuessedStreetName().compareTo(
-					other.getStreetName());
-				if (cc == 0) {
-				    cc = this.getHouseNumber().compareTo(
-					    other.getHouseNumber());
-				}
-			    } else if (other.hasGuessedStreetName()) {
-				// Compare guessed name with the guessed name
-				cc = this.getGuessedStreetName().compareTo(
-					other.getGuessedStreetName());
-				if (cc == 0) {
-				    cc = this.getHouseNumber().compareTo(
-					    other.getHouseNumber());
-				}
-			    } // else: give up
-			      // No guessed name at all -> just compare the
-			      // number
-			} else {
-			    cc = this.getHouseNumber().compareTo(
-				    other.getHouseNumber());
-			}
-		    }
-		}
-	    }
-	}
-
-	return cc;
+    if (o == null || !(o instanceof OSMAddress)) {
+        return -1;
+    }
+    OSMAddress other = (OSMAddress) o;
+
+    if (this.equals(other))
+        return 0;
+
+    int cc = 0;
+    cc = this.getCountry().compareTo(other.getCountry());
+    if (cc == 0) {
+        cc = this.getState().compareTo(other.getState());
+        if (cc == 0) {
+        cc = this.getCity().compareTo(other.getCity());
+        if (cc == 0) {
+            cc = this.getStreetName().compareTo(other.getStreetName());
+            if (cc == 0) {
+            if (hasGuessedStreetName()) {
+                if (other.hasStreetName()) {
+                // Compare guessed name with the real name
+                /*String gsm =*/ this.getGuessedStreetName();
+                cc = this.getGuessedStreetName().compareTo(
+                    other.getStreetName());
+                if (cc == 0) {
+                    cc = this.getHouseNumber().compareTo(
+                        other.getHouseNumber());
+                }
+                } else if (other.hasGuessedStreetName()) {
+                // Compare guessed name with the guessed name
+                cc = this.getGuessedStreetName().compareTo(
+                    other.getGuessedStreetName());
+                if (cc == 0) {
+                    cc = this.getHouseNumber().compareTo(
+                        other.getHouseNumber());
+                }
+                } // else: give up
+                  // No guessed name at all -> just compare the
+                  // number
+            } else {
+                cc = this.getHouseNumber().compareTo(
+                    other.getHouseNumber());
+            }
+            }
+        }
+        }
+    }
+
+    return cc;
     }
 
@@ -502,12 +471,12 @@
      */
     public void assignStreet(OSMStreet node) {
-	if (node == null || !node.hasName())
-	    return;
-
-	if (!node.getName().equals(getStreetName())) {
-	    setStreetName(node.getName());
-	    node.addAddress(this);
-	    fireEntityChanged(this);
-	}
+    if (node == null || !node.hasName())
+        return;
+
+    if (!node.getName().equals(getStreetName())) {
+        setStreetName(node.getName());
+        node.addAddress(this);
+        fireEntityChanged(this);
+    }
     }
 
@@ -520,10 +489,10 @@
      */
     public String getGuessedValue(String tag) {
-	CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-
-	if (!hasGuessedValue(tag)) {
-	    return null;
-	}
-	return guessedValues.get(tag);
+    CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+
+    if (!hasGuessedValue(tag)) {
+        return null;
+    }
+    return guessedValues.get(tag);
     }
 
@@ -536,10 +505,10 @@
      */
     public OsmPrimitive getGuessedObject(String tag) {
-	CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-
-	if (guessedObjects.containsKey(tag)) {
-	    return guessedObjects.get(tag);
-	}
-	return null;
+    CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+
+    if (guessedObjects.containsKey(tag)) {
+        return guessedObjects.get(tag);
+    }
+    return null;
     }
 
@@ -551,8 +520,8 @@
      */
     public Collection<OsmPrimitive> getGuessedObjects() {
-	if (guessedObjects == null)
-	    return null;
-
-	return guessedObjects.values();
+    if (guessedObjects == null)
+        return null;
+
+    return guessedObjects.values();
     }
 
@@ -564,9 +533,9 @@
      */
     public boolean needsGuess() {
-	return needsGuessedValue(TagUtils.ADDR_CITY_TAG)
-		|| needsGuessedValue(TagUtils.ADDR_POSTCODE_TAG)
-		|| needsGuessedValue(TagUtils.ADDR_COUNTRY_TAG) ||
-		// needsGuessedValue(TagUtils.ADDR_STATE_TAG) ||
-		needsGuessedValue(TagUtils.ADDR_STREET_TAG);
+    return needsGuessedValue(TagUtils.ADDR_CITY_TAG)
+        || needsGuessedValue(TagUtils.ADDR_POSTCODE_TAG)
+        || needsGuessedValue(TagUtils.ADDR_COUNTRY_TAG) ||
+        // needsGuessedValue(TagUtils.ADDR_STATE_TAG) ||
+        needsGuessedValue(TagUtils.ADDR_STREET_TAG);
     }
 
@@ -577,5 +546,5 @@
      */
     public boolean needsGuessedValue(String tag) {
-	return MISSING_TAG.equals(getTagValueWithGuess(tag));
+    return MISSING_TAG.equals(getTagValueWithGuess(tag));
     }
 
@@ -584,5 +553,5 @@
      */
     public void clearAllGuesses() {
-	guessedValues.clear();
+    guessedValues.clear();
     }
 
@@ -596,8 +565,8 @@
      */
     private boolean hasGuessedValue(String tag) {
-	CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-
-	return guessedValues.containsKey(tag)
-		&& !StringUtils.isNullOrEmpty(guessedValues.get(tag));
+    CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+
+    return guessedValues.containsKey(tag)
+        && !StringUtils.isNullOrEmpty(guessedValues.get(tag));
     }
 
@@ -613,13 +582,13 @@
      */
     public void setGuessedValue(String tag, String value, OsmPrimitive osm) {
-	CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-
-	if (value != null && osm != null) {
-	    guessedValues.put(tag, value);
-	    if (osm != null) {
-		guessedObjects.put(tag, osm);
-	    }
-	    fireEntityChanged(this);
-	}
+    CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+
+    if (value != null && osm != null) {
+        guessedValues.put(tag, value);
+        if (osm != null) {
+        guessedObjects.put(tag, osm);
+        }
+        fireEntityChanged(this);
+    }
     }
 
@@ -633,8 +602,8 @@
      */
     private boolean hasDerivedValue(String tag) {
-	CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-
-	return derivedValues.containsKey(tag)
-		&& !StringUtils.isNullOrEmpty(derivedValues.get(tag));
+    CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+
+    return derivedValues.containsKey(tag)
+        && !StringUtils.isNullOrEmpty(derivedValues.get(tag));
     }
 
@@ -645,5 +614,5 @@
      */
     public boolean hasDerivedValues() {
-	return derivedValues.size() > 0;
+    return derivedValues.size() > 0;
     }
 
@@ -656,8 +625,8 @@
      */
     public String getDerivedValue(String tag) {
-	if (!hasDerivedValue(tag)) {
-	    return null;
-	}
-	return derivedValues.get(tag);
+    if (!hasDerivedValue(tag)) {
+        return null;
+    }
+    return derivedValues.get(tag);
     }
 
@@ -671,5 +640,5 @@
      */
     public void setDerivedValue(String tag, String value) {
-	derivedValues.put(tag, value);
+    derivedValues.put(tag, value);
     }
 
@@ -680,8 +649,8 @@
      */
     public void setStreetName(String streetName) {
-	if (streetName != null && streetName.length() == 0)
-	    return;
-
-	setOSMTag(TagUtils.ADDR_STREET_TAG, streetName);
+    if (streetName != null && streetName.length() == 0)
+        return;
+
+    setOSMTag(TagUtils.ADDR_STREET_TAG, streetName);
     }
 
@@ -692,8 +661,8 @@
      */
     public void setState(String state) {
-	if (state != null && state.length() == 0)
-	    return;
-
-	setOSMTag(TagUtils.ADDR_STATE_TAG, state);
+    if (state != null && state.length() == 0)
+        return;
+
+    setOSMTag(TagUtils.ADDR_STATE_TAG, state);
     }
 
@@ -704,8 +673,8 @@
      */
     public void setCountry(String country) {
-	if (country != null && country.length() == 0)
-	    return;
-
-	setOSMTag(TagUtils.ADDR_COUNTRY_TAG, country);
+    if (country != null && country.length() == 0)
+        return;
+
+    setOSMTag(TagUtils.ADDR_COUNTRY_TAG, country);
     }
 
@@ -716,76 +685,70 @@
      */
     public void setPostCode(String postCode) {
-	if (postCode != null && postCode.length() == 0)
-	    return;
-
-	setOSMTag(TagUtils.ADDR_POSTCODE_TAG, postCode);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.openstreetmap.josm.plugins.fixAddresses.OSMEntityBase#visit(org.
-     * openstreetmap.josm.plugins.fixAddresses.IProblemVisitor)
-     */
+    if (postCode != null && postCode.length() == 0)
+        return;
+
+    setOSMTag(TagUtils.ADDR_POSTCODE_TAG, postCode);
+    }
+
     @Override
     public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor) {
-	CheckParameterUtil.ensureParameterNotNull(visitor, "visitor");
-
-	// Check for street
-	if (!hasStreetName()) {
-	    AddressProblem p = new AddressProblem(this,
-		    tr("Address has no street"));
-	    if (hasGuessedStreetName()) { // guess exists -> add solution entry
-		String tag = TagUtils.ADDR_STREET_TAG;
-		addGuessValueSolution(p, tag);
-	    }
-	    addRemoveAddressTagsSolution(p);
-	    visitor.addProblem(p);
-	    // Street name exists, but is invalid -> ask the all knowing trash
-	    // heap
-	} else if (!trashHeap.isValidStreetName(getStreetName())) {
-	    AddressProblem p = new AddressProblem(this,
-		    tr("Address has no valid street"));
-	    String match = trashHeap.getClosestStreetName(getStreetName());
-
-	    if (!StringUtils.isNullOrEmpty(match)) {
-		setGuessedStreetName(match, null);
-		addGuessValueSolution(p, TagUtils.ADDR_STREET_TAG);
-	    }
-	    visitor.addProblem(p);
-	}
-
-	// Check for postal code
-	if (!hasPostalCode()) {
-	    AddressProblem p = new AddressProblem(this,
-		    tr("Address has no post code"));
-	    if (hasGuessedStreetName()) {
-		String tag = TagUtils.ADDR_POSTCODE_TAG;
-		addGuessValueSolution(p, tag);
-	    }
-	    addRemoveAddressTagsSolution(p);
-	    visitor.addProblem(p);
-	}
-
-	// Check for city
-	if (!hasCity()) {
-	    AddressProblem p = new AddressProblem(this,
-		    tr("Address has no city"));
-	    if (hasGuessedStreetName()) {
-		String tag = TagUtils.ADDR_CITY_TAG;
-		addGuessValueSolution(p, tag);
-	    }
-	    addRemoveAddressTagsSolution(p);
-	    visitor.addProblem(p);
-	}
-
-	// Check for country
-	if (!hasCountry()) {
-	    // TODO: Add guess for country
-	    AddressProblem p = new AddressProblem(this,
-		    tr("Address has no country"));
-	    addRemoveAddressTagsSolution(p);
-	    visitor.addProblem(p);
-	}
+    CheckParameterUtil.ensureParameterNotNull(visitor, "visitor");
+
+    // Check for street
+    if (!hasStreetName()) {
+        AddressProblem p = new AddressProblem(this,
+            tr("Address has no street"));
+        if (hasGuessedStreetName()) { // guess exists -> add solution entry
+        String tag = TagUtils.ADDR_STREET_TAG;
+        addGuessValueSolution(p, tag);
+        }
+        addRemoveAddressTagsSolution(p);
+        visitor.addProblem(p);
+        // Street name exists, but is invalid -> ask the all knowing trash
+        // heap
+    } else if (!trashHeap.isValidStreetName(getStreetName())) {
+        AddressProblem p = new AddressProblem(this,
+            tr("Address has no valid street"));
+        String match = trashHeap.getClosestStreetName(getStreetName());
+
+        if (!StringUtils.isNullOrEmpty(match)) {
+        setGuessedStreetName(match, null);
+        addGuessValueSolution(p, TagUtils.ADDR_STREET_TAG);
+        }
+        visitor.addProblem(p);
+    }
+
+    // Check for postal code
+    if (!hasPostalCode()) {
+        AddressProblem p = new AddressProblem(this,
+            tr("Address has no post code"));
+        if (hasGuessedStreetName()) {
+        String tag = TagUtils.ADDR_POSTCODE_TAG;
+        addGuessValueSolution(p, tag);
+        }
+        addRemoveAddressTagsSolution(p);
+        visitor.addProblem(p);
+    }
+
+    // Check for city
+    if (!hasCity()) {
+        AddressProblem p = new AddressProblem(this,
+            tr("Address has no city"));
+        if (hasGuessedStreetName()) {
+        String tag = TagUtils.ADDR_CITY_TAG;
+        addGuessValueSolution(p, tag);
+        }
+        addRemoveAddressTagsSolution(p);
+        visitor.addProblem(p);
+    }
+
+    // Check for country
+    if (!hasCountry()) {
+        // TODO: Add guess for country
+        AddressProblem p = new AddressProblem(this,
+            tr("Address has no country"));
+        addRemoveAddressTagsSolution(p);
+        visitor.addProblem(p);
+    }
     }
 
@@ -799,9 +762,9 @@
      */
     private void addGuessValueSolution(AddressProblem p, String tag) {
-	AddressSolution s = new AddressSolution(String.format("%s '%s'",
-		tr("Assign to"), getGuessedValue(tag)),
-		AddressActions.getApplyGuessesAction(), SolutionType.Change);
-
-	p.addSolution(s);
+    AddressSolution s = new AddressSolution(String.format("%s '%s'",
+        tr("Assign to"), getGuessedValue(tag)),
+        AddressActions.getApplyGuessesAction(), SolutionType.Change);
+
+    p.addSolution(s);
     }
 
@@ -813,19 +776,14 @@
      */
     private void addRemoveAddressTagsSolution(IProblem problem) {
-	CheckParameterUtil.ensureParameterNotNull(problem, "problem");
-
-	AddressSolution s = new AddressSolution(tr("Remove all address tags"),
-		AddressActions.getRemoveTagsAction(), SolutionType.Remove);
-	problem.addSolution(s);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.openstreetmap.josm.plugins.fixAddresses.OSMEntityBase#toString()
-     */
+    CheckParameterUtil.ensureParameterNotNull(problem, "problem");
+
+    AddressSolution s = new AddressSolution(tr("Remove all address tags"),
+        AddressActions.getRemoveTagsAction(), SolutionType.Remove);
+    problem.addSolution(s);
+    }
+
     @Override
     public String toString() {
-	return OSMAddress.getFormatString(this);
+    return OSMAddress.getFormatString(this);
     }
 
@@ -838,15 +796,15 @@
      */
     public static String getFormatString(OSMAddress node) {
-	// TODO: Add further countries here
-	// DE
-	String guessed = node.getGuessedStreetName();
-	String sName = node.getStreetName();
-	if (!StringUtils.isNullOrEmpty(guessed) && MISSING_TAG.equals(sName)) {
-	    sName = String.format("(%s)", guessed);
-	}
-
-	return String.format("%s %s, %s-%s %s (%s) ", sName,
-		node.getHouseNumber(), node.getCountry(), node.getPostalCode(),
-		node.getCity(), node.getState());
+    // TODO: Add further countries here
+    // DE
+    String guessed = node.getGuessedStreetName();
+    String sName = node.getStreetName();
+    if (!StringUtils.isNullOrEmpty(guessed) && MISSING_TAG.equals(sName)) {
+        sName = String.format("(%s)", guessed);
+    }
+
+    return String.format("%s %s, %s-%s %s (%s) ", sName,
+        node.getHouseNumber(), node.getCountry(), node.getPostalCode(),
+        node.getCity(), node.getState());
     }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMEntityBase.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMEntityBase.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMEntityBase.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -39,200 +27,185 @@
  */
 public class OSMEntityBase implements IOSMEntity, Comparable<IOSMEntity> {
-	public static final String ANONYMOUS = tr("No name");
-	private static List<IAddressEditContainerListener> containerListeners = new ArrayList<IAddressEditContainerListener>();
-	private List<ICommandListener> cmdListeners = new ArrayList<ICommandListener>();
-
-	protected OsmPrimitive osmObject;
-
-	/**
-	 * @param osmObject
-	 */
-	public OSMEntityBase(OsmPrimitive osmObject) {
-		super();
-		this.osmObject = osmObject;
-	}
-
-	/**
-	 * @param osmObject the osmObject to set
-	 */
-	protected void setOsmObject(OsmPrimitive osmObject) {
-		CheckParameterUtil.ensureParameterNotNull(osmObject, "osmObject");
-		this.osmObject = osmObject;
-	}
-
-	/**
-	 * Adds a change listener.
-	 * @param listener
-	 */
-	public static void addChangedListener(IAddressEditContainerListener listener) {
-		CheckParameterUtil.ensureParameterNotNull(listener, "listener");
-		containerListeners.add(listener);
-	}
-
-	/**
-	 * Removes a change listener.
-	 * @param listener
-	 */
-	public static void removeChangedListener(IAddressEditContainerListener listener) {
-		CheckParameterUtil.ensureParameterNotNull(listener, "listener");
-		containerListeners.remove(listener);
-	}
-
-	/**
-	 * Notifies clients that the address container changed.
-	 */
-	protected static void fireEntityChanged(IOSMEntity entity) {
-		CheckParameterUtil.ensureParameterNotNull(entity, "entity");
-		for (IAddressEditContainerListener listener : containerListeners) {
-			listener.entityChanged(entity);
-		}
-	}
-
-	/**
-	 * Adds a command listener.
-	 * @param listener
-	 */
-	public void addCommandListener(ICommandListener listener) {
-		CheckParameterUtil.ensureParameterNotNull(listener, "listener");
-		cmdListeners.add(listener);
-	}
-
-	/**
-	 * Removes a command listener.
-	 * @param listener
-	 */
-	public void removeCommandListener(ICommandListener listener) {
-		CheckParameterUtil.ensureParameterNotNull(listener, "listener");
-		cmdListeners.remove(listener);
-	}
-
-	/**
-	 * Notifies clients that an entity has issued a command.
-	 *
-	 * @param source the entity that issued the command.
-	 * @param command the command to execute.
-	 */
-	protected void fireCommandIssued(Command command) {
-		CheckParameterUtil.ensureParameterNotNull(command, "command");
-		if (cmdListeners.size() == 0) {
-			throw new RuntimeException("Object has no TX context: " + this);
-		}
-
-		for (ICommandListener l : cmdListeners) {
-			l.commandIssued(this, command);
-		}
-	}
-
-	public OsmPrimitive getOsmObject() {
-		return osmObject;
-	}
-
-	@Override
-	public List<IOSMEntity> getChildren() {
-		return null;
-	}
-
-	@Override
-	/**
-	 * Gets the name of the street or ANONYMOUS, if street has no name.
-	 * @return
-	 */
-	public String getName() {
-		if (TagUtils.hasNameTag(osmObject)) {
-			return  TagUtils.getNameValue(osmObject);
-		}
-		return "";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.INodeEntity#hasName()
-	 */
-	@Override
-	public boolean hasName() {
-		return TagUtils.hasNameTag(osmObject);
-	}
-
-	/**
-	 * Internal helper method which changes the given property and
-	 * puts the appropriate command {@link src.org.openstreetmap.josm.command.Command}
-	 * into the undo/redo queue.
-	 * @param tag The tag to change.
-	 * @param newValue The new value for the tag.
-	 * @param cmd The surrounding command sequence
-	 */
-	protected void setOSMTag(String tag, String newValue) {
-		CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-		
-
-		if (osmObject != null) {
-		    	String existingValue = osmObject.get(tag);
-		    	// Bugfix #9047: Keep existing values
-		    	if (!StringUtils.isNullOrEmpty(existingValue)) {
-		    	    return;
-		    	}
-		    	
-			if ((osmObject.hasKey(tag) && newValue == null) || newValue != null) {
-				fireCommandIssued(new ChangePropertyCommand(osmObject, tag, newValue));
-				fireEntityChanged(this);
-			}
-		}
-	}
-
-	/**
-	 * Removes the given tag from the OSM object.
-	 *
-	 * @param tag the tag
-	 */
-	protected void removeOSMTag(String tag) {
-		CheckParameterUtil.ensureParameterNotNull(tag, "tag");
-		setOSMTag(tag, null); // a value of null removes the tag
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		if (hasName()) {
-			return this.getClass().getName() + ": " + getName();
-		}
-		return this.getClass().getName() + ": " + ANONYMOUS;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Comparable#compareTo(java.lang.Object)
-	 */
-	@Override
-	public int compareTo(IOSMEntity o) {
-		if (o == null || !(o instanceof OSMEntityBase)) return -1;
-		return this.getName().compareTo(o.getName());
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity#visit(org.openstreetmap.josm.plugins.fixAddresses.IAllKnowingTrashHeap, org.openstreetmap.josm.plugins.fixAddresses.IProblemVisitor)
-	 */
-	@Override
-	public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor) {
-		// do nothing
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity#getCoor()
-	 */
-	@Override
-	public LatLon getCoor() {
-		OsmPrimitive osm = getOsmObject();
-		if (osm == null) return null;
-
-		if (osm instanceof Node) {
-			return ((Node)osm).getCoor();
-		// way: return center
-		} else if (osm instanceof Way) {
-			Way w = (Way) osm;
-			BBox bb = w.getBBox();
-			return bb.getBottomRight().getCenter(bb.getTopLeft());
-		}
-		// relations??
-		return null;
-	}
+    public static final String ANONYMOUS = tr("No name");
+    private static List<IAddressEditContainerListener> containerListeners = new ArrayList<IAddressEditContainerListener>();
+    private List<ICommandListener> cmdListeners = new ArrayList<ICommandListener>();
+
+    protected OsmPrimitive osmObject;
+
+    /**
+     * @param osmObject
+     */
+    public OSMEntityBase(OsmPrimitive osmObject) {
+        super();
+        this.osmObject = osmObject;
+    }
+
+    /**
+     * @param osmObject the osmObject to set
+     */
+    protected void setOsmObject(OsmPrimitive osmObject) {
+        CheckParameterUtil.ensureParameterNotNull(osmObject, "osmObject");
+        this.osmObject = osmObject;
+    }
+
+    /**
+     * Adds a change listener.
+     * @param listener
+     */
+    public static void addChangedListener(IAddressEditContainerListener listener) {
+        CheckParameterUtil.ensureParameterNotNull(listener, "listener");
+        containerListeners.add(listener);
+    }
+
+    /**
+     * Removes a change listener.
+     * @param listener
+     */
+    public static void removeChangedListener(IAddressEditContainerListener listener) {
+        CheckParameterUtil.ensureParameterNotNull(listener, "listener");
+        containerListeners.remove(listener);
+    }
+
+    /**
+     * Notifies clients that the address container changed.
+     */
+    protected static void fireEntityChanged(IOSMEntity entity) {
+        CheckParameterUtil.ensureParameterNotNull(entity, "entity");
+        for (IAddressEditContainerListener listener : containerListeners) {
+            listener.entityChanged(entity);
+        }
+    }
+
+    /**
+     * Adds a command listener.
+     * @param listener
+     */
+    public void addCommandListener(ICommandListener listener) {
+        CheckParameterUtil.ensureParameterNotNull(listener, "listener");
+        cmdListeners.add(listener);
+    }
+
+    /**
+     * Removes a command listener.
+     * @param listener
+     */
+    public void removeCommandListener(ICommandListener listener) {
+        CheckParameterUtil.ensureParameterNotNull(listener, "listener");
+        cmdListeners.remove(listener);
+    }
+
+    /**
+     * Notifies clients that an entity has issued a command.
+     *
+     * @param source the entity that issued the command.
+     * @param command the command to execute.
+     */
+    protected void fireCommandIssued(Command command) {
+        CheckParameterUtil.ensureParameterNotNull(command, "command");
+        if (cmdListeners.size() == 0) {
+            throw new RuntimeException("Object has no TX context: " + this);
+        }
+
+        for (ICommandListener l : cmdListeners) {
+            l.commandIssued(this, command);
+        }
+    }
+
+    public OsmPrimitive getOsmObject() {
+        return osmObject;
+    }
+
+    @Override
+    public List<IOSMEntity> getChildren() {
+        return null;
+    }
+
+    @Override
+    /**
+     * Gets the name of the street or ANONYMOUS, if street has no name.
+     * @return
+     */
+    public String getName() {
+        if (TagUtils.hasNameTag(osmObject)) {
+            return  TagUtils.getNameValue(osmObject);
+        }
+        return "";
+    }
+
+    @Override
+    public boolean hasName() {
+        return TagUtils.hasNameTag(osmObject);
+    }
+
+    /**
+     * Internal helper method which changes the given property and
+     * puts the appropriate command {@link src.org.openstreetmap.josm.command.Command}
+     * into the undo/redo queue.
+     * @param tag The tag to change.
+     * @param newValue The new value for the tag.
+     * @param cmd The surrounding command sequence
+     */
+    protected void setOSMTag(String tag, String newValue) {
+        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+        
+
+        if (osmObject != null) {
+                String existingValue = osmObject.get(tag);
+                // Bugfix #9047: Keep existing values
+                if (!StringUtils.isNullOrEmpty(existingValue)) {
+                    return;
+                }
+                
+            if ((osmObject.hasKey(tag) && newValue == null) || newValue != null) {
+                fireCommandIssued(new ChangePropertyCommand(osmObject, tag, newValue));
+                fireEntityChanged(this);
+            }
+        }
+    }
+
+    /**
+     * Removes the given tag from the OSM object.
+     *
+     * @param tag the tag
+     */
+    protected void removeOSMTag(String tag) {
+        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
+        setOSMTag(tag, null); // a value of null removes the tag
+    }
+
+    @Override
+    public String toString() {
+        if (hasName()) {
+            return this.getClass().getName() + ": " + getName();
+        }
+        return this.getClass().getName() + ": " + ANONYMOUS;
+    }
+
+    @Override
+    public int compareTo(IOSMEntity o) {
+        if (o == null || !(o instanceof OSMEntityBase)) return -1;
+        return this.getName().compareTo(o.getName());
+    }
+
+    @Override
+    public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor) {
+        // do nothing
+    }
+
+    @Override
+    public LatLon getCoor() {
+        OsmPrimitive osm = getOsmObject();
+        if (osm == null) return null;
+
+        if (osm instanceof Node) {
+            return ((Node)osm).getCoor();
+        // way: return center
+        } else if (osm instanceof Way) {
+            Way w = (Way) osm;
+            BBox bb = w.getBBox();
+            return bb.getBottomRight().getCenter(bb.getTopLeft());
+        }
+        // relations??
+        return null;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreet.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreet.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreet.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -28,164 +16,160 @@
  */
 public class OSMStreet extends OSMEntityBase {
-	private List<IOSMEntity> children;
-	private List<OSMAddress> addresses;
+    private List<IOSMEntity> children;
+    private List<OSMAddress> addresses;
 
-	/**
-	 * @param osmPrimitive
-	 */
-	public OSMStreet(OsmPrimitive osmPrimitive) {
-		super(osmPrimitive);
-	}
+    /**
+     * @param osmPrimitive
+     */
+    public OSMStreet(OsmPrimitive osmPrimitive) {
+        super(osmPrimitive);
+    }
 
-	public List<IOSMEntity> getChildren() {
-		return children;
-	}
+    public List<IOSMEntity> getChildren() {
+        return children;
+    }
 
-	/**
-	 * Adds a street segment to the street node.
-	 * @param segment
-	 */
-	public void addStreetSegment(OSMStreetSegment segment) {
-		lazyCreateChildren();
+    /**
+     * Adds a street segment to the street node.
+     * @param segment
+     */
+    public void addStreetSegment(OSMStreetSegment segment) {
+        lazyCreateChildren();
 
-		children.add(segment);
-		Collections.sort(children);
-	}
+        children.add(segment);
+        Collections.sort(children);
+    }
 
-	/**
-	 * Lazy creation of children list.
-	 */
-	private void lazyCreateChildren() {
-		if (children == null) {
-			children = new ArrayList<IOSMEntity>();
-		}
-	}
+    /**
+     * Lazy creation of children list.
+     */
+    private void lazyCreateChildren() {
+        if (children == null) {
+            children = new ArrayList<IOSMEntity>();
+        }
+    }
 
-	/**
-	 * Adds an associated address to the street.
-	 *
-	 * @param aNode the address node to add
-	 */
-	public void addAddress(OSMAddress aNode) {
-		lazyCreateAddresses();
-		addresses.add(aNode);
-	}
+    /**
+     * Adds an associated address to the street.
+     *
+     * @param aNode the address node to add
+     */
+    public void addAddress(OSMAddress aNode) {
+        lazyCreateAddresses();
+        addresses.add(aNode);
+    }
 
-	/**
-	 * Lazy creation of address list.
-	 */
-	private void lazyCreateAddresses() {
-		if (addresses == null) {
-			addresses = new ArrayList<OSMAddress>();
-		}
-	}
+    /**
+     * Lazy creation of address list.
+     */
+    private void lazyCreateAddresses() {
+        if (addresses == null) {
+            addresses = new ArrayList<OSMAddress>();
+        }
+    }
 
-	/**
-	 * Checks for addresses.
-	 *
-	 * @return true, if street has one or more associated addresses.
-	 */
-	public boolean hasAddresses() {
-		return addresses != null && addresses.size() > 0;
-	}
+    /**
+     * Checks for addresses.
+     *
+     * @return true, if street has one or more associated addresses.
+     */
+    public boolean hasAddresses() {
+        return addresses != null && addresses.size() > 0;
+    }
 
-	public List<OSMAddress> getAddresses() {
-		return addresses;
-	}
+    public List<OSMAddress> getAddresses() {
+        return addresses;
+    }
 
-	public void setAddresses(List<OSMAddress> addresses) {
-		this.addresses = addresses;
-	}
+    public void setAddresses(List<OSMAddress> addresses) {
+        this.addresses = addresses;
+    }
 
-	/**
-	 * Gets the number of addresses associated with this street.
-	 * @return
-	 */
-	public int getNumberOfAddresses() {
-		if (addresses == null) return 0;
+    /**
+     * Gets the number of addresses associated with this street.
+     * @return
+     */
+    public int getNumberOfAddresses() {
+        if (addresses == null) return 0;
 
-		return addresses.size();
-	}
+        return addresses.size();
+    }
 
-	/**
-	 * Gets the number of street segments of this street.
-	 * @return
-	 */
-	public int getNumberOfSegments() {
-		if (children == null) return 0;
+    /**
+     * Gets the number of street segments of this street.
+     * @return
+     */
+    public int getNumberOfSegments() {
+        if (children == null) return 0;
 
-		int sc = 0;
-		for (IOSMEntity node : children) {
-			if (node instanceof OSMStreetSegment) {
-				sc++;
-			}
-		}
-		return sc;
-	}
+        int sc = 0;
+        for (IOSMEntity node : children) {
+            if (node instanceof OSMStreetSegment) {
+                sc++;
+            }
+        }
+        return sc;
+    }
 
-	/**
-	 * Gets the road type(s) of this street. If the street has different types,
-	 * they are separated by comma.
-	 * @return
-	 */
-	public String getType() {
-		List<String> types = new ArrayList<String>();
+    /**
+     * Gets the road type(s) of this street. If the street has different types,
+     * they are separated by comma.
+     * @return
+     */
+    public String getType() {
+        List<String> types = new ArrayList<String>();
 
-		for (IOSMEntity seg : getChildren()) {
-			OsmPrimitive osmPrim = seg.getOsmObject();
-			if (TagUtils.hasHighwayTag(osmPrim)) {
-				String val = osmPrim.get(TagUtils.HIGHWAY_TAG);
-				if (!types.contains(val)) {
-					types.add(val);
-				}
-			}
-		}
+        for (IOSMEntity seg : getChildren()) {
+            OsmPrimitive osmPrim = seg.getOsmObject();
+            if (TagUtils.hasHighwayTag(osmPrim)) {
+                String val = osmPrim.get(TagUtils.HIGHWAY_TAG);
+                if (!types.contains(val)) {
+                    types.add(val);
+                }
+            }
+        }
 
-		StringBuffer sb = new StringBuffer(20);
-		for (String string : types) {
-			if (sb.length() > 0) {
-				sb.append(", ");
-			}
-			sb.append(string);
+        StringBuffer sb = new StringBuffer(20);
+        for (String string : types) {
+            if (sb.length() > 0) {
+                sb.append(", ");
+            }
+            sb.append(string);
 
-		}
-		return sb.toString();
-	}
+        }
+        return sb.toString();
+    }
 
-	/**
-	 * Checks if the attached way has an associated street relation.
-	 *
-	 * @return true, if this street has an "associatedStreet" relation.
-	 */
-	public boolean hasAssociatedStreetRelation() {
-		OsmPrimitive osm = getOsmObject();
-		for (OsmPrimitive refs : osm.getReferrers()) {
-			if (refs instanceof Relation) {
-				Relation rel = (Relation) refs;
-				if (TagUtils.isAssociatedStreetRelation(rel)) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
+    /**
+     * Checks if the attached way has an associated street relation.
+     *
+     * @return true, if this street has an "associatedStreet" relation.
+     */
+    public boolean hasAssociatedStreetRelation() {
+        OsmPrimitive osm = getOsmObject();
+        for (OsmPrimitive refs : osm.getReferrers()) {
+            if (refs instanceof Relation) {
+                Relation rel = (Relation) refs;
+                if (TagUtils.isAssociatedStreetRelation(rel)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.NodeEntityBase#toString()
-	 */
-	@Override
-	public String toString() {
-		StringBuffer sb = new StringBuffer(getName());
+    @Override
+    public String toString() {
+        StringBuffer sb = new StringBuffer(getName());
 
-		if (children != null) {
-			sb.append(String.format(", %d segments", children.size()));
-		}
+        if (children != null) {
+            sb.append(String.format(", %d segments", children.size()));
+        }
 
-		if (addresses != null) {
-			sb.append(String.format(", %d address entries", addresses.size()));
-		}
+        if (addresses != null) {
+            sb.append(String.format(", %d address entries", addresses.size()));
+        }
 
-		return sb.toString();
-	}
-
+        return sb.toString();
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreetSegment.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreetSegment.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreetSegment.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -25,15 +13,13 @@
  *
  */
-
 public class OSMStreetSegment extends OSMEntityBase {
 
-	public OSMStreetSegment(OsmPrimitive osmObject) {
-		super(osmObject);
-	}
+    public OSMStreetSegment(OsmPrimitive osmObject) {
+        super(osmObject);
+    }
 
-	@Override
-	public List<IOSMEntity> getChildren() {
-		return null;
-	}
-
+    @Override
+    public List<IOSMEntity> getChildren() {
+        return null;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmFactory.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmFactory.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmFactory.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -20,60 +8,60 @@
 
 public class OsmFactory {
-	private static HashMap<String, OSMAddress> addressCache = new HashMap<String, OSMAddress>();
+    private static HashMap<String, OSMAddress> addressCache = new HashMap<String, OSMAddress>();
 
-	/**
-	 * Creates an address node from an OSM node, if possible.
-	 * @param node
-	 * @return
-	 */
-	public static OSMAddress createNode(Node node) {
-		if (TagUtils.isAddress(node)) {
-			String aid = "" + node.getId();
+    /**
+     * Creates an address node from an OSM node, if possible.
+     * @param node
+     * @return
+     */
+    public static OSMAddress createNode(Node node) {
+        if (TagUtils.isAddress(node)) {
+            String aid = "" + node.getId();
 
-			OSMAddress aNode = lookup(aid);
-			if (aNode == null) {
-				aNode = new OSMAddress(node);
-				addressCache.put(aid, aNode);
-			} else {
-				aNode.setOsmObject(node);
-			}
-			return aNode;
-		}
+            OSMAddress aNode = lookup(aid);
+            if (aNode == null) {
+                aNode = new OSMAddress(node);
+                addressCache.put(aid, aNode);
+            } else {
+                aNode.setOsmObject(node);
+            }
+            return aNode;
+        }
 
-		return null;
-	}
+        return null;
+    }
 
-	/**
-	 * Creates an node entity from an OSM way, if possible.
-	 * @param way
-	 * @return The new node instance or null; if given way is inappropriate.
-	 */
-	public static IOSMEntity createNodeFromWay(Way way) {
-		if (TagUtils.hasHighwayTag(way)) {
-			return new OSMStreetSegment(way);
-		}
+    /**
+     * Creates an node entity from an OSM way, if possible.
+     * @param way
+     * @return The new node instance or null; if given way is inappropriate.
+     */
+    public static IOSMEntity createNodeFromWay(Way way) {
+        if (TagUtils.hasHighwayTag(way)) {
+            return new OSMStreetSegment(way);
+        }
 
-		// Check for building with address
-		if (way.isClosed() && TagUtils.hasBuildingTag(way)  && TagUtils.isAddress(way)) {
-			String aid = "" + way.getId();
+        // Check for building with address
+        if (way.isClosed() && TagUtils.hasBuildingTag(way)  && TagUtils.isAddress(way)) {
+            String aid = "" + way.getId();
 
-			OSMAddress aNode = lookup(aid);
-			if (aNode == null) {
-				aNode = new OSMAddress(way);
-				addressCache.put(aid, aNode);
-			} else {
-				aNode.setOsmObject(way);
-			}
+            OSMAddress aNode = lookup(aid);
+            if (aNode == null) {
+                aNode = new OSMAddress(way);
+                addressCache.put(aid, aNode);
+            } else {
+                aNode.setOsmObject(way);
+            }
 
-			return aNode;
-		}
-		return null;
-	}
+            return aNode;
+        }
+        return null;
+    }
 
-	private static OSMAddress lookup(String aid) {
-		if (addressCache.containsKey(aid)) {
-			return addressCache.get(aid);
-		}
-		return null;
-	}
+    private static OSMAddress lookup(String aid) {
+        if (addressCache.containsKey(aid)) {
+            return addressCache.get(aid);
+        }
+        return null;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -35,214 +23,214 @@
 public class OsmUtils {
 
-	/**
-	 * Instantiates a new osm utils.
-	 */
-	private OsmUtils() {}
-
-	/** The cached locale. */
-	private static String cachedLocale = null;
-
-	/**
-	 * Gets the minimum distance of single coordinate to a way.
-	 *
-	 * @param coor the coordinate to get the minimum distance for.
-	 * @param w the w the way to compare against
-	 * @return the minimum distance between the given coordinate and the way
-	 */
-	public static double getMinimumDistanceToWay(LatLon coor, Way w) {
-		if (coor == null || w == null) return Double.POSITIVE_INFINITY;
-
-		double minDist = Double.MAX_VALUE;
-		List<Pair<Node,Node>> x = w.getNodePairs(true);
-
-		for (Pair<Node, Node> pair : x) {
-			LatLon ap = pair.a.getCoor();
-			LatLon bp = pair.b.getCoor();
-
-			double dist = findMinimum(ap, bp, coor);
-			if (dist < minDist) {
-				minDist = dist;
-			}
-		}
-		return minDist;
-	}
-
-	/**
-	 * Find the minimum distance between a point and two way coordinates recursively.
-	 *
-	 * @param a the a the first way point coordinate
-	 * @param b the b the second way point coordinate
-	 * @param c the c the node coordinate
-	 * @return the double the minimum distance in m of the way and the node
-	 */
-	private static double findMinimum(LatLon a, LatLon b, LatLon c) {
-		CheckParameterUtil.ensureParameterNotNull(c, "c");
-		CheckParameterUtil.ensureParameterNotNull(b, "b");
-		CheckParameterUtil.ensureParameterNotNull(a, "a");
-
-		LatLon mid = new LatLon((a.lat() + b.lat()) / 2, (a.lon() + b.lon()) / 2);
-
-		double ac = a.greatCircleDistance(c);
-		double bc = b.greatCircleDistance(c);
-		double mc = mid.greatCircleDistance(c);
-
-		double min = Math.min(Math.min(ac, mc), bc);
-
-
-		if (min < 5.0) { // close enough?
-			return min;
-		}
-
-		if (mc < ac && mc < bc) {
-			// mid point has lower distance than a and b
-			if (ac > bc) { // recurse
-				return findMinimum(b, mid, c);
-			} else {
-				return findMinimum(a, mid, c);
-			}
-		} else { // mid point is not closer than a or b
-			return Math.min(ac, bc);
-		}
-	}
-
-	/**
-	 * Checks, if the given address has a relation hosting the address values. This method looks
-	 * for a relation of type 'associatedStreet' and checks the members for address values, if present.
-	 * If the member has address values, this methods sets the derived properties of the address
-	 * node accordingly.
-	 *
-	 * @param address The address to check.
-	 * @return true, if an associated relation has been found.
-	 */
-	public static boolean getValuesFromRelation(OSMAddress address) {
-		if (address == null) {
-			return false;
-		}
-
-		boolean hasValuesFromRel = false; /* true, if we applied some address props from the relation */
-		OsmPrimitive addrNode = address.getOsmObject();
-
-		// check all referrers of the node
-		for (OsmPrimitive osm : addrNode.getReferrers()) {
-			if (osm instanceof Relation) {
-				Relation r = (Relation) osm;
-				// Relation has the right type?
-				if (!TagUtils.isAssociatedStreetRelation(r)) continue;
-
-				// check for 'street' members
-				for (RelationMember rm : r.getMembers()) {
-					if (TagUtils.isStreetMember(rm)) {
-						OsmPrimitive street = rm.getMember();
-						if (TagUtils.hasHighwayTag(street)) {
-							String streetName = TagUtils.getNameValue(street);
-							if (!StringUtils.isNullOrEmpty(streetName)) {
-								// street name found -> set property
-								address.setDerivedValue(TagUtils.ADDR_STREET_TAG, streetName);
-								hasValuesFromRel = true;
-								break;
-							} // else: Street has no name: Ooops
-						} // else: Street member, but no highway tag: Ooops
-					}
-				}
-
-				// Check for other address properties
-				if (TagUtils.hasAddrCityTag(r)) { // city
-					address.setDerivedValue(TagUtils.ADDR_CITY_TAG, TagUtils.getAddrCityValue(r));
-					hasValuesFromRel = true;
-				}
-				if (TagUtils.hasAddrCountryTag(r)) { // country
-					address.setDerivedValue(TagUtils.ADDR_COUNTRY_TAG, TagUtils.getAddrCountryValue(r));
-					hasValuesFromRel = true;
-				}
-				if (TagUtils.hasAddrPostcodeTag(r)) { // postcode
-					address.setDerivedValue(TagUtils.ADDR_POSTCODE_TAG, TagUtils.getAddrPostcodeValue(r));
-					hasValuesFromRel = true;
-				}
-			}
-		}
-		return hasValuesFromRel;
-	}
-
-	/**
-	 * Gets the tag values from an address interpolation ref, if present.
-	 *
-	 * @param address The address
-	 * @return true, if house numbers are given via address interpolation; otherwise false.
-	 */
-	public static boolean getValuesFromAddressInterpolation(OSMAddress address) {
-		if (address == null) return false;
-
-		OsmPrimitive osmAddr = address.getOsmObject();
-
-		for (OsmPrimitive osm : osmAddr.getReferrers()) {
-			if (osm instanceof Way) {
-				Way w = (Way) osm;
-				if (TagUtils.hasAddrInterpolationTag(w)) {
-					applyDerivedValue(address, w, TagUtils.ADDR_POSTCODE_TAG);
-					applyDerivedValue(address, w, TagUtils.ADDR_CITY_TAG);
-					applyDerivedValue(address, w, TagUtils.ADDR_COUNTRY_TAG);
-					applyDerivedValue(address, w, TagUtils.ADDR_STREET_TAG);
-					applyDerivedValue(address, w, TagUtils.ADDR_STATE_TAG);
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * Gets the local code as string.
-	 *
-	 * @return the string representation of the local.
-	 */
-	public static String getLocale() {
-		// Check if user could prefer imperial system
-		if (cachedLocale == null) {
-			Locale l = Locale.getDefault();
-			cachedLocale = l.toString();
-		}
-		return cachedLocale;
-	}
-
-	/**
-	 * Zooms to the given addresses.
-	 *
-	 * @param addressList the address list
-	 */
-	public static void zoomAddresses(List<OSMAddress> addressList) {
-		CheckParameterUtil.ensureParameterNotNull(addressList, "addressList");
-
-		if (Main.map == null && Main.map.mapView == null) return;   // nothing to do
-		if (addressList.size() == 0) return;                        // dto.
-
-		// compute bounding box
-		BoundingXYVisitor bbox = new BoundingXYVisitor();
-		for (OSMAddress source : addressList) {
-			OsmPrimitive osm = source.getOsmObject();
-			Bounds b = new Bounds(osm.getBBox().getTopLeft(), osm.getBBox().getBottomRight());
-			bbox.visit(b);
-		}
-
-		if (bbox.getBounds() != null) {
-			//  zoom to calculated bounding box
-			Main.map.mapView.zoomTo(bbox.getBounds());
-		}
-	}
-
-	/**
-	 * Helper method to set a derived value of an address node.
-	 *
-	 * @param address The address to change
-	 * @param w the way containing the tag for the derived value.
-	 * @param tag the tag to set as applied value.
-	 */
-	private static void applyDerivedValue(OSMAddress address, Way w, String tag) {
-		CheckParameterUtil.ensureParameterNotNull(address, "address");
-		CheckParameterUtil.ensureParameterNotNull(w, "way");
-
-		if (!address.hasTag(tag) && TagUtils.hasTag(w, tag)) {
-			address.setDerivedValue(tag, w.get(tag));
-		}
-	}
+    /**
+     * Instantiates a new osm utils.
+     */
+    private OsmUtils() {}
+
+    /** The cached locale. */
+    private static String cachedLocale = null;
+
+    /**
+     * Gets the minimum distance of single coordinate to a way.
+     *
+     * @param coor the coordinate to get the minimum distance for.
+     * @param w the w the way to compare against
+     * @return the minimum distance between the given coordinate and the way
+     */
+    public static double getMinimumDistanceToWay(LatLon coor, Way w) {
+        if (coor == null || w == null) return Double.POSITIVE_INFINITY;
+
+        double minDist = Double.MAX_VALUE;
+        List<Pair<Node,Node>> x = w.getNodePairs(true);
+
+        for (Pair<Node, Node> pair : x) {
+            LatLon ap = pair.a.getCoor();
+            LatLon bp = pair.b.getCoor();
+
+            double dist = findMinimum(ap, bp, coor);
+            if (dist < minDist) {
+                minDist = dist;
+            }
+        }
+        return minDist;
+    }
+
+    /**
+     * Find the minimum distance between a point and two way coordinates recursively.
+     *
+     * @param a the a the first way point coordinate
+     * @param b the b the second way point coordinate
+     * @param c the c the node coordinate
+     * @return the double the minimum distance in m of the way and the node
+     */
+    private static double findMinimum(LatLon a, LatLon b, LatLon c) {
+        CheckParameterUtil.ensureParameterNotNull(c, "c");
+        CheckParameterUtil.ensureParameterNotNull(b, "b");
+        CheckParameterUtil.ensureParameterNotNull(a, "a");
+
+        LatLon mid = new LatLon((a.lat() + b.lat()) / 2, (a.lon() + b.lon()) / 2);
+
+        double ac = a.greatCircleDistance(c);
+        double bc = b.greatCircleDistance(c);
+        double mc = mid.greatCircleDistance(c);
+
+        double min = Math.min(Math.min(ac, mc), bc);
+
+
+        if (min < 5.0) { // close enough?
+            return min;
+        }
+
+        if (mc < ac && mc < bc) {
+            // mid point has lower distance than a and b
+            if (ac > bc) { // recurse
+                return findMinimum(b, mid, c);
+            } else {
+                return findMinimum(a, mid, c);
+            }
+        } else { // mid point is not closer than a or b
+            return Math.min(ac, bc);
+        }
+    }
+
+    /**
+     * Checks, if the given address has a relation hosting the address values. This method looks
+     * for a relation of type 'associatedStreet' and checks the members for address values, if present.
+     * If the member has address values, this methods sets the derived properties of the address
+     * node accordingly.
+     *
+     * @param address The address to check.
+     * @return true, if an associated relation has been found.
+     */
+    public static boolean getValuesFromRelation(OSMAddress address) {
+        if (address == null) {
+            return false;
+        }
+
+        boolean hasValuesFromRel = false; /* true, if we applied some address props from the relation */
+        OsmPrimitive addrNode = address.getOsmObject();
+
+        // check all referrers of the node
+        for (OsmPrimitive osm : addrNode.getReferrers()) {
+            if (osm instanceof Relation) {
+                Relation r = (Relation) osm;
+                // Relation has the right type?
+                if (!TagUtils.isAssociatedStreetRelation(r)) continue;
+
+                // check for 'street' members
+                for (RelationMember rm : r.getMembers()) {
+                    if (TagUtils.isStreetMember(rm)) {
+                        OsmPrimitive street = rm.getMember();
+                        if (TagUtils.hasHighwayTag(street)) {
+                            String streetName = TagUtils.getNameValue(street);
+                            if (!StringUtils.isNullOrEmpty(streetName)) {
+                                // street name found -> set property
+                                address.setDerivedValue(TagUtils.ADDR_STREET_TAG, streetName);
+                                hasValuesFromRel = true;
+                                break;
+                            } // else: Street has no name: Ooops
+                        } // else: Street member, but no highway tag: Ooops
+                    }
+                }
+
+                // Check for other address properties
+                if (TagUtils.hasAddrCityTag(r)) { // city
+                    address.setDerivedValue(TagUtils.ADDR_CITY_TAG, TagUtils.getAddrCityValue(r));
+                    hasValuesFromRel = true;
+                }
+                if (TagUtils.hasAddrCountryTag(r)) { // country
+                    address.setDerivedValue(TagUtils.ADDR_COUNTRY_TAG, TagUtils.getAddrCountryValue(r));
+                    hasValuesFromRel = true;
+                }
+                if (TagUtils.hasAddrPostcodeTag(r)) { // postcode
+                    address.setDerivedValue(TagUtils.ADDR_POSTCODE_TAG, TagUtils.getAddrPostcodeValue(r));
+                    hasValuesFromRel = true;
+                }
+            }
+        }
+        return hasValuesFromRel;
+    }
+
+    /**
+     * Gets the tag values from an address interpolation ref, if present.
+     *
+     * @param address The address
+     * @return true, if house numbers are given via address interpolation; otherwise false.
+     */
+    public static boolean getValuesFromAddressInterpolation(OSMAddress address) {
+        if (address == null) return false;
+
+        OsmPrimitive osmAddr = address.getOsmObject();
+
+        for (OsmPrimitive osm : osmAddr.getReferrers()) {
+            if (osm instanceof Way) {
+                Way w = (Way) osm;
+                if (TagUtils.hasAddrInterpolationTag(w)) {
+                    applyDerivedValue(address, w, TagUtils.ADDR_POSTCODE_TAG);
+                    applyDerivedValue(address, w, TagUtils.ADDR_CITY_TAG);
+                    applyDerivedValue(address, w, TagUtils.ADDR_COUNTRY_TAG);
+                    applyDerivedValue(address, w, TagUtils.ADDR_STREET_TAG);
+                    applyDerivedValue(address, w, TagUtils.ADDR_STATE_TAG);
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Gets the local code as string.
+     *
+     * @return the string representation of the local.
+     */
+    public static String getLocale() {
+        // Check if user could prefer imperial system
+        if (cachedLocale == null) {
+            Locale l = Locale.getDefault();
+            cachedLocale = l.toString();
+        }
+        return cachedLocale;
+    }
+
+    /**
+     * Zooms to the given addresses.
+     *
+     * @param addressList the address list
+     */
+    public static void zoomAddresses(List<OSMAddress> addressList) {
+        CheckParameterUtil.ensureParameterNotNull(addressList, "addressList");
+
+        if (Main.map == null && Main.map.mapView == null) return;   // nothing to do
+        if (addressList.size() == 0) return;                        // dto.
+
+        // compute bounding box
+        BoundingXYVisitor bbox = new BoundingXYVisitor();
+        for (OSMAddress source : addressList) {
+            OsmPrimitive osm = source.getOsmObject();
+            Bounds b = new Bounds(osm.getBBox().getTopLeft(), osm.getBBox().getBottomRight());
+            bbox.visit(b);
+        }
+
+        if (bbox.getBounds() != null) {
+            //  zoom to calculated bounding box
+            Main.map.mapView.zoomTo(bbox.getBounds());
+        }
+    }
+
+    /**
+     * Helper method to set a derived value of an address node.
+     *
+     * @param address The address to change
+     * @param w the way containing the tag for the derived value.
+     * @param tag the tag to set as applied value.
+     */
+    private static void applyDerivedValue(OSMAddress address, Way w, String tag) {
+        CheckParameterUtil.ensureParameterNotNull(address, "address");
+        CheckParameterUtil.ensureParameterNotNull(w, "way");
+
+        if (!address.hasTag(tag) && TagUtils.hasTag(w, tag)) {
+            address.setDerivedValue(tag, w.get(tag));
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/PostalCodeChecker.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/PostalCodeChecker.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/PostalCodeChecker.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -23,388 +11,388 @@
  */
 public class PostalCodeChecker {
-	private static HashMap<String, String> postalCodePatternMap = new HashMap<String, String>();
-
-	static {
-		fillMap();
-	}
-
-	/**
-	 * Checks if given address has a valid postal code.
-	 *
-	 * @param address the address to check the postal code for
-	 * @return true, if postal code is valid (this implies
-	 * also that a country is NOT supported); otherwise false.
-	 */
-	public static boolean hasValidPostalCode(OSMAddress address) {
-		CheckParameterUtil.ensureParameterNotNull(address, "address");
-
-		if (!address.hasPostalCode()) {
-			return false; // no postal code available
-		}
-
-		String ctry = getCountry(address);
-		String postalCode = address.getPostalCode();
-
-		return hasValidPostalCode(ctry, postalCode);
-	}
-
-	/**
-	 * Checks if postal code is valid for the country reported by the Java VM.
-	 *
-	 * @param postalCode the postal code
-	 * @return true, if successful
-	 */
-	public static boolean hasValidPostalCode(String postalCode) {
-		return hasValidPostalCode(getCountry(), postalCode);
-	}
-
-	/**
-	 * Checks if given postal code if valid for the specified country.
-	 *
-	 * @param country the country
-	 * @param postalCode the postal code
-	 * @return true, if successful
-	 */
-	public static boolean hasValidPostalCode(String country, String postalCode) {
-		// Get country-specific pattern for postal code
-		if (postalCodePatternMap.containsKey(country)) {
-			String pattern = postalCodePatternMap.get(country);
-			// Check if postal code matches pattern
-			return postalCode.matches(pattern);
-		} else {
-			// we cannot validate; assume postal code as valid until we know better
-			return true;
-		}
-	}
-
-	/**
-	 * Checks if validation for the given country is supported.
-	 *
-	 * @param country 2-letter ISO-Code (e. g. "GB", "US", "IT") of the country to check.
-	 * @return true, if is validation supported; otherwise false
-	 */
-	public static boolean isValidationSupported(String country) {
-		CheckParameterUtil.ensureParameterNotNull(country, "country");
-		return postalCodePatternMap.containsKey(country.toUpperCase());
-	}
-
-	/**
-	 * Checks if validation for the given address is supported.
-	 *
-	 * @param address the address to check postal code validation support for.
-	 * @return true, if is validation supported; otherwise false
-	 */
-	public static boolean isValidationSupported(OSMAddress address) {
-		CheckParameterUtil.ensureParameterNotNull(address, "address");
-
-		String ctry = getCountry(address);
-		return postalCodePatternMap.containsKey(ctry);
-	}
-
-	/**
-	 * Gets the current country.
-	 *
-	 * @return the country of the Java VM.
-	 */
-	public static String getCountry() {
-		return getCountry(null);
-	}
-
-	/**
-	 * Gets the country of the given address.
-	 *
-	 * @param address the address to get the country for
-	 * @return the country of the address. If the given address has no postal code,
-	 * the default country of the Java VM is returned instead.
-	 */
-	private static String getCountry(OSMAddress address) {
-		String ctry = Locale.getDefault().getCountry();
-		if (address != null && address.hasCountry()) {
-			// If address has a country, use this one (e. g. a dutch edits UK data)
-			ctry = address.getCountry().toUpperCase();
-		}
-		return ctry;
-	}
-
-	/**
-	 * Fills the country-postal code pattern map.
-	 */
-	private static void fillMap() {
-		/*
-		String[] countries = Locale.getISOCountries();
-
-		for (int i = 0; i < countries.length; i++) {
-			System.out.println("//postalCodePatternMap.put(\"" + countries[i] + "\", \"[0-9]{5}\");");
-		}
-
-		String x = "A9999AAA";
-
-		if (x.matches("[A-Z]{1}[0-9]{4}[A-Z]{3}")) {
-			System.out.println("YES");
-		}
-
-		String xx = "99999-999";
-		// "[0-9]{5}\-[0-9]{3}"); //
-		if (xx.matches("[0-9]{5}-[0-9]{3}")) {
-			System.out.println("YES");
-		}
-
-
-		String[] xxx = new String[]{"A9 9AA", "A99 9AA", "A9A 9AA", "AA9 9AA", "AA99 9AA", "AA9A 9AA"};
-		for (int i = 0; i < xxx.length; i++) {
-			if (!xxx[i].matches("[A-Z]{1,2}[0-9]{1,2}[A-Z]? [0-9]{1}[A-Z]{2}")) {
-				System.err.println(xxx[i]);
-			}
-		}*/
-		// see http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html for country codes
-		//
-
-		//postalCodePatternMap.put("AD", "[0-9]{5}");
-		//postalCodePatternMap.put("AE", "[0-9]{5}");
-		//postalCodePatternMap.put("AF", "[0-9]{5}");
-		//postalCodePatternMap.put("AG", "[0-9]{5}");
-		//postalCodePatternMap.put("AI", "[0-9]{5}");
-		postalCodePatternMap.put("AL", "[0-9]{5}");
-		postalCodePatternMap.put("AM", "[0-9]{4}");
-		//postalCodePatternMap.put("AN", "[0-9]{5}");
-		//postalCodePatternMap.put("AO", "[0-9]{5}");
-		//postalCodePatternMap.put("AQ", "[0-9]{5}");
-		postalCodePatternMap.put("AR", "[A-Z]{1}[0-9]{4}[A-Z]{3}"); // Argentina
-		//postalCodePatternMap.put("AS", "[0-9]{5}");
-		postalCodePatternMap.put("AT", "[0-9]{4}"); // Austria
-		postalCodePatternMap.put("AU", "[0-9]{4}"); // Australia
-		//postalCodePatternMap.put("AW", "[0-9]{5}");
-		//postalCodePatternMap.put("AX", "[0-9]{5}");
-		//postalCodePatternMap.put("AZ", "[0-9]{5}");
-		//postalCodePatternMap.put("BA", "[0-9]{5}");
-		//postalCodePatternMap.put("BB", "[0-9]{5}");
-		//postalCodePatternMap.put("BD", "[0-9]{5}");
-		//postalCodePatternMap.put("BE", "[0-9]{5}");
-		//postalCodePatternMap.put("BF", "[0-9]{5}");
-		//postalCodePatternMap.put("BG", "[0-9]{5}");
-		//postalCodePatternMap.put("BH", "[0-9]{5}");
-		//postalCodePatternMap.put("BI", "[0-9]{5}");
-		//postalCodePatternMap.put("BJ", "[0-9]{5}");
-		//postalCodePatternMap.put("BL", "[0-9]{5}");
-		//postalCodePatternMap.put("BM", "[0-9]{5}");
-		//postalCodePatternMap.put("BN", "[0-9]{5}");
-		//postalCodePatternMap.put("BO", "[0-9]{5}");
-		postalCodePatternMap.put("BR", "[0-9]{5}-[0-9]{3}"); // 99999-999
-		//postalCodePatternMap.put("BS", "[0-9]{5}");
-		//postalCodePatternMap.put("BT", "[0-9]{5}");
-		//postalCodePatternMap.put("BV", "[0-9]{5}");
-		//postalCodePatternMap.put("BW", "[0-9]{5}");
-		//postalCodePatternMap.put("BY", "[0-9]{5}");
-		//postalCodePatternMap.put("BZ", "[0-9]{5}");
-		postalCodePatternMap.put("CA", "[A-Z][0-9][A-Z] [0-9][A-Z][0-9]"); // Canada A9A 9A9
-		//postalCodePatternMap.put("CC", "[0-9]{5}");
-		//postalCodePatternMap.put("CD", "[0-9]{5}");
-		//postalCodePatternMap.put("CF", "[0-9]{5}");
-		//postalCodePatternMap.put("CG", "[0-9]{5}");
-		postalCodePatternMap.put("CH", "[0-9]{4}"); // Switzerland
-		//postalCodePatternMap.put("CI", "[0-9]{5}");
-		//postalCodePatternMap.put("CK", "[0-9]{5}");
-		//postalCodePatternMap.put("CL", "[0-9]{5}");
-		//postalCodePatternMap.put("CM", "[0-9]{5}");
-		postalCodePatternMap.put("CN", "[0-9]{6}"); // China
-		//postalCodePatternMap.put("CO", "[0-9]{5}");
-		//postalCodePatternMap.put("CR", "[0-9]{5}");
-		//postalCodePatternMap.put("CS", "[0-9]{5}");
-		//postalCodePatternMap.put("CU", "[0-9]{5}");
-		//postalCodePatternMap.put("CV", "[0-9]{5}");
-		//postalCodePatternMap.put("CX", "[0-9]{5}");
-		//postalCodePatternMap.put("CY", "[0-9]{5}");
-		postalCodePatternMap.put("CZ", "[0-9]{3} [0-9]{2}"); // Czech: 999-99
-		postalCodePatternMap.put("DE", "[0-9]{5}"); // Germany
-		//postalCodePatternMap.put("DJ", "[0-9]{5}");
-		postalCodePatternMap.put("DK", "[0-9]{4}"); // Denmark
-		//postalCodePatternMap.put("DM", "[0-9]{5}");
-		//postalCodePatternMap.put("DO", "[0-9]{5}");
-		//postalCodePatternMap.put("DZ", "[0-9]{5}");
-		//postalCodePatternMap.put("EC", "[0-9]{5}");
-		postalCodePatternMap.put("EE", "[0-9]{5}"); // Estonia
-		//postalCodePatternMap.put("EG", "[0-9]{5}");
-		//postalCodePatternMap.put("EH", "[0-9]{5}");
-		//postalCodePatternMap.put("ER", "[0-9]{5}");
-		postalCodePatternMap.put("ES", "[0-9]{5}");
-		//postalCodePatternMap.put("ET", "[0-9]{5}");
-		postalCodePatternMap.put("FI", "[0-9]{5}");
-		//postalCodePatternMap.put("FJ", "[0-9]{5}");
-		//postalCodePatternMap.put("FK", "[0-9]{5}");
-		//postalCodePatternMap.put("FM", "[0-9]{5}");
-		//postalCodePatternMap.put("FO", "[0-9]{5}");
-		postalCodePatternMap.put("FR", "[0-9]{5}"); // France
-		//postalCodePatternMap.put("GA", "[0-9]{5}");
-		postalCodePatternMap.put("GB", "[A-Z]{1,2}[0-9]{1,2}[A-Z]? [0-9]{1}[A-Z]{2}"); // UK
-		//postalCodePatternMap.put("GD", "[0-9]{5}");
-		//postalCodePatternMap.put("GE", "[0-9]{5}");
-		//postalCodePatternMap.put("GF", "[0-9]{5}");
-		//postalCodePatternMap.put("GG", "[0-9]{5}");
-		//postalCodePatternMap.put("GH", "[0-9]{5}");
-		//postalCodePatternMap.put("GI", "[0-9]{5}");
-		//postalCodePatternMap.put("GL", "[0-9]{5}");
-		//postalCodePatternMap.put("GM", "[0-9]{5}");
-		//postalCodePatternMap.put("GN", "[0-9]{5}");
-		//postalCodePatternMap.put("GP", "[0-9]{5}");
-		//postalCodePatternMap.put("GQ", "[0-9]{5}");
-		postalCodePatternMap.put("GR", "[0-9]{5}"); // Greece
-		//postalCodePatternMap.put("GS", "[0-9]{5}");
-		//postalCodePatternMap.put("GT", "[0-9]{5}");
-		//postalCodePatternMap.put("GU", "[0-9]{5}");
-		//postalCodePatternMap.put("GW", "[0-9]{5}");
-		//postalCodePatternMap.put("GY", "[0-9]{5}");
-		//postalCodePatternMap.put("HK", "[0-9]{5}");
-		//postalCodePatternMap.put("HM", "[0-9]{5}");
-		//postalCodePatternMap.put("HN", "[0-9]{5}");
-		postalCodePatternMap.put("HR", "[0-9]{5}"); // Croatia (Hrvatska)
-		//postalCodePatternMap.put("HT", "[0-9]{5}");
-		postalCodePatternMap.put("HU", "[0-9]{4}"); // Hungary
-		//postalCodePatternMap.put("ID", "[0-9]{5}");
-		//postalCodePatternMap.put("IE", "[0-9]{5}");
-		postalCodePatternMap.put("IL", "[0-9]{5}");
-		//postalCodePatternMap.put("IM", "[0-9]{5}");
-		//postalCodePatternMap.put("IN", "[0-9]{5}");
-		//postalCodePatternMap.put("IO", "[0-9]{5}");
-		//postalCodePatternMap.put("IQ", "[0-9]{5}");
-		//postalCodePatternMap.put("IR", "[0-9]{5}");
-		postalCodePatternMap.put("IS", "[0-9]{3}"); // Iceland
-		postalCodePatternMap.put("IT", "[0-9]{5}"); // Italy
-		//postalCodePatternMap.put("JE", "[0-9]{5}");
-		//postalCodePatternMap.put("JM", "[0-9]{5}");
-		//postalCodePatternMap.put("JO", "[0-9]{5}");
-		postalCodePatternMap.put("JP", "[0-9]{3}-[0-9]{4}"); // Japan: 999-9999
-		//postalCodePatternMap.put("KE", "[0-9]{5}");
-		//postalCodePatternMap.put("KG", "[0-9]{5}");
-		//postalCodePatternMap.put("KH", "[0-9]{5}");
-		//postalCodePatternMap.put("KI", "[0-9]{5}");
-		//postalCodePatternMap.put("KM", "[0-9]{5}");
-		//postalCodePatternMap.put("KN", "[0-9]{5}");
-		//postalCodePatternMap.put("KP", "[0-9]{5}");
-		//postalCodePatternMap.put("KR", "[0-9]{5}");
-		//postalCodePatternMap.put("KW", "[0-9]{5}");
-		//postalCodePatternMap.put("KY", "[0-9]{5}");
-		//postalCodePatternMap.put("KZ", "[0-9]{5}");
-		postalCodePatternMap.put("LA", "[0-9]{5}");
-		//postalCodePatternMap.put("LB", "[0-9]{5}");
-		//postalCodePatternMap.put("LC", "[0-9]{5}");
-		postalCodePatternMap.put("LI", "[0-9]{4}");
-		//postalCodePatternMap.put("LK", "[0-9]{5}");
-		//postalCodePatternMap.put("LR", "[0-9]{5}");
-		//postalCodePatternMap.put("LS", "[0-9]{5}");
-		postalCodePatternMap.put("LT", "[0-9]{5}");
-		postalCodePatternMap.put("LU", "[0-9]{4}");
-		postalCodePatternMap.put("LV", "[0-9]{4}"); // Latvia
-		//postalCodePatternMap.put("LY", "[0-9]{5}");
-		//postalCodePatternMap.put("MA", "[0-9]{5}");
-		//postalCodePatternMap.put("MC", "[0-9]{5}");
-		//postalCodePatternMap.put("MD", "[0-9]{5}");
-		postalCodePatternMap.put("ME", "[0-9]{5}"); // Montenegro
-		//postalCodePatternMap.put("MF", "[0-9]{5}");
-		//postalCodePatternMap.put("MG", "[0-9]{5}");
-		//postalCodePatternMap.put("MH", "[0-9]{5}");
-		//postalCodePatternMap.put("MK", "[0-9]{5}");
-		//postalCodePatternMap.put("ML", "[0-9]{5}");
-		//postalCodePatternMap.put("MM", "[0-9]{5}");
-		//postalCodePatternMap.put("MN", "[0-9]{5}");
-		//postalCodePatternMap.put("MO", "[0-9]{5}");
-		//postalCodePatternMap.put("MP", "[0-9]{5}");
-		//postalCodePatternMap.put("MQ", "[0-9]{5}");
-		//postalCodePatternMap.put("MR", "[0-9]{5}");
-		//postalCodePatternMap.put("MS", "[0-9]{5}");
-		//postalCodePatternMap.put("MT", "[0-9]{5}");
-		//postalCodePatternMap.put("MU", "[0-9]{5}");
-		//postalCodePatternMap.put("MV", "[0-9]{5}");
-		//postalCodePatternMap.put("MW", "[0-9]{5}");
-		postalCodePatternMap.put("MX", "[0-9]{5}"); // Mexico
-		//postalCodePatternMap.put("MY", "[0-9]{5}");
-		//postalCodePatternMap.put("MZ", "[0-9]{5}");
-		//postalCodePatternMap.put("NA", "[0-9]{5}");
-		//postalCodePatternMap.put("NC", "[0-9]{5}");
-		//postalCodePatternMap.put("NE", "[0-9]{5}");
-		//postalCodePatternMap.put("NF", "[0-9]{5}");
-		//postalCodePatternMap.put("NG", "[0-9]{5}");
-		//postalCodePatternMap.put("NI", "[0-9]{5}");
-		postalCodePatternMap.put("NL", "[0-9]{4} [A-Z]{2}"); // Dutch
-		postalCodePatternMap.put("NO", "[0-9]{4}"); // Norway
-		//postalCodePatternMap.put("NP", "[0-9]{5}");
-		//postalCodePatternMap.put("NR", "[0-9]{5}");
-		//postalCodePatternMap.put("NU", "[0-9]{5}");
-		//postalCodePatternMap.put("NZ", "[0-9]{5}");
-		//postalCodePatternMap.put("OM", "[0-9]{5}");
-		//postalCodePatternMap.put("PA", "[0-9]{5}");
-		//postalCodePatternMap.put("PE", "[0-9]{5}");
-		//postalCodePatternMap.put("PF", "[0-9]{5}");
-		//postalCodePatternMap.put("PG", "[0-9]{5}");
-		//postalCodePatternMap.put("PH", "[0-9]{5}");
-		//postalCodePatternMap.put("PK", "[0-9]{5}");
-		postalCodePatternMap.put("PL", "[0-9]{2}-[0-9]{3}"); // Poland
-		//postalCodePatternMap.put("PM", "[0-9]{5}");
-		//postalCodePatternMap.put("PN", "[0-9]{5}");
-		//postalCodePatternMap.put("PR", "[0-9]{5}");
-		//postalCodePatternMap.put("PS", "[0-9]{5}");
-		postalCodePatternMap.put("PT", "[0-9]{4}-[0-9]{3}"); // Portugal
-		//postalCodePatternMap.put("PW", "[0-9]{5}");
-		//postalCodePatternMap.put("PY", "[0-9]{5}");
-		//postalCodePatternMap.put("QA", "[0-9]{5}");
-		//postalCodePatternMap.put("RE", "[0-9]{5}");
-		postalCodePatternMap.put("RO", "[0-9]{6}"); // Romania
-		//postalCodePatternMap.put("RS", "[0-9]{5}");
-		postalCodePatternMap.put("RU", "[0-9]{6}"); // Russia
-		//postalCodePatternMap.put("RW", "[0-9]{5}");
-		//postalCodePatternMap.put("SA", "[0-9]{5}");
-		//postalCodePatternMap.put("SB", "[0-9]{5}");
-		//postalCodePatternMap.put("SC", "[0-9]{5}");
-		//postalCodePatternMap.put("SD", "[0-9]{5}");
-		postalCodePatternMap.put("SE", "[0-9]{3} [0-9]{2}"); // Sweden: 999-99
-		//postalCodePatternMap.put("SG", "[0-9]{5}");
-		//postalCodePatternMap.put("SH", "[0-9]{5}");
-		postalCodePatternMap.put("SI", "[0-9]{4}");
-		//postalCodePatternMap.put("SJ", "[0-9]{5}");
-		postalCodePatternMap.put("SK", "[0-9]{3} [0-9]{2}"); // Slovakia: 999-99
-		postalCodePatternMap.put("SL", "[0-9]{4}"); // Slowenia
-		postalCodePatternMap.put("SM", "[0-9]{5}"); // san marino -> Italy
-		//postalCodePatternMap.put("SN", "[0-9]{5}");
-		//postalCodePatternMap.put("SO", "[0-9]{5}");
-		//postalCodePatternMap.put("SR", "[0-9]{5}");
-		//postalCodePatternMap.put("ST", "[0-9]{5}");
-		//postalCodePatternMap.put("SV", "[0-9]{5}");
-		//postalCodePatternMap.put("SY", "[0-9]{5}");
-		//postalCodePatternMap.put("SZ", "[0-9]{5}");
-		//postalCodePatternMap.put("TC", "[0-9]{5}");
-		//postalCodePatternMap.put("TD", "[0-9]{5}");
-		//postalCodePatternMap.put("TF", "[0-9]{5}");
-		//postalCodePatternMap.put("TG", "[0-9]{5}");
-		//postalCodePatternMap.put("TH", "[0-9]{5}");
-		//postalCodePatternMap.put("TJ", "[0-9]{5}");
-		//postalCodePatternMap.put("TK", "[0-9]{5}");
-		//postalCodePatternMap.put("TL", "[0-9]{5}");
-		//postalCodePatternMap.put("TM", "[0-9]{5}");
-		//postalCodePatternMap.put("TN", "[0-9]{5}");
-		//postalCodePatternMap.put("TO", "[0-9]{5}");
-		postalCodePatternMap.put("TR", "[0-9]{5}"); // turkye
-		//postalCodePatternMap.put("TT", "[0-9]{5}");
-		//postalCodePatternMap.put("TV", "[0-9]{5}");
-		//postalCodePatternMap.put("TW", "[0-9]{5}");
-		//postalCodePatternMap.put("TZ", "[0-9]{5}");
-		postalCodePatternMap.put("UA", "[0-9]{5}"); // Ukraine
-		//postalCodePatternMap.put("UG", "[0-9]{5}");
-		//postalCodePatternMap.put("UM", "[0-9]{5}");
-		postalCodePatternMap.put("US", "([A-Z]{2} )?[0-9]{5}"); // USA: support "99999" and "IL 99999"
-		//postalCodePatternMap.put("UY", "[0-9]{5}");
-		//postalCodePatternMap.put("UZ", "[0-9]{5}");
-		//postalCodePatternMap.put("VA", "[0-9]{5}");
-		//postalCodePatternMap.put("VC", "[0-9]{5}");
-		//postalCodePatternMap.put("VE", "[0-9]{5}");
-		//postalCodePatternMap.put("VG", "[0-9]{5}");
-		//postalCodePatternMap.put("VI", "[0-9]{5}");
-		//postalCodePatternMap.put("VN", "[0-9]{5}");
-		//postalCodePatternMap.put("VU", "[0-9]{5}");
-		//postalCodePatternMap.put("WF", "[0-9]{5}");
-		//postalCodePatternMap.put("WS", "[0-9]{5}");
-		//postalCodePatternMap.put("YE", "[0-9]{5}");
-		//postalCodePatternMap.put("YT", "[0-9]{5}");
-		//postalCodePatternMap.put("ZA", "[0-9]{5}");
-		//postalCodePatternMap.put("ZM", "[0-9]{5}");
-		//postalCodePatternMap.put("ZW", "[0-9]{5}");
-	}
+    private static HashMap<String, String> postalCodePatternMap = new HashMap<String, String>();
+
+    static {
+        fillMap();
+    }
+
+    /**
+     * Checks if given address has a valid postal code.
+     *
+     * @param address the address to check the postal code for
+     * @return true, if postal code is valid (this implies
+     * also that a country is NOT supported); otherwise false.
+     */
+    public static boolean hasValidPostalCode(OSMAddress address) {
+        CheckParameterUtil.ensureParameterNotNull(address, "address");
+
+        if (!address.hasPostalCode()) {
+            return false; // no postal code available
+        }
+
+        String ctry = getCountry(address);
+        String postalCode = address.getPostalCode();
+
+        return hasValidPostalCode(ctry, postalCode);
+    }
+
+    /**
+     * Checks if postal code is valid for the country reported by the Java VM.
+     *
+     * @param postalCode the postal code
+     * @return true, if successful
+     */
+    public static boolean hasValidPostalCode(String postalCode) {
+        return hasValidPostalCode(getCountry(), postalCode);
+    }
+
+    /**
+     * Checks if given postal code if valid for the specified country.
+     *
+     * @param country the country
+     * @param postalCode the postal code
+     * @return true, if successful
+     */
+    public static boolean hasValidPostalCode(String country, String postalCode) {
+        // Get country-specific pattern for postal code
+        if (postalCodePatternMap.containsKey(country)) {
+            String pattern = postalCodePatternMap.get(country);
+            // Check if postal code matches pattern
+            return postalCode.matches(pattern);
+        } else {
+            // we cannot validate; assume postal code as valid until we know better
+            return true;
+        }
+    }
+
+    /**
+     * Checks if validation for the given country is supported.
+     *
+     * @param country 2-letter ISO-Code (e. g. "GB", "US", "IT") of the country to check.
+     * @return true, if is validation supported; otherwise false
+     */
+    public static boolean isValidationSupported(String country) {
+        CheckParameterUtil.ensureParameterNotNull(country, "country");
+        return postalCodePatternMap.containsKey(country.toUpperCase());
+    }
+
+    /**
+     * Checks if validation for the given address is supported.
+     *
+     * @param address the address to check postal code validation support for.
+     * @return true, if is validation supported; otherwise false
+     */
+    public static boolean isValidationSupported(OSMAddress address) {
+        CheckParameterUtil.ensureParameterNotNull(address, "address");
+
+        String ctry = getCountry(address);
+        return postalCodePatternMap.containsKey(ctry);
+    }
+
+    /**
+     * Gets the current country.
+     *
+     * @return the country of the Java VM.
+     */
+    public static String getCountry() {
+        return getCountry(null);
+    }
+
+    /**
+     * Gets the country of the given address.
+     *
+     * @param address the address to get the country for
+     * @return the country of the address. If the given address has no postal code,
+     * the default country of the Java VM is returned instead.
+     */
+    private static String getCountry(OSMAddress address) {
+        String ctry = Locale.getDefault().getCountry();
+        if (address != null && address.hasCountry()) {
+            // If address has a country, use this one (e. g. a dutch edits UK data)
+            ctry = address.getCountry().toUpperCase();
+        }
+        return ctry;
+    }
+
+    /**
+     * Fills the country-postal code pattern map.
+     */
+    private static void fillMap() {
+        /*
+        String[] countries = Locale.getISOCountries();
+
+        for (int i = 0; i < countries.length; i++) {
+            System.out.println("//postalCodePatternMap.put(\"" + countries[i] + "\", \"[0-9]{5}\");");
+        }
+
+        String x = "A9999AAA";
+
+        if (x.matches("[A-Z]{1}[0-9]{4}[A-Z]{3}")) {
+            System.out.println("YES");
+        }
+
+        String xx = "99999-999";
+        // "[0-9]{5}\-[0-9]{3}"); //
+        if (xx.matches("[0-9]{5}-[0-9]{3}")) {
+            System.out.println("YES");
+        }
+
+
+        String[] xxx = new String[]{"A9 9AA", "A99 9AA", "A9A 9AA", "AA9 9AA", "AA99 9AA", "AA9A 9AA"};
+        for (int i = 0; i < xxx.length; i++) {
+            if (!xxx[i].matches("[A-Z]{1,2}[0-9]{1,2}[A-Z]? [0-9]{1}[A-Z]{2}")) {
+                System.err.println(xxx[i]);
+            }
+        }*/
+        // see http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html for country codes
+        //
+
+        //postalCodePatternMap.put("AD", "[0-9]{5}");
+        //postalCodePatternMap.put("AE", "[0-9]{5}");
+        //postalCodePatternMap.put("AF", "[0-9]{5}");
+        //postalCodePatternMap.put("AG", "[0-9]{5}");
+        //postalCodePatternMap.put("AI", "[0-9]{5}");
+        postalCodePatternMap.put("AL", "[0-9]{5}");
+        postalCodePatternMap.put("AM", "[0-9]{4}");
+        //postalCodePatternMap.put("AN", "[0-9]{5}");
+        //postalCodePatternMap.put("AO", "[0-9]{5}");
+        //postalCodePatternMap.put("AQ", "[0-9]{5}");
+        postalCodePatternMap.put("AR", "[A-Z]{1}[0-9]{4}[A-Z]{3}"); // Argentina
+        //postalCodePatternMap.put("AS", "[0-9]{5}");
+        postalCodePatternMap.put("AT", "[0-9]{4}"); // Austria
+        postalCodePatternMap.put("AU", "[0-9]{4}"); // Australia
+        //postalCodePatternMap.put("AW", "[0-9]{5}");
+        //postalCodePatternMap.put("AX", "[0-9]{5}");
+        //postalCodePatternMap.put("AZ", "[0-9]{5}");
+        //postalCodePatternMap.put("BA", "[0-9]{5}");
+        //postalCodePatternMap.put("BB", "[0-9]{5}");
+        //postalCodePatternMap.put("BD", "[0-9]{5}");
+        //postalCodePatternMap.put("BE", "[0-9]{5}");
+        //postalCodePatternMap.put("BF", "[0-9]{5}");
+        //postalCodePatternMap.put("BG", "[0-9]{5}");
+        //postalCodePatternMap.put("BH", "[0-9]{5}");
+        //postalCodePatternMap.put("BI", "[0-9]{5}");
+        //postalCodePatternMap.put("BJ", "[0-9]{5}");
+        //postalCodePatternMap.put("BL", "[0-9]{5}");
+        //postalCodePatternMap.put("BM", "[0-9]{5}");
+        //postalCodePatternMap.put("BN", "[0-9]{5}");
+        //postalCodePatternMap.put("BO", "[0-9]{5}");
+        postalCodePatternMap.put("BR", "[0-9]{5}-[0-9]{3}"); // 99999-999
+        //postalCodePatternMap.put("BS", "[0-9]{5}");
+        //postalCodePatternMap.put("BT", "[0-9]{5}");
+        //postalCodePatternMap.put("BV", "[0-9]{5}");
+        //postalCodePatternMap.put("BW", "[0-9]{5}");
+        //postalCodePatternMap.put("BY", "[0-9]{5}");
+        //postalCodePatternMap.put("BZ", "[0-9]{5}");
+        postalCodePatternMap.put("CA", "[A-Z][0-9][A-Z] [0-9][A-Z][0-9]"); // Canada A9A 9A9
+        //postalCodePatternMap.put("CC", "[0-9]{5}");
+        //postalCodePatternMap.put("CD", "[0-9]{5}");
+        //postalCodePatternMap.put("CF", "[0-9]{5}");
+        //postalCodePatternMap.put("CG", "[0-9]{5}");
+        postalCodePatternMap.put("CH", "[0-9]{4}"); // Switzerland
+        //postalCodePatternMap.put("CI", "[0-9]{5}");
+        //postalCodePatternMap.put("CK", "[0-9]{5}");
+        //postalCodePatternMap.put("CL", "[0-9]{5}");
+        //postalCodePatternMap.put("CM", "[0-9]{5}");
+        postalCodePatternMap.put("CN", "[0-9]{6}"); // China
+        //postalCodePatternMap.put("CO", "[0-9]{5}");
+        //postalCodePatternMap.put("CR", "[0-9]{5}");
+        //postalCodePatternMap.put("CS", "[0-9]{5}");
+        //postalCodePatternMap.put("CU", "[0-9]{5}");
+        //postalCodePatternMap.put("CV", "[0-9]{5}");
+        //postalCodePatternMap.put("CX", "[0-9]{5}");
+        //postalCodePatternMap.put("CY", "[0-9]{5}");
+        postalCodePatternMap.put("CZ", "[0-9]{3} [0-9]{2}"); // Czech: 999-99
+        postalCodePatternMap.put("DE", "[0-9]{5}"); // Germany
+        //postalCodePatternMap.put("DJ", "[0-9]{5}");
+        postalCodePatternMap.put("DK", "[0-9]{4}"); // Denmark
+        //postalCodePatternMap.put("DM", "[0-9]{5}");
+        //postalCodePatternMap.put("DO", "[0-9]{5}");
+        //postalCodePatternMap.put("DZ", "[0-9]{5}");
+        //postalCodePatternMap.put("EC", "[0-9]{5}");
+        postalCodePatternMap.put("EE", "[0-9]{5}"); // Estonia
+        //postalCodePatternMap.put("EG", "[0-9]{5}");
+        //postalCodePatternMap.put("EH", "[0-9]{5}");
+        //postalCodePatternMap.put("ER", "[0-9]{5}");
+        postalCodePatternMap.put("ES", "[0-9]{5}");
+        //postalCodePatternMap.put("ET", "[0-9]{5}");
+        postalCodePatternMap.put("FI", "[0-9]{5}");
+        //postalCodePatternMap.put("FJ", "[0-9]{5}");
+        //postalCodePatternMap.put("FK", "[0-9]{5}");
+        //postalCodePatternMap.put("FM", "[0-9]{5}");
+        //postalCodePatternMap.put("FO", "[0-9]{5}");
+        postalCodePatternMap.put("FR", "[0-9]{5}"); // France
+        //postalCodePatternMap.put("GA", "[0-9]{5}");
+        postalCodePatternMap.put("GB", "[A-Z]{1,2}[0-9]{1,2}[A-Z]? [0-9]{1}[A-Z]{2}"); // UK
+        //postalCodePatternMap.put("GD", "[0-9]{5}");
+        //postalCodePatternMap.put("GE", "[0-9]{5}");
+        //postalCodePatternMap.put("GF", "[0-9]{5}");
+        //postalCodePatternMap.put("GG", "[0-9]{5}");
+        //postalCodePatternMap.put("GH", "[0-9]{5}");
+        //postalCodePatternMap.put("GI", "[0-9]{5}");
+        //postalCodePatternMap.put("GL", "[0-9]{5}");
+        //postalCodePatternMap.put("GM", "[0-9]{5}");
+        //postalCodePatternMap.put("GN", "[0-9]{5}");
+        //postalCodePatternMap.put("GP", "[0-9]{5}");
+        //postalCodePatternMap.put("GQ", "[0-9]{5}");
+        postalCodePatternMap.put("GR", "[0-9]{5}"); // Greece
+        //postalCodePatternMap.put("GS", "[0-9]{5}");
+        //postalCodePatternMap.put("GT", "[0-9]{5}");
+        //postalCodePatternMap.put("GU", "[0-9]{5}");
+        //postalCodePatternMap.put("GW", "[0-9]{5}");
+        //postalCodePatternMap.put("GY", "[0-9]{5}");
+        //postalCodePatternMap.put("HK", "[0-9]{5}");
+        //postalCodePatternMap.put("HM", "[0-9]{5}");
+        //postalCodePatternMap.put("HN", "[0-9]{5}");
+        postalCodePatternMap.put("HR", "[0-9]{5}"); // Croatia (Hrvatska)
+        //postalCodePatternMap.put("HT", "[0-9]{5}");
+        postalCodePatternMap.put("HU", "[0-9]{4}"); // Hungary
+        //postalCodePatternMap.put("ID", "[0-9]{5}");
+        //postalCodePatternMap.put("IE", "[0-9]{5}");
+        postalCodePatternMap.put("IL", "[0-9]{5}");
+        //postalCodePatternMap.put("IM", "[0-9]{5}");
+        //postalCodePatternMap.put("IN", "[0-9]{5}");
+        //postalCodePatternMap.put("IO", "[0-9]{5}");
+        //postalCodePatternMap.put("IQ", "[0-9]{5}");
+        //postalCodePatternMap.put("IR", "[0-9]{5}");
+        postalCodePatternMap.put("IS", "[0-9]{3}"); // Iceland
+        postalCodePatternMap.put("IT", "[0-9]{5}"); // Italy
+        //postalCodePatternMap.put("JE", "[0-9]{5}");
+        //postalCodePatternMap.put("JM", "[0-9]{5}");
+        //postalCodePatternMap.put("JO", "[0-9]{5}");
+        postalCodePatternMap.put("JP", "[0-9]{3}-[0-9]{4}"); // Japan: 999-9999
+        //postalCodePatternMap.put("KE", "[0-9]{5}");
+        //postalCodePatternMap.put("KG", "[0-9]{5}");
+        //postalCodePatternMap.put("KH", "[0-9]{5}");
+        //postalCodePatternMap.put("KI", "[0-9]{5}");
+        //postalCodePatternMap.put("KM", "[0-9]{5}");
+        //postalCodePatternMap.put("KN", "[0-9]{5}");
+        //postalCodePatternMap.put("KP", "[0-9]{5}");
+        //postalCodePatternMap.put("KR", "[0-9]{5}");
+        //postalCodePatternMap.put("KW", "[0-9]{5}");
+        //postalCodePatternMap.put("KY", "[0-9]{5}");
+        //postalCodePatternMap.put("KZ", "[0-9]{5}");
+        postalCodePatternMap.put("LA", "[0-9]{5}");
+        //postalCodePatternMap.put("LB", "[0-9]{5}");
+        //postalCodePatternMap.put("LC", "[0-9]{5}");
+        postalCodePatternMap.put("LI", "[0-9]{4}");
+        //postalCodePatternMap.put("LK", "[0-9]{5}");
+        //postalCodePatternMap.put("LR", "[0-9]{5}");
+        //postalCodePatternMap.put("LS", "[0-9]{5}");
+        postalCodePatternMap.put("LT", "[0-9]{5}");
+        postalCodePatternMap.put("LU", "[0-9]{4}");
+        postalCodePatternMap.put("LV", "[0-9]{4}"); // Latvia
+        //postalCodePatternMap.put("LY", "[0-9]{5}");
+        //postalCodePatternMap.put("MA", "[0-9]{5}");
+        //postalCodePatternMap.put("MC", "[0-9]{5}");
+        //postalCodePatternMap.put("MD", "[0-9]{5}");
+        postalCodePatternMap.put("ME", "[0-9]{5}"); // Montenegro
+        //postalCodePatternMap.put("MF", "[0-9]{5}");
+        //postalCodePatternMap.put("MG", "[0-9]{5}");
+        //postalCodePatternMap.put("MH", "[0-9]{5}");
+        //postalCodePatternMap.put("MK", "[0-9]{5}");
+        //postalCodePatternMap.put("ML", "[0-9]{5}");
+        //postalCodePatternMap.put("MM", "[0-9]{5}");
+        //postalCodePatternMap.put("MN", "[0-9]{5}");
+        //postalCodePatternMap.put("MO", "[0-9]{5}");
+        //postalCodePatternMap.put("MP", "[0-9]{5}");
+        //postalCodePatternMap.put("MQ", "[0-9]{5}");
+        //postalCodePatternMap.put("MR", "[0-9]{5}");
+        //postalCodePatternMap.put("MS", "[0-9]{5}");
+        //postalCodePatternMap.put("MT", "[0-9]{5}");
+        //postalCodePatternMap.put("MU", "[0-9]{5}");
+        //postalCodePatternMap.put("MV", "[0-9]{5}");
+        //postalCodePatternMap.put("MW", "[0-9]{5}");
+        postalCodePatternMap.put("MX", "[0-9]{5}"); // Mexico
+        //postalCodePatternMap.put("MY", "[0-9]{5}");
+        //postalCodePatternMap.put("MZ", "[0-9]{5}");
+        //postalCodePatternMap.put("NA", "[0-9]{5}");
+        //postalCodePatternMap.put("NC", "[0-9]{5}");
+        //postalCodePatternMap.put("NE", "[0-9]{5}");
+        //postalCodePatternMap.put("NF", "[0-9]{5}");
+        //postalCodePatternMap.put("NG", "[0-9]{5}");
+        //postalCodePatternMap.put("NI", "[0-9]{5}");
+        postalCodePatternMap.put("NL", "[0-9]{4} [A-Z]{2}"); // Dutch
+        postalCodePatternMap.put("NO", "[0-9]{4}"); // Norway
+        //postalCodePatternMap.put("NP", "[0-9]{5}");
+        //postalCodePatternMap.put("NR", "[0-9]{5}");
+        //postalCodePatternMap.put("NU", "[0-9]{5}");
+        //postalCodePatternMap.put("NZ", "[0-9]{5}");
+        //postalCodePatternMap.put("OM", "[0-9]{5}");
+        //postalCodePatternMap.put("PA", "[0-9]{5}");
+        //postalCodePatternMap.put("PE", "[0-9]{5}");
+        //postalCodePatternMap.put("PF", "[0-9]{5}");
+        //postalCodePatternMap.put("PG", "[0-9]{5}");
+        //postalCodePatternMap.put("PH", "[0-9]{5}");
+        //postalCodePatternMap.put("PK", "[0-9]{5}");
+        postalCodePatternMap.put("PL", "[0-9]{2}-[0-9]{3}"); // Poland
+        //postalCodePatternMap.put("PM", "[0-9]{5}");
+        //postalCodePatternMap.put("PN", "[0-9]{5}");
+        //postalCodePatternMap.put("PR", "[0-9]{5}");
+        //postalCodePatternMap.put("PS", "[0-9]{5}");
+        postalCodePatternMap.put("PT", "[0-9]{4}-[0-9]{3}"); // Portugal
+        //postalCodePatternMap.put("PW", "[0-9]{5}");
+        //postalCodePatternMap.put("PY", "[0-9]{5}");
+        //postalCodePatternMap.put("QA", "[0-9]{5}");
+        //postalCodePatternMap.put("RE", "[0-9]{5}");
+        postalCodePatternMap.put("RO", "[0-9]{6}"); // Romania
+        //postalCodePatternMap.put("RS", "[0-9]{5}");
+        postalCodePatternMap.put("RU", "[0-9]{6}"); // Russia
+        //postalCodePatternMap.put("RW", "[0-9]{5}");
+        //postalCodePatternMap.put("SA", "[0-9]{5}");
+        //postalCodePatternMap.put("SB", "[0-9]{5}");
+        //postalCodePatternMap.put("SC", "[0-9]{5}");
+        //postalCodePatternMap.put("SD", "[0-9]{5}");
+        postalCodePatternMap.put("SE", "[0-9]{3} [0-9]{2}"); // Sweden: 999-99
+        //postalCodePatternMap.put("SG", "[0-9]{5}");
+        //postalCodePatternMap.put("SH", "[0-9]{5}");
+        postalCodePatternMap.put("SI", "[0-9]{4}");
+        //postalCodePatternMap.put("SJ", "[0-9]{5}");
+        postalCodePatternMap.put("SK", "[0-9]{3} [0-9]{2}"); // Slovakia: 999-99
+        postalCodePatternMap.put("SL", "[0-9]{4}"); // Slowenia
+        postalCodePatternMap.put("SM", "[0-9]{5}"); // san marino -> Italy
+        //postalCodePatternMap.put("SN", "[0-9]{5}");
+        //postalCodePatternMap.put("SO", "[0-9]{5}");
+        //postalCodePatternMap.put("SR", "[0-9]{5}");
+        //postalCodePatternMap.put("ST", "[0-9]{5}");
+        //postalCodePatternMap.put("SV", "[0-9]{5}");
+        //postalCodePatternMap.put("SY", "[0-9]{5}");
+        //postalCodePatternMap.put("SZ", "[0-9]{5}");
+        //postalCodePatternMap.put("TC", "[0-9]{5}");
+        //postalCodePatternMap.put("TD", "[0-9]{5}");
+        //postalCodePatternMap.put("TF", "[0-9]{5}");
+        //postalCodePatternMap.put("TG", "[0-9]{5}");
+        //postalCodePatternMap.put("TH", "[0-9]{5}");
+        //postalCodePatternMap.put("TJ", "[0-9]{5}");
+        //postalCodePatternMap.put("TK", "[0-9]{5}");
+        //postalCodePatternMap.put("TL", "[0-9]{5}");
+        //postalCodePatternMap.put("TM", "[0-9]{5}");
+        //postalCodePatternMap.put("TN", "[0-9]{5}");
+        //postalCodePatternMap.put("TO", "[0-9]{5}");
+        postalCodePatternMap.put("TR", "[0-9]{5}"); // turkye
+        //postalCodePatternMap.put("TT", "[0-9]{5}");
+        //postalCodePatternMap.put("TV", "[0-9]{5}");
+        //postalCodePatternMap.put("TW", "[0-9]{5}");
+        //postalCodePatternMap.put("TZ", "[0-9]{5}");
+        postalCodePatternMap.put("UA", "[0-9]{5}"); // Ukraine
+        //postalCodePatternMap.put("UG", "[0-9]{5}");
+        //postalCodePatternMap.put("UM", "[0-9]{5}");
+        postalCodePatternMap.put("US", "([A-Z]{2} )?[0-9]{5}"); // USA: support "99999" and "IL 99999"
+        //postalCodePatternMap.put("UY", "[0-9]{5}");
+        //postalCodePatternMap.put("UZ", "[0-9]{5}");
+        //postalCodePatternMap.put("VA", "[0-9]{5}");
+        //postalCodePatternMap.put("VC", "[0-9]{5}");
+        //postalCodePatternMap.put("VE", "[0-9]{5}");
+        //postalCodePatternMap.put("VG", "[0-9]{5}");
+        //postalCodePatternMap.put("VI", "[0-9]{5}");
+        //postalCodePatternMap.put("VN", "[0-9]{5}");
+        //postalCodePatternMap.put("VU", "[0-9]{5}");
+        //postalCodePatternMap.put("WF", "[0-9]{5}");
+        //postalCodePatternMap.put("WS", "[0-9]{5}");
+        //postalCodePatternMap.put("YE", "[0-9]{5}");
+        //postalCodePatternMap.put("YT", "[0-9]{5}");
+        //postalCodePatternMap.put("ZA", "[0-9]{5}");
+        //postalCodePatternMap.put("ZM", "[0-9]{5}");
+        //postalCodePatternMap.put("ZW", "[0-9]{5}");
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ProblemType.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ProblemType.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ProblemType.java	(revision 30348)
@@ -1,19 +1,7 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
 public enum ProblemType {
-	Warning,
-	Error,
+    Warning,
+    Error,
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/SolutionType.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/SolutionType.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/SolutionType.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -19,6 +7,6 @@
  */
 public enum SolutionType {
-	Remove,
-	Change,
-	Add
+    Remove,
+    Change,
+    Add
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StringUtils.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StringUtils.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StringUtils.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -17,134 +5,134 @@
 
 public class StringUtils {
-	/**
-	 * Checks, if a string is either null or empty.
-	 *
-	 * @param txt
-	 *            Text to check
-	 * @return True, if string is null or empty; otherwise false
-	 */
-	public static boolean isNullOrEmpty(String txt) {
-		return txt == null || txt.length() == 0;
-	}
+    /**
+     * Checks, if a string is either null or empty.
+     *
+     * @param txt
+     *            Text to check
+     * @return True, if string is null or empty; otherwise false
+     */
+    public static boolean isNullOrEmpty(String txt) {
+        return txt == null || txt.length() == 0;
+    }
 
-	/**
-	 * Gets the length of the longest common substring of a and b
-	 *
-	 * @param a
-	 *            First string
-	 * @param b
-	 *            Second string
-	 * @return The length of the longest common substring or 0, if no common
-	 *         sequence exists or one of the arguments are invalid. For
-	 *         algorithm details please refer to {@link http
-	 *         ://www.ics.uci.edu/~eppstein/161/960229.html}
-	 */
-	public static int lcsLength(String a, String b) {
-		if (StringUtils.isNullOrEmpty(a))
-			return 0;
-		if (StringUtils.isNullOrEmpty(b))
-			return 0;
+    /**
+     * Gets the length of the longest common substring of a and b
+     *
+     * @param a
+     *            First string
+     * @param b
+     *            Second string
+     * @return The length of the longest common substring or 0, if no common
+     *         sequence exists or one of the arguments are invalid. For
+     *         algorithm details please refer to {@link http
+     *         ://www.ics.uci.edu/~eppstein/161/960229.html}
+     */
+    public static int lcsLength(String a, String b) {
+        if (StringUtils.isNullOrEmpty(a))
+            return 0;
+        if (StringUtils.isNullOrEmpty(b))
+            return 0;
 
-		int[][] L = createLCSTable(a, b);
-		return L[0][0];
-	}
+        int[][] L = createLCSTable(a, b);
+        return L[0][0];
+    }
 
-	/**
-	 * Internal use only
-	 */
-	private static int[][] createLCSTable(String a, String b) {
-		if (StringUtils.isNullOrEmpty(a))
-			return null;
-		if (StringUtils.isNullOrEmpty(b))
-			return null;
+    /**
+     * Internal use only
+     */
+    private static int[][] createLCSTable(String a, String b) {
+        if (StringUtils.isNullOrEmpty(a))
+            return null;
+        if (StringUtils.isNullOrEmpty(b))
+            return null;
 
-		int m = a.length();
-		int n = b.length();
-		int[][] l = new int[m + 1][n + 1];
-		for (int i = 0; i < l.length; i++) {
-			l[i] = new int[n + 1];
-		}
+        int m = a.length();
+        int n = b.length();
+        int[][] l = new int[m + 1][n + 1];
+        for (int i = 0; i < l.length; i++) {
+            l[i] = new int[n + 1];
+        }
 
-		int i, j;
-		for (i = m - 1; i >= 0; i--) {
-			for (j = n - 1; j >= 0; j--) {
-				/*
-				 * if (i >= m || j >= n) { l[i][j] = 0; } else
-				 */if (a.charAt(i) == b.charAt(j)) {
-					l[i][j] = 1 + l[i + 1][j + 1];
-				} else {
-					l[i][j] = Math.max(l[i + 1][j], l[i][j + 1]);
-				}
-			}
-		}
-		return l;
-	}
+        int i, j;
+        for (i = m - 1; i >= 0; i--) {
+            for (j = n - 1; j >= 0; j--) {
+                /*
+                 * if (i >= m || j >= n) { l[i][j] = 0; } else
+                 */if (a.charAt(i) == b.charAt(j)) {
+                    l[i][j] = 1 + l[i + 1][j + 1];
+                } else {
+                    l[i][j] = Math.max(l[i + 1][j], l[i][j + 1]);
+                }
+            }
+        }
+        return l;
+    }
 
-	/**
-	 * Gets the longest common substring of a and b.
-	 *
-	 * @param a The first string.
-	 * @param b The second string.
-	 * @return
-	 */
-	public static String getLongestCommonSubstring(String a, String b) {
-		if (StringUtils.isNullOrEmpty(a))
-			return null;
-		if (StringUtils.isNullOrEmpty(b))
-			return null;
+    /**
+     * Gets the longest common substring of a and b.
+     *
+     * @param a The first string.
+     * @param b The second string.
+     * @return
+     */
+    public static String getLongestCommonSubstring(String a, String b) {
+        if (StringUtils.isNullOrEmpty(a))
+            return null;
+        if (StringUtils.isNullOrEmpty(b))
+            return null;
 
-		StringBuffer sb = new StringBuffer();
-		int[][] l = createLCSTable(a, b);
-		int m = a.length();
-		int n = b.length();
-		int i = 0;
-		int j = 0;
-		while (i < m && j < n) {
-			char aa = a.charAt(i);
-			char bb = b.charAt(j);
-			if (aa == bb) {
-				sb.append(aa);
-				i++;
-				j++;
-			} else if (l[i + 1][j] >= l[i][j + 1]) {
-				i++;
-			} else {
-				j++;
-			}
-		}
+        StringBuffer sb = new StringBuffer();
+        int[][] l = createLCSTable(a, b);
+        int m = a.length();
+        int n = b.length();
+        int i = 0;
+        int j = 0;
+        while (i < m && j < n) {
+            char aa = a.charAt(i);
+            char bb = b.charAt(j);
+            if (aa == bb) {
+                sb.append(aa);
+                i++;
+                j++;
+            } else if (l[i + 1][j] >= l[i][j + 1]) {
+                i++;
+            } else {
+                j++;
+            }
+        }
 
-		l = null;
-		return sb.toString();
-	}
+        l = null;
+        return sb.toString();
+    }
 
-	/**
-	 * @param needle The string to find the best match for.
-	 * @param haystack The list of strings to pick the best match from.
-	 * @return The string of the list with the longest common substring to needle or
-	 * <tt>null</tt>, if either <tt>needle</tt> or <tt>haystack</tt> is empty or null.
-	 */
-	public static String findBestMatch(String needle, List<String> haystack) {
-		String bestMatch = null;
-		double maxRatio = Double.MIN_VALUE;
+    /**
+     * @param needle The string to find the best match for.
+     * @param haystack The list of strings to pick the best match from.
+     * @return The string of the list with the longest common substring to needle or
+     * <tt>null</tt>, if either <tt>needle</tt> or <tt>haystack</tt> is empty or null.
+     */
+    public static String findBestMatch(String needle, List<String> haystack) {
+        String bestMatch = null;
+        double maxRatio = Double.MIN_VALUE;
 
-		if (StringUtils.isNullOrEmpty(needle)) {
-			return null;
-		}
-		if (haystack == null || haystack.size() == 0) {
-			return null;
-		}
+        if (StringUtils.isNullOrEmpty(needle)) {
+            return null;
+        }
+        if (haystack == null || haystack.size() == 0) {
+            return null;
+        }
 
-		int lNeedle = needle.length();
-		for (String curString : haystack) {
-			int ll = lcsLength(needle, curString);
-			double ratio = ll / (double)lNeedle;
-			if (ratio > maxRatio) {
-				maxRatio = ratio;
-				bestMatch = curString;
-			}
+        int lNeedle = needle.length();
+        for (String curString : haystack) {
+            int ll = lcsLength(needle, curString);
+            double ratio = ll / (double)lNeedle;
+            if (ratio > maxRatio) {
+                maxRatio = ratio;
+                bestMatch = curString;
+            }
 
-		}
+        }
 
-		return bestMatch;
-	}
+        return bestMatch;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/TagUtils.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/TagUtils.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/TagUtils.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses;
 
@@ -27,2065 +15,2065 @@
  */
 public final class TagUtils {
-	private static String COUNTRIES_REQUIRE_STATE[] = {
-		"en_US",    /* USA */
-		"en_AU" /* Australia */
-	};
-
-	/**
-	 * Checks if the given OSM object has a (non-empty) value for the given tag.
-	 *
-	 * @param osm the osm object to inspect.
-	 * @param tag the tag to look for.
-	 * @return true, if osm object has a non-empty value for this tag
-	 */
-	public static boolean hasTag(OsmPrimitive osm, String tag) {
-		return osm != null && !StringUtils.isNullOrEmpty(osm.get(tag));
-	}
-
-	/**
-	 * Checks if the given OSM primitive is an address node.
-	 * @return
-	 */
-	public static boolean isAddress(OsmPrimitive osmObject) {
-		return  TagUtils.hasAddrCityTag(osmObject) || TagUtils.hasAddrCountryTag(osmObject) ||
-				TagUtils.hasAddrHousenumberTag(osmObject) || TagUtils.hasAddrPostcodeTag(osmObject) ||
-				TagUtils.hasAddrStateTag(osmObject) || TagUtils.hasAddrStreetTag(osmObject);
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'parking'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasParkingTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(PARKING_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'parking'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getParkingValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(PARKING_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'shop'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasShopTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SHOP_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'shop'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getShopValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SHOP_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'craft'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCraftTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(CRAFT_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'craft'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCraftValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CRAFT_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'surface'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasSurfaceTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SURFACE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'surface'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getSurfaceValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SURFACE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'cuisine'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCuisineTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(CUISINE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'cuisine'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCuisineValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CUISINE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'wood'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWoodTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(WOOD_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'wood'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWoodValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(WOOD_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'foot'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasFootTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(FOOT_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'foot'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getFootValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(FOOT_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'name:de'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNameDeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NAME_DE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'name:de'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNameDeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NAME_DE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'nat_ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNatRefTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NAT_REF_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'nat_ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNatRefValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NAT_REF_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'note:de'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNoteDeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NOTE_DE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'note:de'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNoteDeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NOTE_DE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:street'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrStreetTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_STREET_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:street'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrStreetValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_STREET_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'type'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasTypeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(TYPE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'type'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getTypeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(TYPE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:city'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrCityTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_CITY_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:city'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrCityValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_CITY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'boundary'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasBoundaryTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(BOUNDARY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'boundary'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getBoundaryValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(BOUNDARY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'smoothness'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasSmoothnessTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SMOOTHNESS_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'smoothness'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getSmoothnessValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SMOOTHNESS_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'opening_hours'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasOpeningHoursTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(OPENING_HOURS_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'opening_hours'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getOpeningHoursValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(OPENING_HOURS_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'bicycle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasBicycleTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(BICYCLE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'bicycle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getBicycleValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(BICYCLE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'religion'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasReligionTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(RELIGION_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'religion'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getReligionValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(RELIGION_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'barrier'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasBarrierTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(BARRIER_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'barrier'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getBarrierValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(BARRIER_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'power'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasPowerTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(POWER_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'power'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getPowerValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(POWER_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'landuse'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasLanduseTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(LANDUSE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'landuse'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getLanduseValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(LANDUSE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'fireplace'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasFireplaceTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(FIREPLACE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'fireplace'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getFireplaceValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(FIREPLACE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'int_ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasIntRefTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(INT_REF_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'int_ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getIntRefValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(INT_REF_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'whitewater:section_grade'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWhitewaterSectionGradeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive
-				.hasKey(WHITEWATER_SECTION_GRADE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'whitewater:section_grade'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWhitewaterSectionGradeValue(
-			OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive
-				.get(WHITEWATER_SECTION_GRADE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'denomination'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasDenominationTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(DENOMINATION_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'denomination'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getDenominationValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(DENOMINATION_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:postcode'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrPostcodeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_POSTCODE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:postcode'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrPostcodeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_POSTCODE_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'wires'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWiresTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(WIRES_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'wires'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWiresValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(WIRES_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'loc_ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasLocRefTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(LOC_REF_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'loc_ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getLocRefValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(LOC_REF_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'width'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWidthTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(WIDTH_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'width'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWidthValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(WIDTH_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'tourism'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasTourismTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(TOURISM_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'tourism'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getTourismValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(TOURISM_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'leisure'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasLeisureTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(LEISURE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'leisure'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getLeisureValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(LEISURE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'electrified'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasElectrifiedTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ELECTRIFIED_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'electrified'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getElectrifiedValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ELECTRIFIED_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'junction'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasJunctionTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(JUNCTION_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'junction'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getJunctionValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(JUNCTION_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'railway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasRailwayTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(RAILWAY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'railway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getRailwayValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(RAILWAY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'voltage'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasVoltageTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(VOLTAGE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'voltage'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getVoltageValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(VOLTAGE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'bridge'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasBridgeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(BRIDGE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'bridge'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getBridgeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(BRIDGE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'motor_vehicle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasMotorVehicleTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(MOTOR_VEHICLE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'motor_vehicle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getMotorVehicleValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(MOTOR_VEHICLE_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'comment'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCommentTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(COMMENT_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'comment'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCommentValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(COMMENT_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'maxspeed'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasMaxspeedTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(MAXSPEED_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'maxspeed'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getMaxspeedValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(MAXSPEED_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'natural'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNaturalTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NATURAL_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'natural'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNaturalValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NATURAL_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'sac_scale'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasSacScaleTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SAC_SCALE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'sac_scale'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getSacScaleValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SAC_SCALE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'tunnel'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasTunnelTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(TUNNEL_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'tunnel'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getTunnelValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(TUNNEL_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'waterway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWaterwayTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(WATERWAY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'waterway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWaterwayValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(WATERWAY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'trail_visibility'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasTrailVisibilityTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(TRAIL_VISIBILITY_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'trail_visibility'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getTrailVisibilityValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(TRAIL_VISIBILITY_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'highway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasHighwayTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(HIGHWAY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'highway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getHighwayValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(HIGHWAY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'vehicle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasVehicleTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(VEHICLE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'vehicle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getVehicleValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(VEHICLE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'horse'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasHorseTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(HORSE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'horse'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getHorseValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(HORSE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'goods'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasGoodsTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(GOODS_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'goods'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getGoodsValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(GOODS_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'frequency'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasFrequencyTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(FREQUENCY_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'frequency'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getFrequencyValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(FREQUENCY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'man_made'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasManMadeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(MAN_MADE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'man_made'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getManMadeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(MAN_MADE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:housenumber'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrHousenumberTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENUMBER_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:housenumber'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrHousenumberValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENUMBER_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:housename'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrHousenameTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENAME_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:housename'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrHousenameValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENAME_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'area'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAreaTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(AREA_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'area'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAreaValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(AREA_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'building:levels'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasBuildingLevelsTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(BUILDING_LEVELS_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'building:levels'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getBuildingLevelsValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(BUILDING_LEVELS_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'wheelchair'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWheelchairTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(WHEELCHAIR_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'wheelchair'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWheelchairValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(WHEELCHAIR_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'name'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNameTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NAME_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'name'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNameValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NAME_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'oneway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasOnewayTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ONEWAY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'oneway'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getOnewayValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ONEWAY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'FIXME'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasFIXMETag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(FIXME_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'FIXME'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getFIXMEValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(FIXME_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'capacity'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCapacityTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(CAPACITY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'capacity'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCapacityValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CAPACITY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'motorcycle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasMotorcycleTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(MOTORCYCLE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'motorcycle'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getMotorcycleValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(MOTORCYCLE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'hgv'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasHgvTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(HGV_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'hgv'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getHgvValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(HGV_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'construction'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasConstructionTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(CONSTRUCTION_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'construction'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getConstructionValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CONSTRUCTION_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:state'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrStateTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_STATE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:state'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrStateValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_STATE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'lanes'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasLanesTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(LANES_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'lanes'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getLanesValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(LANES_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'note'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNoteTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NOTE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'note'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNoteValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NOTE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'lit'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasLitTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(LIT_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'lit'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getLitValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(LIT_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'building'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasBuildingTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(BUILDING_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'building'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getBuildingValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(BUILDING_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'segregated'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasSegregatedTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SEGREGATED_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'segregated'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getSegregatedValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SEGREGATED_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:inclusion'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrInclusionTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_INCLUSION_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:inclusion'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrInclusionValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_INCLUSION_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'layer'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasLayerTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(LAYER_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'layer'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getLayerValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(LAYER_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'sport'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasSportTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SPORT_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'sport'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getSportValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SPORT_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:interpolation'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrInterpolationTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive
-				.hasKey(ADDR_INTERPOLATION_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:interpolation'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrInterpolationValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_INTERPOLATION_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'cutting'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCuttingTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(CUTTING_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'cutting'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCuttingValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CUTTING_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'amenity'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAmenityTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(AMENITY_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'amenity'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAmenityValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(AMENITY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'access'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAccessTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ACCESS_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'access'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAccessValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ACCESS_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'agricultural'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAgriculturalTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(AGRICULTURAL_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'agricultural'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAgriculturalValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(AGRICULTURAL_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'capacity:disabled'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCapacityDisabledTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive
-				.hasKey(CAPACITY_DISABLED_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'capacity:disabled'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCapacityDisabledValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CAPACITY_DISABLED_TAG)
-				: null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'operator'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasOperatorTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(OPERATOR_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'operator'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getOperatorValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(OPERATOR_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasRefTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(REF_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'ref'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getRefValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(REF_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'noexit'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasNoexitTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(NOEXIT_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'noexit'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getNoexitValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(NOEXIT_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'admin_level'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAdminLevelTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADMIN_LEVEL_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'admin_level'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAdminLevelValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADMIN_LEVEL_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'source'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasSourceTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SOURCE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'source'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getSourceValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SOURCE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'tracktype'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasTracktypeTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(TRACKTYPE_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'tracktype'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getTracktypeValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(TRACKTYPE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'addr:country'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasAddrCountryTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_COUNTRY_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'addr:country'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getAddrCountryValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ADDR_COUNTRY_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'route'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasRouteTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(ROUTE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'route'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getRouteValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(ROUTE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'cables'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasCablesTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(CABLES_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'cables'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getCablesValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(CABLES_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'service'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasServiceTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(SERVICE_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'service'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getServiceValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(SERVICE_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'motorcar'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasMotorcarTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(MOTORCAR_TAG) : false;
-	}
-
-	/**
-	 * Gets the value of tag 'motorcar'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getMotorcarValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(MOTORCAR_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'whitewater'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasWhitewaterTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(WHITEWATER_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'whitewater'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getWhitewaterValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(WHITEWATER_TAG) : null;
-	}
-
-	/**
-	 * Check if OSM primitive has a tag 'embankment'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean hasEmbankmentTag(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.hasKey(EMBANKMENT_TAG)
-				: false;
-	}
-
-	/**
-	 * Gets the value of tag 'embankment'.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static String getEmbankmentValue(OsmPrimitive osmPrimitive) {
-		return osmPrimitive != null ? osmPrimitive.get(EMBANKMENT_TAG) : null;
-	}
-
-	/**
-	 * Checks if the given street supporting housenumbers. Usually motor ways and primary roads have
-	 * no addresses, also no paths or tracks.
-	 *
-	 * @param w the w
-	 * @return true, if is street supporting housenumbers
-	 */
-	public static boolean isStreetSupportingHousenumbers(Way w) {
-		if (w == null) return false;
-		if (!hasHighwayTag(w)) {
-			return false;
-		}
-
-		// TODO: Should be configurable
-
-		/* Allow everything until this can be configured */
-		return true;
-		/*
-		String hwType = getHighwayValue(w);
-		return  !(TagUtils.HIGHWAY_MOTORWAY_LINK_VALUE.equals(hwType) ||
-				TagUtils.HIGHWAY_MOTORWAY_VALUE.equals(hwType) ||
-				TagUtils.HIGHWAY_FOOTWAY_VALUE.equals(hwType) ||
-				TagUtils.HIGHWAY_TRACK_VALUE.equals(hwType)
-				);*/
-	}
-
-	// Relation support
-
-	/**
-	 * Check if OSM relation is a 'associatedStreet' relation.
-	 *
-	 * @param osmPrimitive
-	 *            The OSM entity to check.
-	 */
-	public static boolean isAssociatedStreetRelation(Relation rel) {
-		return rel != null &&
-			rel.hasKey(RELATION_TYPE) &&
-			ASSOCIATEDSTREET_RELATION_TYPE.equals(rel.get(RELATION_TYPE));
-	}
-
-	/**
-	 * Checks if given relation member has role "street".
-	 *
-	 * @param relMember the relation member
-	 * @return true, if is street member
-	 */
-	public static boolean isStreetMember(RelationMember relMember) {
-		return relMember != null && STREET_RELATION_ROLE.equals(relMember.getRole());
-	}
-
-	/**
-	 * Checks if given relation member has role "house".
-	 *
-	 * @param relMember the relation member
-	 * @return true, if is street member
-	 */
-	public static boolean isHouseMember(RelationMember relMember) {
-		return relMember != null && STREET_RELATION_ROLE.equals(relMember.getRole());
-	}
-
-	/**
-	 * Checks if "addr:state" tag is required.
-	 *
-	 * @return true, if is state required
-	 */
-	public static boolean isStateRequired() {
-		String loc = OsmUtils.getLocale();
-
-		for (int i = 0; i < COUNTRIES_REQUIRE_STATE.length; i++) {
-			if (COUNTRIES_REQUIRE_STATE[i].equals(loc)) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	public static final String PARKING_TAG = "parking";
-	public static final String SHOP_TAG = "shop";
-	public static final String CRAFT_TAG = "craft";
-	public static final String SURFACE_TAG = "surface";
-	public static final String CUISINE_TAG = "cuisine";
-	public static final String WOOD_TAG = "wood";
-	public static final String FOOT_TAG = "foot";
-	public static final String NAME_DE_TAG = "name:de";
-	public static final String NAT_REF_TAG = "nat_ref";
-	public static final String NOTE_DE_TAG = "note:de";
-	public static final String ADDR_STREET_TAG = "addr:street";
-	public static final String TYPE_TAG = "type";
-	public static final String ADDR_CITY_TAG = "addr:city";
-	public static final String BOUNDARY_TAG = "boundary";
-	public static final String SMOOTHNESS_TAG = "smoothness";
-	public static final String OPENING_HOURS_TAG = "opening_hours";
-	public static final String BICYCLE_TAG = "bicycle";
-	public static final String RELIGION_TAG = "religion";
-	public static final String BARRIER_TAG = "barrier";
-	public static final String POWER_TAG = "power";
-	public static final String LANDUSE_TAG = "landuse";
-	public static final String FIREPLACE_TAG = "fireplace";
-	public static final String INT_REF_TAG = "int_ref";
-	public static final String WHITEWATER_SECTION_GRADE_TAG = "whitewater:section_grade";
-	public static final String DENOMINATION_TAG = "denomination";
-	public static final String ADDR_POSTCODE_TAG = "addr:postcode";
-	public static final String WIRES_TAG = "wires";
-	public static final String LOC_REF_TAG = "loc_ref";
-	public static final String WIDTH_TAG = "width";
-	public static final String TOURISM_TAG = "tourism";
-	public static final String LEISURE_TAG = "leisure";
-	public static final String ELECTRIFIED_TAG = "electrified";
-	public static final String JUNCTION_TAG = "junction";
-	public static final String RAILWAY_TAG = "railway";
-	public static final String VOLTAGE_TAG = "voltage";
-	public static final String BRIDGE_TAG = "bridge";
-	public static final String MOTOR_VEHICLE_TAG = "motor_vehicle";
-	public static final String COMMENT_TAG = "comment";
-	public static final String MAXSPEED_TAG = "maxspeed";
-	public static final String NATURAL_TAG = "natural";
-	public static final String BUILDING_HEIGHT_TAG = "building:height";
-	public static final String SAC_SCALE_TAG = "sac_scale";
-	public static final String TUNNEL_TAG = "tunnel";
-	public static final String WATERWAY_TAG = "waterway";
-	public static final String TRAIL_VISIBILITY_TAG = "trail_visibility";
-	public static final String HIGHWAY_TAG = "highway";
-	public static final String VEHICLE_TAG = "vehicle";
-	public static final String HORSE_TAG = "horse";
-	public static final String GOODS_TAG = "goods";
-	public static final String FREQUENCY_TAG = "frequency";
-	public static final String MAN_MADE_TAG = "man_made";
-	public static final String ADDR_HOUSENUMBER_TAG = "addr:housenumber";
-	public static final String AREA_TAG = "area";
-	public static final String BUILDING_LEVELS_TAG = "building:levels";
-	public static final String WHEELCHAIR_TAG = "wheelchair";
-	public static final String NAME_TAG = "name";
-	public static final String ONEWAY_TAG = "oneway";
-	public static final String FIXME_TAG = "FIXME";
-	public static final String CAPACITY_TAG = "capacity";
-	public static final String MOTORCYCLE_TAG = "motorcycle";
-	public static final String HGV_TAG = "hgv";
-	public static final String CONSTRUCTION_TAG = "construction";
-	public static final String ADDR_STATE_TAG = "addr:state";
-	public static final String LANES_TAG = "lanes";
-	public static final String NOTE_TAG = "note";
-	public static final String LIT_TAG = "lit";
-	public static final String BUILDING_TAG = "building";
-	public static final String SEGREGATED_TAG = "segregated";
-	public static final String ADDR_INCLUSION_TAG = "addr:inclusion";
-	public static final String LAYER_TAG = "layer";
-	public static final String SPORT_TAG = "sport";
-	public static final String ADDR_INTERPOLATION_TAG = "addr:interpolation";
-	public static final String CUTTING_TAG = "cutting";
-	public static final String AMENITY_TAG = "amenity";
-	public static final String ACCESS_TAG = "access";
-	public static final String AGRICULTURAL_TAG = "agricultural";
-	public static final String CAPACITY_DISABLED_TAG = "capacity:disabled";
-	public static final String OPERATOR_TAG = "operator";
-	public static final String REF_TAG = "ref";
-	public static final String NOEXIT_TAG = "noexit";
-	public static final String ADMIN_LEVEL_TAG = "admin_level";
-	public static final String SOURCE_TAG = "source";
-	public static final String TRACKTYPE_TAG = "tracktype";
-	public static final String ADDR_COUNTRY_TAG = "addr:country";
-	public static final String ROUTE_TAG = "route";
-	public static final String CABLES_TAG = "cables";
-	public static final String SERVICE_TAG = "service";
-	public static final String MOTORCAR_TAG = "motorcar";
-	public static final String WHITEWATER_TAG = "whitewater";
-	public static final String EMBANKMENT_TAG = "embankment";
-	public static final String ADDR_HOUSENAME_TAG = "addr:housename";
-
-	/* Highway types */
-	public static final String HIGHWAY_CYCLEWAY_VALUE = "cycleway";
-	public static final String HIGHWAY_FOOTWAY_VALUE = "footway";
-	public static final String HIGHWAY_MOTORWAY_LINK_VALUE = "motorway_link";
-	public static final String HIGHWAY_MOTORWAY_VALUE = "motorway";
-	public static final String HIGHWAY_PATH_VALUE = "path";
-	public static final String HIGHWAY_RESIDENTIAL_VALUE = "residential";
-	public static final String HIGHWAY_LIVING_STREET_VALUE = "living_street";
-	public static final String HIGHWAY_ROAD_VALUE = "road";
-	public static final String HIGHWAY_SECONDARY_VALUE = "secondary";
-	public static final String HIGHWAY_SERVICE_VALUE = "service";
-	public static final String HIGHWAY_STEPS_VALUE = "steps";
-	public static final String HIGHWAY_TERTIARY_VALUE = "tertiary";
-	public static final String HIGHWAY_TRACK_VALUE = "track";
-	public static final String HIGHWAY_TRUNK_LINK_VALUE = "trunk_link";
-	public static final String HIGHWAY_TRUNK_VALUE = "trunk";
-	public static final String HIGHWAY_UNCLASSIFIED_VALUE = "unclassified";
-
-	/* Relation keys */
-
-	// Associated street: See http://wiki.openstreetmap.org/wiki/Proposed_features/De:Hausnummern
-	public static final String RELATION_TYPE = "type";
-	public static final String ASSOCIATEDSTREET_RELATION_TYPE = "associatedStreet";
-	public static final String STREET_RELATION_ROLE = "street";
-	public static final String HOUSE_RELATION_ROLE = "house";
+    private static String COUNTRIES_REQUIRE_STATE[] = {
+        "en_US",    /* USA */
+        "en_AU" /* Australia */
+    };
+
+    /**
+     * Checks if the given OSM object has a (non-empty) value for the given tag.
+     *
+     * @param osm the osm object to inspect.
+     * @param tag the tag to look for.
+     * @return true, if osm object has a non-empty value for this tag
+     */
+    public static boolean hasTag(OsmPrimitive osm, String tag) {
+        return osm != null && !StringUtils.isNullOrEmpty(osm.get(tag));
+    }
+
+    /**
+     * Checks if the given OSM primitive is an address node.
+     * @return
+     */
+    public static boolean isAddress(OsmPrimitive osmObject) {
+        return  TagUtils.hasAddrCityTag(osmObject) || TagUtils.hasAddrCountryTag(osmObject) ||
+                TagUtils.hasAddrHousenumberTag(osmObject) || TagUtils.hasAddrPostcodeTag(osmObject) ||
+                TagUtils.hasAddrStateTag(osmObject) || TagUtils.hasAddrStreetTag(osmObject);
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'parking'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasParkingTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(PARKING_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'parking'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getParkingValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(PARKING_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'shop'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasShopTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SHOP_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'shop'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getShopValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SHOP_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'craft'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCraftTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(CRAFT_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'craft'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCraftValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CRAFT_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'surface'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasSurfaceTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SURFACE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'surface'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getSurfaceValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SURFACE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'cuisine'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCuisineTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(CUISINE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'cuisine'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCuisineValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CUISINE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'wood'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWoodTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(WOOD_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'wood'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWoodValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(WOOD_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'foot'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasFootTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(FOOT_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'foot'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getFootValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(FOOT_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'name:de'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNameDeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NAME_DE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'name:de'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNameDeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NAME_DE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'nat_ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNatRefTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NAT_REF_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'nat_ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNatRefValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NAT_REF_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'note:de'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNoteDeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NOTE_DE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'note:de'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNoteDeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NOTE_DE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:street'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrStreetTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_STREET_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:street'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrStreetValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_STREET_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'type'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasTypeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(TYPE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'type'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getTypeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(TYPE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:city'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrCityTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_CITY_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:city'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrCityValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_CITY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'boundary'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasBoundaryTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(BOUNDARY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'boundary'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getBoundaryValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(BOUNDARY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'smoothness'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasSmoothnessTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SMOOTHNESS_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'smoothness'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getSmoothnessValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SMOOTHNESS_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'opening_hours'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasOpeningHoursTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(OPENING_HOURS_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'opening_hours'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getOpeningHoursValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(OPENING_HOURS_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'bicycle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasBicycleTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(BICYCLE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'bicycle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getBicycleValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(BICYCLE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'religion'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasReligionTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(RELIGION_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'religion'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getReligionValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(RELIGION_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'barrier'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasBarrierTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(BARRIER_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'barrier'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getBarrierValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(BARRIER_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'power'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasPowerTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(POWER_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'power'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getPowerValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(POWER_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'landuse'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasLanduseTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(LANDUSE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'landuse'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getLanduseValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(LANDUSE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'fireplace'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasFireplaceTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(FIREPLACE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'fireplace'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getFireplaceValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(FIREPLACE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'int_ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasIntRefTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(INT_REF_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'int_ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getIntRefValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(INT_REF_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'whitewater:section_grade'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWhitewaterSectionGradeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive
+                .hasKey(WHITEWATER_SECTION_GRADE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'whitewater:section_grade'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWhitewaterSectionGradeValue(
+            OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive
+                .get(WHITEWATER_SECTION_GRADE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'denomination'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasDenominationTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(DENOMINATION_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'denomination'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getDenominationValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(DENOMINATION_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:postcode'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrPostcodeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_POSTCODE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:postcode'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrPostcodeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_POSTCODE_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'wires'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWiresTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(WIRES_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'wires'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWiresValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(WIRES_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'loc_ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasLocRefTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(LOC_REF_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'loc_ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getLocRefValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(LOC_REF_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'width'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWidthTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(WIDTH_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'width'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWidthValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(WIDTH_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'tourism'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasTourismTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(TOURISM_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'tourism'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getTourismValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(TOURISM_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'leisure'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasLeisureTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(LEISURE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'leisure'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getLeisureValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(LEISURE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'electrified'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasElectrifiedTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ELECTRIFIED_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'electrified'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getElectrifiedValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ELECTRIFIED_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'junction'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasJunctionTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(JUNCTION_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'junction'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getJunctionValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(JUNCTION_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'railway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasRailwayTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(RAILWAY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'railway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getRailwayValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(RAILWAY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'voltage'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasVoltageTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(VOLTAGE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'voltage'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getVoltageValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(VOLTAGE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'bridge'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasBridgeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(BRIDGE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'bridge'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getBridgeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(BRIDGE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'motor_vehicle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasMotorVehicleTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(MOTOR_VEHICLE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'motor_vehicle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getMotorVehicleValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(MOTOR_VEHICLE_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'comment'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCommentTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(COMMENT_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'comment'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCommentValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(COMMENT_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'maxspeed'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasMaxspeedTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(MAXSPEED_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'maxspeed'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getMaxspeedValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(MAXSPEED_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'natural'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNaturalTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NATURAL_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'natural'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNaturalValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NATURAL_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'sac_scale'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasSacScaleTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SAC_SCALE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'sac_scale'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getSacScaleValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SAC_SCALE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'tunnel'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasTunnelTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(TUNNEL_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'tunnel'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getTunnelValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(TUNNEL_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'waterway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWaterwayTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(WATERWAY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'waterway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWaterwayValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(WATERWAY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'trail_visibility'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasTrailVisibilityTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(TRAIL_VISIBILITY_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'trail_visibility'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getTrailVisibilityValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(TRAIL_VISIBILITY_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'highway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasHighwayTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(HIGHWAY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'highway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getHighwayValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(HIGHWAY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'vehicle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasVehicleTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(VEHICLE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'vehicle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getVehicleValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(VEHICLE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'horse'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasHorseTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(HORSE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'horse'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getHorseValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(HORSE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'goods'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasGoodsTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(GOODS_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'goods'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getGoodsValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(GOODS_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'frequency'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasFrequencyTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(FREQUENCY_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'frequency'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getFrequencyValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(FREQUENCY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'man_made'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasManMadeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(MAN_MADE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'man_made'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getManMadeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(MAN_MADE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:housenumber'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrHousenumberTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENUMBER_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:housenumber'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrHousenumberValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENUMBER_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:housename'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrHousenameTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENAME_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:housename'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrHousenameValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENAME_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'area'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAreaTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(AREA_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'area'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAreaValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(AREA_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'building:levels'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasBuildingLevelsTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(BUILDING_LEVELS_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'building:levels'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getBuildingLevelsValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(BUILDING_LEVELS_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'wheelchair'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWheelchairTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(WHEELCHAIR_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'wheelchair'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWheelchairValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(WHEELCHAIR_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'name'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNameTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NAME_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'name'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNameValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NAME_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'oneway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasOnewayTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ONEWAY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'oneway'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getOnewayValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ONEWAY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'FIXME'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasFIXMETag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(FIXME_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'FIXME'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getFIXMEValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(FIXME_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'capacity'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCapacityTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(CAPACITY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'capacity'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCapacityValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CAPACITY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'motorcycle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasMotorcycleTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(MOTORCYCLE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'motorcycle'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getMotorcycleValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(MOTORCYCLE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'hgv'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasHgvTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(HGV_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'hgv'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getHgvValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(HGV_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'construction'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasConstructionTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(CONSTRUCTION_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'construction'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getConstructionValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CONSTRUCTION_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:state'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrStateTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_STATE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:state'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrStateValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_STATE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'lanes'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasLanesTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(LANES_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'lanes'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getLanesValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(LANES_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'note'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNoteTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NOTE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'note'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNoteValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NOTE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'lit'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasLitTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(LIT_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'lit'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getLitValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(LIT_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'building'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasBuildingTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(BUILDING_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'building'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getBuildingValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(BUILDING_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'segregated'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasSegregatedTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SEGREGATED_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'segregated'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getSegregatedValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SEGREGATED_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:inclusion'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrInclusionTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_INCLUSION_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:inclusion'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrInclusionValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_INCLUSION_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'layer'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasLayerTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(LAYER_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'layer'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getLayerValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(LAYER_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'sport'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasSportTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SPORT_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'sport'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getSportValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SPORT_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:interpolation'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrInterpolationTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive
+                .hasKey(ADDR_INTERPOLATION_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:interpolation'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrInterpolationValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_INTERPOLATION_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'cutting'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCuttingTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(CUTTING_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'cutting'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCuttingValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CUTTING_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'amenity'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAmenityTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(AMENITY_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'amenity'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAmenityValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(AMENITY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'access'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAccessTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ACCESS_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'access'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAccessValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ACCESS_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'agricultural'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAgriculturalTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(AGRICULTURAL_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'agricultural'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAgriculturalValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(AGRICULTURAL_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'capacity:disabled'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCapacityDisabledTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive
+                .hasKey(CAPACITY_DISABLED_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'capacity:disabled'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCapacityDisabledValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CAPACITY_DISABLED_TAG)
+                : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'operator'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasOperatorTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(OPERATOR_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'operator'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getOperatorValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(OPERATOR_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasRefTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(REF_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'ref'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getRefValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(REF_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'noexit'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasNoexitTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(NOEXIT_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'noexit'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getNoexitValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(NOEXIT_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'admin_level'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAdminLevelTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADMIN_LEVEL_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'admin_level'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAdminLevelValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADMIN_LEVEL_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'source'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasSourceTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SOURCE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'source'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getSourceValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SOURCE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'tracktype'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasTracktypeTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(TRACKTYPE_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'tracktype'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getTracktypeValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(TRACKTYPE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'addr:country'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasAddrCountryTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_COUNTRY_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'addr:country'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getAddrCountryValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ADDR_COUNTRY_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'route'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasRouteTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(ROUTE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'route'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getRouteValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(ROUTE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'cables'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasCablesTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(CABLES_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'cables'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getCablesValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(CABLES_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'service'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasServiceTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(SERVICE_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'service'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getServiceValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(SERVICE_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'motorcar'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasMotorcarTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(MOTORCAR_TAG) : false;
+    }
+
+    /**
+     * Gets the value of tag 'motorcar'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getMotorcarValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(MOTORCAR_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'whitewater'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasWhitewaterTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(WHITEWATER_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'whitewater'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getWhitewaterValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(WHITEWATER_TAG) : null;
+    }
+
+    /**
+     * Check if OSM primitive has a tag 'embankment'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean hasEmbankmentTag(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.hasKey(EMBANKMENT_TAG)
+                : false;
+    }
+
+    /**
+     * Gets the value of tag 'embankment'.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static String getEmbankmentValue(OsmPrimitive osmPrimitive) {
+        return osmPrimitive != null ? osmPrimitive.get(EMBANKMENT_TAG) : null;
+    }
+
+    /**
+     * Checks if the given street supporting housenumbers. Usually motor ways and primary roads have
+     * no addresses, also no paths or tracks.
+     *
+     * @param w the w
+     * @return true, if is street supporting housenumbers
+     */
+    public static boolean isStreetSupportingHousenumbers(Way w) {
+        if (w == null) return false;
+        if (!hasHighwayTag(w)) {
+            return false;
+        }
+
+        // TODO: Should be configurable
+
+        /* Allow everything until this can be configured */
+        return true;
+        /*
+        String hwType = getHighwayValue(w);
+        return  !(TagUtils.HIGHWAY_MOTORWAY_LINK_VALUE.equals(hwType) ||
+                TagUtils.HIGHWAY_MOTORWAY_VALUE.equals(hwType) ||
+                TagUtils.HIGHWAY_FOOTWAY_VALUE.equals(hwType) ||
+                TagUtils.HIGHWAY_TRACK_VALUE.equals(hwType)
+                );*/
+    }
+
+    // Relation support
+
+    /**
+     * Check if OSM relation is a 'associatedStreet' relation.
+     *
+     * @param osmPrimitive
+     *            The OSM entity to check.
+     */
+    public static boolean isAssociatedStreetRelation(Relation rel) {
+        return rel != null &&
+            rel.hasKey(RELATION_TYPE) &&
+            ASSOCIATEDSTREET_RELATION_TYPE.equals(rel.get(RELATION_TYPE));
+    }
+
+    /**
+     * Checks if given relation member has role "street".
+     *
+     * @param relMember the relation member
+     * @return true, if is street member
+     */
+    public static boolean isStreetMember(RelationMember relMember) {
+        return relMember != null && STREET_RELATION_ROLE.equals(relMember.getRole());
+    }
+
+    /**
+     * Checks if given relation member has role "house".
+     *
+     * @param relMember the relation member
+     * @return true, if is street member
+     */
+    public static boolean isHouseMember(RelationMember relMember) {
+        return relMember != null && STREET_RELATION_ROLE.equals(relMember.getRole());
+    }
+
+    /**
+     * Checks if "addr:state" tag is required.
+     *
+     * @return true, if is state required
+     */
+    public static boolean isStateRequired() {
+        String loc = OsmUtils.getLocale();
+
+        for (int i = 0; i < COUNTRIES_REQUIRE_STATE.length; i++) {
+            if (COUNTRIES_REQUIRE_STATE[i].equals(loc)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    public static final String PARKING_TAG = "parking";
+    public static final String SHOP_TAG = "shop";
+    public static final String CRAFT_TAG = "craft";
+    public static final String SURFACE_TAG = "surface";
+    public static final String CUISINE_TAG = "cuisine";
+    public static final String WOOD_TAG = "wood";
+    public static final String FOOT_TAG = "foot";
+    public static final String NAME_DE_TAG = "name:de";
+    public static final String NAT_REF_TAG = "nat_ref";
+    public static final String NOTE_DE_TAG = "note:de";
+    public static final String ADDR_STREET_TAG = "addr:street";
+    public static final String TYPE_TAG = "type";
+    public static final String ADDR_CITY_TAG = "addr:city";
+    public static final String BOUNDARY_TAG = "boundary";
+    public static final String SMOOTHNESS_TAG = "smoothness";
+    public static final String OPENING_HOURS_TAG = "opening_hours";
+    public static final String BICYCLE_TAG = "bicycle";
+    public static final String RELIGION_TAG = "religion";
+    public static final String BARRIER_TAG = "barrier";
+    public static final String POWER_TAG = "power";
+    public static final String LANDUSE_TAG = "landuse";
+    public static final String FIREPLACE_TAG = "fireplace";
+    public static final String INT_REF_TAG = "int_ref";
+    public static final String WHITEWATER_SECTION_GRADE_TAG = "whitewater:section_grade";
+    public static final String DENOMINATION_TAG = "denomination";
+    public static final String ADDR_POSTCODE_TAG = "addr:postcode";
+    public static final String WIRES_TAG = "wires";
+    public static final String LOC_REF_TAG = "loc_ref";
+    public static final String WIDTH_TAG = "width";
+    public static final String TOURISM_TAG = "tourism";
+    public static final String LEISURE_TAG = "leisure";
+    public static final String ELECTRIFIED_TAG = "electrified";
+    public static final String JUNCTION_TAG = "junction";
+    public static final String RAILWAY_TAG = "railway";
+    public static final String VOLTAGE_TAG = "voltage";
+    public static final String BRIDGE_TAG = "bridge";
+    public static final String MOTOR_VEHICLE_TAG = "motor_vehicle";
+    public static final String COMMENT_TAG = "comment";
+    public static final String MAXSPEED_TAG = "maxspeed";
+    public static final String NATURAL_TAG = "natural";
+    public static final String BUILDING_HEIGHT_TAG = "building:height";
+    public static final String SAC_SCALE_TAG = "sac_scale";
+    public static final String TUNNEL_TAG = "tunnel";
+    public static final String WATERWAY_TAG = "waterway";
+    public static final String TRAIL_VISIBILITY_TAG = "trail_visibility";
+    public static final String HIGHWAY_TAG = "highway";
+    public static final String VEHICLE_TAG = "vehicle";
+    public static final String HORSE_TAG = "horse";
+    public static final String GOODS_TAG = "goods";
+    public static final String FREQUENCY_TAG = "frequency";
+    public static final String MAN_MADE_TAG = "man_made";
+    public static final String ADDR_HOUSENUMBER_TAG = "addr:housenumber";
+    public static final String AREA_TAG = "area";
+    public static final String BUILDING_LEVELS_TAG = "building:levels";
+    public static final String WHEELCHAIR_TAG = "wheelchair";
+    public static final String NAME_TAG = "name";
+    public static final String ONEWAY_TAG = "oneway";
+    public static final String FIXME_TAG = "FIXME";
+    public static final String CAPACITY_TAG = "capacity";
+    public static final String MOTORCYCLE_TAG = "motorcycle";
+    public static final String HGV_TAG = "hgv";
+    public static final String CONSTRUCTION_TAG = "construction";
+    public static final String ADDR_STATE_TAG = "addr:state";
+    public static final String LANES_TAG = "lanes";
+    public static final String NOTE_TAG = "note";
+    public static final String LIT_TAG = "lit";
+    public static final String BUILDING_TAG = "building";
+    public static final String SEGREGATED_TAG = "segregated";
+    public static final String ADDR_INCLUSION_TAG = "addr:inclusion";
+    public static final String LAYER_TAG = "layer";
+    public static final String SPORT_TAG = "sport";
+    public static final String ADDR_INTERPOLATION_TAG = "addr:interpolation";
+    public static final String CUTTING_TAG = "cutting";
+    public static final String AMENITY_TAG = "amenity";
+    public static final String ACCESS_TAG = "access";
+    public static final String AGRICULTURAL_TAG = "agricultural";
+    public static final String CAPACITY_DISABLED_TAG = "capacity:disabled";
+    public static final String OPERATOR_TAG = "operator";
+    public static final String REF_TAG = "ref";
+    public static final String NOEXIT_TAG = "noexit";
+    public static final String ADMIN_LEVEL_TAG = "admin_level";
+    public static final String SOURCE_TAG = "source";
+    public static final String TRACKTYPE_TAG = "tracktype";
+    public static final String ADDR_COUNTRY_TAG = "addr:country";
+    public static final String ROUTE_TAG = "route";
+    public static final String CABLES_TAG = "cables";
+    public static final String SERVICE_TAG = "service";
+    public static final String MOTORCAR_TAG = "motorcar";
+    public static final String WHITEWATER_TAG = "whitewater";
+    public static final String EMBANKMENT_TAG = "embankment";
+    public static final String ADDR_HOUSENAME_TAG = "addr:housename";
+
+    /* Highway types */
+    public static final String HIGHWAY_CYCLEWAY_VALUE = "cycleway";
+    public static final String HIGHWAY_FOOTWAY_VALUE = "footway";
+    public static final String HIGHWAY_MOTORWAY_LINK_VALUE = "motorway_link";
+    public static final String HIGHWAY_MOTORWAY_VALUE = "motorway";
+    public static final String HIGHWAY_PATH_VALUE = "path";
+    public static final String HIGHWAY_RESIDENTIAL_VALUE = "residential";
+    public static final String HIGHWAY_LIVING_STREET_VALUE = "living_street";
+    public static final String HIGHWAY_ROAD_VALUE = "road";
+    public static final String HIGHWAY_SECONDARY_VALUE = "secondary";
+    public static final String HIGHWAY_SERVICE_VALUE = "service";
+    public static final String HIGHWAY_STEPS_VALUE = "steps";
+    public static final String HIGHWAY_TERTIARY_VALUE = "tertiary";
+    public static final String HIGHWAY_TRACK_VALUE = "track";
+    public static final String HIGHWAY_TRUNK_LINK_VALUE = "trunk_link";
+    public static final String HIGHWAY_TRUNK_VALUE = "trunk";
+    public static final String HIGHWAY_UNCLASSIFIED_VALUE = "unclassified";
+
+    /* Relation keys */
+
+    // Associated street: See http://wiki.openstreetmap.org/wiki/Proposed_features/De:Hausnummern
+    public static final String RELATION_TYPE = "type";
+    public static final String ASSOCIATEDSTREET_RELATION_TYPE = "associatedStreet";
+    public static final String STREET_RELATION_ROLE = "street";
+    public static final String HOUSE_RELATION_ROLE = "house";
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -62,399 +50,399 @@
 @SuppressWarnings("serial")
 public class AddressEditDialog extends JDialog implements ActionListener, ListSelectionListener, IAddressEditContainerListener {
-	private static final String UNRESOLVED_ADDRESS = tr("Unresolved Addresses");
-	private static final String STREETS = tr("Streets");
-	private static final String UNRESOLVED_HEADER_FMT = "%s (%d)";
-	private static final String STREET_HEADER_FMT = "%s (%d)";
-	private static final String OK_COMMAND = tr("Close");
-	private static final String SELECT_AND_CLOSE = tr("Select and close");
-
-	private AddressEditContainer editContainer;
-	private JTable unresolvedTable;
-	private JTable streetTable;
-
-	private AbstractAddressEditAction[] actions = new AbstractAddressEditAction[] {
-		AddressActions.getResolveAction(),
-		AddressActions.getGuessAddressAction(),
-		AddressActions.getApplyGuessesAction(),
-		AddressActions.getSelectAction(),
-		AddressActions.getRemoveTagsAction(),
-		AddressActions.getConvertToRelationAction(),
-		AddressActions.getConvertAllToRelationAction()
-	};
-	
-	private JLabel streetLabel;
-	private JLabel unresolvedAddressesLabel;
-	private JMapViewer mapViewer;
-
-
-	/**
-	 * @param arg0
-	 * @throws HeadlessException
-	 */
-	public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException  {
-		super(JOptionPane.getFrameForComponent(Main.parent), tr("Fix unresolved addresses"), false);
-
-		this.editContainer = addressEditContainer;
-		this.editContainer.addChangedListener(this);
-		setLayout(new BorderLayout());
-		setSize(1024,600);
-		setLocationRelativeTo(null);
-
-		if (addressEditContainer != null) {
-			/* Panel for street table */
-			JPanel streetPanel = new JPanel(new BorderLayout());
-			streetTable = new JTable(new StreetTableModel(editContainer));
-			streetTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-			streetTable.getSelectionModel().addListSelectionListener(this);
-			streetTable.addKeyListener(new JumpToEntryListener(1));
-
-			JScrollPane scroll1 = new JScrollPane(streetTable);
-			streetPanel.add(scroll1, BorderLayout.CENTER);
-
-			streetLabel = createHeaderLabel(STREET_HEADER_FMT,
-					tr(STREETS),
-					editContainer.getNumberOfStreets());
-
-			JPanel headerPanel = new JPanel(new GridLayout(1, 4));
-			headerPanel.setMinimumSize(new Dimension(100, 30));
-			headerPanel.add(streetLabel);
-
-			/*
-			JPanel streetButtonPanel = new JPanel(new GridLayout(1, 3));
-			SideButton convertToRel = new SideButton(convertToRelationAction);
-			streetButtonPanel.add(convertToRel);
-			// SideButton convertAllToRel = new SideButton(convertAllToRelationAction);
-			// streetButtonPanel.add(convertAllToRel);
-			// add filler
-			streetButtonPanel.add(new JPanel());
-			streetButtonPanel.add(new JPanel());
-
-
-			streetPanel.add(streetButtonPanel, BorderLayout.SOUTH);
-			*/
-			streetPanel.add(headerPanel, BorderLayout.NORTH);
-			streetPanel.setMinimumSize(new Dimension(500, 200));
-
-			/* Panel for unresolved addresses table */
-			JPanel unresolvedPanel = new JPanel(new BorderLayout());
-			UnresolvedAddressesTableModel uaModel = new UnresolvedAddressesTableModel(editContainer);
-			unresolvedTable = new JTable(uaModel);
-			unresolvedTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-			unresolvedTable.getSelectionModel().addListSelectionListener(this);
-			unresolvedTable.getSelectionModel().addListSelectionListener(new IncompleteAddressListener());
-			unresolvedTable.addMouseListener(AddressActions.getApplyGuessesAction());
-
-			JTableHeader header = unresolvedTable.getTableHeader();
-			header.addMouseListener(uaModel.new ColumnListener(unresolvedTable));
-
-			JScrollPane scroll2 = new JScrollPane(unresolvedTable);
-			unresolvedPanel.add(scroll2, BorderLayout.CENTER);
-			unresolvedAddressesLabel = createHeaderLabel(
-					UNRESOLVED_HEADER_FMT,
-					tr(UNRESOLVED_ADDRESS),
-					editContainer.getNumberOfUnresolvedAddresses());
-
-			JPanel headerPanel2 = new JPanel(new GridLayout(1, 4));
-			headerPanel2.setMinimumSize(new Dimension(100, 30));
-			headerPanel2.add(unresolvedAddressesLabel);
-			unresolvedPanel.add(headerPanel2 , BorderLayout.NORTH);
-			unresolvedPanel.setMinimumSize(new Dimension(500, 200));
-
-
-			try {
-				JPanel unresolvedButtons = new JPanel(new GridLayout(2,5, 5, 5));
-				SideButton assign = new SideButton(AddressActions.getResolveAction());
-				unresolvedButtons.add(assign);
-
-				SideButton guess = new SideButton(AddressActions.getGuessAddressAction());
-				unresolvedButtons.add(guess);
-				SideButton applyAllGuesses = new SideButton(AddressActions.getApplyGuessesAction());
-				unresolvedButtons.add(applyAllGuesses);
-
-				SideButton removeAddressTags = new SideButton(AddressActions.getRemoveTagsAction());
-				unresolvedButtons.add(removeAddressTags);
-
-				unresolvedButtons.add(new JPanel());
-
-				SideButton selectInMap = new SideButton(AddressActions.getSelectAction());
-				unresolvedButtons.add(selectInMap);
-				headerPanel2.setMinimumSize(new Dimension(100, 70));
-
-				unresolvedPanel.add(unresolvedButtons, BorderLayout.SOUTH);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-
-			/* Map Panel */
-			JPanel mapPanel = new JPanel(new BorderLayout());
-			mapViewer = new JMapViewer();
-			mapPanel.add(mapViewer, BorderLayout.CENTER);
-			mapPanel.setMinimumSize(new Dimension(200, 200));
-			mapViewer.setVisible(false);
-
-			JPanel mapControl = new JPanel(new GridLayout(1, 4));
-			JLabel mapL1 = new JLabel(tr("Complete Addresses"));
-			mapL1.setForeground(Color.BLUE);
-			mapControl.add(mapL1);
-
-			JLabel mapL2 = new JLabel(tr("Incomplete Addresses"));
-			mapL2.setForeground(Color.RED);
-			mapControl.add(mapL2);
-
-			JLabel mapL3 = new JLabel(tr("Selected Addresses"));
-			mapL3.setForeground(Color.ORANGE);
-			mapControl.add(mapL3);
-
-			JLabel mapL4 = new JLabel(tr("Selected Street"));
-			mapL4.setForeground(Color.GREEN);
-			mapControl.add(mapL4);
-
-			mapPanel.add(mapControl, BorderLayout.SOUTH);
-
-			/* Combine panels */
-			JSplitPane unresSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, streetPanel, unresolvedPanel);
-			JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, unresSplitPane, mapPanel);
-
-			this.getContentPane().add(pane, BorderLayout.CENTER);
-			//this.getContentPane().add(mapPanel, BorderLayout.SOUTH);
-		} else {
-			this.getContentPane().add(new JLabel(tr("(No data)")), BorderLayout.CENTER);
-		}
-
-		for (int i = 0; i < actions.length; i++) {
-			actions[i].setContainer(addressEditContainer);
-		}
-
-		JPanel buttonPanel = new JPanel(new GridLayout(1,10));
-		JButton ok = new JButton(OK_COMMAND, ImageProvider.getIfAvailable(null, "ok"));
-		ok.addActionListener(this);
-		JButton selectAndClose = new JButton(SELECT_AND_CLOSE);
-		selectAndClose.addActionListener(this);
-
-		// Murks
-		for (int i = 0; i < 8; i++) {
-			buttonPanel.add(new JSeparator());
-		}
-
-		buttonPanel.add(ok);
-
-
-		this.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
-	}
-
-	/**
-	 * Creates a header label in the form "title (number)" with bold font.
-	 * @param fmtString The format string having a string and a numeric placeholder.
-	 * @param title The title of the header.
-	 * @param n The number to show in the header.
-	 * @return
-	 */
-	private JLabel createHeaderLabel(String fmtString, String title, int n) {
-		JLabel label = new JLabel(String.format(fmtString, title, n));
-		label.setFont(label.getFont().deriveFont(Font.BOLD, label.getFont().getSize() + 2));
-		label.setBorder(new EmptyBorder(5,2,4,5));
-		return label;
-	}
-
-	/**
-	 * Updates the list headings.
-	 */
-	private void updateHeaders() {
-		if (editContainer != null) {
-			streetLabel.setText(String.format(
-					STREET_HEADER_FMT,
-					STREETS,
-					editContainer.getNumberOfStreets()));
-			unresolvedAddressesLabel.setText(
-					String.format(UNRESOLVED_HEADER_FMT,
-							UNRESOLVED_ADDRESS,
-							editContainer.getNumberOfUnresolvedAddresses()));
-		} else {
-			streetLabel.setText(String.format(STREET_HEADER_FMT, 0));
-			unresolvedAddressesLabel.setText(String.format(UNRESOLVED_HEADER_FMT, 0));
-		}
-	}
-
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		if (OK_COMMAND.equals(e.getActionCommand())) {
-			this.setVisible(false);
-		}
-	}
-
-	@Override
-	public void valueChanged(ListSelectionEvent e) {
-
-		AddressEditSelectionEvent ev = new AddressEditSelectionEvent(e.getSource(),
-				streetTable, unresolvedTable, null, editContainer);
-
-		for (AbstractAddressEditAction action : actions) {
-			action.setEvent(ev);
-		}
-
-		clearMapViewer();
-		OSMStreet sNode = ev.getSelectedStreet();
-		if (sNode != null) {
-
-			//mapViewer.addMapRectangle(new BBoxMapRectangle(bb));
-			for (IOSMEntity seg : sNode.getChildren()) {
-				Way way = (Way) seg.getOsmObject();
-				//BBox bb = way.getBBox();
-
-				for (Node node : way.getNodes()) {
-					mapViewer.addMapMarker(new MapMarkerDot(Color.GREEN, node.getCoor().lat(), node.getCoor().lon()));
-				}
-			}
-
-			// show addresses as blue marker
-			if (sNode.hasAddresses()) {
-				for (OSMAddress aNode : sNode.getAddresses()) {
-					Color markerCol = Color.BLUE;
-					if (!aNode.isComplete()) {
-						markerCol = Color.RED;
-					}
-					mapViewer.addMapMarker(new MapMarkerDot(markerCol, aNode.getCoor().lat(), aNode.getCoor().lon()));
-				}
-			}
-		}
-
-		List<OSMAddress> unrAddresses = ev.getSelectedUnresolvedAddresses();
-		if (unrAddresses != null) {
-			for (OSMAddress aNode : unrAddresses) {
-				mapViewer.addMapMarker(new MapMarkerDot(Color.ORANGE, aNode.getCoor().lat(), aNode.getCoor().lon()));
-			}
-		}
-		mapViewer.setDisplayToFitMapMarkers();
-		mapViewer.setVisible(true);
-	}
-
-	/**
-	 * Removes all markers and rectangles from the map viewer.
-	 */
-	private void clearMapViewer() {
-		mapViewer.setVisible(false);
-		// remove markers and rectangles from map viewer
-		mapViewer.getMapMarkerList().clear();
-		mapViewer.getMapRectangleList().clear();
-	}
-
-	@Override
-	public void containerChanged(AddressEditContainer container) {
-		updateHeaders();
-
-		for (int i = 0; i < actions.length; i++) {
-			actions[i].setEvent(null);
-			actions[i].setContainer(container);
-		}
-	}
-
-	@Override
-	public void entityChanged(IOSMEntity entity) {
-		updateHeaders();
-	}
-
-	/**
-	 * Special listener to react on selection changes in the incomplete address list.
-	 * It searches the street table for the streets which matches best matching to the
-	 * street name given in the address.
-	 *
-	 * @author Oliver Wieland <oliver.wieland@online.de>
-	 */
-	class IncompleteAddressListener implements ListSelectionListener {
-
-		@Override
-		public void valueChanged(ListSelectionEvent e) {
-			if (unresolvedTable.getSelectedRowCount() == 1) {
-				String streetOfAddr = (String) unresolvedTable.
-											getModel().getValueAt(unresolvedTable.getSelectedRow(), 0);
-
-				int maxScore = 0, score = 0, row = -1;
-				for (int i = 0; i < streetTable.getRowCount(); i++) {
-					String streetName = (String) streetTable.getModel().getValueAt(i, 1);
-
-					score = StringUtils.lcsLength(streetOfAddr, streetName);
-					if (score > maxScore) {
-						maxScore = score;
-						row = i;
-					}
-				}
-
-				if (row > 0) {
-					streetTable.getSelectionModel().clearSelection();
-					streetTable.getSelectionModel().addSelectionInterval(row, row);
-					streetTable.scrollRectToVisible(streetTable.getCellRect(row, 0, true));
-				}
-			}
-		}
-
-	}
-
-	/**
-	 * The listener interface for receiving key events of a table.
-	 * The class that is interested in processing a jumpToEntry
-	 * event implements this interface, and the object created
-	 * with that class is registered with a component using the
-	 * component's <code>addJumpToEntryListener<code> method. When
-	 * the jumpToEntry event occurs, that object's appropriate
-	 * method is invoked.
-	 *
-	 * @see JumpToEntryEvent
-	 */
-	class JumpToEntryListener implements KeyListener {
-		private int column;
-
-		/**
-		 * Instantiates a new jump-to-entry listener.
-		 * @param column the column of the table to use for the comparison
-		 */
-		public JumpToEntryListener(int column) {
-			super();
-			this.column = column;
-		}
-
-		@Override
-		public void keyPressed(KeyEvent arg0) {
-			// TODO Auto-generated method stub
-
-		}
-
-		@Override
-		public void keyReleased(KeyEvent arg0) {
-			// TODO Auto-generated method stub
-
-		}
-
-		@Override
-		public void keyTyped(KeyEvent arg0) {
-			JTable table  = (JTable) arg0.getSource();
-
-			if (table == null) return;
-
-			TableModel model = table.getModel();
-
-			if (model == null || model.getColumnCount() == 0) {
-				return;
-			}
-			// clip column
-			if (column < 0 || column >= model.getColumnCount()) {
-				column = 0; // use the first column
-			}
-
-			char firstChar = Character.toLowerCase(arg0.getKeyChar());
-
-			// visit every row and find a matching entry
-			for (int i = 0; i < model.getRowCount(); i++) {
-				Object obj = model.getValueAt(i, column);
-				if (obj != null) {
-					String s = obj.toString();
-					if (s.length() > 0 && firstChar == Character.toLowerCase(s.charAt(0))) {
-						// select entry and make it visible in the table
-						table.getSelectionModel().setSelectionInterval(i, i);
-						table.scrollRectToVisible(streetTable.getCellRect(i, 0, true));
-						return;
-					}
-				}
-			}
-		}
-	}
+    private static final String UNRESOLVED_ADDRESS = tr("Unresolved Addresses");
+    private static final String STREETS = tr("Streets");
+    private static final String UNRESOLVED_HEADER_FMT = "%s (%d)";
+    private static final String STREET_HEADER_FMT = "%s (%d)";
+    private static final String OK_COMMAND = tr("Close");
+    private static final String SELECT_AND_CLOSE = tr("Select and close");
+
+    private AddressEditContainer editContainer;
+    private JTable unresolvedTable;
+    private JTable streetTable;
+
+    private AbstractAddressEditAction[] actions = new AbstractAddressEditAction[] {
+        AddressActions.getResolveAction(),
+        AddressActions.getGuessAddressAction(),
+        AddressActions.getApplyGuessesAction(),
+        AddressActions.getSelectAction(),
+        AddressActions.getRemoveTagsAction(),
+        AddressActions.getConvertToRelationAction(),
+        AddressActions.getConvertAllToRelationAction()
+    };
+    
+    private JLabel streetLabel;
+    private JLabel unresolvedAddressesLabel;
+    private JMapViewer mapViewer;
+
+
+    /**
+     * @param arg0
+     * @throws HeadlessException
+     */
+    public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException  {
+        super(JOptionPane.getFrameForComponent(Main.parent), tr("Fix unresolved addresses"), false);
+
+        this.editContainer = addressEditContainer;
+        this.editContainer.addChangedListener(this);
+        setLayout(new BorderLayout());
+        setSize(1024,600);
+        setLocationRelativeTo(null);
+
+        if (addressEditContainer != null) {
+            /* Panel for street table */
+            JPanel streetPanel = new JPanel(new BorderLayout());
+            streetTable = new JTable(new StreetTableModel(editContainer));
+            streetTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            streetTable.getSelectionModel().addListSelectionListener(this);
+            streetTable.addKeyListener(new JumpToEntryListener(1));
+
+            JScrollPane scroll1 = new JScrollPane(streetTable);
+            streetPanel.add(scroll1, BorderLayout.CENTER);
+
+            streetLabel = createHeaderLabel(STREET_HEADER_FMT,
+                    tr(STREETS),
+                    editContainer.getNumberOfStreets());
+
+            JPanel headerPanel = new JPanel(new GridLayout(1, 4));
+            headerPanel.setMinimumSize(new Dimension(100, 30));
+            headerPanel.add(streetLabel);
+
+            /*
+            JPanel streetButtonPanel = new JPanel(new GridLayout(1, 3));
+            SideButton convertToRel = new SideButton(convertToRelationAction);
+            streetButtonPanel.add(convertToRel);
+            // SideButton convertAllToRel = new SideButton(convertAllToRelationAction);
+            // streetButtonPanel.add(convertAllToRel);
+            // add filler
+            streetButtonPanel.add(new JPanel());
+            streetButtonPanel.add(new JPanel());
+
+
+            streetPanel.add(streetButtonPanel, BorderLayout.SOUTH);
+            */
+            streetPanel.add(headerPanel, BorderLayout.NORTH);
+            streetPanel.setMinimumSize(new Dimension(500, 200));
+
+            /* Panel for unresolved addresses table */
+            JPanel unresolvedPanel = new JPanel(new BorderLayout());
+            UnresolvedAddressesTableModel uaModel = new UnresolvedAddressesTableModel(editContainer);
+            unresolvedTable = new JTable(uaModel);
+            unresolvedTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+            unresolvedTable.getSelectionModel().addListSelectionListener(this);
+            unresolvedTable.getSelectionModel().addListSelectionListener(new IncompleteAddressListener());
+            unresolvedTable.addMouseListener(AddressActions.getApplyGuessesAction());
+
+            JTableHeader header = unresolvedTable.getTableHeader();
+            header.addMouseListener(uaModel.new ColumnListener(unresolvedTable));
+
+            JScrollPane scroll2 = new JScrollPane(unresolvedTable);
+            unresolvedPanel.add(scroll2, BorderLayout.CENTER);
+            unresolvedAddressesLabel = createHeaderLabel(
+                    UNRESOLVED_HEADER_FMT,
+                    tr(UNRESOLVED_ADDRESS),
+                    editContainer.getNumberOfUnresolvedAddresses());
+
+            JPanel headerPanel2 = new JPanel(new GridLayout(1, 4));
+            headerPanel2.setMinimumSize(new Dimension(100, 30));
+            headerPanel2.add(unresolvedAddressesLabel);
+            unresolvedPanel.add(headerPanel2 , BorderLayout.NORTH);
+            unresolvedPanel.setMinimumSize(new Dimension(500, 200));
+
+
+            try {
+                JPanel unresolvedButtons = new JPanel(new GridLayout(2,5, 5, 5));
+                SideButton assign = new SideButton(AddressActions.getResolveAction());
+                unresolvedButtons.add(assign);
+
+                SideButton guess = new SideButton(AddressActions.getGuessAddressAction());
+                unresolvedButtons.add(guess);
+                SideButton applyAllGuesses = new SideButton(AddressActions.getApplyGuessesAction());
+                unresolvedButtons.add(applyAllGuesses);
+
+                SideButton removeAddressTags = new SideButton(AddressActions.getRemoveTagsAction());
+                unresolvedButtons.add(removeAddressTags);
+
+                unresolvedButtons.add(new JPanel());
+
+                SideButton selectInMap = new SideButton(AddressActions.getSelectAction());
+                unresolvedButtons.add(selectInMap);
+                headerPanel2.setMinimumSize(new Dimension(100, 70));
+
+                unresolvedPanel.add(unresolvedButtons, BorderLayout.SOUTH);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+            /* Map Panel */
+            JPanel mapPanel = new JPanel(new BorderLayout());
+            mapViewer = new JMapViewer();
+            mapPanel.add(mapViewer, BorderLayout.CENTER);
+            mapPanel.setMinimumSize(new Dimension(200, 200));
+            mapViewer.setVisible(false);
+
+            JPanel mapControl = new JPanel(new GridLayout(1, 4));
+            JLabel mapL1 = new JLabel(tr("Complete Addresses"));
+            mapL1.setForeground(Color.BLUE);
+            mapControl.add(mapL1);
+
+            JLabel mapL2 = new JLabel(tr("Incomplete Addresses"));
+            mapL2.setForeground(Color.RED);
+            mapControl.add(mapL2);
+
+            JLabel mapL3 = new JLabel(tr("Selected Addresses"));
+            mapL3.setForeground(Color.ORANGE);
+            mapControl.add(mapL3);
+
+            JLabel mapL4 = new JLabel(tr("Selected Street"));
+            mapL4.setForeground(Color.GREEN);
+            mapControl.add(mapL4);
+
+            mapPanel.add(mapControl, BorderLayout.SOUTH);
+
+            /* Combine panels */
+            JSplitPane unresSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, streetPanel, unresolvedPanel);
+            JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, unresSplitPane, mapPanel);
+
+            this.getContentPane().add(pane, BorderLayout.CENTER);
+            //this.getContentPane().add(mapPanel, BorderLayout.SOUTH);
+        } else {
+            this.getContentPane().add(new JLabel(tr("(No data)")), BorderLayout.CENTER);
+        }
+
+        for (int i = 0; i < actions.length; i++) {
+            actions[i].setContainer(addressEditContainer);
+        }
+
+        JPanel buttonPanel = new JPanel(new GridLayout(1,10));
+        JButton ok = new JButton(OK_COMMAND, ImageProvider.getIfAvailable(null, "ok"));
+        ok.addActionListener(this);
+        JButton selectAndClose = new JButton(SELECT_AND_CLOSE);
+        selectAndClose.addActionListener(this);
+
+        // Murks
+        for (int i = 0; i < 8; i++) {
+            buttonPanel.add(new JSeparator());
+        }
+
+        buttonPanel.add(ok);
+
+
+        this.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
+    }
+
+    /**
+     * Creates a header label in the form "title (number)" with bold font.
+     * @param fmtString The format string having a string and a numeric placeholder.
+     * @param title The title of the header.
+     * @param n The number to show in the header.
+     * @return
+     */
+    private JLabel createHeaderLabel(String fmtString, String title, int n) {
+        JLabel label = new JLabel(String.format(fmtString, title, n));
+        label.setFont(label.getFont().deriveFont(Font.BOLD, label.getFont().getSize() + 2));
+        label.setBorder(new EmptyBorder(5,2,4,5));
+        return label;
+    }
+
+    /**
+     * Updates the list headings.
+     */
+    private void updateHeaders() {
+        if (editContainer != null) {
+            streetLabel.setText(String.format(
+                    STREET_HEADER_FMT,
+                    STREETS,
+                    editContainer.getNumberOfStreets()));
+            unresolvedAddressesLabel.setText(
+                    String.format(UNRESOLVED_HEADER_FMT,
+                            UNRESOLVED_ADDRESS,
+                            editContainer.getNumberOfUnresolvedAddresses()));
+        } else {
+            streetLabel.setText(String.format(STREET_HEADER_FMT, 0));
+            unresolvedAddressesLabel.setText(String.format(UNRESOLVED_HEADER_FMT, 0));
+        }
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        if (OK_COMMAND.equals(e.getActionCommand())) {
+            this.setVisible(false);
+        }
+    }
+
+    @Override
+    public void valueChanged(ListSelectionEvent e) {
+
+        AddressEditSelectionEvent ev = new AddressEditSelectionEvent(e.getSource(),
+                streetTable, unresolvedTable, null, editContainer);
+
+        for (AbstractAddressEditAction action : actions) {
+            action.setEvent(ev);
+        }
+
+        clearMapViewer();
+        OSMStreet sNode = ev.getSelectedStreet();
+        if (sNode != null) {
+
+            //mapViewer.addMapRectangle(new BBoxMapRectangle(bb));
+            for (IOSMEntity seg : sNode.getChildren()) {
+                Way way = (Way) seg.getOsmObject();
+                //BBox bb = way.getBBox();
+
+                for (Node node : way.getNodes()) {
+                    mapViewer.addMapMarker(new MapMarkerDot(Color.GREEN, node.getCoor().lat(), node.getCoor().lon()));
+                }
+            }
+
+            // show addresses as blue marker
+            if (sNode.hasAddresses()) {
+                for (OSMAddress aNode : sNode.getAddresses()) {
+                    Color markerCol = Color.BLUE;
+                    if (!aNode.isComplete()) {
+                        markerCol = Color.RED;
+                    }
+                    mapViewer.addMapMarker(new MapMarkerDot(markerCol, aNode.getCoor().lat(), aNode.getCoor().lon()));
+                }
+            }
+        }
+
+        List<OSMAddress> unrAddresses = ev.getSelectedUnresolvedAddresses();
+        if (unrAddresses != null) {
+            for (OSMAddress aNode : unrAddresses) {
+                mapViewer.addMapMarker(new MapMarkerDot(Color.ORANGE, aNode.getCoor().lat(), aNode.getCoor().lon()));
+            }
+        }
+        mapViewer.setDisplayToFitMapMarkers();
+        mapViewer.setVisible(true);
+    }
+
+    /**
+     * Removes all markers and rectangles from the map viewer.
+     */
+    private void clearMapViewer() {
+        mapViewer.setVisible(false);
+        // remove markers and rectangles from map viewer
+        mapViewer.getMapMarkerList().clear();
+        mapViewer.getMapRectangleList().clear();
+    }
+
+    @Override
+    public void containerChanged(AddressEditContainer container) {
+        updateHeaders();
+
+        for (int i = 0; i < actions.length; i++) {
+            actions[i].setEvent(null);
+            actions[i].setContainer(container);
+        }
+    }
+
+    @Override
+    public void entityChanged(IOSMEntity entity) {
+        updateHeaders();
+    }
+
+    /**
+     * Special listener to react on selection changes in the incomplete address list.
+     * It searches the street table for the streets which matches best matching to the
+     * street name given in the address.
+     *
+     * @author Oliver Wieland <oliver.wieland@online.de>
+     */
+    class IncompleteAddressListener implements ListSelectionListener {
+
+        @Override
+        public void valueChanged(ListSelectionEvent e) {
+            if (unresolvedTable.getSelectedRowCount() == 1) {
+                String streetOfAddr = (String) unresolvedTable.
+                                            getModel().getValueAt(unresolvedTable.getSelectedRow(), 0);
+
+                int maxScore = 0, score = 0, row = -1;
+                for (int i = 0; i < streetTable.getRowCount(); i++) {
+                    String streetName = (String) streetTable.getModel().getValueAt(i, 1);
+
+                    score = StringUtils.lcsLength(streetOfAddr, streetName);
+                    if (score > maxScore) {
+                        maxScore = score;
+                        row = i;
+                    }
+                }
+
+                if (row > 0) {
+                    streetTable.getSelectionModel().clearSelection();
+                    streetTable.getSelectionModel().addSelectionInterval(row, row);
+                    streetTable.scrollRectToVisible(streetTable.getCellRect(row, 0, true));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * The listener interface for receiving key events of a table.
+     * The class that is interested in processing a jumpToEntry
+     * event implements this interface, and the object created
+     * with that class is registered with a component using the
+     * component's <code>addJumpToEntryListener<code> method. When
+     * the jumpToEntry event occurs, that object's appropriate
+     * method is invoked.
+     *
+     * @see JumpToEntryEvent
+     */
+    class JumpToEntryListener implements KeyListener {
+        private int column;
+
+        /**
+         * Instantiates a new jump-to-entry listener.
+         * @param column the column of the table to use for the comparison
+         */
+        public JumpToEntryListener(int column) {
+            super();
+            this.column = column;
+        }
+
+        @Override
+        public void keyPressed(KeyEvent arg0) {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        public void keyReleased(KeyEvent arg0) {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        public void keyTyped(KeyEvent arg0) {
+            JTable table  = (JTable) arg0.getSource();
+
+            if (table == null) return;
+
+            TableModel model = table.getModel();
+
+            if (model == null || model.getColumnCount() == 0) {
+                return;
+            }
+            // clip column
+            if (column < 0 || column >= model.getColumnCount()) {
+                column = 0; // use the first column
+            }
+
+            char firstChar = Character.toLowerCase(arg0.getKeyChar());
+
+            // visit every row and find a matching entry
+            for (int i = 0; i < model.getRowCount(); i++) {
+                Object obj = model.getValueAt(i, column);
+                if (obj != null) {
+                    String s = obj.toString();
+                    if (s.length() > 0 && firstChar == Character.toLowerCase(s.charAt(0))) {
+                        // select entry and make it visible in the table
+                        table.getSelectionModel().setSelectionInterval(i, i);
+                        table.scrollRectToVisible(streetTable.getCellRect(i, 0, true));
+                        return;
+                    }
+                }
+            }
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -27,93 +15,93 @@
 
 public class AddressEditModel {
-	private List<OSMStreet> streets;
-	private List<OSMAddress> unresolvedAddresses;
-	private List<OSMAddress> incompleteAddresses = new ArrayList<OSMAddress>();
-	private DefaultMutableTreeNode streetRoot;
-	private DefaultMutableTreeNode unresolvedRoot;
-	private DefaultMutableTreeNode incompleteRoot;
+    private List<OSMStreet> streets;
+    private List<OSMAddress> unresolvedAddresses;
+    private List<OSMAddress> incompleteAddresses = new ArrayList<OSMAddress>();
+    private DefaultMutableTreeNode streetRoot;
+    private DefaultMutableTreeNode unresolvedRoot;
+    private DefaultMutableTreeNode incompleteRoot;
 
-	/**
-	 * @param streets
-	 * @param unresolvedAddresses
-	 */
-	public AddressEditModel(List<OSMStreet> streets,
-			List<OSMAddress> unresolvedAddresses) {
-		super();
-		this.streets = streets;
-		this.unresolvedAddresses = unresolvedAddresses;
-	}
+    /**
+     * @param streets
+     * @param unresolvedAddresses
+     */
+    public AddressEditModel(List<OSMStreet> streets,
+            List<OSMAddress> unresolvedAddresses) {
+        super();
+        this.streets = streets;
+        this.unresolvedAddresses = unresolvedAddresses;
+    }
 
-	public TreeNode getStreetsTree() {
-		if (streets == null) return new DefaultMutableTreeNode(tr("(No data)"));
+    public TreeNode getStreetsTree() {
+        if (streets == null) return new DefaultMutableTreeNode(tr("(No data)"));
 
-		if (streetRoot == null) {
-			streetRoot = new DefaultMutableTreeNode();
-			for (OSMStreet sNode : streets) {
-				DefaultMutableTreeNode treeStreetNode = new DefaultMutableTreeNode(sNode);
+        if (streetRoot == null) {
+            streetRoot = new DefaultMutableTreeNode();
+            for (OSMStreet sNode : streets) {
+                DefaultMutableTreeNode treeStreetNode = new DefaultMutableTreeNode(sNode);
 
-				DefaultMutableTreeNode segmentsNode = new DefaultMutableTreeNode(tr("Segments"));
-				treeStreetNode.add(segmentsNode);
+                DefaultMutableTreeNode segmentsNode = new DefaultMutableTreeNode(tr("Segments"));
+                treeStreetNode.add(segmentsNode);
 
-				// Add street segment(s)
-				for (IOSMEntity child : sNode.getChildren()) {
-					segmentsNode.add(new DefaultMutableTreeNode(child));
-				}
+                // Add street segment(s)
+                for (IOSMEntity child : sNode.getChildren()) {
+                    segmentsNode.add(new DefaultMutableTreeNode(child));
+                }
 
-				if (sNode.hasAddresses()) {
-					// Add address nodes
-					DefaultMutableTreeNode addressNode = new DefaultMutableTreeNode(tr("Addresses"));
-					treeStreetNode.add(addressNode);
+                if (sNode.hasAddresses()) {
+                    // Add address nodes
+                    DefaultMutableTreeNode addressNode = new DefaultMutableTreeNode(tr("Addresses"));
+                    treeStreetNode.add(addressNode);
 
-					for (OSMAddress addr : sNode.getAddresses()) {
-						addressNode.add(new DefaultMutableTreeNode(addr));
-						if (!addr.isComplete()) {
-							incompleteAddresses.add(addr);
-						}
-					}
-				}
-				streetRoot.add(treeStreetNode);
-			}
-		}
+                    for (OSMAddress addr : sNode.getAddresses()) {
+                        addressNode.add(new DefaultMutableTreeNode(addr));
+                        if (!addr.isComplete()) {
+                            incompleteAddresses.add(addr);
+                        }
+                    }
+                }
+                streetRoot.add(treeStreetNode);
+            }
+        }
 
-		return streetRoot;
-	}
+        return streetRoot;
+    }
 
-	/**
-	 * Gets the tree node containing all unresolved addresses.
-	 * @return
-	 */
-	public TreeNode getUnresolvedAddressesTree() {
-		if (unresolvedAddresses == null) return new DefaultMutableTreeNode(tr("(No data)"));
+    /**
+     * Gets the tree node containing all unresolved addresses.
+     * @return
+     */
+    public TreeNode getUnresolvedAddressesTree() {
+        if (unresolvedAddresses == null) return new DefaultMutableTreeNode(tr("(No data)"));
 
-		if (unresolvedRoot == null) {
-			unresolvedRoot = new DefaultMutableTreeNode();
+        if (unresolvedRoot == null) {
+            unresolvedRoot = new DefaultMutableTreeNode();
 
-			for (OSMAddress addr : unresolvedAddresses) {
-				// Add address nodes
-				unresolvedRoot.add(new DefaultMutableTreeNode(addr));
-			}
-		}
+            for (OSMAddress addr : unresolvedAddresses) {
+                // Add address nodes
+                unresolvedRoot.add(new DefaultMutableTreeNode(addr));
+            }
+        }
 
-		return unresolvedRoot;
-	}
+        return unresolvedRoot;
+    }
 
-	/**
-	 * Gets the tree node containing all incomplete addresses.
-	 * @return
-	 */
-	public TreeNode getIncompleteAddressesTree() {
-		if (incompleteAddresses == null) return new DefaultMutableTreeNode(tr("(No data)"));
+    /**
+     * Gets the tree node containing all incomplete addresses.
+     * @return
+     */
+    public TreeNode getIncompleteAddressesTree() {
+        if (incompleteAddresses == null) return new DefaultMutableTreeNode(tr("(No data)"));
 
-		if (incompleteRoot == null) {
-			incompleteRoot = new DefaultMutableTreeNode();
+        if (incompleteRoot == null) {
+            incompleteRoot = new DefaultMutableTreeNode();
 
-			for (OSMAddress addr : incompleteAddresses) {
-				// Add address nodes
-				incompleteRoot.add(new DefaultMutableTreeNode(addr));
-			}
-		}
+            for (OSMAddress addr : incompleteAddresses) {
+                // Add address nodes
+                incompleteRoot.add(new DefaultMutableTreeNode(addr));
+            }
+        }
 
-		return incompleteRoot;
-	}
+        return incompleteRoot;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditSelectionEvent.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditSelectionEvent.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditSelectionEvent.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -25,178 +13,178 @@
 
 public class AddressEditSelectionEvent extends ActionEvent {
-	/**
-	 *
-	 */
-	private static final long serialVersionUID = -93034483427803409L;
-	private JTable streetTable;
-	private JTable unresolvedAddressTable;
-	private JTable incompleteAddressTable;
-	private AddressEditContainer addressContainer;
+    /**
+     *
+     */
+    private static final long serialVersionUID = -93034483427803409L;
+    private JTable streetTable;
+    private JTable unresolvedAddressTable;
+    private JTable incompleteAddressTable;
+    private AddressEditContainer addressContainer;
 
-	private List<OSMAddress> unresolvedCache;
-	private List<OSMAddress> incompleteCache;
+    private List<OSMAddress> unresolvedCache;
+    private List<OSMAddress> incompleteCache;
 
-	/**
-	 * Creates a new 'AddressEditSelectionEvent'.
-	 * @param source The event source.
-	 * @param selStreet The street table component.
-	 * @param unresolvedAddresses The unresolved addresses table component.
-	 * @param incomplete The incomplete addresses table component.
-	 * @param container The address container instance holding the entities for streets and addresses.
-	 */
-	public AddressEditSelectionEvent(Object source, JTable selStreet, JTable unresolvedAddresses, JTable incompleteAddresses, AddressEditContainer container) {
-		super(source, -1, "");
-		this.streetTable = selStreet;
-		this.unresolvedAddressTable = unresolvedAddresses;
-		this.incompleteAddressTable = incompleteAddresses;
-		this.addressContainer = container;
-	}
+    /**
+     * Creates a new 'AddressEditSelectionEvent'.
+     * @param source The event source.
+     * @param selStreet The street table component.
+     * @param unresolvedAddresses The unresolved addresses table component.
+     * @param incomplete The incomplete addresses table component.
+     * @param container The address container instance holding the entities for streets and addresses.
+     */
+    public AddressEditSelectionEvent(Object source, JTable selStreet, JTable unresolvedAddresses, JTable incompleteAddresses, AddressEditContainer container) {
+        super(source, -1, "");
+        this.streetTable = selStreet;
+        this.unresolvedAddressTable = unresolvedAddresses;
+        this.incompleteAddressTable = incompleteAddresses;
+        this.addressContainer = container;
+    }
 
-	/**
-	 * Gets the street table component.
-	 * @return
-	 */
-	public JTable getStreetTable() {
-		return streetTable;
-	}
+    /**
+     * Gets the street table component.
+     * @return
+     */
+    public JTable getStreetTable() {
+        return streetTable;
+    }
 
-	/**
-	 * Gets the 'unresolved addresses' table component.
-	 * @return
-	 */
-	public JTable getUnresolvedAddressTable() {
-		return unresolvedAddressTable;
-	}
+    /**
+     * Gets the 'unresolved addresses' table component.
+     * @return
+     */
+    public JTable getUnresolvedAddressTable() {
+        return unresolvedAddressTable;
+    }
 
-	/**
-	 * @return the incompleteAddressTable
-	 */
-	protected JTable getIncompleteAddressTable() {
-		return incompleteAddressTable;
-	}
+    /**
+     * @return the incompleteAddressTable
+     */
+    protected JTable getIncompleteAddressTable() {
+        return incompleteAddressTable;
+    }
 
-	/**
-	 * Gets the address container.
-	 *
-	 * @return the address container
-	 */
-	public AddressEditContainer getAddressContainer() {
-		return addressContainer;
-	}
+    /**
+     * Gets the address container.
+     *
+     * @return the address container
+     */
+    public AddressEditContainer getAddressContainer() {
+        return addressContainer;
+    }
 
-	/**
-	 * Gets the selected street of the street table.
-	 * @return
-	 */
-	public OSMStreet getSelectedStreet() {
-		if (streetTable != null && addressContainer != null && addressContainer.getStreetList() != null) {
-			int selRows = streetTable.getSelectedRow();
+    /**
+     * Gets the selected street of the street table.
+     * @return
+     */
+    public OSMStreet getSelectedStreet() {
+        if (streetTable != null && addressContainer != null && addressContainer.getStreetList() != null) {
+            int selRows = streetTable.getSelectedRow();
 
-			if (selRows < 0 || selRows >= addressContainer.getNumberOfStreets()) {
-				return null;
-			}
+            if (selRows < 0 || selRows >= addressContainer.getNumberOfStreets()) {
+                return null;
+            }
 
-			return addressContainer.getStreetList().get(selRows);
-		}
-		return null;
-	}
+            return addressContainer.getStreetList().get(selRows);
+        }
+        return null;
+    }
 
-	/**
-	 * Checks for addresses.
-	 *
-	 * @return true, if successful
-	 */
-	public boolean hasAddresses() {
-		return hasIncompleteAddresses() || hasUnresolvedAddresses();
-	}
+    /**
+     * Checks for addresses.
+     *
+     * @return true, if successful
+     */
+    public boolean hasAddresses() {
+        return hasIncompleteAddresses() || hasUnresolvedAddresses();
+    }
 
-	/**
-	 * Checks for incomplete addresses.
-	 *
-	 * @return true, if successful
-	 */
-	public boolean hasIncompleteAddresses() {
-		return getSelectedIncompleteAddresses() != null;
-	}
+    /**
+     * Checks for incomplete addresses.
+     *
+     * @return true, if successful
+     */
+    public boolean hasIncompleteAddresses() {
+        return getSelectedIncompleteAddresses() != null;
+    }
 
-	/**
-	 * Checks for unresolved addresses.
-	 *
-	 * @return true, if successful
-	 */
-	public boolean hasUnresolvedAddresses() {
-		return getSelectedUnresolvedAddresses() != null;
-	}
+    /**
+     * Checks for unresolved addresses.
+     *
+     * @return true, if successful
+     */
+    public boolean hasUnresolvedAddresses() {
+        return getSelectedUnresolvedAddresses() != null;
+    }
 
-	/**
-	 * Checks for addresses with guesses.
-	 *
-	 * @return true, if successful
-	 */
-	public boolean hasAddressesWithGuesses() {
-		if (hasIncompleteAddresses()) {
-			for (OSMAddress addr : getSelectedIncompleteAddresses()) {
-				if (addr.hasGuesses()) {
-					return true;
-				}
-			}
-		}
+    /**
+     * Checks for addresses with guesses.
+     *
+     * @return true, if successful
+     */
+    public boolean hasAddressesWithGuesses() {
+        if (hasIncompleteAddresses()) {
+            for (OSMAddress addr : getSelectedIncompleteAddresses()) {
+                if (addr.hasGuesses()) {
+                    return true;
+                }
+            }
+        }
 
-		if (hasUnresolvedAddresses()) {
-			for (OSMAddress addr : getSelectedUnresolvedAddresses()) {
-				if (addr.hasGuesses()) {
-					return true;
-				}
-			}
-		}
+        if (hasUnresolvedAddresses()) {
+            for (OSMAddress addr : getSelectedUnresolvedAddresses()) {
+                if (addr.hasGuesses()) {
+                    return true;
+                }
+            }
+        }
 
-		return false;
-	}
+        return false;
+    }
 
-	/**
-	 * Gets the list containing the selected items of the 'unresolved addresses ' table.
-	 * @return
-	 */
-	public List<OSMAddress> getSelectedUnresolvedAddresses() {
-		if (unresolvedAddressTable != null &&
-				addressContainer != null &&
-				unresolvedCache == null) {
+    /**
+     * Gets the list containing the selected items of the 'unresolved addresses ' table.
+     * @return
+     */
+    public List<OSMAddress> getSelectedUnresolvedAddresses() {
+        if (unresolvedAddressTable != null &&
+                addressContainer != null &&
+                unresolvedCache == null) {
 
-			int[] selRows = unresolvedAddressTable.getSelectedRows();
+            int[] selRows = unresolvedAddressTable.getSelectedRows();
 
-			unresolvedCache = new ArrayList<OSMAddress>();
-			for (int i = 0; i < selRows.length; i++) {
-				if (selRows[i] >= 0 && selRows[i] < addressContainer.getNumberOfUnresolvedAddresses()) {
-					unresolvedCache.add(addressContainer.getUnresolvedAddresses().get(selRows[i]));
-				}
-			}
-			return unresolvedCache;
-		} else {
-			return unresolvedCache;
-		}
-	}
+            unresolvedCache = new ArrayList<OSMAddress>();
+            for (int i = 0; i < selRows.length; i++) {
+                if (selRows[i] >= 0 && selRows[i] < addressContainer.getNumberOfUnresolvedAddresses()) {
+                    unresolvedCache.add(addressContainer.getUnresolvedAddresses().get(selRows[i]));
+                }
+            }
+            return unresolvedCache;
+        } else {
+            return unresolvedCache;
+        }
+    }
 
-	/**
-	 * Gets the selected incomplete addresses.
-	 *
-	 * @return the selected incomplete addresses
-	 */
-	public List<OSMAddress> getSelectedIncompleteAddresses() {
-		if (incompleteAddressTable != null &&
-				addressContainer != null &&
-				incompleteCache == null) {
+    /**
+     * Gets the selected incomplete addresses.
+     *
+     * @return the selected incomplete addresses
+     */
+    public List<OSMAddress> getSelectedIncompleteAddresses() {
+        if (incompleteAddressTable != null &&
+                addressContainer != null &&
+                incompleteCache == null) {
 
-			int[] selRows = incompleteAddressTable.getSelectedRows();
+            int[] selRows = incompleteAddressTable.getSelectedRows();
 
-			incompleteCache = new ArrayList<OSMAddress>();
-			for (int i = 0; i < selRows.length; i++) {
-				if (selRows[i] >= 0 && selRows[i] < addressContainer.getNumberOfIncompleteAddresses()) {
-					incompleteCache.add(addressContainer.getIncompleteAddresses().get(selRows[i]));
-				}
-			}
-			return incompleteCache;
-		} else {
-			return incompleteCache; // equals null, if no data is present
-		}
-	}
+            incompleteCache = new ArrayList<OSMAddress>();
+            for (int i = 0; i < selRows.length; i++) {
+                if (selRows[i] >= 0 && selRows[i] < addressContainer.getNumberOfIncompleteAddresses()) {
+                    incompleteCache.add(addressContainer.getIncompleteAddresses().get(selRows[i]));
+                }
+            }
+            return incompleteCache;
+        } else {
+            return incompleteCache; // equals null, if no data is present
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -31,167 +19,161 @@
 @SuppressWarnings("serial")
 public abstract class AddressEditTableModel extends DefaultTableModel implements
-		IAddressEditContainerListener {
+        IAddressEditContainerListener {
 
-	protected AddressEditContainer addressContainer;
-	protected int sortCol = 0;
-	protected boolean isSortAsc = true;
+    protected AddressEditContainer addressContainer;
+    protected int sortCol = 0;
+    protected boolean isSortAsc = true;
 
-	public AddressEditTableModel(AddressEditContainer addressContainer) {
-		super();
-		this.addressContainer = addressContainer;
-		addressContainer.addChangedListener(this);
-	}
+    public AddressEditTableModel(AddressEditContainer addressContainer) {
+        super();
+        this.addressContainer = addressContainer;
+        addressContainer.addChangedListener(this);
+    }
 
-	@Override
-	public void containerChanged(AddressEditContainer container) {
-		if (SwingUtilities.isEventDispatchThread()) {
-			fireTableDataChanged(); // update model
-		} else {
-			SwingUtilities.invokeLater(new Runnable() {
-				
-				@Override
-				public void run() {
-					fireTableDataChanged(); // update model					
-				}
-			});
-		}
-	}
+    @Override
+    public void containerChanged(AddressEditContainer container) {
+        if (SwingUtilities.isEventDispatchThread()) {
+            fireTableDataChanged(); // update model
+        } else {
+            SwingUtilities.invokeLater(new Runnable() {
+                
+                @Override
+                public void run() {
+                    fireTableDataChanged(); // update model                    
+                }
+            });
+        }
+    }
 
-	@Override
-	public void entityChanged(IOSMEntity entity) {
-		int row = getRowOfEntity(entity);
-		if (row != -1) { // valid row? -> update model
-			fireTableRowsUpdated(row, row);
-		} // else we don't do anything
-	}
+    @Override
+    public void entityChanged(IOSMEntity entity) {
+        int row = getRowOfEntity(entity);
+        if (row != -1) { // valid row? -> update model
+            fireTableRowsUpdated(row, row);
+        } // else we don't do anything
+    }
 
-	/**
-	 * Gets the node entity for the given row or null; if row contains no
-	 * entity.
-	 *
-	 * @param row
-	 *            The row to get the entity object for.
-	 * @return
-	 */
-	public abstract IOSMEntity getEntityOfRow(int row);
+    /**
+     * Gets the node entity for the given row or null; if row contains no
+     * entity.
+     *
+     * @param row
+     *            The row to get the entity object for.
+     * @return
+     */
+    public abstract IOSMEntity getEntityOfRow(int row);
 
-	/**
-	 * Gets the row for the given node entity or -1; if the model does not
-	 * contain the entity.
-	 *
-	 * @param entity
-	 *            The entity to get the row for.
-	 * @return
-	 */
-	public abstract int getRowOfEntity(IOSMEntity entity);
+    /**
+     * Gets the row for the given node entity or -1; if the model does not
+     * contain the entity.
+     *
+     * @param entity
+     *            The entity to get the row for.
+     * @return
+     */
+    public abstract int getRowOfEntity(IOSMEntity entity);
 
-	/**
-	 * Sorts the model data by the given column.
-	 *
-	 * @param column
-	 *            the column
-	 * @param ascending
-	 *            the ascending
-	 */
-	protected abstract void sortByColumn(int column, boolean ascending);
+    /**
+     * Sorts the model data by the given column.
+     *
+     * @param column
+     *            the column
+     * @param ascending
+     *            the ascending
+     */
+    protected abstract void sortByColumn(int column, boolean ascending);
 
 
-	/**
-	 * The listener interface for receiving column events.
-	 * The class that is interested in processing a column
-	 * event implements this interface, and the object created
-	 * with that class is registered with a component using the
-	 * component's <code>addColumnListener<code> method. When
-	 * the column event occurs, that object's appropriate
-	 * method is invoked.
-	 *
-	 * @see ColumnEvent
-	 */
-	class ColumnListener extends MouseAdapter {
-		protected JTable table;
+    /**
+     * The listener interface for receiving column events.
+     * The class that is interested in processing a column
+     * event implements this interface, and the object created
+     * with that class is registered with a component using the
+     * component's <code>addColumnListener<code> method. When
+     * the column event occurs, that object's appropriate
+     * method is invoked.
+     *
+     * @see ColumnEvent
+     */
+    class ColumnListener extends MouseAdapter {
+        protected JTable table;
 
-		/**
-		 * Instantiates a new column listener.
-		 *
-		 * @param t the t
-		 */
-		public ColumnListener(JTable t) {
-			table = t;
-		}
+        /**
+         * Instantiates a new column listener.
+         *
+         * @param t the t
+         */
+        public ColumnListener(JTable t) {
+            table = t;
+        }
 
-		/* (non-Javadoc)
-		 * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
-		 */
-		public void mouseClicked(MouseEvent e) {
-			TableColumnModel colModel = table.getColumnModel();
-			int columnModelIndex = colModel.getColumnIndexAtX(e.getX());
-			int modelIndex = colModel.getColumn(columnModelIndex)
-					.getModelIndex();
+        public void mouseClicked(MouseEvent e) {
+            TableColumnModel colModel = table.getColumnModel();
+            int columnModelIndex = colModel.getColumnIndexAtX(e.getX());
+            int modelIndex = colModel.getColumn(columnModelIndex)
+                    .getModelIndex();
 
-			if (modelIndex < 0) {
-				return;
-			}
-			// Same column? If yes, flip order
-			if (sortCol == modelIndex) {
-				isSortAsc = !isSortAsc;
-			} else {
-				sortCol = modelIndex;
-			}
+            if (modelIndex < 0) {
+                return;
+            }
+            // Same column? If yes, flip order
+            if (sortCol == modelIndex) {
+                isSortAsc = !isSortAsc;
+            } else {
+                sortCol = modelIndex;
+            }
 
-			for (int i = 0; i < colModel.getColumnCount(); i++) {
-				TableColumn column = colModel.getColumn(i);
-				column.setHeaderValue(getColumnName(column.getModelIndex()));
-			}
-			table.getTableHeader().repaint();
+            for (int i = 0; i < colModel.getColumnCount(); i++) {
+                TableColumn column = colModel.getColumn(i);
+                column.setHeaderValue(getColumnName(column.getModelIndex()));
+            }
+            table.getTableHeader().repaint();
 
-			//Collections.sort(addressContainer, new MyComparator(isSortAsc));
+            //Collections.sort(addressContainer, new MyComparator(isSortAsc));
 
-			sortByColumn(sortCol, isSortAsc);
-			table.tableChanged(new TableModelEvent(AddressEditTableModel.this));
-			table.repaint();
-		}
-	}
+            sortByColumn(sortCol, isSortAsc);
+            table.tableChanged(new TableModelEvent(AddressEditTableModel.this));
+            table.repaint();
+        }
+    }
 
-	/**
-	 * Internal base class to sort items by different columns.
-	 */
-	protected abstract class ColumnSorter<E> implements Comparator<E> {
-		private int column;
-		private boolean ascending;
+    /**
+     * Internal base class to sort items by different columns.
+     */
+    protected abstract class ColumnSorter<E> implements Comparator<E> {
+        private int column;
+        private boolean ascending;
 
-		/**
-		 * Instantiates a new address sorter.
-		 *
-		 * @param column the column to sort by
-		 */
-		public ColumnSorter(int column, boolean ascending) {
-			super();
-			this.column = column;
-			this.ascending = ascending;
-		}
+        /**
+         * Instantiates a new address sorter.
+         *
+         * @param column the column to sort by
+         */
+        public ColumnSorter(int column, boolean ascending) {
+            super();
+            this.column = column;
+            this.ascending = ascending;
+        }
 
-		/**
-		 * Gets the index of the column to sort.
-		 *
-		 * @return the column
-		 */
-		protected int getColumn() {
-			return column;
-		}
+        /**
+         * Gets the index of the column to sort.
+         *
+         * @return the column
+         */
+        protected int getColumn() {
+            return column;
+        }
 
-		/**
-		 * Checks if sort mode is ascending or not.
-		 *
-		 * @return true, if is ascending
-		 */
-		protected boolean isAscending() {
-			return ascending;
-		}
+        /**
+         * Checks if sort mode is ascending or not.
+         *
+         * @return true, if is ascending
+         */
+        protected boolean isAscending() {
+            return ascending;
+        }
 
-		/* (non-Javadoc)
-		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-		 */
-		@Override
-		public abstract int compare(E arg0, E arg1);
-	}
+        @Override
+        public abstract int compare(E arg0, E arg1);
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/BBoxMapRectangle.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/BBoxMapRectangle.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/BBoxMapRectangle.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -22,27 +10,27 @@
 
 public class BBoxMapRectangle extends MapRectangleImpl {
-	private BBox bbox;
+    private BBox bbox;
 
-	/**
-	 * @param bbox
-	 */
-	public BBoxMapRectangle(BBox bbox) {
-		super(null, null);
-		this.bbox = bbox;
-	}
+    /**
+     * @param bbox
+     */
+    public BBoxMapRectangle(BBox bbox) {
+        super(null, null);
+        this.bbox = bbox;
+    }
 
-	@Override
-	public Coordinate getBottomRight() {
-		return new Coordinate(bbox.getBottomRight().lat(), bbox.getBottomRight().lon());
-	}
+    @Override
+    public Coordinate getBottomRight() {
+        return new Coordinate(bbox.getBottomRight().lat(), bbox.getBottomRight().lon());
+    }
 
-	@Override
-	public Coordinate getTopLeft() {
-		return new Coordinate(bbox.getTopLeft().lat(), bbox.getTopLeft().lon());
-	}
+    @Override
+    public Coordinate getTopLeft() {
+        return new Coordinate(bbox.getTopLeft().lat(), bbox.getTopLeft().lon());
+    }
 
-	@Override
-	public void paint(Graphics g, Point topLeft, Point bottomRight) {
-			// do nothing here
-	}
+    @Override
+    public void paint(Graphics g, Point topLeft, Point bottomRight) {
+            // do nothing here
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesDialog.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesDialog.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesDialog.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -85,7 +73,4 @@
      }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.gui.dialogs.ToggleDialog#hideNotify()
-     */
     @Override
     public void hideNotify() {
@@ -94,7 +79,4 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.gui.dialogs.ToggleDialog#showNotify()
-     */
     @Override
     public void showNotify() {
@@ -103,7 +85,4 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#dataChanged(org.openstreetmap.josm.data.osm.event.DataChangedEvent)
-     */
     @Override
     public void dataChanged(DataChangedEvent event) {
@@ -111,7 +90,4 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#nodeMoved(org.openstreetmap.josm.data.osm.event.NodeMovedEvent)
-     */
     @Override
     public void nodeMoved(NodeMovedEvent event) {
@@ -119,33 +95,19 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#otherDatasetChange(org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent)
-     */
     @Override
     public void otherDatasetChange(AbstractDatasetChangedEvent event) {
         // TODO Auto-generated method stub
-
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#primitivesAdded(org.openstreetmap.josm.data.osm.event.PrimitivesAddedEvent)
-     */
-        @Override
+    @Override
     public void primitivesAdded(PrimitivesAddedEvent event) {
         container.invalidate();
-
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#primitivesRemoved(org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent)
-     */
-        @Override
+    @Override
     public void primitivesRemoved(PrimitivesRemovedEvent event) {
         container.invalidate();
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#relationMembersChanged(org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent)
-     */
     @Override
     public void relationMembersChanged(RelationMembersChangedEvent event) {
@@ -153,16 +115,9 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#tagsChanged(org.openstreetmap.josm.data.osm.event.TagsChangedEvent)
-     */
     @Override
     public void tagsChanged(TagsChangedEvent event) {
         container.invalidate();
-
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.data.osm.event.DataSetListener#wayNodesChanged(org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent)
-     */
     @Override
     public void wayNodesChanged(WayNodesChangedEvent event) {
@@ -170,7 +125,4 @@
     }
 
-    /* (non-Javadoc)
-     * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
-     */
     @Override
     public void valueChanged(ListSelectionEvent e) {
@@ -184,7 +136,4 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#containerChanged(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-     */
     @Override
     public void containerChanged(AddressEditContainer container) {
@@ -198,7 +147,4 @@
     }
 
-    /* (non-Javadoc)
-     * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
-     */
     @Override
     public void entityChanged(IOSMEntity node) {
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -24,183 +12,152 @@
 
 public class IncompleteAddressesTableModel extends AddressEditTableModel  {
-	/**
-	 *
-	 */
-	private static final long serialVersionUID = -5951629033395186324L;
+    /**
+     *
+     */
+    private static final long serialVersionUID = -5951629033395186324L;
 
-	// TODO: Add "state" column, if required
-	private static final int NUMBER_OF_COLUMNS = 5;
-	private static final String[] COLUMN_NAMES = new String[]{tr("Country"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Street"), tr("Number")};
-	private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{
-		String.class, String.class, String.class, String.class, String.class, String.class};
+    // TODO: Add "state" column, if required
+    private static final int NUMBER_OF_COLUMNS = 5;
+    private static final String[] COLUMN_NAMES = new String[]{tr("Country"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Street"), tr("Number")};
+    private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{
+        String.class, String.class, String.class, String.class, String.class, String.class};
 
 
-	/**
-	 * Instantiates a new incomplete addresses table model.
-	 *
-	 * @param addressContainer the address container used for display
-	 */
-	public IncompleteAddressesTableModel(AddressEditContainer addressContainer) {
-		super(addressContainer);
-	}
+    /**
+     * Instantiates a new incomplete addresses table model.
+     *
+     * @param addressContainer the address container used for display
+     */
+    public IncompleteAddressesTableModel(AddressEditContainer addressContainer) {
+        super(addressContainer);
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getColumnCount()
-	 */
-	@Override
-	public int getColumnCount() {
-		return NUMBER_OF_COLUMNS;
-	}
+    @Override
+    public int getColumnCount() {
+        return NUMBER_OF_COLUMNS;
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getColumnName(int)
-	 */
-	@Override
-	public String getColumnName(int column) {
-		return COLUMN_NAMES[column];
-	}
+    @Override
+    public String getColumnName(int column) {
+        return COLUMN_NAMES[column];
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getRowCount()
-	 */
-	@Override
-	public int getRowCount() {
-		if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
-			return 0;
-		}
-		return addressContainer.getNumberOfIncompleteAddresses();
-	}
+    @Override
+    public int getRowCount() {
+        if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
+            return 0;
+        }
+        return addressContainer.getNumberOfIncompleteAddresses();
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getValueAt(int, int)
-	 */
-	@Override
-	public Object getValueAt(int row, int column) {
-		OSMAddress aNode = (OSMAddress) getEntityOfRow(row);
+    @Override
+    public Object getValueAt(int row, int column) {
+        OSMAddress aNode = (OSMAddress) getEntityOfRow(row);
 
-		if (aNode == null) {
-			return null;
-		}
+        if (aNode == null) {
+            return null;
+        }
 
-		switch (column) {
-		case 0:
-			return aNode.getCountry();
-		case 1:
-			return aNode.getCity();
-		case 2:
-			return aNode.getPostalCode();
-		case 3:
-			return aNode.getStreetName();
-		case 4:
-			return aNode.getHouseNumber();
-		default:
-			throw new RuntimeException("Invalid column index: " + column);
-		}
+        switch (column) {
+        case 0:
+            return aNode.getCountry();
+        case 1:
+            return aNode.getCity();
+        case 2:
+            return aNode.getPostalCode();
+        case 3:
+            return aNode.getStreetName();
+        case 4:
+            return aNode.getHouseNumber();
+        default:
+            throw new RuntimeException("Invalid column index: " + column);
+        }
 
-	}
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
-	 */
-	@Override
-	public Class<?> getColumnClass(int arg0) {
-		return COLUMN_CLASSES[arg0];
-	}
+    @Override
+    public Class<?> getColumnClass(int arg0) {
+        return COLUMN_CLASSES[arg0];
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#isCellEditable(int, int)
-	 */
-	@Override
-	public boolean isCellEditable(int row, int column) {
-		return false;
-	}
+    @Override
+    public boolean isCellEditable(int row, int column) {
+        return false;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel#getEntityOfRow(int)
-	 */
-	@Override
-	public IOSMEntity getEntityOfRow(int row) {
-		if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
-			return null;
-		}
-		if (row < 0 || row >= addressContainer.getNumberOfIncompleteAddresses()) {
-			return null;
-		}
-		return addressContainer.getIncompleteAddresses().get(row);
-	}
+    @Override
+    public IOSMEntity getEntityOfRow(int row) {
+        if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
+            return null;
+        }
+        if (row < 0 || row >= addressContainer.getNumberOfIncompleteAddresses()) {
+            return null;
+        }
+        return addressContainer.getIncompleteAddresses().get(row);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel#getRowOfEntity(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
-	 */
-	@Override
-	public int getRowOfEntity(IOSMEntity entity) {
-		if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
-			return -1;
-		}
+    @Override
+    public int getRowOfEntity(IOSMEntity entity) {
+        if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
+            return -1;
+        }
 
-		return addressContainer.getIncompleteAddresses().indexOf(entity);
-	}
+        return addressContainer.getIncompleteAddresses().indexOf(entity);
+    }
 
+    @Override
+    protected void sortByColumn(int column, boolean ascending) {
+        if (addressContainer.getNumberOfIncompleteAddresses() == 0) return;
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel#sortByColumn(int, boolean)
-	 */
-	@Override
-	protected void sortByColumn(int column, boolean ascending) {
-		if (addressContainer.getNumberOfIncompleteAddresses() == 0) return;
+        Collections.sort(addressContainer.getIncompleteAddresses(),
+                new IncompleteAddressModelSorter(column, ascending));
+    }
 
-		Collections.sort(addressContainer.getIncompleteAddresses(),
-				new IncompleteAddressModelSorter(column, ascending));
-	}
+    /**
+     * Internal class StreetModelSorter.
+     */
+    class IncompleteAddressModelSorter extends ColumnSorter<OSMAddress> {
 
-	/**
-	 * Internal class StreetModelSorter.
-	 */
-	class IncompleteAddressModelSorter extends ColumnSorter<OSMAddress> {
+        /**
+         * Instantiates a new incomplete address model sorter.
+         *
+         * @param column the column to sort
+         * @param asc sort ascending
+         */
+        public IncompleteAddressModelSorter(int column, boolean asc) {
+            super(column, asc);
+        }
 
-		/**
-		 * Instantiates a new incomplete address model sorter.
-		 *
-		 * @param column the column to sort
-		 * @param asc sort ascending
-		 */
-		public IncompleteAddressModelSorter(int column, boolean asc) {
-			super(column, asc);
-		}
+        @Override
+        public int compare(OSMAddress arg0, OSMAddress arg1) {
+            int cc = 0;
 
-		/* (non-Javadoc)
-		 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel.ColumnSorter#compare(java.lang.Object, java.lang.Object)
-		 */
-		@Override
-		public int compare(OSMAddress arg0, OSMAddress arg1) {
-			int cc = 0;
+            switch (getColumn()) {
+            case 0:
+                cc=arg0.getCountry().compareTo(arg1.getCountry());
+                break;
+            case 1:
+                cc=arg0.getCity().compareTo(arg1.getCity());
+                break;
+            case 2:
+                cc=arg0.getPostalCode().compareTo(arg1.getPostalCode());
+                break;
+            case 3:
+                cc= arg0.getStreetName().compareTo(arg1.getStreetName());
+                break;
+            case 4:
+                cc=arg0.getHouseNumber().compareTo(arg1.getHouseNumber());
+                break;
+            default:
+                throw new RuntimeException("Invalid column index: " + getColumn());
+            }
 
-			switch (getColumn()) {
-			case 0:
-				cc=arg0.getCountry().compareTo(arg1.getCountry());
-				break;
-			case 1:
-				cc=arg0.getCity().compareTo(arg1.getCity());
-				break;
-			case 2:
-				cc=arg0.getPostalCode().compareTo(arg1.getPostalCode());
-				break;
-			case 3:
-				cc= arg0.getStreetName().compareTo(arg1.getStreetName());
-				break;
-			case 4:
-				cc=arg0.getHouseNumber().compareTo(arg1.getHouseNumber());
-				break;
-			default:
-				throw new RuntimeException("Invalid column index: " + getColumn());
-			}
+            if (!isAscending()) {
+                cc = -cc;
+            }
 
-			if (!isAscending()) {
-				cc = -cc;
-			}
-
-			return cc;
-		}
-	}
+            return cc;
+        }
+    }
 
 
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -24,144 +12,126 @@
 @SuppressWarnings("serial")
 public class StreetTableModel extends AddressEditTableModel {
-	private static final int NUMBER_OF_COLUMNS = 3;
-	private static final String[] COLUMN_NAMES = new String[]{tr("Type"), tr("Name"), tr("Addresses")};
-	private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{String.class, String.class, Integer.class};
-	/**
-	 * @param addressContainer
-	 */
-	public StreetTableModel(AddressEditContainer addressContainer) {
-		super(addressContainer);
-	}
+    private static final int NUMBER_OF_COLUMNS = 3;
+    private static final String[] COLUMN_NAMES = new String[]{tr("Type"), tr("Name"), tr("Addresses")};
+    private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{String.class, String.class, Integer.class};
+    /**
+     * @param addressContainer
+     */
+    public StreetTableModel(AddressEditContainer addressContainer) {
+        super(addressContainer);
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getColumnCount()
-	 */
-	@Override
-	public int getColumnCount() {
-		// TODO Auto-generated method stub
-		return NUMBER_OF_COLUMNS;
-	}
+    @Override
+    public int getColumnCount() {
+        // TODO Auto-generated method stub
+        return NUMBER_OF_COLUMNS;
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getColumnName(int)
-	 */
-	@Override
-	public String getColumnName(int column) {
-		return COLUMN_NAMES[column];
-	}
+    @Override
+    public String getColumnName(int column) {
+        return COLUMN_NAMES[column];
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
-	 */
-	@Override
-	public Class<?> getColumnClass(int columnIndex) {
-		return COLUMN_CLASSES[columnIndex];
-	}
+    @Override
+    public Class<?> getColumnClass(int columnIndex) {
+        return COLUMN_CLASSES[columnIndex];
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getRowCount()
-	 */
-	@Override
-	public int getRowCount() {
-		if (addressContainer == null || addressContainer.getStreetList() == null) {
-			return 0;
-		}
-		return addressContainer.getNumberOfStreets();
-	}
+    @Override
+    public int getRowCount() {
+        if (addressContainer == null || addressContainer.getStreetList() == null) {
+            return 0;
+        }
+        return addressContainer.getNumberOfStreets();
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.table.DefaultTableModel#getValueAt(int, int)
-	 */
-	@Override
-	public Object getValueAt(int row, int column) {
-		OSMStreet sNode = (OSMStreet) getEntityOfRow(row);
+    @Override
+    public Object getValueAt(int row, int column) {
+        OSMStreet sNode = (OSMStreet) getEntityOfRow(row);
 
-		if (sNode == null) {
-			return null;
-		}
+        if (sNode == null) {
+            return null;
+        }
 
-		switch (column) {
-		case 0:
-			return sNode.getType();
-		case 1:
-			return sNode.getName();
-		case 2:
-			return sNode.getNumberOfSegments();
-		case 3:
-			return sNode.getNumberOfAddresses();
-		case 4:
-			return sNode.hasAssociatedStreetRelation();
-		default:
-			throw new RuntimeException("Invalid column index: " + column);
-		}
+        switch (column) {
+        case 0:
+            return sNode.getType();
+        case 1:
+            return sNode.getName();
+        case 2:
+            return sNode.getNumberOfSegments();
+        case 3:
+            return sNode.getNumberOfAddresses();
+        case 4:
+            return sNode.hasAssociatedStreetRelation();
+        default:
+            throw new RuntimeException("Invalid column index: " + column);
+        }
 
-	}
+    }
 
-	@Override
-	public boolean isCellEditable(int row, int column) {
-		// TODO Auto-generated method stub
-		return false;
-	}
+    @Override
+    public boolean isCellEditable(int row, int column) {
+        // TODO Auto-generated method stub
+        return false;
+    }
 
-	@Override
-	public IOSMEntity getEntityOfRow(int row) {
-		if (addressContainer == null || addressContainer.getStreetList() == null) {
-			return null;
-		}
-		if (row < 0 || row >= addressContainer.getNumberOfStreets()) {
-			return null;
-		}
-		return addressContainer.getStreetList().get(row);
-	}
+    @Override
+    public IOSMEntity getEntityOfRow(int row) {
+        if (addressContainer == null || addressContainer.getStreetList() == null) {
+            return null;
+        }
+        if (row < 0 || row >= addressContainer.getNumberOfStreets()) {
+            return null;
+        }
+        return addressContainer.getStreetList().get(row);
+    }
 
-	@Override
-	public int getRowOfEntity(IOSMEntity entity) {
-		if (addressContainer == null || addressContainer.getStreetList() == null) {
-			return -1;
-		}
+    @Override
+    public int getRowOfEntity(IOSMEntity entity) {
+        if (addressContainer == null || addressContainer.getStreetList() == null) {
+            return -1;
+        }
 
-		return addressContainer.getStreetList().indexOf(entity);
-	}
+        return addressContainer.getStreetList().indexOf(entity);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel#sortByColumn(int, boolean)
-	 */
-	@Override
-	protected void sortByColumn(int column, boolean ascending) {
-		Collections.sort(addressContainer.getStreetList(), new StreetModelSorter(column, ascending));
-	}
+    @Override
+    protected void sortByColumn(int column, boolean ascending) {
+        Collections.sort(addressContainer.getStreetList(), new StreetModelSorter(column, ascending));
+    }
 
-	/**
-	 * Internal class StreetModelSorter.
-	 */
-	class StreetModelSorter extends ColumnSorter<OSMStreet> {
+    /**
+     * Internal class StreetModelSorter.
+     */
+    class StreetModelSorter extends ColumnSorter<OSMStreet> {
 
-		public StreetModelSorter(int column, boolean asc) {
-			super(column, asc);
-		}
+        public StreetModelSorter(int column, boolean asc) {
+            super(column, asc);
+        }
 
-		public int compare(OSMStreet arg0, OSMStreet arg1) {
-			if (arg0 == null || arg1 == null) return 0;
+        public int compare(OSMStreet arg0, OSMStreet arg1) {
+            if (arg0 == null || arg1 == null) return 0;
 
-			switch (getColumn()) {
-			case 0:
-				if (arg0.getType() != null) {
-					return arg0.getType().compareTo(arg1.getType());
-				} else {
-					return arg1.hasName() ? -1 : 0;
-				}
-			case 1:
-				if (arg0.hasName()) {
-					return arg0.getName().compareTo(arg1.getName());
-				} else {
-					return arg1.hasName() ? -1 : 0;
-				}
-			case 2:
-				return new Integer(arg0.getNumberOfAddresses()).
-								compareTo(new Integer(arg1.getNumberOfAddresses()));
-			default:
-			}
-			return 0;
-		}
-	}
+            switch (getColumn()) {
+            case 0:
+                if (arg0.getType() != null) {
+                    return arg0.getType().compareTo(arg1.getType());
+                } else {
+                    return arg1.hasName() ? -1 : 0;
+                }
+            case 1:
+                if (arg0.hasName()) {
+                    return arg0.getName().compareTo(arg1.getName());
+                } else {
+                    return arg1.hasName() ? -1 : 0;
+                }
+            case 2:
+                return new Integer(arg0.getNumberOfAddresses()).
+                                compareTo(new Integer(arg1.getNumberOfAddresses()));
+            default:
+            }
+            return 0;
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java	(revision 30348)
@@ -1,30 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
-/**
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* File created on 25.10.2010 */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui;
 
@@ -47,199 +20,148 @@
 public class UnresolvedAddressesTableModel extends AddressEditTableModel {
 
-	private static final int NUMBER_OF_COLUMNS = 5;
-	private static final String[] COLUMN_NAMES = new String[] { tr("Street"),
-			tr("Number"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Name") };
+    private static final int NUMBER_OF_COLUMNS = 5;
+    private static final String[] COLUMN_NAMES = new String[] { tr("Street"),
+            tr("Number"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Name") };
 
-	private static final Class<?>[] COLUMN_CLASSES = new Class<?>[] {
-			String.class, String.class, String.class, String.class,
-			String.class };
+    private static final Class<?>[] COLUMN_CLASSES = new Class<?>[] {
+            String.class, String.class, String.class, String.class,
+            String.class };
 
-	/**
-	 *
-	 */
-	private static final long serialVersionUID = 424009321818130586L;
+    /**
+     *
+     */
+    private static final long serialVersionUID = 424009321818130586L;
 
-	/**
-	 * @param addressContainer
-	 */
-	public UnresolvedAddressesTableModel(AddressEditContainer addressContainer) {
-		super(addressContainer);
-	}
+    /**
+     * @param addressContainer
+     */
+    public UnresolvedAddressesTableModel(AddressEditContainer addressContainer) {
+        super(addressContainer);
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.swing.table.DefaultTableModel#getColumnCount()
-	 */
-	@Override
-	public int getColumnCount() {
-		return NUMBER_OF_COLUMNS;
-	}
+    @Override
+    public int getColumnCount() {
+        return NUMBER_OF_COLUMNS;
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.swing.table.DefaultTableModel#getColumnName(int)
-	 */
-	@Override
-	public String getColumnName(int column) {
-		return COLUMN_NAMES[column];
-	}
+    @Override
+    public String getColumnName(int column) {
+        return COLUMN_NAMES[column];
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.swing.table.DefaultTableModel#getRowCount()
-	 */
-	@Override
-	public int getRowCount() {
-		if (addressContainer == null
-				|| addressContainer.getUnresolvedAddresses() == null) {
-			return 0;
-		}
-		return addressContainer.getNumberOfUnresolvedAddresses();
-	}
+    @Override
+    public int getRowCount() {
+        if (addressContainer == null
+                || addressContainer.getUnresolvedAddresses() == null) {
+            return 0;
+        }
+        return addressContainer.getNumberOfUnresolvedAddresses();
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.swing.table.DefaultTableModel#getValueAt(int, int)
-	 */
-	@Override
-	public Object getValueAt(int row, int column) {
-		OSMAddress aNode = (OSMAddress) getEntityOfRow(row);
+    @Override
+    public Object getValueAt(int row, int column) {
+        OSMAddress aNode = (OSMAddress) getEntityOfRow(row);
 
-		if (aNode == null) {
-			return null;
-		}
+        if (aNode == null) {
+            return null;
+        }
 
-		switch (column) {
-		case 0:
-			return aNode.getStreetName();
-		case 1:
-			return aNode.getHouseNumber();
-		case 2:
-			return aNode.getCity();
-		case 3:
-			return aNode.getPostalCode();
-		case 4:
-			return aNode.getName();
-		default:
-			throw new RuntimeException("Invalid column index: " + column);
-		}
+        switch (column) {
+        case 0:
+            return aNode.getStreetName();
+        case 1:
+            return aNode.getHouseNumber();
+        case 2:
+            return aNode.getCity();
+        case 3:
+            return aNode.getPostalCode();
+        case 4:
+            return aNode.getName();
+        default:
+            throw new RuntimeException("Invalid column index: " + column);
+        }
 
-	}
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
-	 */
-	@Override
-	public Class<?> getColumnClass(int arg0) {
-		return COLUMN_CLASSES[arg0];
-	}
+    @Override
+    public Class<?> getColumnClass(int arg0) {
+        return COLUMN_CLASSES[arg0];
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.swing.table.DefaultTableModel#isCellEditable(int, int)
-	 */
-	@Override
-	public boolean isCellEditable(int row, int column) {
-		return false;
-	}
+    @Override
+    public boolean isCellEditable(int row, int column) {
+        return false;
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel
-	 * #getEntityOfRow(int)
-	 */
-	@Override
-	public IOSMEntity getEntityOfRow(int row) {
-		if (addressContainer == null
-				|| addressContainer.getUnresolvedAddresses() == null) {
-			return null;
-		}
-		if (row < 0 || row >= addressContainer.getNumberOfUnresolvedAddresses()) {
-			return null;
-		}
-		return addressContainer.getUnresolvedAddresses().get(row);
-	}
+    @Override
+    public IOSMEntity getEntityOfRow(int row) {
+        if (addressContainer == null
+                || addressContainer.getUnresolvedAddresses() == null) {
+            return null;
+        }
+        if (row < 0 || row >= addressContainer.getNumberOfUnresolvedAddresses()) {
+            return null;
+        }
+        return addressContainer.getUnresolvedAddresses().get(row);
+    }
 
-	@Override
-	public int getRowOfEntity(IOSMEntity entity) {
-		if (addressContainer == null
-				|| addressContainer.getUnresolvedAddresses() == null) {
-			return -1;
-		}
+    @Override
+    public int getRowOfEntity(IOSMEntity entity) {
+        if (addressContainer == null
+                || addressContainer.getUnresolvedAddresses() == null) {
+            return -1;
+        }
 
-		return addressContainer.getUnresolvedAddresses().indexOf(entity);
-	}
+        return addressContainer.getUnresolvedAddresses().indexOf(entity);
+    }
 
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel
-	 * #sortByColumn(int, boolean)
-	 */
-	@Override
-	protected void sortByColumn(int column, boolean ascending) {
-		if (addressContainer.getNumberOfUnresolvedAddresses() == 0)
-			return;
+    @Override
+    protected void sortByColumn(int column, boolean ascending) {
+        if (addressContainer.getNumberOfUnresolvedAddresses() == 0)
+            return;
 
-		Collections.sort(addressContainer.getUnresolvedAddresses(),
-				new UnresolvedAddressModelSorter(column, ascending));
-	}
+        Collections.sort(addressContainer.getUnresolvedAddresses(),
+                new UnresolvedAddressModelSorter(column, ascending));
+    }
 
-	/**
-	 * Internal class StreetModelSorter.
-	 */
-	class UnresolvedAddressModelSorter extends ColumnSorter<OSMAddress> {
+    /**
+     * Internal class StreetModelSorter.
+     */
+    class UnresolvedAddressModelSorter extends ColumnSorter<OSMAddress> {
 
-		public UnresolvedAddressModelSorter(int column, boolean asc) {
-			super(column, asc);
-		}
+        public UnresolvedAddressModelSorter(int column, boolean asc) {
+            super(column, asc);
+        }
 
-		/*
-		 * (non-Javadoc)
-		 *
-		 * @see
-		 * org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel
-		 * .ColumnSorter#compare(java.lang.Object, java.lang.Object)
-		 */
-		@Override
-		public int compare(OSMAddress arg0, OSMAddress arg1) {
-			int cc = 0;
-			switch (getColumn()) {
-			case 0:
-				cc = arg0.getStreetName().compareTo(arg1.getStreetName());
-				break;
-			case 1:
-				cc = arg0.getHouseNumber().compareTo(arg1.getHouseNumber());
-				break;
-			case 2:
-				cc = arg0.getCity().compareTo(arg1.getCity());
-				break;
-			case 3:
-				cc = arg0.getPostalCode().compareTo(arg1.getPostalCode());
-				break;
-			case 4:
-				cc = arg0.getName().compareTo(arg1.getName());
-				break;
-			default:
-				throw new RuntimeException("Invalid column index: "
-						+ getColumn());
-			}
+        @Override
+        public int compare(OSMAddress arg0, OSMAddress arg1) {
+            int cc = 0;
+            switch (getColumn()) {
+            case 0:
+                cc = arg0.getStreetName().compareTo(arg1.getStreetName());
+                break;
+            case 1:
+                cc = arg0.getHouseNumber().compareTo(arg1.getHouseNumber());
+                break;
+            case 2:
+                cc = arg0.getCity().compareTo(arg1.getCity());
+                break;
+            case 3:
+                cc = arg0.getPostalCode().compareTo(arg1.getPostalCode());
+                break;
+            case 4:
+                cc = arg0.getName().compareTo(arg1.getName());
+                break;
+            default:
+                throw new RuntimeException("Invalid column index: "
+                        + getColumn());
+            }
 
-			if (!isAscending()) {
-				cc = -cc;
-			}
+            if (!isAscending()) {
+                cc = -cc;
+            }
 
-			return cc;
-		}
-	}
+            return cc;
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -43,207 +31,191 @@
 @SuppressWarnings("serial")
 public abstract class AbstractAddressEditAction extends JosmAction implements IAddressEditContainerListener, ICommandListener {
-	private AddressEditSelectionEvent event;
-	protected AddressEditContainer container;
-	protected List<Command> commands;
-	private String txName;
-
-	/**
-	 * @param name
-	 * @param icon
-	 */
-	public AbstractAddressEditAction(String name, String iconName, String tooltip, String toolbar) {
-		super(name, iconName, tooltip, null, true, toolbar, true);
-
-		setEnabled(false);
-	}
-
-	/**
-	 * @param name
-	 */
-	public AbstractAddressEditAction(String name) {
-		this(name, null, "", null);
-	}
-
-	/**
-	 * Gets the current address container.
-	 * @return the container
-	 */
-	public AddressEditContainer getContainer() {
-		return container;
-	}
-
-	/**
-	 * @param container the container to set
-	 */
-	public void setContainer(AddressEditContainer container) {
-		if (container != null) { // remove old listener first
-			container.removeChangedListener(this);
-		}
-		this.container = container;
-		updateEnabledState();
-		if (container != null) {
-			container.addChangedListener(this);
-		}
-	}
-
-	/**
-	 * @return the event
-	 */
-	protected AddressEditSelectionEvent getEvent() {
-		return event;
-	}
-
-	/**
-	 * @param event the event to set
-	 */
-	public void setEvent(AddressEditSelectionEvent event) {
-		this.event = event;
-		updateEnabledState();
-	}
-
-	/* (non-Javadoc)
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
-	@Override
-	public void actionPerformed(ActionEvent arg0) {
-		if (event != null) { // use the event acquired previously.
-			addressEditActionPerformed(event);
-			event = null; // consume event
-		} else {
-			if (container != null) {
-				addressEditActionPerformed(container);
-			} else {
-				throw new RuntimeException("AbstractAddressEditAction has no container or event");
-			}
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState()
-	 */
-	@Override
-	protected void updateEnabledState() {
-		if (this.event != null) {
-			updateEnabledState(this.event);
-		} else {
-			if (container != null) {
-				updateEnabledState(container);
-			} else {
-				super.updateEnabledState();
-			}
-		}
-	}
-
-	/**
-	 * Updates 'enabled' state depending on the given address container object.
-	 * @param container The address container (maybe null).
-	 * @return
-	 */
-	protected abstract void updateEnabledState(AddressEditContainer container);
-
-	/**
-	 * Updates 'enabled' state depending on the current selection.
-	 * @param container The selection event.
-	 * @return
-	 */
-	protected abstract void updateEnabledState(AddressEditSelectionEvent event);
-
-	/**
-	 * Redirected action handler for doing actions on a address selection.
-	 * @param ev
-	 */
-	public abstract void addressEditActionPerformed(AddressEditSelectionEvent ev);
-
-	/**
-	 * Redirected action handler for doing actions on an address container.
-	 * @param ev
-	 */
-	public abstract void addressEditActionPerformed(AddressEditContainer container);
-
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#containerChanged(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void containerChanged(AddressEditContainer container) {
-		updateEnabledState();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
-	 */
-	@Override
-	public void entityChanged(IOSMEntity node) {
-		container.removeProblemsOfSource(node); // clear problems of changed node...
-		node.visit(container, container);                   // .. and revisit it.
-		updateEnabledState();
-	}
-
-	/**
-	 * Begins the transaction (command sequence). Must be called by every subclass before
-	 * any modification on OSM objects starts.
-	 *
-	 * @param txName the name of the transaction (e. g. "change address tags").
-	 */
-	public void beginTransaction(String txName) {
-		if (commands != null && commands.size() > 0) {
-			throw new RuntimeException("TX has not been closed (missing finishTransaction?)");
-		}
-
-		commands = new ArrayList<Command>();
-		if (StringUtils.isNullOrEmpty(txName)) {
-			throw new RuntimeException("Transaction must have a name");
-		}
-		this.txName = txName;
-	}
-
-	/**
-	 * Finishes the transaction and passes the command sequence to the framework.
-	 */
-	public void finishTransaction() {
-		if (commands == null) {
-			throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
-		}
-		// execute the command
-		Main.main.undoRedo.add(new SequenceCommand(txName, commands));
-		commands.clear();
-		container.invalidate();
-	}
-
-	/**
-	 * Begins the transaction for a single object.
-	 *
-	 * @param entity the entity
-	 */
-	public void beginObjectTransaction(IOSMEntity entity) {
-		if (entity != null) {
-			entity.addCommandListener(this);
-		} else {
-			throw new RuntimeException("Entity must not be null");
-		}
-	}
-
-	/**
-	 * Finishes the transaction for a single object.
-	 *
-	 * @param entity the entity
-	 */
-	public void finishObjectTransaction(IOSMEntity entity) {
-		if (entity != null) {
-			entity.removeCommandListener(this);
-		} else {
-			throw new RuntimeException("Entity must not be null");
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity, org.openstreetmap.josm.command.Command)
-	 */
-	@Override
-	public void commandIssued(IOSMEntity entity, Command command) {
-		if (commands == null) {
-			throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
-		}
-		commands.add(command);
-	}
+    private AddressEditSelectionEvent event;
+    protected AddressEditContainer container;
+    protected List<Command> commands;
+    private String txName;
+
+    /**
+     * @param name
+     * @param icon
+     */
+    public AbstractAddressEditAction(String name, String iconName, String tooltip, String toolbar) {
+        super(name, iconName, tooltip, null, true, toolbar, true);
+
+        setEnabled(false);
+    }
+
+    /**
+     * @param name
+     */
+    public AbstractAddressEditAction(String name) {
+        this(name, null, "", null);
+    }
+
+    /**
+     * Gets the current address container.
+     * @return the container
+     */
+    public AddressEditContainer getContainer() {
+        return container;
+    }
+
+    /**
+     * @param container the container to set
+     */
+    public void setContainer(AddressEditContainer container) {
+        if (container != null) { // remove old listener first
+            container.removeChangedListener(this);
+        }
+        this.container = container;
+        updateEnabledState();
+        if (container != null) {
+            container.addChangedListener(this);
+        }
+    }
+
+    /**
+     * @return the event
+     */
+    protected AddressEditSelectionEvent getEvent() {
+        return event;
+    }
+
+    /**
+     * @param event the event to set
+     */
+    public void setEvent(AddressEditSelectionEvent event) {
+        this.event = event;
+        updateEnabledState();
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent arg0) {
+        if (event != null) { // use the event acquired previously.
+            addressEditActionPerformed(event);
+            event = null; // consume event
+        } else {
+            if (container != null) {
+                addressEditActionPerformed(container);
+            } else {
+                throw new RuntimeException("AbstractAddressEditAction has no container or event");
+            }
+        }
+    }
+
+    @Override
+    protected void updateEnabledState() {
+        if (this.event != null) {
+            updateEnabledState(this.event);
+        } else {
+            if (container != null) {
+                updateEnabledState(container);
+            } else {
+                super.updateEnabledState();
+            }
+        }
+    }
+
+    /**
+     * Updates 'enabled' state depending on the given address container object.
+     * @param container The address container (maybe null).
+     * @return
+     */
+    protected abstract void updateEnabledState(AddressEditContainer container);
+
+    /**
+     * Updates 'enabled' state depending on the current selection.
+     * @param container The selection event.
+     * @return
+     */
+    protected abstract void updateEnabledState(AddressEditSelectionEvent event);
+
+    /**
+     * Redirected action handler for doing actions on a address selection.
+     * @param ev
+     */
+    public abstract void addressEditActionPerformed(AddressEditSelectionEvent ev);
+
+    /**
+     * Redirected action handler for doing actions on an address container.
+     * @param ev
+     */
+    public abstract void addressEditActionPerformed(AddressEditContainer container);
+
+    @Override
+    public void containerChanged(AddressEditContainer container) {
+        updateEnabledState();
+    }
+
+    @Override
+    public void entityChanged(IOSMEntity node) {
+        container.removeProblemsOfSource(node); // clear problems of changed node...
+        node.visit(container, container);                   // .. and revisit it.
+        updateEnabledState();
+    }
+
+    /**
+     * Begins the transaction (command sequence). Must be called by every subclass before
+     * any modification on OSM objects starts.
+     *
+     * @param txName the name of the transaction (e. g. "change address tags").
+     */
+    public void beginTransaction(String txName) {
+        if (commands != null && commands.size() > 0) {
+            throw new RuntimeException("TX has not been closed (missing finishTransaction?)");
+        }
+
+        commands = new ArrayList<Command>();
+        if (StringUtils.isNullOrEmpty(txName)) {
+            throw new RuntimeException("Transaction must have a name");
+        }
+        this.txName = txName;
+    }
+
+    /**
+     * Finishes the transaction and passes the command sequence to the framework.
+     */
+    public void finishTransaction() {
+        if (commands == null) {
+            throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
+        }
+        // execute the command
+        Main.main.undoRedo.add(new SequenceCommand(txName, commands));
+        commands.clear();
+        container.invalidate();
+    }
+
+    /**
+     * Begins the transaction for a single object.
+     *
+     * @param entity the entity
+     */
+    public void beginObjectTransaction(IOSMEntity entity) {
+        if (entity != null) {
+            entity.addCommandListener(this);
+        } else {
+            throw new RuntimeException("Entity must not be null");
+        }
+    }
+
+    /**
+     * Finishes the transaction for a single object.
+     *
+     * @param entity the entity
+     */
+    public void finishObjectTransaction(IOSMEntity entity) {
+        if (entity != null) {
+            entity.removeCommandListener(this);
+        } else {
+            throw new RuntimeException("Entity must not be null");
+        }
+    }
+
+    @Override
+    public void commandIssued(IOSMEntity entity, Command command) {
+        if (commands == null) {
+            throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
+        }
+        commands.add(command);
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AddressActions.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AddressActions.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AddressActions.java	(revision 30348)
@@ -1,48 +1,35 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
 public final class AddressActions {
-	/* Global action objects */
-	private static SelectAddressesInMapAction selectAction = new SelectAddressesInMapAction();
-	private static GuessAddressDataAction guessDataAction = new GuessAddressDataAction();
-	private static ApplyAllGuessesAction applyGuessesAction = new ApplyAllGuessesAction();
-	private static RemoveAddressTagsAction removeTagsAction = new RemoveAddressTagsAction();
-	private static AssignAddressToStreetAction resolveAction = new AssignAddressToStreetAction();
-	private static ConvertToRelationAction convertToRelationAction = new ConvertToRelationAction();
-	private static ConvertAllToRelationAction convertAllToRelationAction = new ConvertAllToRelationAction();
-	
-	public static SelectAddressesInMapAction getSelectAction() {
-		return selectAction;
-	}
-	public static GuessAddressDataAction getGuessAddressAction() {
-		return guessDataAction;
-	}
-	public static ApplyAllGuessesAction getApplyGuessesAction() {
-		return applyGuessesAction;
-	}
-	public static RemoveAddressTagsAction getRemoveTagsAction() {
-		return removeTagsAction;
-	}
-	public static AssignAddressToStreetAction getResolveAction() {
-		return resolveAction;
-	}
-	public static ConvertToRelationAction getConvertToRelationAction() {
-		return convertToRelationAction;
-	}
-	public static ConvertAllToRelationAction getConvertAllToRelationAction() {
-		return convertAllToRelationAction;
-	}
+    /* Global action objects */
+    private static SelectAddressesInMapAction selectAction = new SelectAddressesInMapAction();
+    private static GuessAddressDataAction guessDataAction = new GuessAddressDataAction();
+    private static ApplyAllGuessesAction applyGuessesAction = new ApplyAllGuessesAction();
+    private static RemoveAddressTagsAction removeTagsAction = new RemoveAddressTagsAction();
+    private static AssignAddressToStreetAction resolveAction = new AssignAddressToStreetAction();
+    private static ConvertToRelationAction convertToRelationAction = new ConvertToRelationAction();
+    private static ConvertAllToRelationAction convertAllToRelationAction = new ConvertAllToRelationAction();
+    
+    public static SelectAddressesInMapAction getSelectAction() {
+        return selectAction;
+    }
+    public static GuessAddressDataAction getGuessAddressAction() {
+        return guessDataAction;
+    }
+    public static ApplyAllGuessesAction getApplyGuessesAction() {
+        return applyGuessesAction;
+    }
+    public static RemoveAddressTagsAction getRemoveTagsAction() {
+        return removeTagsAction;
+    }
+    public static AssignAddressToStreetAction getResolveAction() {
+        return resolveAction;
+    }
+    public static ConvertToRelationAction getConvertToRelationAction() {
+        return convertToRelationAction;
+    }
+    public static ConvertAllToRelationAction getConvertAllToRelationAction() {
+        return convertAllToRelationAction;
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -36,145 +24,117 @@
  *
  */
-
 @SuppressWarnings("serial")
 public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener{
-	private String tag;
-	/**
-	 * Instantiates a new "apply all guesses" action.
-	 */
-	public ApplyAllGuessesAction(String tag) {
-		super(tr("Apply"), "applyguesses_24", tr("Turns all guesses into the corresponding tag values."),
-			"fixaddresses/applyallguesses");
-		this.tag = tag;
-	}
+    private String tag;
+    /**
+     * Instantiates a new "apply all guesses" action.
+     */
+    public ApplyAllGuessesAction(String tag) {
+        super(tr("Apply"), "applyguesses_24", tr("Turns all guesses into the corresponding tag values."),
+            "fixaddresses/applyallguesses");
+        this.tag = tag;
+    }
 
-	/**
-	 * Instantiates a new "apply all guesses" action.
-	 */
-	public ApplyAllGuessesAction() {
-		this(null);
-	}
+    /**
+     * Instantiates a new "apply all guesses" action.
+     */
+    public ApplyAllGuessesAction() {
+        this(null);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		if (ev == null) return;
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        if (ev == null) return;
 
-		if (ev.getSelectedUnresolvedAddresses() != null) {
-			List<OSMAddress> addrToFix = ev.getSelectedUnresolvedAddresses();
-			applyGuesses(addrToFix);
-		}
+        if (ev.getSelectedUnresolvedAddresses() != null) {
+            List<OSMAddress> addrToFix = ev.getSelectedUnresolvedAddresses();
+            applyGuesses(addrToFix);
+        }
 
-		if (ev.getSelectedIncompleteAddresses() != null) {
-			List<OSMAddress> addrToFix = ev.getSelectedIncompleteAddresses();
-			applyGuesses(addrToFix);
-		}
-	}
+        if (ev.getSelectedIncompleteAddresses() != null) {
+            List<OSMAddress> addrToFix = ev.getSelectedIncompleteAddresses();
+            applyGuesses(addrToFix);
+        }
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(container != null && container.getNumberOfGuesses() > 0);
-	}
+    @Override
+    protected void updateEnabledState(AddressEditContainer container) {
+        setEnabled(container != null && container.getNumberOfGuesses() > 0);
+    }
 
-	/**
-	 * Apply guesses.
-	 *
-	 * @param addrToFix the addr to fix
-	 */
-	private void applyGuesses(List<OSMAddress> addrToFix) {
-		beginTransaction(tr("Applied guessed values"));
-		List<OSMAddress> addrToFixShadow = new ArrayList<OSMAddress>(addrToFix);
-		for (OSMAddress aNode : addrToFixShadow) {
-			beginObjectTransaction(aNode);
+    /**
+     * Apply guesses.
+     *
+     * @param addrToFix the addr to fix
+     */
+    private void applyGuesses(List<OSMAddress> addrToFix) {
+        beginTransaction(tr("Applied guessed values"));
+        List<OSMAddress> addrToFixShadow = new ArrayList<OSMAddress>(addrToFix);
+        for (OSMAddress aNode : addrToFixShadow) {
+            beginObjectTransaction(aNode);
 
-			if (StringUtils.isNullOrEmpty(tag)) { // tag given?
-				aNode.applyAllGuesses(); // no -> apply all guesses
-			} else { // apply guessed values for single tag only
-				aNode.applyGuessForTag(tag);
-			}
-			finishObjectTransaction(aNode);
-		}
-		finishTransaction();
-	}
+            if (StringUtils.isNullOrEmpty(tag)) { // tag given?
+                aNode.applyAllGuesses(); // no -> apply all guesses
+            } else { // apply guessed values for single tag only
+                aNode.applyGuessForTag(tag);
+            }
+            finishObjectTransaction(aNode);
+        }
+        finishTransaction();
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		setEnabled(event.hasAddressesWithGuesses());
-	}
+    @Override
+    protected void updateEnabledState(AddressEditSelectionEvent event) {
+        setEnabled(event.hasAddressesWithGuesses());
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		if (container == null || container.getNumberOfIncompleteAddresses() == 0) return;
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        if (container == null || container.getNumberOfIncompleteAddresses() == 0) return;
 
-		List<OSMAddress> addrToFix = container.getUnresolvedAddresses();
-		applyGuesses(addrToFix);
+        List<OSMAddress> addrToFix = container.getUnresolvedAddresses();
+        applyGuesses(addrToFix);
 
-		addrToFix = container.getIncompleteAddresses();
-		applyGuesses(addrToFix);
-	}
+        addrToFix = container.getIncompleteAddresses();
+        applyGuesses(addrToFix);
+    }
 
-	/* (non-Javadoc)
-	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
-	 */
-	@Override
-	public void mouseClicked(MouseEvent e) {
-		JTable table = (JTable)e.getSource();
-		Point p = e.getPoint();
-		if(e.getClickCount() == 2) {
-			AddressEditTableModel model = (AddressEditTableModel) table.getModel();
-			if (model != null) {
-				int row = table.rowAtPoint(p);
-				IOSMEntity node = model.getEntityOfRow(row);
-				if (node instanceof OSMAddress) {
-					beginTransaction(tr("Applied guessed values for ") + node.getOsmObject());
-					beginObjectTransaction(node);
-					OSMAddress aNode = (OSMAddress) node;
+    @Override
+    public void mouseClicked(MouseEvent e) {
+        JTable table = (JTable)e.getSource();
+        Point p = e.getPoint();
+        if(e.getClickCount() == 2) {
+            AddressEditTableModel model = (AddressEditTableModel) table.getModel();
+            if (model != null) {
+                int row = table.rowAtPoint(p);
+                IOSMEntity node = model.getEntityOfRow(row);
+                if (node instanceof OSMAddress) {
+                    beginTransaction(tr("Applied guessed values for ") + node.getOsmObject());
+                    beginObjectTransaction(node);
+                    OSMAddress aNode = (OSMAddress) node;
 
-					aNode.applyAllGuesses();
+                    aNode.applyAllGuesses();
 
-					finishObjectTransaction(node);
-					finishTransaction();
-				}
-			}
-		}
-	}
+                    finishObjectTransaction(node);
+                    finishTransaction();
+                }
+            }
+        }
+    }
 
-	/* (non-Javadoc)
-	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
-	 */
-	@Override
-	public void mouseEntered(MouseEvent arg0) {
-	}
+    @Override
+    public void mouseEntered(MouseEvent arg0) {
+    }
 
-	/* (non-Javadoc)
-	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
-	 */
-	@Override
-	public void mouseExited(MouseEvent arg0) {
-	}
+    @Override
+    public void mouseExited(MouseEvent arg0) {
+    }
 
-	/* (non-Javadoc)
-	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
-	 */
-	@Override
-	public void mousePressed(MouseEvent arg0) {
-	}
+    @Override
+    public void mousePressed(MouseEvent arg0) {
+    }
 
-	/* (non-Javadoc)
-	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
-	 */
-	@Override
-	public void mouseReleased(MouseEvent arg0) {
-	}
+    @Override
+    public void mouseReleased(MouseEvent arg0) {
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -29,55 +17,49 @@
 public class AssignAddressToStreetAction extends AbstractAddressEditAction  {
 
-	/**
-	 * Instantiates a new "assign address to street" action.
-	 */
-	public AssignAddressToStreetAction() {
-		super(tr("Assign address to street"), "assignstreet_24",
-			tr("Assign the selected address(es) to the selected street."),
-			"fixaddresses/assignaddresstostreet");
-	}
+    /**
+     * Instantiates a new "assign address to street" action.
+     */
+    public AssignAddressToStreetAction() {
+        super(tr("Assign address to street"), "assignstreet_24",
+            tr("Assign the selected address(es) to the selected street."),
+            "fixaddresses/assignaddresstostreet");
+    }
 
-	/**
-	 *
-	 */
-	private static final long serialVersionUID = -6180491357232121384L;
+    /**
+     *
+     */
+    private static final long serialVersionUID = -6180491357232121384L;
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		OSMStreet streetNode = ev.getSelectedStreet();
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        OSMStreet streetNode = ev.getSelectedStreet();
 
-		if (streetNode != null && ev.getSelectedUnresolvedAddresses() != null) {
-			beginTransaction(tr("Set street name") + " '" + streetNode.getName() + "'");
-			for (OSMAddress addrNode : ev.getSelectedUnresolvedAddresses()) {
-				beginObjectTransaction(addrNode);
-				addrNode.assignStreet(streetNode);
-				finishObjectTransaction(addrNode);
-			}
-			finishTransaction();
-		}
+        if (streetNode != null && ev.getSelectedUnresolvedAddresses() != null) {
+            beginTransaction(tr("Set street name") + " '" + streetNode.getName() + "'");
+            for (OSMAddress addrNode : ev.getSelectedUnresolvedAddresses()) {
+                beginObjectTransaction(addrNode);
+                addrNode.assignStreet(streetNode);
+                finishObjectTransaction(addrNode);
+            }
+            finishTransaction();
+        }
 
-	}
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void updateEnabledState(AddressEditSelectionEvent ev) {
-		setEnabled(ev.getSelectedStreet() != null && ev.hasUnresolvedAddresses());
-	}
+    @Override
+    public void updateEnabledState(AddressEditSelectionEvent ev) {
+        setEnabled(ev.getSelectedStreet() != null && ev.hasUnresolvedAddresses());
+    }
 
-	@Override
-	public void updateEnabledState(AddressEditContainer container) {
-		// we only accept a selection here
-		setEnabled(false);
-	}
+    @Override
+    public void updateEnabledState(AddressEditContainer container) {
+        // we only accept a selection here
+        setEnabled(false);
+    }
 
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		// we only accept a selection: nothing to do here
-	}
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        // we only accept a selection: nothing to do here
+    }
 
 
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertAllToRelationAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertAllToRelationAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertAllToRelationAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -22,49 +10,49 @@
 @SuppressWarnings("serial")
 public class ConvertAllToRelationAction extends ConvertToRelationAction {
-	public ConvertAllToRelationAction() {
-		super(tr("Convert ALL streets."), "convert2rel_24",
-			tr("Create relation between street and related addresses for ALL streets in the current layer."),
-			"fixaddresses/convertalltorelation");
-	}
+    public ConvertAllToRelationAction() {
+        super(tr("Convert ALL streets."), "convert2rel_24",
+            tr("Create relation between street and related addresses for ALL streets in the current layer."),
+            "fixaddresses/convertalltorelation");
+    }
 
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		// nothing to do
-	}
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        // nothing to do
+    }
 
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		if (container != null) {
-			for (OSMStreet street : container.getStreetList()) {
-				createRelationForStreet(street);
-			}
-		}
-	}
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        if (container != null) {
+            for (OSMStreet street : container.getStreetList()) {
+                createRelationForStreet(street);
+            }
+        }
+    }
 
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(hasStreetsToConvert());
-	}
+    @Override
+    protected void updateEnabledState(AddressEditContainer container) {
+        setEnabled(hasStreetsToConvert());
+    }
 
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		setEnabled(hasStreetsToConvert());
-	}
+    @Override
+    protected void updateEnabledState(AddressEditSelectionEvent event) {
+        setEnabled(hasStreetsToConvert());
+    }
 
-	/**
-	 * Checks for streets to convert to a relation.
-	 *
-	 * @return true, if successful
-	 */
-	private boolean hasStreetsToConvert() {
-		if (container != null) {
-			for (OSMStreet street : container.getStreetList()) {
-				if (street.hasAddresses() && !street.hasAssociatedStreetRelation()) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
+    /**
+     * Checks for streets to convert to a relation.
+     *
+     * @return true, if successful
+     */
+    private boolean hasStreetsToConvert() {
+        if (container != null) {
+            for (OSMStreet street : container.getStreetList()) {
+                if (street.hasAddresses() && !street.hasAssociatedStreetRelation()) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
 
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertToRelationAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertToRelationAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertToRelationAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -29,87 +17,74 @@
 public class ConvertToRelationAction extends AbstractAddressEditAction {
 
-	public ConvertToRelationAction() {
-		super(tr("Convert to relation."), "convert2rel_24",
-			tr("Create relation between street and related addresses."),
-			"fixaddresses/converttorelation");
-	}
+    public ConvertToRelationAction() {
+        super(tr("Convert to relation."), "convert2rel_24",
+            tr("Create relation between street and related addresses."),
+            "fixaddresses/converttorelation");
+    }
 
-	/**
-	 * Instantiates a new convert to relation action.
-	 *
-	 * @param name the name of the action
-	 * @param iconName the icon name
-	 * @param tooltip the tool tip to show on hover
-	 */
-	public ConvertToRelationAction(String name, String iconName, String tooltip, String toolbar) {
-		super(name, iconName, tooltip, toolbar);
-	}
+    /**
+     * Instantiates a new convert to relation action.
+     *
+     * @param name the name of the action
+     * @param iconName the icon name
+     * @param tooltip the tool tip to show on hover
+     */
+    public ConvertToRelationAction(String name, String iconName, String tooltip, String toolbar) {
+        super(name, iconName, tooltip, toolbar);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		OSMStreet streetNode = ev.getSelectedStreet();
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        OSMStreet streetNode = ev.getSelectedStreet();
 
-		if (streetNode != null) {
-			createRelationForStreet(streetNode);
-		}
-	}
+        if (streetNode != null) {
+            createRelationForStreet(streetNode);
+        }
+    }
 
-	/**
-	 * Creates the 'associatedStreet' relation for a given street by adding all addresses which
-	 * matches the name of the street.
-	 *
-	 * @param streetNode the street node
-	 */
-	protected void createRelationForStreet(OSMStreet streetNode) {
-		if (streetNode == null || !streetNode.hasAddresses()) return;
+    /**
+     * Creates the 'associatedStreet' relation for a given street by adding all addresses which
+     * matches the name of the street.
+     *
+     * @param streetNode the street node
+     */
+    protected void createRelationForStreet(OSMStreet streetNode) {
+        if (streetNode == null || !streetNode.hasAddresses()) return;
 
-		beginTransaction(tr("Create address relation for ") + " '" + streetNode.getName() + "'");
-		// Create the relation
-		Relation r = new Relation();
-		commands.add(new AddCommand(r));
-		commands.add(new ChangePropertyCommand(r, TagUtils.NAME_TAG, streetNode.getName()));
-		commands.add(new ChangePropertyCommand(r, TagUtils.RELATION_TYPE, TagUtils.ASSOCIATEDSTREET_RELATION_TYPE));
-		// add street with role 'street'
-		r.addMember(new RelationMember(TagUtils.STREET_RELATION_ROLE, streetNode.getOsmObject()));
+        beginTransaction(tr("Create address relation for ") + " '" + streetNode.getName() + "'");
+        // Create the relation
+        Relation r = new Relation();
+        commands.add(new AddCommand(r));
+        commands.add(new ChangePropertyCommand(r, TagUtils.NAME_TAG, streetNode.getName()));
+        commands.add(new ChangePropertyCommand(r, TagUtils.RELATION_TYPE, TagUtils.ASSOCIATEDSTREET_RELATION_TYPE));
+        // add street with role 'street'
+        r.addMember(new RelationMember(TagUtils.STREET_RELATION_ROLE, streetNode.getOsmObject()));
 
-		// add address members
-		for (OSMAddress addrNode : streetNode.getAddresses()) {
-			beginObjectTransaction(addrNode);
-			r.addMember(new RelationMember(TagUtils.HOUSE_RELATION_ROLE, addrNode.getOsmObject()));
-			addrNode.setStreetName(null); // remove street name
-			finishObjectTransaction(addrNode);
-		}
-		finishTransaction();
-	}
+        // add address members
+        for (OSMAddress addrNode : streetNode.getAddresses()) {
+            beginObjectTransaction(addrNode);
+            r.addMember(new RelationMember(TagUtils.HOUSE_RELATION_ROLE, addrNode.getOsmObject()));
+            addrNode.setStreetName(null); // remove street name
+            finishObjectTransaction(addrNode);
+        }
+        finishTransaction();
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		// Nothing to do (yet).
-	}
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        // Nothing to do (yet).
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(false);
-	}
+    @Override
+    protected void updateEnabledState(AddressEditContainer container) {
+        setEnabled(false);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		if (event == null) return;
+    @Override
+    protected void updateEnabledState(AddressEditSelectionEvent event) {
+        if (event == null) return;
 
-		OSMStreet street = event.getSelectedStreet();
-		setEnabled(street != null && street.hasAddresses() && !street.hasAssociatedStreetRelation());
-	}
-
+        OSMStreet street = event.getSelectedStreet();
+        setEnabled(street != null && street.hasAddresses() && !street.hasAssociatedStreetRelation());
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -31,72 +19,59 @@
  * @author Oliver Wieland <oliver.wieland@online.de>
  */
-
 @SuppressWarnings("serial")
 public class GuessAddressDataAction extends AbstractAddressEditAction implements IProgressMonitorFinishedListener {
 
-	/**
-	 * Instantiates a new "guess address data" action.
-	 */
-	public GuessAddressDataAction() {
-		super(tr("Guess"), "guessstreets_24", tr("Tries to guess address data by picking the name of the closest object with according tag."),
-			"fixaddresses/guessaddressdata");
-	}
+    /**
+     * Instantiates a new "guess address data" action.
+     */
+    public GuessAddressDataAction() {
+        super(tr("Guess"), "guessstreets_24", tr("Tries to guess address data by picking the name of the closest object with according tag."),
+            "fixaddresses/guessaddressdata");
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void updateEnabledState(AddressEditSelectionEvent ev) {
-		setEnabled(ev != null && ev.hasAddresses());
-	}
+    @Override
+    public void updateEnabledState(AddressEditSelectionEvent ev) {
+        setEnabled(ev != null && ev.hasAddresses());
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(container != null && container.getNumberOfInvalidAddresses() > 0);
-	}
+    @Override
+    protected void updateEnabledState(AddressEditContainer container) {
+        setEnabled(container != null && container.getNumberOfInvalidAddresses() > 0);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		if (container == null || container.getNumberOfInvalidAddresses() == 0) return;
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        if (container == null || container.getNumberOfInvalidAddresses() == 0) return;
 
-		internalGuessAddresses(container.getAllAddressesToFix());
-	}
+        internalGuessAddresses(container.getAllAddressesToFix());
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		if (ev == null || !ev.hasAddresses()) return;
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        if (ev == null || !ev.hasAddresses()) return;
 
-		// guess tags for selected addresses only
-		internalGuessAddresses(ev.getSelectedIncompleteAddresses());
-		internalGuessAddresses(ev.getSelectedUnresolvedAddresses());
-	}
+        // guess tags for selected addresses only
+        internalGuessAddresses(ev.getSelectedIncompleteAddresses());
+        internalGuessAddresses(ev.getSelectedUnresolvedAddresses());
+    }
 
-	/**
-	 * Internal method to start several threads guessing tag values for the given list of addresses.
-	 * @param addrNodes
-	 */
-	private void internalGuessAddresses(List<OSMAddress> nodes) {
-		if (nodes == null) return;
+    /**
+     * Internal method to start several threads guessing tag values for the given list of addresses.
+     * @param addrNodes
+     */
+    private void internalGuessAddresses(List<OSMAddress> nodes) {
+        if (nodes == null) return;
 
-		// Launch address guessing thread
-		GuessAddressRunnable aft = new GuessAddressRunnable(nodes, tr("Guessing address values"));
-		aft.addFinishListener(this);
-		Main.worker.submit(aft);
-	}
+        // Launch address guessing thread
+        GuessAddressRunnable aft = new GuessAddressRunnable(nodes, tr("Guessing address values"));
+        aft.addFinishListener(this);
+        Main.worker.submit(aft);
+    }
 
-	@Override
-	public void finished() {
-		if (container != null) {
-			container.invalidate();
-		}
-	}
+    @Override
+    public void finished() {
+        if (container != null) {
+            container.invalidate();
+        }
+    }
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/RemoveAddressTagsAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/RemoveAddressTagsAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/RemoveAddressTagsAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -23,48 +11,48 @@
 public class RemoveAddressTagsAction extends AbstractAddressEditAction {
 
-	public RemoveAddressTagsAction() {
-		super(tr("Remove"), "removeaddrtags_24", tr("Removes address related tags from the object."),
-			"fixaddresses/removeaddresstags");
-	}
+    public RemoveAddressTagsAction() {
+        super(tr("Remove"), "removeaddrtags_24", tr("Removes address related tags from the object."),
+            "fixaddresses/removeaddresstags");
+    }
 
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		beginTransaction(tr("Remove address tags"));
-		if (ev.hasUnresolvedAddresses()) {
-			for (OSMAddress aNode : ev.getSelectedUnresolvedAddresses()) {
-				beginObjectTransaction(aNode);
-				aNode.removeAllAddressTags();
-				finishObjectTransaction(aNode);
-			}
-		}
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        beginTransaction(tr("Remove address tags"));
+        if (ev.hasUnresolvedAddresses()) {
+            for (OSMAddress aNode : ev.getSelectedUnresolvedAddresses()) {
+                beginObjectTransaction(aNode);
+                aNode.removeAllAddressTags();
+                finishObjectTransaction(aNode);
+            }
+        }
 
-		if (ev.hasIncompleteAddresses()) {
-			for (OSMAddress aNode : ev.getSelectedIncompleteAddresses()) {
-				beginObjectTransaction(aNode);
-				aNode.removeAllAddressTags();
-				finishObjectTransaction(aNode);
-			}
-		}
-		finishTransaction();
-	}
+        if (ev.hasIncompleteAddresses()) {
+            for (OSMAddress aNode : ev.getSelectedIncompleteAddresses()) {
+                beginObjectTransaction(aNode);
+                aNode.removeAllAddressTags();
+                finishObjectTransaction(aNode);
+            }
+        }
+        finishTransaction();
+    }
 
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		// do nothing
-	}
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        // do nothing
+    }
 
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(false);
-	}
+    @Override
+    protected void updateEnabledState(AddressEditContainer container) {
+        setEnabled(false);
+    }
 
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		if (event == null) {
-			setEnabled(false);
-		}
+    @Override
+    protected void updateEnabledState(AddressEditSelectionEvent event) {
+        if (event == null) {
+            setEnabled(false);
+        }
 
-		setEnabled(event.hasAddresses());
-	}
+        setEnabled(event.hasAddresses());
+    }
 
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java	(revision 30348)
@@ -1,30 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
-/**
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* File created on 30.10.2010 */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -45,74 +18,64 @@
  *
  */
-
 @SuppressWarnings("serial")
 public class SelectAddressesInMapAction extends AbstractAddressEditAction {
 
-	/**
-	 * Instantiates a new "select addresses in map" action.
-	 */
-	public SelectAddressesInMapAction() {
-		super(tr("Select"), "selectall", tr("Marks selected addresses in the map"),
-			"fixaddresses/selectaddressesinmap");
-	}
+    /**
+     * Instantiates a new "select addresses in map" action.
+     */
+    public SelectAddressesInMapAction() {
+        super(tr("Select"), "selectall", tr("Marks selected addresses in the map"),
+            "fixaddresses/selectaddressesinmap");
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		if (ev == null) return;
+    @Override
+    public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+        if (ev == null) return;
 
-		if (ev.hasUnresolvedAddresses()) {
-			internalSelectAddresses(ev.getSelectedUnresolvedAddresses());
-		} else if (ev.hasIncompleteAddresses()) {
-			internalSelectAddresses(ev.getSelectedIncompleteAddresses());
-		}
-	}
+        if (ev.hasUnresolvedAddresses()) {
+            internalSelectAddresses(ev.getSelectedUnresolvedAddresses());
+        } else if (ev.hasIncompleteAddresses()) {
+            internalSelectAddresses(ev.getSelectedIncompleteAddresses());
+        }
+    }
 
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		// do nothing
-	}
+    @Override
+    public void addressEditActionPerformed(AddressEditContainer container) {
+        // do nothing
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(false);
-	}
+    @Override
+    protected void updateEnabledState(AddressEditContainer container) {
+        setEnabled(false);
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		setEnabled(event != null && event.hasAddresses());
-	}
+    @Override
+    protected void updateEnabledState(AddressEditSelectionEvent event) {
+        setEnabled(event != null && event.hasAddresses());
+    }
 
-	/**
-	 * Internal helper to select the given addresses in the map.
-	 * @param addrToSel
-	 */
-	private void internalSelectAddresses(List<OSMAddress> addrToSel) {
-		if (addrToSel == null) return;
+    /**
+     * Internal helper to select the given addresses in the map.
+     * @param addrToSel
+     */
+    private void internalSelectAddresses(List<OSMAddress> addrToSel) {
+        if (addrToSel == null) return;
 
-		List<OsmPrimitive> sel = new ArrayList<OsmPrimitive>();
+        List<OsmPrimitive> sel = new ArrayList<OsmPrimitive>();
 
-		getCurrentDataSet().clearSelection();
-		for (OSMAddress aNode : addrToSel) {
-			sel.add(aNode.getOsmObject());
+        getCurrentDataSet().clearSelection();
+        for (OSMAddress aNode : addrToSel) {
+            sel.add(aNode.getOsmObject());
 
-			// Select also guessed objects, if wished
-			if (FixAddressesPlugin.getPreferences().isSelectGuessedObjects()) {
-				for (OsmPrimitive osmPrimitive : aNode.getGuessedObjects()) {
-					sel.add(osmPrimitive);
-				}
-			}
-		}
+            // Select also guessed objects, if wished
+            if (FixAddressesPlugin.getPreferences().isSelectGuessedObjects()) {
+                for (OsmPrimitive osmPrimitive : aNode.getGuessedObjects()) {
+                    sel.add(osmPrimitive);
+                }
+            }
+        }
 
-		getCurrentDataSet().setSelected(sel);
-	}
+        getCurrentDataSet().setSelected(sel);
+    }
 
 }
Index: applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectIncompleteAddressesAction.java
===================================================================
--- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectIncompleteAddressesAction.java	(revision 30347)
+++ applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectIncompleteAddressesAction.java	(revision 30348)
@@ -1,15 +1,3 @@
-/*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
 
@@ -29,32 +17,29 @@
 
 
-	private AddressEditContainer addressEditContainer;
+    private AddressEditContainer addressEditContainer;
 
-	public SelectIncompleteAddressesAction() {
-		super(tr("Select incomplete addresses"), "select_invaddr_24",
-				tr("Selects all addresses with incomplete data."), null, false);
-	}
+    public SelectIncompleteAddressesAction() {
+        super(tr("Select incomplete addresses"), "select_invaddr_24",
+                tr("Selects all addresses with incomplete data."), null, false);
+    }
 
-	@Override
-	public void actionPerformed(ActionEvent arg0) {
-		addressEditContainer = new AddressEditContainer();
-		addressEditContainer.invalidate();
+    @Override
+    public void actionPerformed(ActionEvent arg0) {
+        addressEditContainer = new AddressEditContainer();
+        addressEditContainer.invalidate();
 
-		if (addressEditContainer.getIncompleteAddresses() != null) {
-			List<OsmPrimitive> osms = new ArrayList<OsmPrimitive>();
+        if (addressEditContainer.getIncompleteAddresses() != null) {
+            List<OsmPrimitive> osms = new ArrayList<OsmPrimitive>();
 
-			for (OSMAddress aNode : addressEditContainer.getIncompleteAddresses()) {
-				osms.add(aNode.getOsmObject());
-			}
-			getCurrentDataSet().setSelected(osms);
-		}
-	}
+            for (OSMAddress aNode : addressEditContainer.getIncompleteAddresses()) {
+                osms.add(aNode.getOsmObject());
+            }
+            getCurrentDataSet().setSelected(osms);
+        }
+    }
 
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState()
-	 */
-	@Override
-	protected void updateEnabledState() {
-		setEnabled(getCurrentDataSet() != null);
-	}
+    @Override
+    protected void updateEnabledState() {
+        setEnabled(getCurrentDataSet() != null);
+    }
 }
