Index: /applications/editors/josm/plugins/terracer/.checkstyle
===================================================================
--- /applications/editors/josm/plugins/terracer/.checkstyle	(revision 33077)
+++ /applications/editors/josm/plugins/terracer/.checkstyle	(revision 33077)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value=".svn"/>
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="resources"/>
+    <filter-data value="styles"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: /applications/editors/josm/plugins/terracer/.project
===================================================================
--- /applications/editors/josm/plugins/terracer/.project	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/.project	(revision 33077)
@@ -16,7 +16,13 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>
Index: /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java	(revision 33077)
@@ -1,9 +1,3 @@
-/**
- * Terracer: A JOSM Plugin for terraced houses.
- *
- * Copyright 2009 CloudMade Ltd.
- *
- * Released under the GPLv2, see LICENSE file for details.
- */
+// License: GPL. For details, see LICENSE file.
 package terracer;
 
@@ -45,21 +39,21 @@
  *  HouseNumberinputHandler class.
  *
- * @author casualwalker
+ * @author casualwalker - Copyright 2009 CloudMade Ltd
  */
 public class HouseNumberInputDialog extends ExtendedDialog {
     /*
-    final static String MIN_NUMBER = "plugin.terracer.lowest_number";
-    final static String MAX_NUMBER = "plugin.terracer.highest_number";
-    final static String INTERPOLATION = "plugin.terracer.interpolation_mode";
+    static final String MIN_NUMBER = "plugin.terracer.lowest_number";
+    static final String MAX_NUMBER = "plugin.terracer.highest_number";
+    static final String INTERPOLATION = "plugin.terracer.interpolation_mode";
     */
-    final static String DEFAULT_SEGMENTS = "plugins.terracer.segments";
-    final static String HANDLE_RELATION = "plugins.terracer.handle_relation";
-    final static String KEEP_OUTLINE = "plugins.terracer.keep_outline";
-    final static String INTERPOLATION = "plugins.terracer.interpolation";
-
-    //final private Way street;
-    final private String streetName;
-    final private String buildingType;
-    final private boolean relationExists;
+    static final String DEFAULT_SEGMENTS = "plugins.terracer.segments";
+    static final String HANDLE_RELATION = "plugins.terracer.handle_relation";
+    static final String KEEP_OUTLINE = "plugins.terracer.keep_outline";
+    static final String INTERPOLATION = "plugins.terracer.interpolation";
+
+    //private final Way street;
+    private final String streetName;
+    private final String buildingType;
+    private final boolean relationExists;
     final ArrayList<Node> housenumbers;
 
@@ -97,8 +91,9 @@
      * @param housenumbers a list of house numbers in this outline (may be empty)
      */
-    public HouseNumberInputDialog(HouseNumberInputHandler handler, Way street, String streetName, String buildingType, boolean relationExists, ArrayList<Node> housenumbers) {
+    public HouseNumberInputDialog(HouseNumberInputHandler handler, Way street, String streetName,
+            String buildingType, boolean relationExists, ArrayList<Node> housenumbers) {
         super(Main.parent,
                 tr("Terrace a house"),
-                new String[] { tr("OK"), tr("Cancel")},
+                new String[] {tr("OK"), tr("Cancel")},
                 true
         );
@@ -190,24 +185,24 @@
             inputPanel.add(messageLabel, c);
 
-            inputPanel.add(loLabel, GBC.std().insets(3,3,0,0));
-            inputPanel.add(getLo(), GBC.eol().fill(GBC.HORIZONTAL).insets(5,3,0,0));
-            inputPanel.add(hiLabel, GBC.std().insets(3,3,0,0));
-            inputPanel.add(getHi(), GBC.eol().fill(GBC.HORIZONTAL).insets(5,3,0,0));
-            inputPanel.add(numbersLabel, GBC.std().insets(3,3,0,0));
-            inputPanel.add(getNumbers(), GBC.eol().fill(GBC.HORIZONTAL).insets(5,3,0,0));
-            inputPanel.add(interpolationLabel, GBC.std().insets(3,3,0,0));
-            inputPanel.add(getInterpolation(), GBC.eol().insets(5,3,0,0));
-            inputPanel.add(segmentsLabel, GBC.std().insets(3,3,0,0));
-            inputPanel.add(getSegments(), GBC.eol().fill(GBC.HORIZONTAL).insets(5,3,0,0));
+            inputPanel.add(loLabel, GBC.std().insets(3, 3, 0, 0));
+            inputPanel.add(getLo(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 3, 0, 0));
+            inputPanel.add(hiLabel, GBC.std().insets(3, 3, 0, 0));
+            inputPanel.add(getHi(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 3, 0, 0));
+            inputPanel.add(numbersLabel, GBC.std().insets(3, 3, 0, 0));
+            inputPanel.add(getNumbers(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 3, 0, 0));
+            inputPanel.add(interpolationLabel, GBC.std().insets(3, 3, 0, 0));
+            inputPanel.add(getInterpolation(), GBC.eol().insets(5, 3, 0, 0));
+            inputPanel.add(segmentsLabel, GBC.std().insets(3, 3, 0, 0));
+            inputPanel.add(getSegments(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 3, 0, 0));
             if (streetName == null) {
-                inputPanel.add(streetLabel, GBC.std().insets(3,3,0,0));
-                inputPanel.add(getStreet(), GBC.eol().insets(5,3,0,0));
+                inputPanel.add(streetLabel, GBC.std().insets(3, 3, 0, 0));
+                inputPanel.add(getStreet(), GBC.eol().insets(5, 3, 0, 0));
             } else {
-                inputPanel.add(new JLabel(tr("Street name: ")+"\""+streetName+"\""), GBC.eol().insets(3,3,0,0));
-            }
-            inputPanel.add(buildingLabel, GBC.std().insets(3,3,0,0));
-            inputPanel.add(getBuilding(), GBC.eol().insets(5,3,0,0));
-            inputPanel.add(handleRelationCheckBox, GBC.eol().insets(3,3,0,0));
-            inputPanel.add(keepOutlineCheckBox, GBC.eol().insets(3,3,0,0));
+                inputPanel.add(new JLabel(tr("Street name: ")+"\""+streetName+"\""), GBC.eol().insets(3, 3, 0, 0));
+            }
+            inputPanel.add(buildingLabel, GBC.std().insets(3, 3, 0, 0));
+            inputPanel.add(getBuilding(), GBC.eol().insets(5, 3, 0, 0));
+            inputPanel.add(handleRelationCheckBox, GBC.eol().insets(3, 3, 0, 0));
+            inputPanel.add(keepOutlineCheckBox, GBC.eol().insets(3, 3, 0, 0));
 
             if (numbers.isVisible()) {
@@ -275,8 +270,8 @@
             if (it.hasNext()) {
                 s.append(it.next().get("addr:housenumber"));
-                while (it.hasNext())
+                while (it.hasNext()) {
                     s.append(';').append(it.next().get("addr:housenumber"));
-            }
-            else {
+                }
+            } else {
                 numbersLabel.setVisible(false);
                 numbers.setVisible(false);
Index: /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java	(revision 33077)
@@ -1,9 +1,3 @@
-/**
- * Terracer: A JOSM Plugin for terraced houses.
- *
- * Copyright 2009 CloudMade Ltd.
- *
- * Released under the GPLv2, see LICENSE file for details.
- */
+// License: GPL. For details, see LICENSE file.
 package terracer;
 
@@ -42,5 +36,5 @@
  * is already cluttered with auto-generated layout code.
  *
- * @author casualwalker
+ * @author casualwalker - Copyright 2009 CloudMade Ltd
  */
 public class HouseNumberInputHandler extends JosmAction implements ActionListener, FocusListener, ItemListener {
@@ -95,5 +89,5 @@
      */
     private static JButton getButton(Container root, String caption) {
-        Component children[] = root.getComponents();
+        Component[] children = root.getComponents();
         for (Component child : children) {
             JButton b;
@@ -126,5 +120,5 @@
         // Allow non numeric characters for the low number as long as there is
         // no high number of the segmentcount is 1
-        if (dialog.hi.getText().length() > 0 && (segments()!= null || segments() < 1)) {
+        if (dialog.hi.getText().length() > 0 && (segments() != null || segments() < 1)) {
             isOk = isOk
                     && checkNumberStringField(dialog.lo, tr("Lowest number"),
@@ -306,5 +300,5 @@
                             doKeepOutline(), buildingType());
                     } catch (UserCancelException ex) {
-                        // Ignore
+                        Main.trace(ex);
                     }
 
@@ -396,10 +390,7 @@
         } else {
             String name;
-            if (selected instanceof AutoCompletionListItem)
-            {
-               name = ((AutoCompletionListItem)selected).getValue();
-            }
-            else
-            {
+            if (selected instanceof AutoCompletionListItem) {
+               name = ((AutoCompletionListItem) selected).getValue();
+            } else {
                name = selected.toString();
             }
Index: /applications/editors/josm/plugins/terracer/src/terracer/ReverseTerraceAction.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/ReverseTerraceAction.java	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/src/terracer/ReverseTerraceAction.java	(revision 33077)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package terracer;
 
@@ -100,5 +101,5 @@
                     for (OsmPrimitive prim : n.getReferrers()) {
                         if (prim.keySet().contains("building") && prim instanceof Way) {
-                            front.add((Way)prim);
+                            front.add((Way) prim);
                         }
                     }
Index: /applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java	(revision 33077)
@@ -1,9 +1,3 @@
-/**
- * Terracer: A JOSM Plugin for terraced houses.
- *
- * Copyright 2009 CloudMade Ltd.
- *
- * Released under the GPLv2, see LICENSE file for details.
- */
+// License: GPL. For details, see LICENSE file.
 package terracer;
 
@@ -60,5 +54,5 @@
  * algorithm employed is naive, but it works in the simple case.
  *
- * @author zere
+ * @author zere - Copyright 2009 CloudMade Ltd
  */
 public final class TerracerAction extends JosmAction {
@@ -81,5 +75,5 @@
     }
 
-    protected static final Set<Relation> findAssociatedStreets(Collection<OsmPrimitive> objects) {
+    protected static Set<Relation> findAssociatedStreets(Collection<OsmPrimitive> objects) {
         Set<Relation> result = new HashSet<>();
         if (objects != null) {
@@ -221,7 +215,8 @@
             // Don't open the dialog
             try {
-                terraceBuilding(outline, init, street, associatedStreet, 0, null, null, 0, housenumbers, streetname, associatedStreet != null, false, "yes");
+                terraceBuilding(outline, init, street, associatedStreet, 0, null, null, 0, 
+                        housenumbers, streetname, associatedStreet != null, false, "yes");
             } catch (UserCancelException ex) {
-                // Ignore
+                Main.trace(ex);
             } finally {
                 this.commands.clear();
@@ -270,6 +265,5 @@
                     // If the numbers are the same, the rest has to make the decision,
                     // e.g. when comparing 23, 23a and 23b.
-                    if (node1Int.equals(node2Int))
-                    {
+                    if (node1Int.equals(node2Int)) {
                       String node2Rest = mat.group(2);
                       return node1Rest.compareTo(node2Rest);
@@ -295,5 +289,5 @@
      * @param init The node that hints at which side to start the numbering
      * @param street The street, the buildings belong to (may be null)
-     * @param associatedStreet
+     * @param associatedStreet associated street relation
      * @param segments The number of segments to generate
      * @param start Starting housenumber
@@ -308,5 +302,5 @@
      * @param keepOutline If the outline way should be kept
      * @param buildingValue The value for {@code building} key to add
-     * @throws UserCancelException
+     * @throws UserCancelException if user cancels the operation
      */
     public void terraceBuilding(final Way outline, Node init, Way street, Relation associatedStreet, Integer segments,
@@ -403,7 +397,8 @@
                 List<Node> nodes = outline.getNodes();
                 ArrayList<Node> nodesToDelete = new ArrayList<>();
-                for (Node n : nodes)
+                for (Node n : nodes) {
                     if (!n.hasKeys() && n.getReferrers().size() == 1 && !reusedNodes.contains(n))
                         nodesToDelete.add(n);
+                }
                 if (!nodesToDelete.isEmpty())
                     this.commands.add(DeleteCommand.delete(Main.getLayerManager().getEditLayer(), nodesToDelete));
@@ -493,5 +488,5 @@
                         }
                     } catch (UserCancelException e) {
-                        // Ignore
+                        Main.trace(e);
                     }
                 }
@@ -510,5 +505,5 @@
      * @param buildingValue The value for {@code building} key to add
      * @return {@code outline}
-     * @throws UserCancelException
+     * @throws UserCancelException if user cancels the operation
      */
     private void addressBuilding(Way outline, Way street, String streetName, Relation associatedStreet,
@@ -560,7 +555,7 @@
      */
     private Node interpolateAlong(Way w, double l) {
-        List<Pair<Node,Node>> pairs = w.getNodePairs(false);
+        List<Pair<Node, Node>> pairs = w.getNodePairs(false);
         for (int i = 0; i < pairs.size(); ++i) {
-            Pair<Node,Node> p = pairs.get(i);
+            Pair<Node, Node> p = pairs.get(i);
             final double seg_length = p.a.getCoor().greatCircleDistance(p.b.getCoor());
             if (l <= seg_length || i == pairs.size() - 1) {
@@ -698,5 +693,5 @@
             public int i;
 
-            public SortWithIndex(double a, int b) {
+            SortWithIndex(double a, int b) {
                 x = a;
                 i = b;
Index: /applications/editors/josm/plugins/terracer/src/terracer/TerracerPlugin.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/TerracerPlugin.java	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/src/terracer/TerracerPlugin.java	(revision 33077)
@@ -1,9 +1,3 @@
-/**
- * Terracer: A JOSM Plugin for terraced houses.
- *
- * Copyright 2009 CloudMade Ltd.
- *
- * Released under the GPLv2, see LICENSE file for details.
- */
+// License: GPL. For details, see LICENSE file.
 package terracer;
 
@@ -16,5 +10,5 @@
  * Plugin interface implementation for Terracer.
  *
- * @author zere
+ * @author zere - Copyright 2009 CloudMade Ltd
  */
 public class TerracerPlugin extends Plugin {
Index: /applications/editors/josm/plugins/terracer/src/terracer/TerracerRuntimeException.java
===================================================================
--- /applications/editors/josm/plugins/terracer/src/terracer/TerracerRuntimeException.java	(revision 33076)
+++ /applications/editors/josm/plugins/terracer/src/terracer/TerracerRuntimeException.java	(revision 33077)
@@ -1,9 +1,3 @@
-/**
- * Terracer: A JOSM Plugin for terraced houses.
- *
- * Copyright 2009 CloudMade Ltd.
- *
- * Released under the GPLv2, see LICENSE file for details.
- */
+// License: GPL. For details, see LICENSE file.
 package terracer;
 
@@ -11,5 +5,5 @@
  * The Class TerracerRuntimeException indicates errors from the Terracer Plugin.
  *
- * @author casualwalker
+ * @author casualwalker - Copyright 2009 CloudMade Ltd
  */
 public class TerracerRuntimeException extends RuntimeException {
@@ -22,22 +16,12 @@
     }
 
-    /**
-     * @param message
-     * @param cause
-     */
     public TerracerRuntimeException(String message, Throwable cause) {
         super(message, cause);
     }
 
-    /**
-     * @param message
-     */
     public TerracerRuntimeException(String message) {
         super(message);
     }
 
-    /**
-     * @param cause
-     */
     public TerracerRuntimeException(Throwable cause) {
         super(cause);
