Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 5480)
+++ /trunk/build.xml	(revision 5481)
@@ -140,4 +140,5 @@
                 windowtitle="JOSM"
                 use="true"
+                private="true"
                 linksource="true"
                 author="false">
Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 5480)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 5481)
@@ -16,4 +16,5 @@
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -151,4 +152,7 @@
     public MainMenu menu;
 
+    /**
+     * The data validation handler.
+     */
     public OsmValidator validator;
     /**
@@ -158,7 +162,11 @@
 
     /**
-     * Print a message if logging is on.
+     * Logging level (3 = debug, 2 = info, 1 = warn, 0 = none).
      */
     static public int log_level = 2;
+    /**
+     * Print a warning message if logging is on.
+     * @param msg The message to print.
+     */
     static public void warn(String msg) {
         if (log_level < 1)
@@ -166,4 +174,8 @@
         System.out.println(msg);
     }
+    /**
+     * Print an informational message if logging is on.
+     * @param msg The message to print.
+     */
     static public void info(String msg) {
         if (log_level < 2)
@@ -171,8 +183,39 @@
         System.out.println(msg);
     }
+    /**
+     * Print an debug message if logging is on.
+     * @param msg The message to print.
+     */
     static public void debug(String msg) {
         if (log_level < 3)
             return;
         System.out.println(msg);
+    }
+    /**
+     * Print a formated warning message if logging is on. Calls {@link MessageFormat#format}
+     * function to format text.
+     * @param msg The formated message to print.
+     * @param objects The objects to insert into format string.
+     */
+    static public void warn(String msg, Object... objects) {
+        warn(MessageFormat.format(msg, objects));
+    }
+    /**
+     * Print a formated informational message if logging is on. Calls {@link MessageFormat#format}
+     * function to format text.
+     * @param msg The formated message to print.
+     * @param objects The objects to insert into format string.
+     */
+    static public void info(String msg, Object... objects) {
+        info(MessageFormat.format(msg, objects));
+    }
+    /**
+     * Print a formated debug message if logging is on. Calls {@link MessageFormat#format}
+     * function to format text.
+     * @param msg The formated message to print.
+     * @param objects The objects to insert into format string.
+     */
+    static public void debug(String msg, Object... objects) {
+        debug(MessageFormat.format(msg, objects));
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java	(revision 5480)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java	(revision 5481)
@@ -26,5 +26,5 @@
  * the deleted or visible state of {@link OsmPrimitive}s.
  *
- * This model is an {@link Observable}. It notifies registered {@link Observer}s whenever the
+ * This model is an {@link Observable}. It notifies registered {@link java.util.Observer}s whenever the
  * internal state changes.
  *
@@ -33,6 +33,6 @@
  *
  * @see Node#getCoor()
- * @see OsmPrimitive#deleted
- * @see OsmPrimitive#visible
+ * @see OsmPrimitive#isDeleted
+ * @see OsmPrimitive#isVisible
  *
  */
@@ -120,8 +120,7 @@
 
     /**
-     * populates the model with the differences between my and their version
-     *
-     * @param my my version of the primitive
-     * @param their their version of the primitive
+     * Populates the model with the differences between local and server version
+     *
+     * @param conflict The conflict information
      */
     public void populate(Conflict<? extends OsmPrimitive> conflict) {
@@ -151,8 +150,8 @@
     /**
      * replies the coordinates of my {@link OsmPrimitive}. null, if my primitive hasn't
-     * coordinates (i.e. because it is a {@link Way}).
+     * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
      *
      * @return the coordinates of my {@link OsmPrimitive}. null, if my primitive hasn't
-     *  coordinates (i.e. because it is a {@link Way}).
+     *  coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
      */
     public LatLon getMyCoords() {
@@ -162,8 +161,8 @@
     /**
      * replies the coordinates of their {@link OsmPrimitive}. null, if their primitive hasn't
-     * coordinates (i.e. because it is a {@link Way}).
+     * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
      *
      * @return the coordinates of my {@link OsmPrimitive}. null, if my primitive hasn't
-     * coordinates (i.e. because it is a {@link Way}).
+     * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
      */
     public LatLon getTheirCoords() {
@@ -189,5 +188,5 @@
 
     /**
-     * decides a conflict between my and their coordinates
+     * Decides a conflict between local and server coordinates
      *
      * @param decision the decision
@@ -201,6 +200,6 @@
 
     /**
-     * replies my deleted state,
-     * @return
+     * Replies deleted state of local dataset
+     * @return The state of deleted flag
      */
     public Boolean getMyDeletedState() {
@@ -208,8 +207,16 @@
     }
 
+    /**
+     * Replies deleted state of Server dataset
+     * @return The state of deleted flag
+     */
     public  Boolean getTheirDeletedState() {
         return theirDeletedState;
     }
 
+    /**
+     * Replies deleted state of combined dataset
+     * @return The state of deleted flag
+     */
     public Boolean getMergedDeletedState() {
         switch(deletedMergeDecision) {
@@ -223,6 +230,6 @@
 
     /**
-     * returns my referrers,
-     * @return my referrers
+     * Returns local referrers
+     * @return The referrers
      */
     public List<OsmPrimitive> getMyReferrers() {
@@ -231,6 +238,6 @@
 
     /**
-     * returns their referrers,
-     * @return their referrers
+     * Returns server referrers
+     * @return The referrers
      */
     public List<OsmPrimitive> getTheirReferrers() {
@@ -289,5 +296,5 @@
      * their deleted states
      *
-     * @return true if my and their primitive have a conflict between
+     * @return <code>true</code> if my and their primitive have a conflict between
      * their deleted states
      */
@@ -299,5 +306,5 @@
      * replies true if all conflict in this model are resolved
      *
-     * @return true if all conflict in this model are resolved; false otherwise
+     * @return <code>true</code> if all conflict in this model are resolved; <code>false</code> otherwise
      */
     public boolean isResolvedCompletely() {
@@ -313,9 +320,8 @@
 
     /**
-     * builds the command(s) to apply the conflict resolutions to my primitive
-     *
-     * @param my  my primitive
-     * @param their their primitive
-     * @return the list of commands
+     * Builds the command(s) to apply the conflict resolutions to my primitive
+     *
+     * @param conflict The conflict information
+     * @return The list of commands
      */
     public List<Command> buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) {
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 5480)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 5481)
@@ -317,5 +317,5 @@
         p.add(Box.createHorizontalStrut(10), GBC.std());
         p.add(values, GBC.eol().fill(GBC.HORIZONTAL));
-        addFocusAdapter(row, keys, values, autocomplete, usedValuesAwareComparator);
+        addFocusAdapter(keys, values, autocomplete, usedValuesAwareComparator);
 
         final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION) {
@@ -447,5 +447,5 @@
 
     /**
-     * This simply fires up an relation editor for the relation shown; everything else
+     * This simply fires up an {@link RelationEditor} for the relation shown; everything else
      * is the editor's business.
      *
@@ -535,5 +535,5 @@
         }
 
-        FocusAdapter focus = addFocusAdapter(-1, keys, values, autocomplete, defaultACItemComparator);
+        FocusAdapter focus = addFocusAdapter(keys, values, autocomplete, defaultACItemComparator);
         // fire focus event in advance or otherwise the popup list will be too small at first
         focus.focusGained(null);
@@ -617,5 +617,4 @@
                 // performing this action leads to autocomplete to the next key (see #7671 comments)
                 for (int j = 0; j < propertyData.getRowCount(); ++j) {
-                    System.out.println(propertyData.getValueAt(j, 0));
                     if (t.getKey().equals(propertyData.getValueAt(j, 0))) {
                         action.setEnabled(false);
@@ -655,10 +654,13 @@
 
     /**
-     * @param allData
-     * @param keys
-     * @param values
-     */
-    private FocusAdapter addFocusAdapter(final int row,
-            final AutoCompletingComboBox keys, final AutoCompletingComboBox values,
+     * Create a focus handling adapter and apply in to the editor component of value
+     * autocompletion box.
+     * @param keys Box for keys entering and autocompletion
+     * @param values Box for values entering and autocompletion
+     * @param autocomplete Manager handling the autocompletion
+     * @param comparator Class to decide what values are offered on autocompletion
+     * @return The created adapter
+     */
+    private FocusAdapter addFocusAdapter(final AutoCompletingComboBox keys, final AutoCompletingComboBox values,
             final AutoCompletionManager autocomplete, final Comparator<AutoCompletionListItem> comparator) {
         // get the combo box' editor component
@@ -683,5 +685,5 @@
 
     /**
-     * The property data.
+     * The property data of selected objects.
      */
     private final DefaultTableModel propertyData = new DefaultTableModel() {
@@ -695,5 +697,5 @@
 
     /**
-     * The membership data.
+     * The membership data of selected objects.
      */
     private final DefaultTableModel membershipData = new DefaultTableModel() {
@@ -707,17 +709,32 @@
 
     /**
-     * The properties list.
+     * The properties table.
      */
     private final JTable propertyTable = new JTable(propertyData);
+    /**
+     * The membership table.
+     */
     private final JTable membershipTable = new JTable(membershipData);
 
     /**
-     * The Add/Edit/Delete buttons (needed to be able to disable them)
+     * The Add button (needed to be able to disable it)
      */
     private final SideButton btnAdd;
+    /**
+     * The Edit button (needed to be able to disable it)
+     */
     private final SideButton btnEdit;
+    /**
+     * The Delete button (needed to be able to disable it)
+     */
     private final SideButton btnDel;
+    /**
+     * Matching preset display class
+     */
     private final PresetListPanel presets = new PresetListPanel();
 
+    /**
+     * Text to display when nothing selected.
+     */
     private final JLabel selectSth = new JLabel("<html><p>"
             + tr("Select objects for which to change properties.") + "</p></html>");
@@ -996,5 +1013,6 @@
     }
 
-    @Override public void setVisible(boolean b) {
+    @Override
+    public void setVisible(boolean b) {
         super.setVisible(b);
         if (b && Main.main.getCurrentDataSet() != null) {
@@ -1030,4 +1048,5 @@
     };
 
+    @Override
     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
         if (!isVisible())
@@ -1156,4 +1175,7 @@
     }
 
+    /**
+     * Update selection status, call @{link #selectionChanged} function.
+     */
     private void updateSelection() {
         if (Main.main.getCurrentDataSet() == null) {
@@ -1165,14 +1187,19 @@
 
     /* ---------------------------------------------------------------------------------- */
-    /* EditLayerChangeListener                                                                */
+    /* EditLayerChangeListener                                                            */
     /* ---------------------------------------------------------------------------------- */
+    @Override
     public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
         updateSelection();
     }
 
+    @Override
     public void processDatasetEvent(AbstractDatasetChangedEvent event) {
         updateSelection();
     }
 
+    /**
+     * Action handling delete button press in properties dialog.
+     */
     class DeleteAction extends JosmAction implements ListSelectionListener {
 
@@ -1277,4 +1304,7 @@
     }
 
+    /**
+     * Action handling add button press in properties dialog.
+     */
     class AddAction extends JosmAction {
         public AddAction() {
@@ -1290,4 +1320,7 @@
     }
 
+    /**
+     * Action handling edit button press in properties dialog.
+     */
     class EditAction extends JosmAction implements ListSelectionListener {
         public EditAction() {
@@ -1381,5 +1414,5 @@
 
                                 if (conn.getResponseCode() != 200) {
-                                    System.out.println("INFO: " + u + " does not exist");
+                                    Main.info("INFO: {0} does not exist", u);
                                     conn.disconnect();
                                 } else {
@@ -1398,8 +1431,8 @@
                                      */
                                     if (Math.abs(conn.getContentLength() - osize) > 200) {
-                                        System.out.println("INFO: " + u + " is a mediawiki redirect");
+                                        Main.info("INFO: {0} is a mediawiki redirect", u);
                                         conn.disconnect();
                                     } else {
-                                        System.out.println("INFO: browsing to " + u);
+                                        Main.info("INFO: browsing to {0}", u);
                                         conn.disconnect();
 
Index: /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 5480)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 5481)
@@ -17,4 +17,5 @@
 import javax.swing.Icon;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchCompiler.Match;
 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
@@ -108,5 +109,5 @@
                     cache.put(key, result);
                 } catch (ParseError e) {
-                    System.out.println(String.format("Unable to parse template engine pattern '%s' for property %s", defaultValue, key));
+                    Main.warn("Unable to parse template engine pattern ''{0}'' for property {1}", defaultValue, key);
                 }
             }
@@ -127,5 +128,5 @@
                     cache.put(key, result);
                 } catch (ParseError e) {
-                    System.out.println(String.format("Unable to parse template engine pattern '%s' for property %s", defaultValue, key));
+                    Main.warn("Unable to parse template engine pattern ''{0}'' for property {1}", defaultValue, key);
                 }
             }
@@ -147,6 +148,6 @@
                 return new TemplateParser(s).parse();
             } catch (ParseError e) {
-                System.out.println(String.format("Unable to parse template engine pattern '%s' for property %s. Using default ('%s') instead",
-                        s, getKey(), super.getDefaultValueAsString()));
+                Main.warn("Unable to parse template engine pattern ''{0}'' for property {1}. Using default (''{2}'') instead",
+                        s, getKey(), super.getDefaultValueAsString());
                 return getDefaultValue();
             }
@@ -177,5 +178,5 @@
     public static final List<MarkerProducers> markerProducers = new LinkedList<MarkerProducers>();
 
-    // Add one Maker specifying the default behaviour.
+    // Add one Marker specifying the default behaviour.
     static {
         Marker.markerProducers.add(new MarkerProducers() {
@@ -203,5 +204,5 @@
                                 url = new File(relativePath.getParentFile(), uri).toURI().toURL();
                             } catch (MalformedURLException e1) {
-                                System.err.println("Unable to convert uri " + uri + " to URL: "  + e1.getMessage());
+                                Main.warn("Unable to convert uri {0} to URL: {1}", uri, e1.getMessage());
                             }
                         }
@@ -217,10 +218,11 @@
                     return new Marker(wpt.getCoor(), wpt, symbolName, parentLayer, time, offset);
                 }
-                else if (url.toString().endsWith(".wav"))
+                else if (url.toString().endsWith(".wav")) {
                     return new AudioMarker(wpt.getCoor(), wpt, url, parentLayer, time, offset);
-                else if (url.toString().endsWith(".png") || url.toString().endsWith(".jpg") || url.toString().endsWith(".jpeg") || url.toString().endsWith(".gif"))
+                } else if (url.toString().endsWith(".png") || url.toString().endsWith(".jpg") || url.toString().endsWith(".jpeg") || url.toString().endsWith(".gif")) {
                     return new ImageMarker(wpt.getCoor(), url, parentLayer, time, offset);
-                else
+                } else {
                     return new WebMarker(wpt.getCoor(), url, parentLayer, time, offset);
+                }
             }
         });
@@ -366,5 +368,5 @@
     /**
      * Returns the Text which should be displayed, depending on chosen preference
-     * @return Text
+     * @return Text of the label
      */
     public String getText() {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 5480)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 5481)
@@ -424,4 +424,8 @@
     }
 
+    /**
+     * Get state of text display.
+     * @return <code>true</code> if text should be shown, <code>false</code> otherwise.
+     */
     private boolean isTextOrIconShown() {
         String current = Main.pref.get("marker.show "+getName(),"show");
