Index: /applications/editors/josm/plugins/trustosm/.checkstyle
===================================================================
--- /applications/editors/josm/plugins/trustosm/.checkstyle	(revision 32533)
+++ /applications/editors/josm/plugins/trustosm/.checkstyle	(revision 32533)
@@ -0,0 +1,18 @@
+<?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="data"/>
+    <filter-data value="images"/>
+    <filter-data value="styles"/>
+    <filter-data value="resources"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: /applications/editors/josm/plugins/trustosm/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /applications/editors/josm/plugins/trustosm/.settings/org.eclipse.jdt.core.prefs	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/.settings/org.eclipse.jdt.core.prefs	(revision 32533)
@@ -64,5 +64,5 @@
 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -86,4 +86,5 @@
 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
 org.eclipse.jdt.core.compiler.problem.unusedImport=warning
 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
Index: /applications/editors/josm/plugins/trustosm/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /applications/editors/josm/plugins/trustosm/.settings/org.eclipse.jdt.ui.prefs	(revision 32533)
+++ /applications/editors/josm/plugins/trustosm/.settings/org.eclipse.jdt.ui.prefs	(revision 32533)
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/TrustOSMplugin.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/TrustOSMplugin.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/TrustOSMplugin.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm;
 
@@ -66,6 +67,6 @@
             Main.pref.put("trustosm.jarLibsExtracted", extractFiles("trustosm","resources"));
         }*/
-        extractFiles("trustosm","lib");
-        extractFiles("trustosm","resources");
+        extractFiles("trustosm", "lib");
+        extractFiles("trustosm", "resources");
 
         refreshMenu();
@@ -84,15 +85,15 @@
 
     public static void checkForUnrestrictedPolicyFiles() {
-        byte[] data = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
+        byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
 
         // create a cipher and attempt to encrypt the data block with our key
-        try{
+        try {
             Cipher c = Cipher.getInstance("AES");
             // create a 192 bit secret key from raw bytes
 
-            SecretKey key192 = new SecretKeySpec(new byte[] { 0x00, 0x01, 0x02,
-                    0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
-                    0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
-                    0x17 }, "AES");
+            SecretKey key192 = new SecretKeySpec(new byte[] {0x00, 0x01, 0x02,
+                   0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
+                   0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+                   0x17 }, "AES");
 
             // now try encrypting with the larger key
@@ -103,5 +104,4 @@
             Main.warn("It seems that the Unrestricted Policy Files are not available in this JVM. "+
                       "So high level crypto is not allowed. Problems may occur.");
-            //extractFiles("trustosm","jce");
             installUnrestrictedPolicyFiles();
         } catch (BadPaddingException | IllegalBlockSizeException | NoSuchPaddingException | NoSuchAlgorithmException e) {
@@ -260,9 +260,8 @@
             gpgJMenu.add(new JMenuItem(new ExportSigsAction()));
         }
-
     }
 
     public static void setSettings() {
-        Map<String,String> prefs = Main.pref.getAllPrefix("trustosm.");
+        Map<String, String> prefs = Main.pref.getAllPrefix("trustosm.");
 
         // if setting isn't present, we set a default
@@ -272,5 +271,4 @@
     }
 
-
     @Override
     public PreferenceSetting getPreferenceSetting() {
@@ -280,5 +278,5 @@
     @Override
     public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-        if (oldFrame==null && newFrame!=null) {
+        if (oldFrame == null && newFrame != null) {
             trustDialog = new TrustDialog();
             newFrame.addToggleDialog(trustDialog);
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/ExportSigsAction.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/ExportSigsAction.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/ExportSigsAction.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.actions;
 
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/GetMissingDataAction.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/GetMissingDataAction.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/GetMissingDataAction.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.actions;
 
@@ -22,6 +23,6 @@
 
     public GetMissingDataAction() {
-        super(tr("Download OSM"),"getmissing",tr("Get all referenced but not actually present OSM objects from OSM server."),
-                Shortcut.registerShortcut("gpg:download", tr("Download referenced osm objects..."), KeyEvent.VK_T, Shortcut.CTRL),true);
+        super(tr("Download OSM"), "getmissing", tr("Get all referenced but not actually present OSM objects from OSM server."),
+                Shortcut.registerShortcut("gpg:download", tr("Download referenced osm objects..."), KeyEvent.VK_T, Shortcut.CTRL), true);
     }
 
@@ -35,5 +36,5 @@
     public boolean downloadMissing() {
         Collection<OsmPrimitive> missingData = new HashSet<>();
-        Map<String,TrustOsmPrimitive> trustitems = TrustOSMplugin.signedItems;
+        Map<String, TrustOsmPrimitive> trustitems = TrustOSMplugin.signedItems;
         getMissing(trustitems, missingData);
 
@@ -41,7 +42,10 @@
         int itemCount = trustitems.size();
         if (missingCount == 0) {
-            JOptionPane.showMessageDialog(Main.parent, tr("{0} Signatures loaded. All referenced OSM objects found.",itemCount));
+            JOptionPane.showMessageDialog(Main.parent, tr("{0} Signatures loaded. All referenced OSM objects found.", itemCount));
         } else {
-            int n = JOptionPane.showOptionDialog(Main.parent, tr("{0} of {1} OSM objects are referenced but not there.\nDo you want to load them from OSM-Server?",missingCount,itemCount), tr("Load objects from server"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
+            int n = JOptionPane.showOptionDialog(Main.parent,
+                    tr("{0} of {1} OSM objects are referenced but not there.\nDo you want to load them from OSM-Server?",
+                            missingCount, itemCount),
+                    tr("Load objects from server"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
 
             if (n == JOptionPane.YES_OPTION) {
@@ -54,5 +58,5 @@
     }
 
-    public void getMissing(Map<String,TrustOsmPrimitive> trustitems, Collection<OsmPrimitive> missingData) {
+    public void getMissing(Map<String, TrustOsmPrimitive> trustitems, Collection<OsmPrimitive> missingData) {
         Collection<OsmPrimitive> presentData = Main.getLayerManager().getEditDataSet().allPrimitives();
         for (TrustOsmPrimitive t : trustitems.values()) {
@@ -62,5 +66,3 @@
         }
     }
-
-
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustNode.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustNode.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustNode.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.data;
 
@@ -12,5 +13,4 @@
 public class TrustNode extends TrustOsmPrimitive {
 
-
     public static Node generateNodeFromSigtext(String sigtext) {
         Pattern p = Pattern.compile("^(\\d*)\\((\\d*\\.?\\d*),(\\d*\\.?\\d*)\\)");
@@ -18,5 +18,5 @@
         if (m.matches()) {
             Node node = new Node(Long.parseLong(m.group(1)));
-            node.setCoor(new LatLon(Double.parseDouble(m.group(2)),Double.parseDouble(m.group(3))));
+            node.setCoor(new LatLon(Double.parseDouble(m.group(2)), Double.parseDouble(m.group(3))));
             return node;
         }
@@ -40,5 +40,5 @@
     @Override
     public void setOsmPrimitive(OsmPrimitive osmItem) {
-        if(osmItem instanceof Node) {
+        if (osmItem instanceof Node) {
             osm = osmItem;
         } else {
@@ -56,5 +56,5 @@
 
     public void setNodeRatings(TrustSignatures ratings) {
-        this.ratings =ratings;
+        this.ratings = ratings;
     }
 
@@ -62,4 +62,3 @@
         return ratings;
     }
-
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustOsmPrimitive.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustOsmPrimitive.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustOsmPrimitive.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.data;
 
@@ -11,13 +12,13 @@
 import org.openstreetmap.josm.data.osm.Way;
 
-abstract public class TrustOsmPrimitive {
+public abstract class TrustOsmPrimitive {
 
     public static String createUniqueObjectIdentifier(OsmPrimitive osm) {
         String id = "";
-        if(osm instanceof Node) {
+        if (osm instanceof Node) {
             id = "n";
-        } else if(osm instanceof Way) {
+        } else if (osm instanceof Way) {
             id = "w";
-        } else if(osm instanceof Relation) {
+        } else if (osm instanceof Relation) {
             id = "r";
         }
@@ -38,9 +39,9 @@
 
     public static TrustOsmPrimitive createTrustOsmPrimitive(OsmPrimitive osm) {
-        if(osm instanceof Node) {
+        if (osm instanceof Node) {
             return new TrustNode((Node) osm);
-        } else if(osm instanceof Way) {
+        } else if (osm instanceof Way) {
             return new TrustWay(osm);
-        } else if(osm instanceof Relation) {
+        } else if (osm instanceof Relation) {
             return new TrustRelation(osm);
         }
@@ -60,5 +61,4 @@
 
     public abstract void setOsmPrimitive(OsmPrimitive osmItem);
-
 
     public static String[] generateTagsFromSigtext(String sigtext) {
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustRelation.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustRelation.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustRelation.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.data;
 
@@ -14,5 +15,4 @@
 public class TrustRelation extends TrustOsmPrimitive {
 
-
     public static RelationMember generateRelationMemberFromSigtext(String sigtext) {
         Pattern p = Pattern.compile("^RelID=(\\w*)\n(\\d*),(.*)");
@@ -20,5 +20,5 @@
         if (m.matches()) {
             OsmPrimitive osm = createOsmPrimitiveFromUniqueObjectIdentifier(m.group(2));
-            return new RelationMember(m.group(3),osm);
+            return new RelationMember(m.group(3), osm);
         }
         return null;
@@ -26,5 +26,5 @@
 
     public static String generateRelationMemberSigtext(TrustRelation trust, String memID) {
-        Relation r = (Relation)trust.getOsmPrimitive();
+        Relation r = (Relation) trust.getOsmPrimitive();
         List<RelationMember> members = r.getMembers();
         RelationMember member = null;
@@ -49,5 +49,5 @@
     @Override
     public void setOsmPrimitive(OsmPrimitive osmItem) {
-        if(osmItem instanceof Relation) {
+        if (osmItem instanceof Relation) {
             osm = osmItem;
         } else {
@@ -55,5 +55,4 @@
         }
     }
-
 
     public void storeMemberSig(String memID, PGPSignature sig) {
@@ -73,4 +72,3 @@
         return memberSig;
     }
-
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustSignatures.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustSignatures.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustSignatures.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.data;
 
@@ -17,8 +18,8 @@
 public class TrustSignatures {
 
-    public final static byte SIG_UNKNOWN = 0;
-    public final static byte SIG_VALID = 1;
-    public final static byte SIG_BROKEN = -1;
-    public final static byte ITEM_REMOVED = -2;
+    public static final byte SIG_UNKNOWN = 0;
+    public static final byte SIG_VALID = 1;
+    public static final byte SIG_BROKEN = -1;
+    public static final byte ITEM_REMOVED = -2;
 
     //private final Vector<PGPSignature> signatures = new Vector<PGPSignature>();
@@ -125,5 +126,5 @@
 
     public String getArmoredFulltextSignatureAll(String plain) {
-        if (textsigs.containsKey(plain)){
+        if (textsigs.containsKey(plain)) {
             List<PGPSignature> l = textsigs.get(plain);
             PGPSignature first = l.get(0);
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustWay.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustWay.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustWay.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.data;
 
@@ -27,5 +28,5 @@
         String[] lines = sigtext.split("\n");
         List<Node> nodes = new ArrayList<>();
-        for (int i=1; i<lines.length; i++){
+        for (int i = 1; i < lines.length; i++) {
             nodes.add(TrustNode.generateNodeFromSigtext(lines[i]));
         }
@@ -50,5 +51,5 @@
     @Override
     public void setOsmPrimitive(OsmPrimitive osmItem) {
-        if(osmItem instanceof Way) {
+        if (osmItem instanceof Way) {
             osm = osmItem;
         } else {
@@ -57,10 +58,9 @@
     }
 
-
     public void storeSegmentSig(List<Node> nodes, PGPSignature sig) {
         if (segmentSig.containsKey(nodes)) {
-            segmentSig.get(nodes).addSignature(sig, TrustWay.generateSegmentSigtext(this,nodes));
+            segmentSig.get(nodes).addSignature(sig, TrustWay.generateSegmentSigtext(this, nodes));
         } else {
-            segmentSig.put(nodes, new TrustSignatures(sig, TrustWay.generateSegmentSigtext(this,nodes), TrustSignatures.SIG_VALID));
+            segmentSig.put(nodes, new TrustSignatures(sig, TrustWay.generateSegmentSigtext(this, nodes), TrustSignatures.SIG_VALID));
         }
     }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/DownloadSignedOsmDataTask.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/DownloadSignedOsmDataTask.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/DownloadSignedOsmDataTask.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui;
 
@@ -23,5 +24,5 @@
 import org.xml.sax.SAXException;
 
-public class DownloadSignedOsmDataTask  extends PleaseWaitRunnable {
+public class DownloadSignedOsmDataTask extends PleaseWaitRunnable {
 
     private boolean canceled;
@@ -41,9 +42,8 @@
     }
 
-
     @Override
     protected void cancel() {
         canceled = true;
-        synchronized(this) {
+        synchronized (this) {
             if (objectReader != null) {
                 objectReader.cancel();
@@ -68,5 +68,5 @@
                 missing.size(),
                 "Wurst"
-        );
+       );
     }
 
@@ -81,5 +81,5 @@
             progressMonitor.indeterminateSubTask(
                     buildDownloadFeedbackMessage()
-            );
+           );
             final DataSet dataSet = objectReader.parseOsm(progressMonitor
                     .createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
@@ -100,5 +100,5 @@
                         }
                     }
-            );
+           );
 
         } catch (Exception e) {
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/KeyGenerationTask.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/KeyGenerationTask.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/KeyGenerationTask.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui;
 
@@ -22,5 +23,5 @@
     protected void cancel() {
         canceled = true;
-        synchronized(this) {
+        synchronized (this) {
             /*        if (objectReader != null) {
                 objectReader.cancel();
@@ -40,8 +41,7 @@
 
     @Override
-    protected void realRun() throws SAXException, IOException,
-    OsmTransferException {
-        try {
-            /*            synchronized (this) {
+    protected void realRun() throws SAXException, IOException, OsmTransferException {
+        /*try {
+                        synchronized (this) {
                 if (canceled) return;
                 objectReader = new MultiFetchServerObjectReader();
@@ -50,5 +50,5 @@
             progressMonitor.indeterminateSubTask(
                     buildDownloadFeedbackMessage()
-            );
+           );
             final DataSet dataSet = objectReader.parseOsm(progressMonitor
                     .createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
@@ -68,6 +68,6 @@
                         }
                     }
-            );
-             */
+           );
+
         } catch (Exception e) {
             if (canceled) {
@@ -77,6 +77,5 @@
             }
             lastException = e;
-        }
-
+        }*/
     }
 
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/KeyTreeTableModel.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/KeyTreeTableModel.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/KeyTreeTableModel.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui;
 
@@ -21,5 +22,5 @@
 
     public static String convPGPSignatureToString(PGPSignature s) {
-        if (s==null) return null;
+        if (s == null) return null;
         PGPSignatureSubpacketVector sv = s.getHashedSubPackets();
         if (sv != null && sv.hasSubpacket(SignatureSubpacketTags.SIGNER_USER_ID))
@@ -27,8 +28,8 @@
 
         PGPPublicKey pub = TrustOSMplugin.gpg.getPublicKeyFromRing(s.getKeyID());
-        if (pub != null){
+        if (pub != null) {
             Iterator<?> i = pub.getUserIDs();
             if (i.hasNext())
-                return (String)i.next();
+                return (String) i.next();
 
         }
@@ -37,5 +38,5 @@
 
     private final SignatureTreeNode root;
-    private final String[] allTitle = {tr("UID"),tr("KeyID"),tr("OSM-Info"),tr("Signed")};
+    private final String[] allTitle = {tr("UID"), tr("KeyID"), tr("OSM-Info"), tr("Signed")};
     private final List<String> columns = new ArrayList<>(Arrays.asList(allTitle));
 
@@ -47,6 +48,6 @@
                 PGPPublicKey pub = TrustOSMplugin.gpg.getPublicKeyFromRing(s.getKeyID());
                 Iterator<?> iter = pub.getSignatures();
-                while (iter.hasNext()){
-                    PGPSignature ks = (PGPSignature)iter.next();
+                while (iter.hasNext()) {
+                    PGPSignature ks = (PGPSignature) iter.next();
                     sn.getChildren().add(new SignatureTreeNode(ks));
                 }
@@ -62,5 +63,5 @@
 
     @Override
-    public String getColumnName( int column ) {
+    public String getColumnName(int column) {
         String title = columns.get(column);
         if (title != null)
@@ -69,10 +70,9 @@
     }
 
-
     @Override
     public Object getValueAt(Object node, int column) {
-        SignatureTreeNode signode = ( SignatureTreeNode )node;
+        SignatureTreeNode signode = (SignatureTreeNode) node;
         String title = columns.get(column);
-        if (title != null){
+        if (title != null) {
             if (title.equals(allTitle[0]))
                 return signode.getUID();
@@ -90,19 +90,19 @@
     @Override
     public Object getChild(Object node, int index) {
-        SignatureTreeNode signode = ( SignatureTreeNode )node;
-        return signode.getChildren().get( index );
+        SignatureTreeNode signode = (SignatureTreeNode) node;
+        return signode.getChildren().get(index);
     }
 
     @Override
     public int getChildCount(Object node) {
-        SignatureTreeNode signode = ( SignatureTreeNode )node;
+        SignatureTreeNode signode = (SignatureTreeNode) node;
         return signode.getChildren().size();
     }
 
     @Override
-    public int getIndexOfChild( Object parent, Object child ) {
-        SignatureTreeNode signode = ( SignatureTreeNode )parent;
-        for( int i=0; i>signode.getChildren().size(); i++ ) {
-            if( signode.getChildren().get( i ) == child )
+    public int getIndexOfChild(Object parent, Object child) {
+        SignatureTreeNode signode = (SignatureTreeNode) parent;
+        for (int i = 0; i > signode.getChildren().size(); i++) {
+            if (signode.getChildren().get(i) == child)
                 return i;
         }
@@ -114,5 +114,4 @@
         return root;
     }
-
 
     public class SignatureTreeNode {
@@ -127,16 +126,19 @@
         }
 
-        public PGPSignature getSignature(){
+        public PGPSignature getSignature() {
             return s;
         }
+
         public String getUID() {
             return convPGPSignatureToString(s);
         }
+
         public String getKeyID() {
             return "0x"+Long.toHexString(s.getKeyID()).substring(8).toUpperCase();
         }
+
         public String getOsmCertificate() {
             String cert = "";
-            for (NotationData nd : s.getHashedSubPackets().getNotationDataOccurrences()){
+            for (NotationData nd : s.getHashedSubPackets().getNotationDataOccurrences()) {
                 if (nd.getNotationName().equals("trustosm@openstreetmap.org")) {
                     cert += nd.getNotationValue();
@@ -145,11 +147,12 @@
             return cert;
         }
+
         public String getSignatureDate() {
             return formatter.format(s.getCreationTime());
         }
+
         public List<SignatureTreeNode> getChildren() {
             return children;
         }
-
     }
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/JCollapsiblePanel.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/JCollapsiblePanel.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/JCollapsiblePanel.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui.dialogs;
 
@@ -21,34 +22,28 @@
         JLabel title;
 
-        public HeaderPanel(String text) {
+        HeaderPanel(String text) {
 
             setLayout(new GridBagLayout());
-            title = new JLabel(text,ImageProvider.get("misc", "minimized"),SwingConstants.LEADING);
-            add(title,GBC.eol());
+            title = new JLabel(text, ImageProvider.get("misc", "minimized"), SwingConstants.LEADING);
+            add(title, GBC.eol());
 
+            addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    expanded = !expanded;
 
-            addMouseListener(
-                    new MouseAdapter() {
-                        @Override
-                        public void mouseClicked(MouseEvent e) {
-                            expanded = !expanded;
+                    if (contentPanel_.isShowing()) {
+                        contentPanel_.setVisible(false);
+                        title.setIcon(ImageProvider.get("misc", "minimized"));
+                    } else {
+                        contentPanel_.setVisible(true);
+                        title.setIcon(ImageProvider.get("misc", "normal"));
+                    }
+                    validate();
 
-                            if (contentPanel_.isShowing()) {
-                                contentPanel_.setVisible(false);
-                                title.setIcon(ImageProvider.get("misc", "minimized"));
-                            }
-                            else {
-                                contentPanel_.setVisible(true);
-                                title.setIcon(ImageProvider.get("misc", "normal"));
-                            }
-                            validate();
-
-                            headerPanel_.repaint();
-                        }
-                    }
-            );
-
+                    headerPanel_.repaint();
+                }
+            });
         }
-
     }
 
@@ -62,4 +57,3 @@
         contentPanel_.setVisible(false);
     }
-
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/KeySignaturesDialog.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/KeySignaturesDialog.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/KeySignaturesDialog.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui.dialogs;
 
@@ -29,5 +30,4 @@
     private JLabel lblMinimized;
 
-
     public KeySignaturesDialog(PGPPublicKey key) {
         super(new BorderLayout());
@@ -36,5 +36,5 @@
         Iterator<?> iter = key.getUserIDs();
         if (iter.hasNext()) {
-            userid = (String)iter.next();
+            userid = (String) iter.next();
         }
 
@@ -52,5 +52,5 @@
         Iterator<?> iter = key.getSignatures();
         while (iter.hasNext()) {
-            PGPSignature sig = (PGPSignature)iter.next();
+            PGPSignature sig = (PGPSignature) iter.next();
             String uid = "0x"+Long.toHexString(sig.getKeyID()).substring(8).toUpperCase();
             p.add(new JLabel(uid));
@@ -67,10 +67,9 @@
             //setContentVisible(false);
             isCollapsed = true;
-            setPreferredSize(new Dimension(0,20));
-            setMaximumSize(new Dimension(Integer.MAX_VALUE,20));
-            setMinimumSize(new Dimension(Integer.MAX_VALUE,20));
+            setPreferredSize(new Dimension(0, 20));
+            setMaximumSize(new Dimension(Integer.MAX_VALUE, 20));
+            setMinimumSize(new Dimension(Integer.MAX_VALUE, 20));
             lblMinimized.setIcon(ImageProvider.get("misc", "minimized"));
-        }
-        else throw new IllegalStateException();
+        } else throw new IllegalStateException();
     }
 
@@ -82,9 +81,8 @@
             //        setContentVisible(true);
             isCollapsed = false;
-            setPreferredSize(new Dimension(0,200));
+            setPreferredSize(new Dimension(0, 200));
             setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
             lblMinimized.setIcon(ImageProvider.get("misc", "normal"));
-        }
-        else throw new IllegalStateException();
+        } else throw new IllegalStateException();
     }
 
@@ -95,7 +93,7 @@
      */
     protected void setContentVisible(boolean visible) {
-        Component comps[] = getComponents();
-        for(int i=0; i<comps.length; i++) {
-            if(comps[i] != titleBar) {
+        Component[] comps = getComponents();
+        for (int i = 0; i < comps.length; i++) {
+            if (comps[i] != titleBar) {
                 comps[i].setVisible(visible);
             }
@@ -105,8 +103,7 @@
     /**
      * The title bar displayed in docked mode
-     *
      */
     protected class TitleBar extends JPanel {
-        final private JLabel lblTitle;
+        private final JLabel lblTitle;
 
         public TitleBar(String toggleDialogName) {
@@ -130,5 +127,5 @@
                         }
                     }
-            );
+           );
 
             setToolTipText(tr("Click to minimize/maximize the panel content"));
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustDialog.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustDialog.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustDialog.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui.dialogs;
 
@@ -66,13 +67,10 @@
 public class TrustDialog extends ToggleDialog implements SelectionChangedListener, MapViewPaintable {
 
-    public final static Color BGCOLOR_NO_SIG = new Color(234, 234, 234);
-    //    public final static Color BGCOLOR_VALID_SIG = new Color(235,255,177);
-    public final static Color BGCOLOR_VALID_SIG = new Color(74,245,106);
-    public final static Color BGCOLOR_BROKEN_SIG = new Color(255, 197, 197);
-    public final static Color BGCOLOR_REMOVED_ITEM = new Color(255, 100, 100);
-    public final static Color BGCOLOR_UPDATED_ITEM = new Color(249,221,95);
-
-    /** Use a TrustGPGPreparer to sign or validate signatures */
-    //private final TrustGPGPreparer gpg;
+    public static final Color BGCOLOR_NO_SIG = new Color(234, 234, 234);
+    //    public static final Color BGCOLOR_VALID_SIG = new Color(235, 255,177);
+    public static final Color BGCOLOR_VALID_SIG = new Color(74, 245, 106);
+    public static final Color BGCOLOR_BROKEN_SIG = new Color(255, 197, 197);
+    public static final Color BGCOLOR_REMOVED_ITEM = new Color(255, 100, 100);
+    public static final Color BGCOLOR_UPDATED_ITEM = new Color(249, 221, 95);
 
     /** The check signatures button */
@@ -103,4 +101,5 @@
             return false;
         }
+
         @Override public Class<?> getColumnClass(int columnIndex) {
             return String.class;
@@ -115,8 +114,8 @@
             if (!isRowSelected(row))
                 switch (stat.byteValue()) {
-                case -2: c.setBackground( BGCOLOR_REMOVED_ITEM ); break;
-                case -1: c.setBackground( BGCOLOR_BROKEN_SIG ); break;
-                case 1: c.setBackground( BGCOLOR_VALID_SIG ); break;
-                default: c.setBackground( BGCOLOR_NO_SIG ); break;
+                case -2: c.setBackground(BGCOLOR_REMOVED_ITEM); break;
+                case -1: c.setBackground(BGCOLOR_BROKEN_SIG); break;
+                case 1: c.setBackground(BGCOLOR_VALID_SIG); break;
+                default: c.setBackground(BGCOLOR_NO_SIG); break;
                 }
             return c;
@@ -142,8 +141,8 @@
             if (!isRowSelected(row))
                 switch (stat.byteValue()) {
-                case -2: c.setBackground( BGCOLOR_REMOVED_ITEM ); break;
-                case -1: c.setBackground( BGCOLOR_BROKEN_SIG ); break;
-                case 1: c.setBackground( BGCOLOR_VALID_SIG ); break;
-                default: c.setBackground( BGCOLOR_NO_SIG ); break;
+                case -2: c.setBackground( BGCOLOR_REMOVED_ITEM); break;
+                case -1: c.setBackground( BGCOLOR_BROKEN_SIG); break;
+                case 1: c.setBackground( BGCOLOR_VALID_SIG); break;
+                default: c.setBackground( BGCOLOR_NO_SIG); break;
                 }
             return c;
@@ -162,9 +161,9 @@
 
         // setting up the properties table
-        propertyData.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")});
+        propertyData.setColumnIdentifiers(new String[]{tr("Key"), tr("Value")});
 
         // copy and paste from org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog
 
-        propertyTable.getColumnModel().getColumn(1).setCellRenderer(new DefaultTableCellRenderer(){
+        propertyTable.getColumnModel().getColumn(1).setCellRenderer(new DefaultTableCellRenderer() {
             /**
              *
@@ -183,5 +182,5 @@
                         Map<?, ?> v = (Map<?, ?>) value;
                         if (v.size() != 1) {
-                            str=tr("<different>");
+                            str = tr("<different>");
                             c.setFont(c.getFont().deriveFont(Font.ITALIC));
                         } else {
@@ -190,5 +189,5 @@
                         }
                     }
-                    ((JLabel)c).setText(str);
+                    ((JLabel) c).setText(str);
                 }
                 return c;
@@ -196,55 +195,50 @@
         });
 
-        geomTree = new JTree( createTree() );
-
-        geomTree.setBackground( BGCOLOR_NO_SIG );
+        geomTree = new JTree(createTree());
+
+        geomTree.setBackground(BGCOLOR_NO_SIG);
         geomTree.setRootVisible(false);
-        geomTree.setCellRenderer(new DefaultTreeCellRenderer(){
-
+        geomTree.setCellRenderer(new DefaultTreeCellRenderer() {
             @Override
             public Component getTreeCellRendererComponent(JTree tree, Object value,
-                    boolean selected, boolean expanded, boolean leaf, int row,
-                    boolean hasFocus)
-            {
+                    boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
                 super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
-
-                DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
+                DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
                 if (node.isRoot()) return this;
-                setBackgroundNonSelectionColor( BGCOLOR_NO_SIG );
+                setBackgroundNonSelectionColor(BGCOLOR_NO_SIG);
                 Object o = node.getUserObject();
-                if (o instanceof OsmPrimitive){
+                if (o instanceof OsmPrimitive) {
                     OsmPrimitive osm = (OsmPrimitive) o;
                     setIcon(ImageProvider.get(OsmPrimitiveType.from(osm)));
                     setText(osm.getDisplayName(DefaultNameFormatter.getInstance()));
-
                     if (osm instanceof Node) {
                         TrustSignatures sigs;
                         String id = TrustOsmPrimitive.createUniqueObjectIdentifier(osm);
-                        if (TrustOSMplugin.signedItems.containsKey(id) && (sigs = ((TrustNode)TrustOSMplugin.signedItems.get(id)).getNodeSigs()) != null) {
+                        if (TrustOSMplugin.signedItems.containsKey(id)
+                                && (sigs = ((TrustNode) TrustOSMplugin.signedItems.get(id)).getNodeSigs()) != null) {
                             byte stat = sigs.getStatus();
                             switch (stat) {
-                            case -2: setBackgroundNonSelectionColor( BGCOLOR_REMOVED_ITEM ); break;
-                            case -1: setBackgroundNonSelectionColor( BGCOLOR_BROKEN_SIG ); break;
-                            case 1: setBackgroundNonSelectionColor( BGCOLOR_VALID_SIG ); break;
-                            default: setBackgroundNonSelectionColor( BGCOLOR_NO_SIG ); break;
+                            case -2: setBackgroundNonSelectionColor(BGCOLOR_REMOVED_ITEM); break;
+                            case -1: setBackgroundNonSelectionColor(BGCOLOR_BROKEN_SIG); break;
+                            case 1: setBackgroundNonSelectionColor(BGCOLOR_VALID_SIG); break;
+                            default: setBackgroundNonSelectionColor(BGCOLOR_NO_SIG); break;
                             }
                         }
-                    } else if (osm instanceof Way) {
-                        //setBackgroundNonSelectionColor( BGCOLOR_NO_SIG );
-                    }
-
-                } else if (o instanceof WaySegment){
+                    }
+                } else if (o instanceof WaySegment) {
                     WaySegment seg = (WaySegment) o;
                     setIcon(ImageProvider.get("mapmode/addsegment"));
-                    setText(seg.getFirstNode().getDisplayName(DefaultNameFormatter.getInstance()) + " ----- " + seg.getSecondNode().getDisplayName(DefaultNameFormatter.getInstance()));
+                    setText(seg.getFirstNode().getDisplayName(DefaultNameFormatter.getInstance())
+                            + " ----- " +
+                            seg.getSecondNode().getDisplayName(DefaultNameFormatter.getInstance()));
                     TrustSignatures sigs;
                     String id = TrustOsmPrimitive.createUniqueObjectIdentifier(seg.way);
-                    if (TrustOSMplugin.signedItems.containsKey(id) && (sigs = ((TrustWay)TrustOSMplugin.signedItems.get(id)).getSigsOnSegment(seg)) != null) {
-                        byte stat = sigs.getStatus();
-                        switch (stat) {
-                        case -2: setBackgroundNonSelectionColor( BGCOLOR_REMOVED_ITEM ); break;
-                        case -1: setBackgroundNonSelectionColor( BGCOLOR_BROKEN_SIG ); break;
-                        case 1: setBackgroundNonSelectionColor( BGCOLOR_VALID_SIG ); break;
-                        default: setBackgroundNonSelectionColor( BGCOLOR_NO_SIG ); break;
+                    if (TrustOSMplugin.signedItems.containsKey(id)
+                            && (sigs = ((TrustWay) TrustOSMplugin.signedItems.get(id)).getSigsOnSegment(seg)) != null) {
+                        switch (sigs.getStatus()) {
+                        case -2: setBackgroundNonSelectionColor(BGCOLOR_REMOVED_ITEM); break;
+                        case -1: setBackgroundNonSelectionColor(BGCOLOR_BROKEN_SIG); break;
+                        case 1: setBackgroundNonSelectionColor(BGCOLOR_VALID_SIG); break;
+                        default: setBackgroundNonSelectionColor(BGCOLOR_NO_SIG); break;
                         }
                     }
@@ -263,5 +257,5 @@
                 selectedPrimitives.clear();
                 selectedSegments.clear();
-                if (geomTree.getSelectionPaths()!=null)
+                if (geomTree.getSelectionPaths() != null)
                     for (TreePath tp : geomTree.getSelectionPaths()) {
                         Object o = ((DefaultMutableTreeNode) tp.getLastPathComponent()).getUserObject();
@@ -278,10 +272,9 @@
         });
 
-        propertyTable.addFocusListener(new FocusListener(){
+        propertyTable.addFocusListener(new FocusListener() {
 
             @Override
             public void focusGained(FocusEvent fe) {
                 geomTree.clearSelection();
-
             }
 
@@ -292,5 +285,5 @@
         });
 
-        geomTree.addFocusListener(new FocusListener(){
+        geomTree.addFocusListener(new FocusListener() {
 
             @Override
@@ -318,5 +311,5 @@
 
         createLayout(dataPanel, true, Arrays.asList(new SideButton[] {
-            checkButton, signButton, showButton
+                checkButton, signButton, showButton
         }));
         DataSet.addSelectionListener(this);
@@ -325,5 +318,5 @@
     private class CheckAction extends JosmAction {
 
-        public CheckAction() {
+        CheckAction() {
             super(tr("Check"), "checksignatures", tr("Check all available signatures for selected object."), null, false);
         }
@@ -336,5 +329,4 @@
                     if (TrustOSMplugin.signedItems.containsKey(id))
                         TrustAnalyzer.checkEverything(TrustOSMplugin.signedItems.get(id));
-                    //checkedItems.put(osm, TrustOSMplugin.gpg.check(checkedItems.containsKey(osm)? checkedItems.get(osm) : new TrustOSMItem(osm)));
                 }
             }
@@ -346,5 +338,5 @@
     private class SignAction extends JosmAction {
 
-        public SignAction() {
+        SignAction() {
             super(tr("Sign"), "sign", tr("Digital sign selected Tags, if you believe they are correct."), null, false);
         }
@@ -354,9 +346,10 @@
             if (osmData != null) {
                 for (int i : propertyTable.getSelectedRows()) {
-                    String key = (String)propertyTable.getValueAt(i, 0);
+                    String key = (String) propertyTable.getValueAt(i, 0);
                     for (OsmPrimitive osm : osmData) {
                         if (osm.keySet().contains(key)) {
                             String id = TrustOsmPrimitive.createUniqueObjectIdentifier(osm);
-                            TrustOsmPrimitive trust = TrustOSMplugin.signedItems.containsKey(id)? TrustOSMplugin.signedItems.get(id) : TrustOsmPrimitive.createTrustOsmPrimitive(osm);
+                            TrustOsmPrimitive trust = TrustOSMplugin.signedItems.containsKey(id) ?
+                                    TrustOSMplugin.signedItems.get(id) : TrustOsmPrimitive.createTrustOsmPrimitive(osm);
                             if (TrustOSMplugin.gpg.signTag(trust, key))
                                 TrustOSMplugin.signedItems.put(id, trust);
@@ -365,5 +358,5 @@
                 }
             }
-            if (geomTree.getSelectionPaths()!=null)
+            if (geomTree.getSelectionPaths() != null)
                 for (TreePath tp : geomTree.getSelectionPaths()) {
                     Object o = ((DefaultMutableTreeNode) tp.getLastPathComponent()).getUserObject();
@@ -373,8 +366,8 @@
                         if (osm instanceof Node) {
                             Node osmNode = ((Node) osm);
-                            TrustNode trust = TrustOSMplugin.signedItems.containsKey(id)? (TrustNode) TrustOSMplugin.signedItems.get(id) : new TrustNode(osmNode);
+                            TrustNode trust = TrustOSMplugin.signedItems.containsKey(id) ?
+                                    (TrustNode) TrustOSMplugin.signedItems.get(id) : new TrustNode(osmNode);
                             trust.storeNodeSig(TrustOSMplugin.gpg.signNode(osmNode));
                             TrustOSMplugin.signedItems.put(id, trust);
-
 
                             /*                        TreePath parentPath = tp.getParentPath();
@@ -386,12 +379,15 @@
                                 id = String.valueOf(osm.getUniqueId());
                             }
-                            TrustOsmPrimitive trust = TrustOSMplugin.signedItems.containsKey(id)? TrustOSMplugin.signedItems.get(id) : TrustOsmPrimitive.createTrustOsmPrimitive(osm);
+                            TrustOsmPrimitive trust = TrustOSMplugin.signedItems.containsKey(id) ?
+                                TrustOSMplugin.signedItems.get(id) : TrustOsmPrimitive.createTrustOsmPrimitive(osm);
                             trust.storeNodeSig(osmNode, TrustOSMplugin.gpg.signNode(osm,osmNode));
                             TrustOSMplugin.signedItems.put(id, trust);
                              */
                         } else if (osm instanceof Way) {
-                            TrustOSMplugin.signedItems.put(id, TrustOSMplugin.gpg.signWay(TrustOSMplugin.signedItems.containsKey(id)? (TrustWay)TrustOSMplugin.signedItems.get(id) : new TrustWay(osm)));
+                            TrustOSMplugin.signedItems.put(id, TrustOSMplugin.gpg.signWay(TrustOSMplugin.signedItems.containsKey(id) ?
+                                    (TrustWay) TrustOSMplugin.signedItems.get(id) : new TrustWay(osm)));
                             /*Way osmWay = ((Way) osm);
-                            TrustWay trust = TrustOSMplugin.signedItems.containsKey(id)? (TrustWay) TrustOSMplugin.signedItems.get(id) : new TrustWay(osmWay);
+                            TrustWay trust = TrustOSMplugin.signedItems.containsKey(id) ?
+                                (TrustWay) TrustOSMplugin.signedItems.get(id) : new TrustWay(osmWay);
                             trust.storeSegmentSig(TrustOSMplugin.gpg.signWay(osmWay));
                             TrustOSMplugin.signedItems.put(id, trust);
@@ -407,6 +403,7 @@
                         Way w = seg.way;
                         String id = TrustOsmPrimitive.createUniqueObjectIdentifier(w);
-                        TrustWay trust = TrustOSMplugin.signedItems.containsKey(id)? (TrustWay) TrustOSMplugin.signedItems.get(id) : new TrustWay(w);
-                        trust.storeSegmentSig(nodes,TrustOSMplugin.gpg.signSegment(trust,nodes));
+                        TrustWay trust = TrustOSMplugin.signedItems.containsKey(id) ?
+                                (TrustWay) TrustOSMplugin.signedItems.get(id) : new TrustWay(w);
+                        trust.storeSegmentSig(nodes, TrustOSMplugin.gpg.signSegment(trust, nodes));
                         TrustOSMplugin.signedItems.put(id, trust);
                     }
@@ -419,5 +416,5 @@
     private class ShowAction extends JosmAction {
 
-        public ShowAction() {
+        ShowAction() {
             super(tr("Show"), "showsig", tr("Show all available signatures for selected attribute."), null, false);
         }
@@ -427,5 +424,5 @@
             if (osmData != null) {
                 for (int i : propertyTable.getSelectedRows()) {
-                    String key = (String)propertyTable.getValueAt(i, 0);
+                    String key = (String) propertyTable.getValueAt(i, 0);
                     for (OsmPrimitive osm : osmData) {
                         String id = TrustOsmPrimitive.createUniqueObjectIdentifier(osm);
@@ -436,5 +433,5 @@
                 }
             }
-            if (geomTree.getSelectionPaths()!=null) {
+            if (geomTree.getSelectionPaths() != null) {
                 for (TreePath tp : geomTree.getSelectionPaths()) {
                     Object o = ((DefaultMutableTreeNode) tp.getLastPathComponent()).getUserObject();
@@ -446,7 +443,8 @@
                                 TrustSignaturesDialog.showSignaturesDialog((TrustNode) TrustOSMplugin.signedItems.get(id));
                             }
-                        } else if (osm instanceof Way) {
-                            //TrustOSMplugin.signedItems.put(id, TrustOSMplugin.gpg.signGeometry(TrustOSMplugin.signedItems.containsKey(id)? TrustOSMplugin.signedItems.get(id) : new TrustOSMItem(osm)));
-                        }
+                        } /*else if (osm instanceof Way) {
+                            TrustOSMplugin.signedItems.put(id, TrustOSMplugin.gpg.signGeometry(
+                                TrustOSMplugin.signedItems.containsKey(id)? TrustOSMplugin.signedItems.get(id) : new TrustOSMItem(osm)));
+                        }*/
                     } else if (o instanceof WaySegment) {
                         WaySegment seg = (WaySegment) o;
@@ -456,5 +454,5 @@
                             nodes.add(seg.getFirstNode());
                             nodes.add(seg.getSecondNode());
-                            TrustSignaturesDialog.showSignaturesDialog((TrustWay) TrustOSMplugin.signedItems.get(id),nodes);
+                            TrustSignaturesDialog.showSignaturesDialog((TrustWay) TrustOSMplugin.signedItems.get(id), nodes);
                         }
                     }
@@ -468,9 +466,10 @@
         TrustSignatures sigs;
         if ((sigs = trust.getSigsOnKey(key)) == null) {
-            JOptionPane.showMessageDialog(null,tr("Sorry, there are no Signatures for the selected Attribute."), tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
+            JOptionPane.showMessageDialog(null, tr("Sorry, there are no Signatures for the selected Attribute."),
+                tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
         } else {
             JPanel p = new JPanel();
             p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
-            Dimension d = new Dimension(0,20);
+            Dimension d = new Dimension(0, 20);
             JLabel head = new JLabel(tr("Selected key value pair was:\n{0}={1}",key,trust.getOsmItem().get(key)));
             head.setAlignmentX(LEFT_ALIGNMENT);
@@ -483,5 +482,6 @@
                 sigtext.setAlignmentX(LEFT_ALIGNMENT);
                 p.add(sigtext);
-                JLabel siginfo = new JLabel(tr("Signature created at {0} by User {1}",formatter.format(s.getCreationTime()),s.getHashedSubPackets().getSignerUserID()));
+                JLabel siginfo = new JLabel(tr("Signature created at {0} by User {1}", formatter.format(s.getCreationTime()),
+                    s.getHashedSubPackets().getSignerUserID()));
                 siginfo.setAlignmentX(LEFT_ALIGNMENT);
                 p.add(siginfo);
@@ -491,5 +491,5 @@
             JScrollPane scroller = new JScrollPane(p);
             JPanel content = new JPanel();
-            content.setMaximumSize(new Dimension(600,500));
+            content.setMaximumSize(new Dimension(600, 500));
             content.add(scroller);
             JOptionPane.showMessageDialog(Main.parent,content, tr("Clearsigned Signature"), JOptionPane.PLAIN_MESSAGE);
@@ -500,21 +500,21 @@
         List<WaySegment> segList = new ArrayList<>();
         for (int i = 0; i < w.getNodesCount()-1; i++) {
-            segList.add(new WaySegment(w,i));
+            segList.add(new WaySegment(w, i));
         }
         return segList;
     }
 
-    private DefaultTreeModel createTree(){
+    private DefaultTreeModel createTree() {
         DefaultMutableTreeNode root = new DefaultMutableTreeNode();
         DefaultMutableTreeNode wayNode;
-        if (osmData!=null)
+        if (osmData != null)
             for (OsmPrimitive osm : osmData) {
                 //String id = TrustOsmPrimitive.createUniqueObjectIdentifier(osm);
-                if(osm instanceof Node) {
+                if (osm instanceof Node) {
                     root.add(new DefaultMutableTreeNode(osm));
-                } else if(osm instanceof Way) {
+                } else if (osm instanceof Way) {
                     wayNode = new DefaultMutableTreeNode(osm);
-                    List<WaySegment> presentSegments = TrustDialog.generateSegmentListFromWay(((Way)osm));
-                    for (WaySegment seg : presentSegments ) {
+                    List<WaySegment> presentSegments = TrustDialog.generateSegmentListFromWay(((Way) osm));
+                    for (WaySegment seg : presentSegments) {
                         wayNode.add(new DefaultMutableTreeNode(seg));
                     }
@@ -542,5 +542,5 @@
                      */
                     root.add(wayNode);
-                } else if(osm instanceof Relation) {
+                } else if (osm instanceof Relation) {
 
                 }
@@ -575,5 +575,5 @@
                     for (String removedKey: removedKeys) {
                         TrustSignatures sigs = signedTags.get(removedKey);
-                        sigs.setStatus( TrustSignatures.ITEM_REMOVED );
+                        sigs.setStatus( TrustSignatures.ITEM_REMOVED);
                         String[] kv = TrustOsmPrimitive.generateTagsFromSigtext(sigs.getOnePlainText());
                         tags.put(kv[0],kv[1]);
@@ -585,26 +585,25 @@
                 }
 
-                //        trust = TrustOSMplugin.signedItems.containsKey(osm) ? TrustOSMplugin.signedItems.get(osm) : new TrustOSMItem(osm);
-
                 for (String key: osm.keySet()) {
                     String value = osm.get(key);
-                    //keyCount.put(key, keyCount.containsKey(key) ? keyCount.get(key) + 1 : 1);
-
-                    byte status = sigsAvailable && trust.getTagSigs().containsKey(key) ? trust.getTagSigs().get(key).getStatus() : TrustSignatures.SIG_UNKNOWN ;
-                    Byte oldstatus = rowStatus.containsKey(key)? rowStatus.get(key) : new Byte(TrustSignatures.SIG_VALID);
+
+                    byte status = sigsAvailable && trust.getTagSigs().containsKey(key) ?
+                            trust.getTagSigs().get(key).getStatus() : TrustSignatures.SIG_UNKNOWN;
+                    Byte oldstatus = rowStatus.containsKey(key) ? rowStatus.get(key) : new Byte(TrustSignatures.SIG_VALID);
                     Byte sigstatus = new Byte(status);
                     Byte newstatus;
                     if (sigstatus.equals(new Byte(TrustSignatures.SIG_BROKEN)) || oldstatus.equals(new Byte(TrustSignatures.SIG_BROKEN))) {
                         newstatus = new Byte(TrustSignatures.SIG_BROKEN);
-                    } else if (sigstatus.equals(new Byte(TrustSignatures.SIG_UNKNOWN)) || oldstatus.equals(new Byte(TrustSignatures.SIG_UNKNOWN))) {
+                    } else if (sigstatus.equals(new Byte(TrustSignatures.SIG_UNKNOWN))
+                            || oldstatus.equals(new Byte(TrustSignatures.SIG_UNKNOWN))) {
                         newstatus = new Byte(TrustSignatures.SIG_UNKNOWN);
                     } else newstatus = new Byte(TrustSignatures.SIG_VALID);
 
-                    rowStatus.put(key, newstatus );
+                    rowStatus.put(key, newstatus);
                     if (valueCount.containsKey(key)) {
                         Map<String, Integer> v = valueCount.get(key);
-                        v.put(value, v.containsKey(value)? v.get(value) + 1 : 1 );
+                        v.put(value, v.containsKey(value) ? v.get(value) + 1 : 1);
                     } else {
-                        TreeMap<String,Integer> v = new TreeMap<>();
+                        TreeMap<String, Integer> v = new TreeMap<>();
                         v.put(value, 1);
                         valueCount.put(key, v);
@@ -613,7 +612,7 @@
             }
             for (Entry<String, Map<String, Integer>> e : valueCount.entrySet()) {
-                int count=0;
+                int count = 0;
                 for (Entry<String, Integer> e1: e.getValue().entrySet()) {
-                    count+=e1.getValue();
+                    count += e1.getValue();
                 }
                 if (count < osmData.size()) {
@@ -639,5 +638,4 @@
         geomTree.setModel(createTree());
         updateTable();
-        //        signButton.setEnabled(newSelection.size() == 1);
     }
 
@@ -657,8 +655,9 @@
         for (WaySegment seg : selectedSegments) {
             GeneralPath b = new GeneralPath();
-            Point p1=mv.getPoint(seg.getFirstNode());
-            Point p2=mv.getPoint(seg.getSecondNode());
-
-            b.moveTo(p1.x,p1.y); b.lineTo(p2.x, p2.y);
+            Point p1 = mv.getPoint(seg.getFirstNode());
+            Point p2 = mv.getPoint(seg.getSecondNode());
+
+            b.moveTo(p1.x, p1.y);
+            b.lineTo(p2.x, p2.y);
 
             g2.draw(b);
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustPreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustPreferenceEditor.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustPreferenceEditor.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui.dialogs;
 
@@ -23,7 +24,10 @@
 public class TrustPreferenceEditor extends DefaultTabPreferenceSetting {
 
-    private final JCheckBox showSignedDeleted = new JCheckBox(tr("Show deleted tags and notes if they were signed before"));
-    private final JRadioButton defaultHomedir = new JRadioButton(tr("Use default (and maybe existing) GnuPG directory ({0}) to store new keys and configs.", "~/.gnupg"));
-    private final JRadioButton separateHomedir = new JRadioButton(tr("Use separate GnuPG directory ({0}) to store new keys and configs.", TrustOSMplugin.getGpgPath()));
+    private final JCheckBox showSignedDeleted = new JCheckBox(
+            tr("Show deleted tags and notes if they were signed before"));
+    private final JRadioButton defaultHomedir = new JRadioButton(
+            tr("Use default (and maybe existing) GnuPG directory ({0}) to store new keys and configs.", "~/.gnupg"));
+    private final JRadioButton separateHomedir = new JRadioButton(
+            tr("Use separate GnuPG directory ({0}) to store new keys and configs.", TrustOSMplugin.getGpgPath()));
 
     public TrustPreferenceEditor() {
@@ -39,7 +43,7 @@
         JPanel gpgsettings = new JPanel(new GridBagLayout());
 
-        gpgsettings.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+        gpgsettings.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
 
-        gpgsettings.add(new JLabel(tr("Use separate GnuPG configuration directory?")), GBC.eol().insets(20,0,0,0));
+        gpgsettings.add(new JLabel(tr("Use separate GnuPG configuration directory?")), GBC.eol().insets(20, 0, 0, 0));
         ButtonGroup gpgdirGroup = new ButtonGroup();
         gpgdirGroup.add(separateHomedir);
@@ -51,15 +55,15 @@
             defaultHomedir.setSelected(true);
 
-        gpgsettings.add(separateHomedir, GBC.eol().insets(40,0,0,0));
-        gpgsettings.add(defaultHomedir, GBC.eol().insets(40,0,0,0));
+        gpgsettings.add(separateHomedir, GBC.eol().insets(40, 0, 0, 0));
+        gpgsettings.add(defaultHomedir, GBC.eol().insets(40, 0, 0, 0));
 
         gpgsettings.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
         JScrollPane scrollpane = new JScrollPane(gpgsettings);
-        scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
+        scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
         tabs.add(tr("GnuPG"), scrollpane);
 
         JPanel dialogsettings = new JPanel(new GridBagLayout());
         tabs.add(tr("Dialog"), dialogsettings);
-        dialogsettings.add(showSignedDeleted, GBC.eol().fill(GBC.HORIZONTAL).insets(20,0,0,5));
+        dialogsettings.add(showSignedDeleted, GBC.eol().fill(GBC.HORIZONTAL).insets(20, 0, 0, 5));
     }
 
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustSignaturesDialog.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustSignaturesDialog.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustSignaturesDialog.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.gui.dialogs;
 
@@ -35,16 +36,16 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 
-
-
-public class TrustSignaturesDialog {
-
+public final class TrustSignaturesDialog {
+
+    private TrustSignaturesDialog() {
+        // Hide default constructors for utilities classes
+    }
 
     private static String createLabel(String plain, int type) {
         if (type == 0) {
             String[] kv = TrustOsmPrimitive.generateTagsFromSigtext(plain);
-            return tr("Signed key value pair was: {0}={1}", kv[0],kv[1]);
+            return tr("Signed key value pair was: {0}={1}", kv[0], kv[1]);
         } else if (type == 1) {
             Node node = TrustNode.generateNodeFromSigtext(plain);
-            //return tr("Signed node was: {0}", node.getDisplayName(DefaultNameFormatter.getInstance()));
             return "ID:"+node.getUniqueId()+" ("+node.getCoor().toString() + ")";
         } else if (type == 2) {
@@ -57,7 +58,5 @@
     private static void showDialog(TrustSignatures sigs, String label, int type) {
         JPanel p = new JPanel(new GridBagLayout());
-        p.add(new JLabel(label),GBC.eol());
-
-        //SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd:hh.mm.ss");
+        p.add(new JLabel(label), GBC.eol());
 
         for (String plain : sigs.getAllPlainTexts()) {
@@ -67,13 +66,10 @@
             textcontent.add(sigtext);
 
-            p.add(new JCollapsiblePanel(createLabel(plain, type),textcontent),GBC.eol());
+            p.add(new JCollapsiblePanel(createLabel(plain, type), textcontent), GBC.eol());
 
             List<PGPSignature> siglist = sigs.getSignaturesByPlaintext(plain);
             JPanel signerPanel = new JPanel(new GridBagLayout());
-            //signerPanel.add(createSignerTree(siglist));
             KeyTreeTableModel km = new KeyTreeTableModel(siglist);
-            final JXTreeTable t = new JXTreeTable( km );
-            //t.setHorizontalScrollEnabled(true);
-            //t.setRootVisible(false);
+            final JXTreeTable t = new JXTreeTable(km);
             t.addMouseListener(new MouseAdapter() {
                 @Override
@@ -83,5 +79,5 @@
                         if (selPath == null)
                             return;
-                        SignatureTreeNode sn = (SignatureTreeNode)selPath.getLastPathComponent();
+                        SignatureTreeNode sn = (SignatureTreeNode) selPath.getLastPathComponent();
                         PGPPublicKey pub = TrustOSMplugin.gpg.getPublicKeyFromRing(sn.getSignature().getKeyID());
                         TrustGPG.showKeyDetails(pub);
@@ -97,34 +93,23 @@
             signerPanel.add(new JScrollPane(t));
 
-
-            //            JTreeTable tt = new JTreeTable();
-
-            /*                for (PGPSignature s : siglist) {
-                signerPanel.add(createKeyButton(tr("Signature created at {0} by User {1}",formatter.format(s.getCreationTime()),s.getHashedSubPackets().getSignerUserID()),s.getKeyID()),GBC.eol());
-                //signerPanel.add(new JLabel(tr("Signature created at {0} by User {1}",formatter.format(s.getCreationTime()),s.getHashedSubPackets().getSignerUserID())),GBC.eol());
-            }*/
-
-            p.add(new JCollapsiblePanel(tr("{0} Signatures found.", siglist.size()),signerPanel),GBC.eol().insets(20,0,0,0));
+            p.add(new JCollapsiblePanel(tr("{0} Signatures found.", siglist.size()), signerPanel), GBC.eol().insets(20, 0, 0, 0));
         }
         p.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
         JScrollPane scroller = new JScrollPane(p);
-        //JPanel content = new JPanel();
-        scroller.setPreferredSize(new Dimension(700,500));
-        //content.add(scroller);
-        //JOptionPane.showMessageDialog(Main.parent,scroller, tr("Clearsigned Signature"), JOptionPane.PLAIN_MESSAGE);
+        scroller.setPreferredSize(new Dimension(700, 500));
         String[] buttons = {tr("Ok")};
-        ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Signature Info"),buttons,false);
-        info.setContent(scroller,false);
+        ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Signature Info"), buttons, false);
+        info.setContent(scroller, false);
         info.showDialog();
     }
-
 
     public static void showSignaturesDialog(TrustNode trust) {
         TrustSignatures sigs;
         if ((sigs = trust.getNodeSigs()) == null) {
-            JOptionPane.showMessageDialog(null,tr("Sorry, there are no Signatures for the selected Node."), tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
+            JOptionPane.showMessageDialog(null, tr("Sorry, there are no Signatures for the selected Node."),
+                    tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
         } else {
-            String nodename = ((Node)trust.getOsmPrimitive()).getDisplayName(DefaultNameFormatter.getInstance());
-            showDialog(sigs, tr("Selected node was:\n{0}",nodename),1);
+            String nodename = ((Node) trust.getOsmPrimitive()).getDisplayName(DefaultNameFormatter.getInstance());
+            showDialog(sigs, tr("Selected node was:\n{0}", nodename), 1);
         }
     }
@@ -133,7 +118,8 @@
         TrustSignatures sigs;
         if ((sigs = trust.getSigsOnKey(key)) == null) {
-            JOptionPane.showMessageDialog(null,tr("Sorry, there are no Signatures for the selected Attribute."), tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
+            JOptionPane.showMessageDialog(null, tr("Sorry, there are no Signatures for the selected Attribute."),
+                    tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
         } else {
-            showDialog(sigs, tr("Selected key value pair was:\n{0}={1}",key,trust.getOsmPrimitive().get(key)), 0);
+            showDialog(sigs, tr("Selected key value pair was:\n{0}={1}", key, trust.getOsmPrimitive().get(key)), 0);
         }
     }
@@ -142,5 +128,6 @@
         TrustSignatures sigs;
         if ((sigs = trust.getSigsOnSegment(nodes)) == null) {
-            JOptionPane.showMessageDialog(null,tr("Sorry, there are no Signatures for the selected Segment."), tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
+            JOptionPane.showMessageDialog(null, tr("Sorry, there are no Signatures for the selected Segment."),
+                    tr("No Signature found"), JOptionPane.WARNING_MESSAGE);
         } else {
             showDialog(sigs, tr("Selected WaySegment was:"), 2);
@@ -187,5 +174,5 @@
 
         PGPPublicKey pub = TrustOSMplugin.gpg.getPublicKeyFromRing(s.getKeyID());
-        if (pub != null){
+        if (pub != null) {
             Iterator i = pub.getUserIDs();
             if (i.hasNext())
@@ -197,9 +184,9 @@
     public static JTree createSignerTree(Collection<PGPSignature> sigs) {
         DefaultMutableTreeNode root = new DefaultMutableTreeNode();
-        for (PGPSignature s : sigs){
+        for (PGPSignature s : sigs) {
             DefaultMutableTreeNode sn = new DefaultMutableTreeNode(s);
             PGPPublicKey pub = TrustOSMplugin.gpg.getPublicKeyFromRing(s.getKeyID());
             Iterator iter = pub.getSignatures();
-            while (iter.hasNext()){
+            while (iter.hasNext()) {
                 PGPSignature ks = (PGPSignature)iter.next();
                 sn.add(new DefaultMutableTreeNode(ks));
@@ -212,5 +199,5 @@
         t.setRootVisible(false);
         t.setBackground(TrustDialog.BGCOLOR_NO_SIG);
-        t.setCellRenderer(new DefaultTreeCellRenderer(){
+        t.setCellRenderer(new DefaultTreeCellRenderer() {
 
             @Override
@@ -229,5 +216,5 @@
                 setBackgroundNonSelectionColor(TrustDialog.BGCOLOR_NO_SIG);
                 if (sv.hasSubpacket(SignatureSubpacketTags.NOTATION_DATA)) {
-                    for (NotationData nd : sv.getNotationDataOccurences()){
+                    for (NotationData nd : sv.getNotationDataOccurences()) {
                         System.out.println(nd.getNotationName()+"="+nd.getNotationValue());
                         if (nd.getNotationName().equals("trustosm@openstreetmap.org")) {
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigExporter.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigExporter.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigExporter.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.io;
 
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigImporter.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigImporter.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigImporter.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.io;
 
@@ -49,5 +50,5 @@
         }
         //        Set<OsmPrimitive> missingData = new HashSet<OsmPrimitive>();
-        Map<String,TrustOsmPrimitive> trustitems = SigReader.parseSignatureXML(in, NullProgressMonitor.INSTANCE);
+        Map<String, TrustOsmPrimitive> trustitems = SigReader.parseSignatureXML(in, NullProgressMonitor.INSTANCE);
         System.out.println(trustitems.size());
         /*
@@ -57,5 +58,7 @@
             JOptionPane.showMessageDialog(Main.parent, tr("{0} Signatures loaded. All referenced OSM objects found.",itemCount));
         } else {
-            int n = JOptionPane.showOptionDialog(Main.parent, tr("{0} of {1} OSM objects are referenced but not there.\nDo you want to load them from OSM-Server?",missingCount,itemCount), tr("Load objects from server"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
+            int n = JOptionPane.showOptionDialog(Main.parent,
+            tr("{0} of {1} OSM objects are referenced but not there.\nDo you want to load them from OSM-Server?",missingCount,itemCount),
+            tr("Load objects from server"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
 
             if (n == JOptionPane.YES_OPTION) {
@@ -67,5 +70,4 @@
         new GetMissingDataAction().downloadMissing();
         //TrustOSMplugin.signedItems.putAll(TrustStoreHandler.loadSigsFromFile(in));
-
     }
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigReader.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigReader.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigReader.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.io;
 
@@ -47,8 +48,8 @@
 public class SigReader {
 
-    private final Map<String,TrustOsmPrimitive> trustitems = new HashMap<>();
+    private final Map<String, TrustOsmPrimitive> trustitems = new HashMap<>();
     private final Set<OsmPrimitive> missingData = new HashSet<>();
 
-    public Map<String,TrustOsmPrimitive> getTrustItems() {
+    public Map<String, TrustOsmPrimitive> getTrustItems() {
         return trustitems;
     }
@@ -75,5 +76,4 @@
         private TrustOsmPrimitive trust;
 
-
         /**
          * The current Signatures.
@@ -81,7 +81,5 @@
         private TrustSignatures tsigs;
 
-
         private StringBuffer tmpbuf = new StringBuffer();
-
 
         @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
@@ -94,5 +92,5 @@
 
                     String osmid = atts.getValue("osmid");
-                    if (osmid == null){
+                    if (osmid == null) {
                         throwException(tr("Missing mandatory attribute ''{0}''.", "osmid"));
                     } else if (!osmid.matches("\\d+")) {
@@ -131,9 +129,8 @@
                 trustitems.put(TrustOsmPrimitive.createUniqueObjectIdentifier(trust.getOsmPrimitive()), trust);
             } else if (qName.equals("openpgp")) {
-                // System.out.println(tmpbuf.toString());
                 try {
                     parseOpenPGP(tmpbuf.toString());
                 } catch (IOException e) {
-                    throw new XmlParsingException(tr("Could not parse OpenPGP message."),e).rememberLocation(locator);
+                    throw new XmlParsingException(tr("Could not parse OpenPGP message."), e).rememberLocation(locator);
                 }
             } else if (qName.equals("key")) {
@@ -141,11 +138,11 @@
                 trust.setTagRatings(kv[0], tsigs);
             } else if (qName.equals("node")) {
-                ((TrustNode)trust).setNodeRatings(tsigs);
+                ((TrustNode) trust).setNodeRatings(tsigs);
             } else if (qName.equals("segment")) {
                 List<Node> nodes = TrustWay.generateSegmentFromSigtext(tsigs.getOnePlainText());
-                ((TrustWay)trust).setSegmentRatings(nodes,tsigs);
+                ((TrustWay) trust).setSegmentRatings(nodes, tsigs);
             } else if (qName.equals("member")) {
                 RelationMember member = TrustRelation.generateRelationMemberFromSigtext(tsigs.getOnePlainText());
-                ((TrustRelation)trust).setMemberRating(TrustOsmPrimitive.createUniqueObjectIdentifier(member.getMember()), tsigs);
+                ((TrustRelation) trust).setMemberRating(TrustOsmPrimitive.createUniqueObjectIdentifier(member.getMember()), tsigs);
             }
         }
@@ -178,13 +175,9 @@
             plain = plain.substring(0, plain.length()-1);
 
-            PGPSignatureList siglist = (PGPSignatureList)pgpFact.nextObject();
-            for (int i=0; i<siglist.size();i++) {
+            PGPSignatureList siglist = (PGPSignatureList) pgpFact.nextObject();
+            for (int i = 0; i < siglist.size(); i++) {
                 tsigs.addSignature(siglist.get(i), plain);
             }
-
-
-        }
-
-
+        }
     }
 
@@ -199,5 +192,6 @@
      * @throws IllegalArgumentException thrown if source is null
      */
-    public static Map<String,TrustOsmPrimitive> parseSignatureXML(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
+    public static Map<String, TrustOsmPrimitive> parseSignatureXML(InputStream source, ProgressMonitor progressMonitor)
+            throws IllegalDataException {
         if (progressMonitor == null) {
             progressMonitor = NullProgressMonitor.INSTANCE;
@@ -216,11 +210,11 @@
 
             return reader.getTrustItems();
-        } catch(ParserConfigurationException e) {
+        } catch (ParserConfigurationException e) {
             throw new IllegalDataException(e.getMessage(), e);
         } catch (SAXParseException e) {
             throw new IllegalDataException(tr("Line {0} column {1}: ", e.getLineNumber(), e.getColumnNumber()) + e.getMessage(), e);
-        } catch(SAXException e) {
+        } catch (SAXException e) {
             throw new IllegalDataException(e.getMessage(), e);
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new IllegalDataException(e);
         } finally {
@@ -228,5 +222,3 @@
         }
     }
-
-
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigWriter.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigWriter.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigWriter.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.io;
 
@@ -75,7 +76,6 @@
     private void writeSigs(TrustSignatures tsigs) {
         for (String plain : tsigs.getAllPlainTexts()) {
-            simpleTag("openpgp",tsigs.getArmoredFulltextSignatureAll(plain));
-        }
-
+            simpleTag("openpgp", tsigs.getArmoredFulltextSignatureAll(plain));
+        }
     }
 
@@ -86,8 +86,6 @@
         openln("tags");
         for (String key : signedKeys) {
-            openAtt("key","k=\""+key+"\"");
-
+            openAtt("key", "k=\""+key+"\"");
             writeSigs(tagsigs.get(key));
-
             closeln("key");
         }
@@ -131,5 +129,5 @@
     private void writeItems(Collection<TrustOsmPrimitive> items) {
 
-        for (TrustOsmPrimitive trust : items){
+        for (TrustOsmPrimitive trust : items) {
             OsmPrimitive osm = trust.getOsmPrimitive();
             if (trust instanceof TrustNode) {
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/NameGenerator.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/NameGenerator.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/NameGenerator.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.util;
 
@@ -53,6 +54,8 @@
     ArrayList<String> sur = new ArrayList<>();
 
-    final private static char[] vocals = {'a', 'e', 'i', 'o', 'u', 'ä', 'ö', 'õ', 'ü', 'y'};
-    final private static char[] consonants = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p',    'q', 'r', 's', 't', 'v', 'w', 'x', 'y'};
+    private static final char[] vocals =
+        {'a', 'e', 'i', 'o', 'u', 'ä', 'ö', 'õ', 'ü', 'y'};
+    private static final char[] consonants =
+        {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y'};
 
     private String fileName;
@@ -61,7 +64,6 @@
      * Create new random name generator object. refresh() is automatically called.
      * @param fileName insert file name, where syllables are located
-     * @throws IOException
-     */
-    public NameGenerator(String fileName) throws IOException{
+     */
+    public NameGenerator(String fileName) throws IOException {
         this.fileName = fileName;
         refresh();
@@ -71,8 +73,7 @@
      * Change the file. refresh() is automatically called during the process.
      * @param fileName insert the file name, where syllables are located.
-     * @throws IOException
-     */
-    public void changeFile(String fileName) throws IOException{
-        if(fileName == null) throw new IOException("File name cannot be null");
+     */
+    public void changeFile(String fileName) throws IOException {
+        if (fileName == null) throw new IOException("File name cannot be null");
         this.fileName = fileName;
         refresh();
@@ -82,16 +83,14 @@
      * Refresh names from file. No need to call that method, if you are not changing the file during the operation of program, as this method
      * is called every time file name is changed or new NameGenerator object created.
-     * @throws IOException
-     */
-    public void refresh() throws IOException{
-        try (
-            FileReader input = new FileReader(fileName);
-            BufferedReader bufRead = new BufferedReader(input);
-        ) {
-            String line="";
-            while (line != null){
+     */
+    public void refresh() throws IOException {
+        try (FileReader input = new FileReader(fileName);
+                BufferedReader bufRead = new BufferedReader(input);
+                ) {
+            String line = "";
+            while (line != null) {
                 line = bufRead.readLine();
                 if (line != null && !line.equals("")) {
-                    if(line.charAt(0) == '-') {
+                    if (line.charAt(0) == '-') {
                         pre.add(line.substring(1).toLowerCase());
                     } else if (line.charAt(0) == '+') {
@@ -106,74 +105,78 @@
 
     private String upper(String s) {
-        return s.substring(0,1).toUpperCase().concat(s.substring(1));
+        return s.substring(0, 1).toUpperCase().concat(s.substring(1));
     }
 
     private boolean containsConsFirst(ArrayList<String> array) {
-        for(String s: array){
-            if(consonantFirst(s)) return true;
-        }
-        return false;
-    }
-
-    private boolean containsVocFirst(ArrayList<String> array){
-        for(String s: array){
-            if(vocalFirst(s)) return true;
-        }
-        return false;
-    }
-
-    private boolean allowCons(ArrayList<String> array){
-        for(String s: array){
-            if(hatesPreviousVocals(s) || hatesPreviousConsonants(s) == false) return true;
-        }
-        return false;
-    }
-
-    private boolean allowVocs(ArrayList<String> array){
-        for(String s: array){
-            if(hatesPreviousConsonants(s) || hatesPreviousVocals(s) == false) return true;
-        }
-        return false;
-    }
-
-    private boolean expectsVocal(String s){
-        if(s.substring(1).contains("+v")) return true;
-        else return false;
-    }
-    private boolean expectsConsonant(String s){
-        if(s.substring(1).contains("+c")) return true;
-        else return false;
-    }
-    private boolean hatesPreviousVocals(String s){
-        if(s.substring(1).contains("-c")) return true;
-        else return false;
-    }
-    private boolean hatesPreviousConsonants(String s){
-        if(s.substring(1).contains("-v")) return true;
-        else return false;
-    }
-
-    private String pureSyl(String s){
+        for (String s: array) {
+            if (consonantFirst(s)) return true;
+        }
+        return false;
+    }
+
+    private boolean containsVocFirst(ArrayList<String> array) {
+        for (String s: array) {
+            if (vocalFirst(s)) return true;
+        }
+        return false;
+    }
+
+    private boolean allowCons(ArrayList<String> array) {
+        for (String s: array) {
+            if (hatesPreviousVocals(s) || hatesPreviousConsonants(s) == false) return true;
+        }
+        return false;
+    }
+
+    private boolean allowVocs(ArrayList<String> array) {
+        for (String s: array) {
+            if (hatesPreviousConsonants(s) || hatesPreviousVocals(s) == false) return true;
+        }
+        return false;
+    }
+
+    private boolean expectsVocal(String s) {
+        if (s.substring(1).contains("+v")) return true;
+        else return false;
+    }
+
+    private boolean expectsConsonant(String s) {
+        if (s.substring(1).contains("+c")) return true;
+        else return false;
+    }
+
+    private boolean hatesPreviousVocals(String s) {
+        if (s.substring(1).contains("-c")) return true;
+        else return false;
+    }
+
+    private boolean hatesPreviousConsonants(String s) {
+        if (s.substring(1).contains("-v")) return true;
+        else return false;
+    }
+
+    private String pureSyl(String s) {
         s = s.trim();
-        if(s.charAt(0) == '+' || s.charAt(0) == '-') s = s.substring(1);
+        if (s.charAt(0) == '+' || s.charAt(0) == '-') s = s.substring(1);
         return s.split(" ")[0];
     }
 
-    private boolean vocalFirst(String s){
+    private boolean vocalFirst(String s) {
         return (String.copyValueOf(vocals).contains(String.valueOf(s.charAt(0)).toLowerCase()));
     }
 
-    private boolean consonantFirst(String s){
+    private boolean consonantFirst(String s) {
         return (String.copyValueOf(consonants).contains(String.valueOf(s.charAt(0)).toLowerCase()));
     }
 
-    private boolean vocalLast(String s){
+    private boolean vocalLast(String s) {
         return (String.copyValueOf(vocals).contains(String.valueOf(s.charAt(s.length()-1)).toLowerCase()));
     }
 
-    private boolean consonantLast(String s){
+    private boolean consonantLast(String s) {
         return (String.copyValueOf(consonants).contains(String.valueOf(s.charAt(s.length()-1)).toLowerCase()));
     }
 
+    // CHECKSTYLE.OFF: LineLength
 
     /**
@@ -183,109 +186,112 @@
      * @throws RuntimeException when logical mistakes are detected inside chosen file, and program is unable to complete the name.
      */
-    public String compose(int syls){
-        if(syls > 2 && mid.size() == 0) throw new RuntimeException("You are trying to create a name with more than 3 parts, which requires middle parts, " +
-                "which you have none in the file "+fileName+". You should add some. Every word, which doesn't have + or - for a prefix is counted as a middle part.");
-        if(pre.size() == 0) throw new RuntimeException("You have no prefixes to start creating a name. add some and use \"-\" prefix, to identify it as a prefix for a name. (example: -asd)");
-        if(sur.size() == 0) throw new RuntimeException("You have no suffixes to end a name. add some and use \"+\" prefix, to identify it as a suffix for a name. (example: +asd)");
-        if(syls < 1) throw new RuntimeException("compose(int syls) can't have less than 1 syllable");
+    public String compose(int syls) {
+        if (syls > 2 && mid.size() == 0)
+            throw new RuntimeException("You are trying to create a name with more than 3 parts, which requires middle parts, " +
+                    "which you have none in the file "+fileName+
+                    ". You should add some. Every word, which doesn't have + or - for a prefix is counted as a middle part.");
+        if (pre.size() == 0)
+            throw new RuntimeException(
+                    "You have no prefixes to start creating a name. add some and use \"-\" prefix, to identify it as a prefix for a name. (example: -asd)");
+        if (sur.size() == 0)
+            throw new RuntimeException(
+                    "You have no suffixes to end a name. add some and use \"+\" prefix, to identify it as a suffix for a name. (example: +asd)");
+        if (syls < 1) throw new RuntimeException("compose(int syls) can't have less than 1 syllable");
         int expecting = 0; // 1 for vocal, 2 for consonant
         int last = 0; // 1 for vocal, 2 for consonant
         String name;
-        int a = (int)(Math.random() * pre.size());
-
-        if(vocalLast(pureSyl(pre.get(a)))) last = 1;
+        int a = (int) (Math.random() * pre.size());
+
+        if (vocalLast(pureSyl(pre.get(a)))) last = 1;
         else last = 2;
 
-        if(syls > 2){
-            if(expectsVocal(pre.get(a))){
+        if (syls > 2) {
+            if (expectsVocal(pre.get(a))) {
                 expecting = 1;
-                if(containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(expectsConsonant(pre.get(a))){
+                if (containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (expectsConsonant(pre.get(a))) {
                 expecting = 2;
-                if(containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-        }
-        else{
-            if(expectsVocal(pre.get(a))){
+                if (containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+        } else {
+            if (expectsVocal(pre.get(a))) {
                 expecting = 1;
-                if(containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(expectsConsonant(pre.get(a))){
+                if (containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (expectsConsonant(pre.get(a))) {
                 expecting = 2;
-                if(containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-        }
-        if(vocalLast(pureSyl(pre.get(a))) && allowVocs(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a vocal, " +
+                if (containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+        }
+        if (vocalLast(pureSyl(pre.get(a))) && allowVocs(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a vocal, " +
                 "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the prefix used, was : \""+pre.get(a)+"\", which" +
-        "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
-
-        if(consonantLast(pureSyl(pre.get(a))) && allowCons(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a consonant, " +
+                "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
+
+        if (consonantLast(pureSyl(pre.get(a))) && allowCons(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a consonant, " +
                 "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the prefix used, was : \""+pre.get(a)+"\", which" +
-        "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
-
-        int b[] = new int[syls];
-        for(int i = 0; i<b.length-2; i++){
-
-            do{
-                b[i] = (int)(Math.random() * mid.size());
-                //System.out.println("exp " +expecting+" vocalF:"+vocalFirst(mid.get(b[i]))+" syl: "+mid.get(b[i]));
-            }
-            while(expecting == 1 && vocalFirst(pureSyl(mid.get(b[i]))) == false || expecting == 2 && consonantFirst(pureSyl(mid.get(b[i]))) == false
+                "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
+
+        int[] b = new int[syls];
+        for (int i = 0; i < b.length-2; i++) {
+
+            do {
+                b[i] = (int) (Math.random() * mid.size());
+            } while (expecting == 1 && vocalFirst(pureSyl(mid.get(b[i]))) == false || expecting == 2 && consonantFirst(pureSyl(mid.get(b[i]))) == false
                     || last == 1 && hatesPreviousVocals(mid.get(b[i])) || last == 2 && hatesPreviousConsonants(mid.get(b[i])));
 
             expecting = 0;
-            if(expectsVocal(mid.get(b[i]))){
+            if (expectsVocal(mid.get(b[i]))) {
                 expecting = 1;
-                if(i < b.length-3 && containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-                if(i == b.length-3 && containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(expectsConsonant(mid.get(b[i]))){
+                if (i < b.length-3 && containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+                if (i == b.length-3 && containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (expectsConsonant(mid.get(b[i]))) {
                 expecting = 2;
-                if(i < b.length-3 && containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-                if(i == b.length-3 && containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a vocal, " +
+                if (i < b.length-3 && containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+                if (i == b.length-3 && containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a vocal, " +
                     "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-            "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
-
-            if(consonantLast(pureSyl(mid.get(b[i]))) && allowCons(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a consonant, " +
+                    "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
+
+            if (consonantLast(pureSyl(mid.get(b[i]))) && allowCons(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a consonant, " +
                     "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-            "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
-            if(i == b.length-3){
-                if(vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a vocal, " +
+                    "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
+            if (i == b.length-3) {
+                if (vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a vocal, " +
                         "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-                "means there should be a suffix available, that has \"-v\" requirement or no requirements for previous syllables at all.");
-
-                if(consonantLast(pureSyl(mid.get(b[i]))) && allowCons(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a consonant, " +
+                        "means there should be a suffix available, that has \"-v\" requirement or no requirements for previous syllables at all.");
+
+                if (consonantLast(pureSyl(mid.get(b[i]))) && allowCons(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a consonant, " +
                         "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-                "means there should be a suffix available, that has \"-c\" requirement or no requirements for previous syllables at all.");
-            }
-            if(vocalLast(pureSyl(mid.get(b[i])))) last = 1;
+                        "means there should be a suffix available, that has \"-c\" requirement or no requirements for previous syllables at all.");
+            }
+            if (vocalLast(pureSyl(mid.get(b[i])))) last = 1;
             else last = 2;
         }
 
         int c;
-        do{
-            c = (int)(Math.random() * sur.size());
-        }
-        while(expecting == 1 && vocalFirst(pureSyl(sur.get(c))) == false || expecting == 2 && consonantFirst(pureSyl(sur.get(c))) == false
+        do {
+            c = (int) (Math.random() * sur.size());
+        } while (expecting == 1 && vocalFirst(pureSyl(sur.get(c))) == false || expecting == 2 && consonantFirst(pureSyl(sur.get(c))) == false
                 || last == 1 && hatesPreviousVocals(sur.get(c)) || last == 2 && hatesPreviousConsonants(sur.get(c)));
 
         name = upper(pureSyl(pre.get(a).toLowerCase()));
-        for(int i = 0; i<b.length-2; i++){
+        for (int i = 0; i < b.length-2; i++) {
             name = name.concat(pureSyl(mid.get(b[i]).toLowerCase()));
         }
-        if(syls > 1)
+        if (syls > 1)
             name = name.concat(pureSyl(sur.get(c).toLowerCase()));
         return name;
     }
+    // CHECKSTYLE.ON: LineLength
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/SpringUtilities.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/SpringUtilities.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/SpringUtilities.java	(revision 32533)
@@ -28,11 +28,12 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */ 
-
+ */
 package org.openstreetmap.josm.plugins.trustosm.util;
 
-import javax.swing.*;
+import java.awt.Component;
+import java.awt.Container;
+
+import javax.swing.Spring;
 import javax.swing.SpringLayout;
-import java.awt.*;
 
 /**
@@ -42,5 +43,10 @@
  * SpringBox and SpringCompactGrid.
  */
-public class SpringUtilities {
+public final class SpringUtilities {
+
+    private SpringUtilities() {
+        // Hide default constructors for utilities classes
+    }
+
     /**
      * A debugging utility that prints to stdout the component's
@@ -73,5 +79,5 @@
         SpringLayout layout;
         try {
-            layout = (SpringLayout)parent.getLayout();
+            layout = (SpringLayout) parent.getLayout();
         } catch (ClassCastException exc) {
             System.err.println("The first argument to makeGrid must use SpringLayout.");
@@ -176,5 +182,5 @@
         SpringLayout layout;
         try {
-            layout = (SpringLayout)parent.getLayout();
+            layout = (SpringLayout) parent.getLayout();
         } catch (ClassCastException exc) {
             System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustAnalyzer.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustAnalyzer.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustAnalyzer.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.util;
 
@@ -20,10 +21,13 @@
 import org.openstreetmap.josm.plugins.trustosm.data.TrustWay;
 
-public class TrustAnalyzer {
-
-    public static void showManipulationWarning(){
+public final class TrustAnalyzer {
+
+    private TrustAnalyzer() {
+        // Hide default constructors for utilities classes
+    }
+
+    public static void showManipulationWarning() {
         JOptionPane.showMessageDialog(Main.parent, tr("The Signature is broken!"), tr("Manipulation Warning"), JOptionPane.WARNING_MESSAGE);
     }
-
 
     public static double computeReputation(TrustOsmPrimitive trust, Map<String, List<PGPSignature>> textsigs) {
@@ -38,8 +42,7 @@
     public static boolean isTagRatingValid(TrustOsmPrimitive trust, String key, String signedPlaintext) {
         /** Rating is valid if signed plaintext matches the current plaintext */
-        String currentSigtext = TrustOsmPrimitive.generateTagSigtext(trust.getOsmPrimitive(),key);
+        String currentSigtext = TrustOsmPrimitive.generateTagSigtext(trust.getOsmPrimitive(), key);
         return currentSigtext.equals(signedPlaintext);
     }
-
 
     public static void checkTag(TrustOsmPrimitive trust, String key) {
@@ -47,5 +50,5 @@
 
         TrustSignatures sigs;
-        if ((sigs = trust.getSigsOnKey(key))!=null) {
+        if ((sigs = trust.getSigsOnKey(key)) != null) {
             for (PGPSignature sig : sigs.getSignatures()) {
                 /** Here we have a full rating
@@ -58,5 +61,5 @@
                      * Second question: Is the rating valid?
                      */
-                    if (isTagRatingValid(trust,key,signedPlaintext)) {
+                    if (isTagRatingValid(trust, key, signedPlaintext)) {
                         /** if the rating is good, we can try to compute a reputation value at the end
                          *  so we save the important rating stuff
@@ -71,7 +74,7 @@
 
                         //if (sigs.getStatus() == TrustSignatures.SIG_UNKNOWN) sigs.setStatus(TrustSignatures.SIG_VALID);
-                    } else {
-                        //sigs.setStatus(TrustSignatures.SIG_BROKEN);
-                    }
+                    } /*else {
+                        sigs.setStatus(TrustSignatures.SIG_BROKEN);
+                    }*/
                 } else {
                     //sigs.setStatus(TrustSignatures.SIG_BROKEN);
@@ -88,13 +91,12 @@
     }
 
-
     public static boolean isNodeRatingValid(TrustNode trust, String signedPlaintext, PGPSignature sig) {
         /** Rating is valid if Node from signed plaintext is inside Tolerance given in Signature */
         Node signedNode = TrustNode.generateNodeFromSigtext(signedPlaintext);
-        Node currentNode = (Node)trust.getOsmPrimitive();
+        Node currentNode = (Node) trust.getOsmPrimitive();
         double dist = signedNode.getCoor().greatCircleDistance(currentNode.getCoor());
 
         /** is distance between signed Node and current Node inside tolerance? */
-        return dist<=TrustGPG.searchTolerance(sig);
+        return dist <= TrustGPG.searchTolerance(sig);
     }
 
@@ -106,13 +108,12 @@
     public static void checkNode(TrustNode trust) {
         Map<String, List<PGPSignature>> validRatings = new HashMap<>();
-        //Node node = (Node)trust.getOsmPrimitive();
         TrustSignatures sigs;
-        if ((sigs = trust.getNodeSigs())!=null) {
+        if ((sigs = trust.getNodeSigs()) != null) {
             for (String signedPlaintext : sigs.getAllPlainTexts()) {
                 for (PGPSignature sig : sigs.getSignaturesByPlaintext(signedPlaintext)) {
                     /** first thing: check signature */
-                    if (TrustOSMplugin.gpg.verify(signedPlaintext,sig)) {
+                    if (TrustOSMplugin.gpg.verify(signedPlaintext, sig)) {
                         /** if signature is valid check rating */
-                        if (isNodeRatingValid(trust,signedPlaintext,sig)) {
+                        if (isNodeRatingValid(trust, signedPlaintext, sig)) {
                             /** if the rating is good, we can try to compute a reputation value at the end
                              *  so we save the important rating stuff
@@ -127,8 +128,7 @@
 
                             //if (sigs.getStatus() == TrustSignatures.SIG_UNKNOWN) sigs.setStatus(TrustSignatures.SIG_VALID);
-                        } else {
-                            //sigs.setStatus(TrustSignatures.SIG_BROKEN);
-                        }
-
+                        } /*else {
+                            sigs.setStatus(TrustSignatures.SIG_BROKEN);
+                        }*/
                     } else {
                         //sigs.setStatus(TrustSignatures.SIG_BROKEN);
@@ -147,9 +147,4 @@
     /**
      * Check if the ratings made for a specific WaySegment are valid for the current form of that WaySegment
-     * @param trust
-     * @param seg
-     * @param signedPlaintext
-     * @param sig
-     * @return
      */
     public static boolean isSegmentRatingValid(TrustWay trust, List<Node> nodes, String signedPlaintext, PGPSignature sig) {
@@ -159,9 +154,9 @@
         double tolerance = TrustGPG.searchTolerance(sig);
 
-        for (int i = 0; i<2; i++){
+        for (int i = 0; i < 2; i++) {
             Node signedNode = signedSegment.get(i);
             Node currentNode = nodes.get(i);
             double dist = signedNode.getCoor().greatCircleDistance(currentNode.getCoor());
-            if (dist>tolerance) return false;
+            if (dist > tolerance) return false;
         }
         return true;
@@ -178,11 +173,11 @@
 
         TrustSignatures sigs;
-        if ((sigs = trust.getSigsOnSegment(nodes))!=null) {
+        if ((sigs = trust.getSigsOnSegment(nodes)) != null) {
             for (String signedPlaintext : sigs.getAllPlainTexts()) {
                 for (PGPSignature sig : sigs.getSignaturesByPlaintext(signedPlaintext)) {
                     /** first thing: check signature */
-                    if (TrustOSMplugin.gpg.verify(signedPlaintext,sig)) {
+                    if (TrustOSMplugin.gpg.verify(signedPlaintext, sig)) {
                         /** if signature is valid check rating */
-                        if (isSegmentRatingValid(trust,nodes,signedPlaintext,sig)) {
+                        if (isSegmentRatingValid(trust, nodes, signedPlaintext, sig)) {
                             /** if the rating is good, we can try to compute a reputation value at the end
                              *  so we save the important rating stuff
@@ -197,8 +192,7 @@
 
                             //if (sigs.getStatus() == TrustSignatures.SIG_UNKNOWN) sigs.setStatus(TrustSignatures.SIG_VALID);
-                        } else {
-                            //sigs.setStatus(TrustSignatures.SIG_BROKEN);
-                        }
-
+                        } /*else {
+                            sigs.setStatus(TrustSignatures.SIG_BROKEN);
+                        }*/
                     } else {
                         //sigs.setStatus(TrustSignatures.SIG_BROKEN);
@@ -215,8 +209,7 @@
     }
 
-
     public static void checkEverything(TrustOsmPrimitive trust) {
         /** check every single tag for reputation */
-        for (String key : trust.getSignedKeys()){
+        for (String key : trust.getSignedKeys()) {
             checkTag(trust, key);
         }
@@ -224,19 +217,17 @@
             /** check all reputation of this single Node */
             checkNode((TrustNode) trust);
-        } else if (trust instanceof TrustWay){
+        } else if (trust instanceof TrustWay) {
             TrustWay tw = (TrustWay) trust;
             /** check all reputation for every Segment of this Way */
-            List<Node> wayNodes = ((Way)tw.getOsmPrimitive()).getNodes();
-            for (int i=0; i<wayNodes.size()-1; i++) {
+            List<Node> wayNodes = ((Way) tw.getOsmPrimitive()).getNodes();
+            for (int i = 0; i < wayNodes.size()-1; i++) {
                 List<Node> nodes = new ArrayList<>();
                 nodes.add(wayNodes.get(i));
                 nodes.add(wayNodes.get(i+1));
-                checkSegment(tw,nodes);
-            }
-
-        } /*else if (trust instanceof TrustRelation){
+                checkSegment(tw, nodes);
+            }
+        } /*else if (trust instanceof TrustRelation) {
             TrustRelation tr = (TrustRelation) trust;
         }*/
-
     }
 }
Index: /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.trustosm.util;
 
@@ -135,5 +136,5 @@
         Iterator<?> iter = k.getUserIDs();
         if (iter.hasNext()) {
-            keyText += (String)iter.next();
+            keyText += (String) iter.next();
         }
         /*            iter = sigKey.getUserIDs();
@@ -172,9 +173,9 @@
         while (rIt.hasNext()) {
 
-            PGPSecretKeyRing    kRing = (PGPSecretKeyRing)rIt.next();
-            Iterator<?>            kIt = kRing.getSecretKeys();
+            PGPSecretKeyRing kRing = (PGPSecretKeyRing) rIt.next();
+            Iterator<?> kIt = kRing.getSecretKeys();
 
             while (kIt.hasNext()) {
-                PGPSecretKey    k = (PGPSecretKey)kIt.next();
+                PGPSecretKey k = (PGPSecretKey) kIt.next();
 
                 if (k.isSigningKey()) {
@@ -196,5 +197,5 @@
         JPanel p = new JPanel();
         p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
-        Dimension d = new Dimension(0,20);
+        Dimension d = new Dimension(0, 20);
 
         JLabel head = new JLabel(tr("Select a signing key from your keyring-file:"));
@@ -212,11 +213,10 @@
         JButton detailsButton = new JButton(tr("Details"), ImageProvider.get("keydetails"));
         detailsButton.setAlignmentX(Component.LEFT_ALIGNMENT);
-        detailsButton.addActionListener(new ActionListener(){
-
+        detailsButton.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent arg0) {
                 PGPSecretKey sk = sigKeys.get(keyBox.getSelectedIndex());
                 showKeyDetails(getPublicKeyFromRing(sk.getKeyID()));
-            }});
+            } });
         p.add(detailsButton);
 
@@ -229,5 +229,5 @@
         JButton createButton = new JButton(tr("Create new Key"), ImageProvider.get("key"));
         createButton.setAlignmentX(Component.LEFT_ALIGNMENT);
-        createButton.addActionListener(new ActionListener(){
+        createButton.addActionListener(new ActionListener() {
 
             @Override
@@ -239,26 +239,13 @@
                         sigKeys.add(secKey);
                     }
-                } catch (NoSuchAlgorithmException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                } catch (NoSuchProviderException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                } catch (FileNotFoundException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                } catch (PGPException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                } catch (IOException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
+                } catch (NoSuchAlgorithmException | NoSuchProviderException | PGPException | IOException e) {
+                    Main.error(e);
                 }
-
-            }});
+            } });
         p.add(createButton);
         p.add(Box.createRigidArea(d));
 
-        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Select a Key to sign"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, ImageProvider.get("keyring"), null, null);
+        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Select a Key to sign"),
+                JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, ImageProvider.get("keyring"), null, null);
 
         if (n == JOptionPane.OK_OPTION) {
@@ -273,9 +260,4 @@
             pgpSecKey = null;
         }
-        //String selection = (String) JOptionPane.showInputDialog(null, tr("Select a Key to sign"),tr("Secret Key Choice"), JOptionPane.OK_CANCEL_OPTION, null, keys, keys[0]);
-
-        //System.out.println(selection);
-
-        //        return pgpSecKey;
     }
 
@@ -301,5 +283,5 @@
         String path = Main.pref.getPluginsDirectory().getPath();
         try (FileOutputStream pubOut = new FileOutputStream(path + "/trustosm/gnupg/pubring.gpg");
-             FileOutputStream secOut = new FileOutputStream(path + "/trustosm/gnupg/secring.gpg")) {
+                FileOutputStream secOut = new FileOutputStream(path + "/trustosm/gnupg/secring.gpg")) {
             pgpSec.encode(secOut);
             pgpPub.encode(pubOut);
@@ -314,17 +296,16 @@
         JOptionPane jop = new JOptionPane(passwordField, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, ImageProvider.get("lock"));
         JDialog dialog = jop.createDialog("Password:");
-        dialog.addComponentListener(new ComponentAdapter(){
+        dialog.addComponentListener(new ComponentAdapter() {
             @Override
-            public void componentShown(ComponentEvent e){
+            public void componentShown(ComponentEvent e) {
                 passwordField.requestFocusInWindow();
             }
         });
         dialog.setVisible(true);
-        int result = (Integer)jop.getValue();
+        int result = (Integer) jop.getValue();
         dialog.dispose();
-        if(result == JOptionPane.OK_OPTION){
+        if (result == JOptionPane.OK_OPTION) {
             password = passwordField.getPassword();
         }
-
 
         /*final JPasswordField passwordField = new JPasswordField(10);
@@ -343,6 +324,4 @@
     }
 
-
-
     /*    public void checkAll(TrustOsmPrimitive trust) {
         OsmPrimitive osm = trust.getOsmPrimitive();
@@ -351,12 +330,12 @@
         }
 
-        if(osm instanceof Node) {
+        if (osm instanceof Node) {
             checkNode((TrustNode) trust);
-        } else if(osm instanceof Way) {
+        } else if (osm instanceof Way) {
             /*            Iterator<Node> iter = ((Way)osm).getNodes().iterator();
             while (iter.hasNext()) {
                 checkNode(trust, iter.next());
             }/
-        } else if(osm instanceof Relation) {
+        } else if (osm instanceof Relation) {
 
         }
@@ -365,5 +344,10 @@
 
     public void invalidIDWarning(OsmPrimitive osm) {
-        JOptionPane.showMessageDialog(Main.parent, tr("The object with the ID \"{0}\" ({1}) is newly created.\nYou can not sign it, because the signature would lose the ID-Reference after uploading it to the OSM-server.",osm.getUniqueId(),osm.toString()), tr("Signing canceled!"), JOptionPane.ERROR_MESSAGE);
+        // CHECKSTYLE.OFF: LineLength
+        JOptionPane.showMessageDialog(Main.parent,
+                tr("The object with the ID \"{0}\" ({1}) is newly created.\nYou can not sign it, because the signature would lose the ID-Reference after uploading it to the OSM-server.",
+                        osm.getUniqueId(), osm.toString()),
+                tr("Signing canceled!"), JOptionPane.ERROR_MESSAGE);
+        // CHECKSTYLE.ON: LineLength
     }
     /*
@@ -377,8 +361,8 @@
             return trust;
         }
-        if(osm instanceof Node) {
+        if (osm instanceof Node) {
             s = signNode(osm,(Node)osm, spGen);
             if (s != null) ((TrustNode)trust).storeNodeSig(s);
-        } else if(osm instanceof Way) {
+        } else if (osm instanceof Way) {
             Iterator<Node> iter = ((Way)osm).getNodes().iterator();
             while (iter.hasNext()) {
@@ -387,5 +371,5 @@
                 if (s != null) ((TrustNode)trust).storeNodeSig(s);
             }
-        } else if(osm instanceof Relation) {
+        } else if (osm instanceof Relation) {
 
         }
@@ -406,10 +390,10 @@
          */
         List<Node> wayNodes = w.getNodes();
-        for (int i=0; i<wayNodes.size()-1; i++) {
+        for (int i = 0; i < wayNodes.size()-1; i++) {
             List<Node> nodes = new ArrayList<>();
             nodes.add(wayNodes.get(i));
             nodes.add(wayNodes.get(i+1));
-            s = signSegment(trust,nodes);
-            if (s != null) trust.storeSegmentSig(nodes,s);
+            s = signSegment(trust, nodes);
+            if (s != null) trust.storeSegmentSig(nodes, s);
         }
 
@@ -423,12 +407,12 @@
             return null;
         }
-        String tosign = TrustWay.generateSegmentSigtext(trust,nodes);
+        String tosign = TrustWay.generateSegmentSigtext(trust, nodes);
         PGPSignatureSubpacketGenerator spGen = chooseAccuracy();
-        return sign(tosign,spGen);
+        return sign(tosign, spGen);
     }
 
     public PGPSignature signNode(Node node) {
-        PGPSignatureSubpacketGenerator  spGen = chooseAccuracy();
-        return signNode(node,spGen);
+        PGPSignatureSubpacketGenerator spGen = chooseAccuracy();
+        return signNode(node, spGen);
     }
 
@@ -439,5 +423,5 @@
         }
         String tosign = TrustNode.generateNodeSigtext(node);
-        return sign(tosign,spGen);
+        return sign(tosign, spGen);
     }
 
@@ -449,7 +433,6 @@
         }
         PGPSignature s;
-        String tosign = TrustOsmPrimitive.generateTagSigtext(osm,key);
-        //s = sign(tosign);
-        s = sign(tosign,chooseInformationSource());
+        String tosign = TrustOsmPrimitive.generateTagSigtext(osm, key);
+        s = sign(tosign, chooseInformationSource());
         if (s != null) {
             trust.storeTagSig(key, s);
@@ -461,10 +444,9 @@
     /**
      * Search in a given Signature for Tolerance information.
-     * @param sig
      * @return found tolerance as double or 0 if no Tolerance is given
      */
     public static double searchTolerance(PGPSignature sig) {
         /** Take the first NotationData packet that seems to have Tolerance information */
-        for (NotationData nd : sig.getHashedSubPackets().getNotationDataOccurrences()){
+        for (NotationData nd : sig.getHashedSubPackets().getNotationDataOccurrences()) {
             if (nd.getNotationName().equals(TrustGPG.NOTATION_DATA_KEY)) {
                 String notation = nd.getNotationValue();
@@ -480,7 +462,7 @@
 
     public PGPSignatureSubpacketGenerator chooseAccuracy() {
-        PGPSignatureSubpacketGenerator  spGen = new PGPSignatureSubpacketGenerator();
+        PGPSignatureSubpacketGenerator spGen = new PGPSignatureSubpacketGenerator();
         JPanel p = new JPanel(new GridBagLayout());
-        p.add(new JLabel(tr("Please give a tolerance in meters")),GBC.eol());
+        p.add(new JLabel(tr("Please give a tolerance in meters")), GBC.eol());
 
         JFormattedTextField meters = new JFormattedTextField(NumberFormat.getNumberInstance());
@@ -488,8 +470,9 @@
         meters.setColumns(5);
 
-        p.add(meters,GBC.std());
-        p.add(new JLabel(tr("meters")),GBC.eol());
-
-        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Accuracy"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
+        p.add(meters, GBC.std());
+        p.add(new JLabel(tr("meters")), GBC.eol());
+
+        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Accuracy"),
+                JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
 
         if (n == JOptionPane.OK_OPTION) {
@@ -501,21 +484,22 @@
 
     public PGPSignatureSubpacketGenerator chooseInformationSource() {
-        PGPSignatureSubpacketGenerator  spGen = new PGPSignatureSubpacketGenerator();
+        PGPSignatureSubpacketGenerator spGen = new PGPSignatureSubpacketGenerator();
         JPanel p = new JPanel(new GridBagLayout());
-        p.add(new JLabel(tr("Select as much as you like:")),GBC.eol());
+        p.add(new JLabel(tr("Select as much as you like:")), GBC.eol());
 
         JCheckBox survey = new JCheckBox(tr("Survey"));
-        p.add(survey,GBC.eol());
+        p.add(survey, GBC.eol());
 
         JCheckBox aerial = new JCheckBox(tr("Aerial Photography"));
-        p.add(aerial,GBC.eol());
+        p.add(aerial, GBC.eol());
 
         JCheckBox web = new JCheckBox(tr("Web Recherche"));
-        p.add(web,GBC.eol());
+        p.add(web, GBC.eol());
 
         JCheckBox trusted = new JCheckBox(tr("Trusted persons told me"));
-        p.add(trusted,GBC.eol());
-
-        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Which source did you use?"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
+        p.add(trusted, GBC.eol());
+
+        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Which source did you use?"),
+                JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
 
         if (n == JOptionPane.OK_OPTION) {
@@ -532,6 +516,6 @@
 
     public PGPSignature sign(String tosign) {
-        PGPSignatureSubpacketGenerator  spGen = new PGPSignatureSubpacketGenerator();
-        return sign(tosign,spGen);
+        PGPSignatureSubpacketGenerator spGen = new PGPSignatureSubpacketGenerator();
+        return sign(tosign, spGen);
     }
 
@@ -540,6 +524,5 @@
         if (spGen == null) return null;
         PGPSignature sig;
-        try{
-
+        try {
             readSecretKey();
             if (pgpSec == null) return null;
@@ -551,8 +534,10 @@
             Provider provider = Security.getProvider("BC");
             PGPDigestCalculatorProvider digestCalculatorProvider = new JcaPGPDigestCalculatorProviderBuilder().setProvider(provider).build();
-            PBESecretKeyDecryptor secretKeyDecryptor = new JcePBESecretKeyDecryptorBuilder(digestCalculatorProvider).setProvider(provider).build(password);
+            PBESecretKeyDecryptor secretKeyDecryptor = new JcePBESecretKeyDecryptorBuilder(digestCalculatorProvider)
+                    .setProvider(provider).build(password);
             PGPPrivateKey pgpPrivKey = pgpSecKey.extractPrivateKey(secretKeyDecryptor);
             int keyAlgorithm = pgpSecKey.getPublicKey().getAlgorithm();
-            PGPContentSignerBuilder contentSignerBuilder = new JcaPGPContentSignerBuilder(keyAlgorithm, digest).setProvider(provider).setDigestProvider(provider);
+            PGPContentSignerBuilder contentSignerBuilder = new JcaPGPContentSignerBuilder(keyAlgorithm, digest)
+                    .setProvider(provider).setDigestProvider(provider);
             PGPSignatureGenerator sGen = new PGPSignatureGenerator(contentSignerBuilder);
             sGen.init(PGPSignature.CANONICAL_TEXT_DOCUMENT, pgpPrivKey);
@@ -560,5 +545,5 @@
             Iterator<?> it = pgpSecKey.getPublicKey().getUserIDs();
             if (it.hasNext()) {
-                spGen.setSignerUserID(false, (String)it.next());
+                spGen.setSignerUserID(false, (String) it.next());
             }
             sGen.setHashedSubpackets(spGen.generate());
@@ -569,5 +554,5 @@
             //sig.encode(new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream("/tmp/sigtest.asc"))));
             return sig;
-        }catch (Exception e){//Catch exception if any
+        } catch (Exception e) {
             System.err.println("PGP Signing Error: " + e.getMessage());
         }
@@ -600,10 +585,9 @@
             sig.update(sigtext.getBytes(Charset.forName("UTF-8")));
             return sig.verify();
-        }catch (Exception e){//Catch exception if any
+        } catch (Exception e) {
             System.err.println("PGP Verification Error: " + e.getMessage());
         }
         return false;
     }
-
 
     //    public static void writeSignatureToFile(PGPSignature sig, String clearText, FileOutputStream fout) throws Exception {
@@ -637,5 +621,5 @@
         Iterator<?> iter = key.getUserIDs();
         if (iter.hasNext()) {
-            userid = (String)iter.next();
+            userid = (String) iter.next();
         }
 
@@ -682,6 +666,6 @@
         }
 
-
-        String[] labels = {tr("Primary user-ID: "), tr("Key-ID: "), tr("Fingerprint: "), tr("Algorithm: "), tr("Strength in bit: "), tr("Creation date: "), tr("Expiration date: ")};
+        String[] labels = {tr("Primary user-ID: "), tr("Key-ID: "), tr("Fingerprint: "), tr("Algorithm: "),
+                tr("Strength in bit: "), tr("Creation date: "), tr("Expiration date: ")};
         String[] values = {userid, keyid, fingerprint, algorithm, strength, creationTime, expirationTime};
         int numPairs = labels.length;
@@ -709,5 +693,5 @@
         //        metaPanel.add(p);
         //        JScrollPane sp = new JScrollPane(new KeySignaturesDialog(key));
-        //        sp.setPreferredSize(new Dimension(0,200));
+        //        sp.setPreferredSize(new Dimension(0, 200));
         //        metaPanel.add(sp);
 
@@ -715,6 +699,6 @@
     }
 
-
-    public PGPSecretKey generateKey() throws NoSuchAlgorithmException, NoSuchProviderException, PGPException, FileNotFoundException, IOException {
+    public PGPSecretKey generateKey()
+            throws NoSuchAlgorithmException, NoSuchProviderException, PGPException, FileNotFoundException, IOException {
 
         JTextField userId = new JTextField();
@@ -727,8 +711,17 @@
         strengthBox.setEnabled(false);
 
-        /*        final String[] curves = {"prime192v1", "prime192v2", "prime192v3", "prime239v1", "prime239v2", "prime239v3", "prime256v1", "secp224r1", "secp256r1", "secp384r1", "secp521r1", "P-224", "P-256", "P-384", "P-521", "c2pnb163v1", "c2pnb163v2", "c2pnb163v3", "c2pnb176w1", "c2tnb191v2", "c2tnb191v1", "c2tnb191v3", "c2pnb208w1", "c2tnb239v1", "c2tnb239v2", "c2tnb239v3", "c2pnb272w1", "c2pnb304w1", "c2tnb359v1", "c2pnb368w1", "c2tnb431r1", "sect163r2", "sect233r1", "sect283r1", "sect409r1", "sect571r1", "B-163", "B-233", "B-283", "B-409", "B-571", "brainpoolp160r1", "brainpoolp160t1", "brainpoolp192r1", "brainpoolp192t1", "brainpoolp224r1", "brainpoolp224t1", "brainpoolp256r1", "brainpoolp256t1", "brainpoolp320r1", "brainpoolp320t1", "brainpoolp384r1", "brainpoolp384t1", "brainpoolp512r1", "brainpoolp512t1"};
-        final String[] curvesizes = {"192", "192", "192", "239", "239", "239", "256", "224", "256", "384", "521", "224", "256", "384", "521", "163", "163", "163", "176", "191", "191", "191", "208", "239", "239", "239", "272", "304", "359", "368", "431", "163", "233", "283", "409", "571", "163", "233", "283", "409", "571", "160", "160", "192", "192", "224", "224", "256", "256", "320", "320", "384", "384", "512", "512"};
+        /* final String[] curves = {"prime192v1", "prime192v2", "prime192v3", "prime239v1", "prime239v2", "prime239v3", "prime256v1",
+           "secp224r1", "secp256r1", "secp384r1", "secp521r1", "P-224", "P-256", "P-384", "P-521", "c2pnb163v1", "c2pnb163v2", "c2pnb163v3",
+           "c2pnb176w1", "c2tnb191v2", "c2tnb191v1", "c2tnb191v3", "c2pnb208w1", "c2tnb239v1", "c2tnb239v2", "c2tnb239v3", "c2pnb272w1",
+           "c2pnb304w1", "c2tnb359v1", "c2pnb368w1", "c2tnb431r1", "sect163r2", "sect233r1", "sect283r1", "sect409r1", "sect571r1",
+           "B-163", "B-233", "B-283", "B-409", "B-571", "brainpoolp160r1", "brainpoolp160t1", "brainpoolp192r1", "brainpoolp192t1",
+           "brainpoolp224r1", "brainpoolp224t1", "brainpoolp256r1", "brainpoolp256t1", "brainpoolp320r1", "brainpoolp320t1", "brainpoolp384r1",
+           "brainpoolp384t1", "brainpoolp512r1", "brainpoolp512t1"};
+        final String[] curvesizes = {"192", "192", "192", "239", "239", "239", "256", "224", "256", "384", "521", "224", "256", "384", "521",
+            "163", "163", "163", "176", "191", "191", "191", "208", "239", "239", "239", "272", "304", "359", "368", "431", "163", "233",
+            "283", "409", "571", "163", "233", "283", "409", "571", "160", "160", "192", "192", "224", "224", "256", "256", "320", "320",
+            "384", "384", "512", "512"};
         final JComboBox curveBox = new JComboBox(curves);
-        curveBox.addActionListener(new ActionListener(){
+        curveBox.addActionListener(new ActionListener() {
 
             @Override
@@ -740,12 +733,12 @@
 
         //        final String[] algos = {"DSA","RSA","ECDSA"};
-        final String[] algos = {"DSA","RSA"};
+        final String[] algos = {"DSA", "RSA"};
         final JComboBox<?> algoBox = new JComboBox<Object>(algos);
-        algoBox.addActionListener(new ActionListener(){
+        algoBox.addActionListener(new ActionListener() {
 
             @Override
             public void actionPerformed(ActionEvent e) {
-                JComboBox<?> cb = (JComboBox<?>)e.getSource();
-                String alg = (String)cb.getSelectedItem();
+                JComboBox<?> cb = (JComboBox<?>) e.getSource();
+                String alg = (String) cb.getSelectedItem();
                 if (alg.equals("DSA")) {
                     strengthBox.setSelectedItem("1024");
@@ -766,16 +759,16 @@
         });
 
-
-
-
-
-        final String[] protectAlgos = {"AES_256", "AES_192", "AES_128", "BLOWFISH", "CAST5", "DES", "IDEA", "SAFER", "TRIPLE_DES", "TWOFISH", "NULL"};
-        int[] protAl = {PGPEncryptedData.AES_256, PGPEncryptedData.AES_192, PGPEncryptedData.AES_128, PGPEncryptedData.BLOWFISH, PGPEncryptedData.CAST5, PGPEncryptedData.DES, PGPEncryptedData.IDEA, PGPEncryptedData.SAFER, PGPEncryptedData.TRIPLE_DES, PGPEncryptedData.TWOFISH, PGPEncryptedData.NULL};
+        final String[] protectAlgos = {"AES_256", "AES_192", "AES_128", "BLOWFISH",
+                "CAST5", "DES", "IDEA", "SAFER", "TRIPLE_DES", "TWOFISH", "NULL"};
+        int[] protAl = {PGPEncryptedData.AES_256, PGPEncryptedData.AES_192, PGPEncryptedData.AES_128, PGPEncryptedData.BLOWFISH,
+                PGPEncryptedData.CAST5, PGPEncryptedData.DES, PGPEncryptedData.IDEA, PGPEncryptedData.SAFER, PGPEncryptedData.TRIPLE_DES,
+                PGPEncryptedData.TWOFISH, PGPEncryptedData.NULL};
         final JComboBox<?> protectBox = new JComboBox<Object>(protectAlgos);
 
         final JDateChooser cal = new JDateChooser(null, null, null, new JSpinnerDateEditor());
-        cal.setPreferredSize(new Dimension(130,cal.getPreferredSize().height));
-
-        final String[] labels = {tr("User-ID:"), tr("Select algorithm:"), tr("Choose Bitlength (Strength):"), tr("Encryption algorithm to protect private key:"), tr("Choose an expiry date for the key:")};
+        cal.setPreferredSize(new Dimension(130, cal.getPreferredSize().height));
+
+        final String[] labels = {tr("User-ID:"), tr("Select algorithm:"), tr("Choose Bitlength (Strength):"),
+                tr("Encryption algorithm to protect private key:"), tr("Choose an expiry date for the key:")};
         final JComponent[] values = {userId, algoBox, strengthBox, protectBox, cal};
 
@@ -795,7 +788,8 @@
                 numPairs, 2, //rows, cols
                 6, 6,        //initX, initY
-                16, 6);       //xPad, yPad
-
-        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Create a new signing key"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
+                16, 6);      //xPad, yPad
+
+        int n = JOptionPane.showOptionDialog(Main.parent, p, tr("Create a new signing key"),
+                JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
 
         if (n != JOptionPane.OK_OPTION)
@@ -803,5 +797,5 @@
 
 
-        String algo = (String)algoBox.getSelectedItem();
+        String algo = (String) algoBox.getSelectedItem();
 
         KeyPairGenerator Kpg = KeyPairGenerator.getInstance(algo, "BC");
@@ -820,5 +814,5 @@
         }
         else {*/
-        Kpg.initialize(Integer.parseInt((String)strengthBox.getSelectedItem()));
+        Kpg.initialize(Integer.parseInt((String) strengthBox.getSelectedItem()));
         //
         // this takes a while as the key generator has to generate some DSA params
@@ -853,5 +847,5 @@
         PBESecretKeyEncryptor encryptor = new JcePBESecretKeyEncryptorBuilder(encAlgorithm).setProvider(provider).
                 setSecureRandom(new SecureRandom()).build(password);
-        
+
         PGPKeyRingGenerator keyRingGen = new PGPKeyRingGenerator(PGPSignature.POSITIVE_CERTIFICATION, pgpKp, userId.getText(),
                 checksumCalculator, subPck, null, signerBuilder, encryptor);
Index: /applications/editors/josm/plugins/trustosm/src/tools/NameGenerator.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/tools/NameGenerator.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/tools/NameGenerator.java	(revision 32533)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package tools;
 
@@ -53,6 +54,8 @@
     ArrayList<String> sur = new ArrayList<>();
 
-    final private static char[] vocals = {'a', 'e', 'i', 'o', 'u', 'ä', 'ö', 'õ', 'ü', 'y'};
-    final private static char[] consonants = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p',    'q', 'r', 's', 't', 'v', 'w', 'x', 'y'};
+    private static final char[] vocals = {
+            'a', 'e', 'i', 'o', 'u', 'ä', 'ö', 'õ', 'ü', 'y'};
+    private static final char[] consonants = {
+            'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y'};
 
     private String fileName;
@@ -61,7 +64,6 @@
      * Create new random name generator object. refresh() is automatically called.
      * @param fileName insert file name, where syllables are located
-     * @throws IOException
-     */
-    public NameGenerator(String fileName) throws IOException{
+     */
+    public NameGenerator(String fileName) throws IOException {
         this.fileName = fileName;
         refresh();
@@ -71,8 +73,7 @@
      * Change the file. refresh() is automatically called during the process.
      * @param fileName insert the file name, where syllables are located.
-     * @throws IOException
-     */
-    public void changeFile(String fileName) throws IOException{
-        if(fileName == null) throw new IOException("File name cannot be null");
+     */
+    public void changeFile(String fileName) throws IOException {
+        if (fileName == null) throw new IOException("File name cannot be null");
         this.fileName = fileName;
         refresh();
@@ -82,12 +83,11 @@
      * Refresh names from file. No need to call that method, if you are not changing the file during the operation of program, as this method
      * is called every time file name is changed or new NameGenerator object created.
-     * @throws IOException
-     */
-    public void refresh() throws IOException{
+     */
+    public void refresh() throws IOException {
         try (
-            FileReader input = new FileReader(fileName);
-            BufferedReader bufRead = new BufferedReader(input);
-        ) {
-            String line="";
+                FileReader input = new FileReader(fileName);
+                BufferedReader bufRead = new BufferedReader(input);
+                ) {
+            String line = "";
 
             while (line != null) {
@@ -98,5 +98,5 @@
                     } else if (line.charAt(0) == '+') {
                         sur.add(line.substring(1).toLowerCase());
-                    } else{
+                    } else {
                         mid.add(line.toLowerCase());
                     }
@@ -107,5 +107,5 @@
 
     private String upper(String s) {
-        return s.substring(0,1).toUpperCase().concat(s.substring(1));
+        return s.substring(0, 1).toUpperCase().concat(s.substring(1));
     }
 
@@ -117,64 +117,68 @@
     }
 
-    private boolean containsVocFirst(ArrayList<String> array){
-        for(String s: array){
-            if(vocalFirst(s)) return true;
-        }
-        return false;
-    }
-
-    private boolean allowCons(ArrayList<String> array){
-        for(String s: array){
-            if(hatesPreviousVocals(s) || hatesPreviousConsonants(s) == false) return true;
-        }
-        return false;
-    }
-
-    private boolean allowVocs(ArrayList<String> array){
-        for(String s: array){
-            if(hatesPreviousConsonants(s) || hatesPreviousVocals(s) == false) return true;
-        }
-        return false;
-    }
-
-    private boolean expectsVocal(String s){
-        if(s.substring(1).contains("+v")) return true;
-        else return false;
-    }
-    private boolean expectsConsonant(String s){
-        if(s.substring(1).contains("+c")) return true;
-        else return false;
-    }
-    private boolean hatesPreviousVocals(String s){
-        if(s.substring(1).contains("-c")) return true;
-        else return false;
-    }
-    private boolean hatesPreviousConsonants(String s){
-        if(s.substring(1).contains("-v")) return true;
-        else return false;
-    }
-
-    private String pureSyl(String s){
+    private boolean containsVocFirst(ArrayList<String> array) {
+        for (String s: array) {
+            if (vocalFirst(s)) return true;
+        }
+        return false;
+    }
+
+    private boolean allowCons(ArrayList<String> array) {
+        for (String s: array) {
+            if (hatesPreviousVocals(s) || hatesPreviousConsonants(s) == false) return true;
+        }
+        return false;
+    }
+
+    private boolean allowVocs(ArrayList<String> array) {
+        for (String s: array) {
+            if (hatesPreviousConsonants(s) || hatesPreviousVocals(s) == false) return true;
+        }
+        return false;
+    }
+
+    private boolean expectsVocal(String s) {
+        if (s.substring(1).contains("+v")) return true;
+        else return false;
+    }
+
+    private boolean expectsConsonant(String s) {
+        if (s.substring(1).contains("+c")) return true;
+        else return false;
+    }
+
+    private boolean hatesPreviousVocals(String s) {
+        if (s.substring(1).contains("-c")) return true;
+        else return false;
+    }
+
+    private boolean hatesPreviousConsonants(String s) {
+        if (s.substring(1).contains("-v")) return true;
+        else return false;
+    }
+
+    private String pureSyl(String s) {
         s = s.trim();
-        if(s.charAt(0) == '+' || s.charAt(0) == '-') s = s.substring(1);
+        if (s.charAt(0) == '+' || s.charAt(0) == '-') s = s.substring(1);
         return s.split(" ")[0];
     }
 
-    private boolean vocalFirst(String s){
+    private boolean vocalFirst(String s) {
         return (String.copyValueOf(vocals).contains(String.valueOf(s.charAt(0)).toLowerCase()));
     }
 
-    private boolean consonantFirst(String s){
+    private boolean consonantFirst(String s) {
         return (String.copyValueOf(consonants).contains(String.valueOf(s.charAt(0)).toLowerCase()));
     }
 
-    private boolean vocalLast(String s){
+    private boolean vocalLast(String s) {
         return (String.copyValueOf(vocals).contains(String.valueOf(s.charAt(s.length()-1)).toLowerCase()));
     }
 
-    private boolean consonantLast(String s){
+    private boolean consonantLast(String s) {
         return (String.copyValueOf(consonants).contains(String.valueOf(s.charAt(s.length()-1)).toLowerCase()));
     }
 
+    // CHECKSTYLE.OFF: LineLength
 
     /**
@@ -184,109 +188,110 @@
      * @throws RuntimeException when logical mistakes are detected inside chosen file, and program is unable to complete the name.
      */
-    public String compose(int syls){
-        if(syls > 2 && mid.size() == 0) throw new RuntimeException("You are trying to create a name with more than 3 parts, which requires middle parts, " +
-                "which you have none in the file "+fileName+". You should add some. Every word, which doesn't have + or - for a prefix is counted as a middle part.");
-        if(pre.size() == 0) throw new RuntimeException("You have no prefixes to start creating a name. add some and use \"-\" prefix, to identify it as a prefix for a name. (example: -asd)");
-        if(sur.size() == 0) throw new RuntimeException("You have no suffixes to end a name. add some and use \"+\" prefix, to identify it as a suffix for a name. (example: +asd)");
-        if(syls < 1) throw new RuntimeException("compose(int syls) can't have less than 1 syllable");
+    public String compose(int syls) {
+        if (syls > 2 && mid.size() == 0)
+            throw new RuntimeException("You are trying to create a name with more than 3 parts, which requires middle parts, " +
+                    "which you have none in the file "+fileName+". You should add some. Every word, which doesn't have + or - for a prefix is counted as a middle part.");
+        if (pre.size() == 0)
+            throw new RuntimeException("You have no prefixes to start creating a name. add some and use \"-\" prefix, to identify it as a prefix for a name. (example: -asd)");
+        if (sur.size() == 0)
+            throw new RuntimeException("You have no suffixes to end a name. add some and use \"+\" prefix, to identify it as a suffix for a name. (example: +asd)");
+        if (syls < 1) throw new RuntimeException("compose(int syls) can't have less than 1 syllable");
         int expecting = 0; // 1 for vocal, 2 for consonant
         int last = 0; // 1 for vocal, 2 for consonant
         String name;
-        int a = (int)(Math.random() * pre.size());
-
-        if(vocalLast(pureSyl(pre.get(a)))) last = 1;
+        int a = (int) (Math.random() * pre.size());
+
+        if (vocalLast(pureSyl(pre.get(a)))) last = 1;
         else last = 2;
 
-        if(syls > 2){
-            if(expectsVocal(pre.get(a))){
+        if (syls > 2) {
+            if (expectsVocal(pre.get(a))) {
                 expecting = 1;
-                if(containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(expectsConsonant(pre.get(a))){
+                if (containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (expectsConsonant(pre.get(a))) {
                 expecting = 2;
-                if(containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-        }
-        else{
-            if(expectsVocal(pre.get(a))){
+                if (containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+        } else {
+            if (expectsVocal(pre.get(a))) {
                 expecting = 1;
-                if(containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(expectsConsonant(pre.get(a))){
+                if (containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (expectsConsonant(pre.get(a))) {
                 expecting = 2;
-                if(containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-        }
-        if(vocalLast(pureSyl(pre.get(a))) && allowVocs(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a vocal, " +
+                if (containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+        }
+        if (vocalLast(pureSyl(pre.get(a))) && allowVocs(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a vocal, " +
                 "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the prefix used, was : \""+pre.get(a)+"\", which" +
-        "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
-
-        if(consonantLast(pureSyl(pre.get(a))) && allowCons(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a consonant, " +
+                "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
+
+        if (consonantLast(pureSyl(pre.get(a))) && allowCons(mid) == false) throw new RuntimeException("Expecting \"middle\" part that allows last character of prefix to be a consonant, " +
                 "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the prefix used, was : \""+pre.get(a)+"\", which" +
-        "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
-
-        int b[] = new int[syls];
-        for(int i = 0; i<b.length-2; i++){
-
-            do{
-                b[i] = (int)(Math.random() * mid.size());
+                "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
+
+        int[] b = new int[syls];
+        for (int i = 0; i < b.length-2; i++) {
+
+            do {
+                b[i] = (int) (Math.random() * mid.size());
                 //System.out.println("exp " +expecting+" vocalF:"+vocalFirst(mid.get(b[i]))+" syl: "+mid.get(b[i]));
-            }
-            while(expecting == 1 && vocalFirst(pureSyl(mid.get(b[i]))) == false || expecting == 2 && consonantFirst(pureSyl(mid.get(b[i]))) == false
+            } while (expecting == 1 && vocalFirst(pureSyl(mid.get(b[i]))) == false || expecting == 2 && consonantFirst(pureSyl(mid.get(b[i]))) == false
                     || last == 1 && hatesPreviousVocals(mid.get(b[i])) || last == 2 && hatesPreviousConsonants(mid.get(b[i])));
 
             expecting = 0;
-            if(expectsVocal(mid.get(b[i]))){
+            if (expectsVocal(mid.get(b[i]))) {
                 expecting = 1;
-                if(i < b.length-3 && containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-                if(i == b.length-3 && containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(expectsConsonant(mid.get(b[i]))){
+                if (i < b.length-3 && containsVocFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+                if (i == b.length-3 && containsVocFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with vocal, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (expectsConsonant(mid.get(b[i]))) {
                 expecting = 2;
-                if(i < b.length-3 && containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-                if(i == b.length-3 && containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
-                "but there is none. You should add one, or remove requirement for one.. ");
-            }
-            if(vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a vocal, " +
+                if (i < b.length-3 && containsConsFirst(mid) == false) throw new RuntimeException("Expecting \"middle\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+                if (i == b.length-3 && containsConsFirst(sur) == false) throw new RuntimeException("Expecting \"suffix\" part starting with consonant, " +
+                        "but there is none. You should add one, or remove requirement for one.. ");
+            }
+            if (vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a vocal, " +
                     "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-            "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
-
-            if(consonantLast(pureSyl(mid.get(b[i]))) && allowCons(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a consonant, " +
+                    "means there should be a part available, that has \"-v\" requirement or no requirements for previous syllables at all.");
+
+            if (consonantLast(pureSyl(mid.get(b[i]))) && allowCons(mid) == false && syls > 3) throw new RuntimeException("Expecting \"middle\" part that allows last character of last syllable to be a consonant, " +
                     "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-            "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
-            if(i == b.length-3){
-                if(vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a vocal, " +
+                    "means there should be a part available, that has \"-c\" requirement or no requirements for previous syllables at all.");
+            if (i == b.length-3) {
+                if (vocalLast(pureSyl(mid.get(b[i]))) && allowVocs(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a vocal, " +
                         "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-                "means there should be a suffix available, that has \"-v\" requirement or no requirements for previous syllables at all.");
-
-                if(consonantLast(pureSyl(mid.get(b[i]))) && allowCons(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a consonant, " +
+                        "means there should be a suffix available, that has \"-v\" requirement or no requirements for previous syllables at all.");
+
+                if (consonantLast(pureSyl(mid.get(b[i]))) && allowCons(sur) == false) throw new RuntimeException("Expecting \"suffix\" part that allows last character of last syllable to be a consonant, " +
                         "but there is none. You should add one, or remove requirements that cannot be fulfilled.. the part used, was : \""+mid.get(b[i])+"\", which " +
-                "means there should be a suffix available, that has \"-c\" requirement or no requirements for previous syllables at all.");
-            }
-            if(vocalLast(pureSyl(mid.get(b[i])))) last = 1;
+                        "means there should be a suffix available, that has \"-c\" requirement or no requirements for previous syllables at all.");
+            }
+            if (vocalLast(pureSyl(mid.get(b[i])))) last = 1;
             else last = 2;
         }
 
         int c;
-        do{
-            c = (int)(Math.random() * sur.size());
-        }
-        while(expecting == 1 && vocalFirst(pureSyl(sur.get(c))) == false || expecting == 2 && consonantFirst(pureSyl(sur.get(c))) == false
+        do {
+            c = (int) (Math.random() * sur.size());
+        } while (expecting == 1 && vocalFirst(pureSyl(sur.get(c))) == false || expecting == 2 && consonantFirst(pureSyl(sur.get(c))) == false
                 || last == 1 && hatesPreviousVocals(sur.get(c)) || last == 2 && hatesPreviousConsonants(sur.get(c)));
 
         name = upper(pureSyl(pre.get(a).toLowerCase()));
-        for(int i = 0; i<b.length-2; i++){
+        for (int i = 0; i < b.length-2; i++) {
             name = name.concat(pureSyl(mid.get(b[i]).toLowerCase()));
         }
-        if(syls > 1)
+        if (syls > 1)
             name = name.concat(pureSyl(sur.get(c).toLowerCase()));
         return name;
     }
+    // CHECKSTYLE.ON: LineLength
 }
Index: /applications/editors/josm/plugins/trustosm/src/tools/SpringUtilities.java
===================================================================
--- /applications/editors/josm/plugins/trustosm/src/tools/SpringUtilities.java	(revision 32532)
+++ /applications/editors/josm/plugins/trustosm/src/tools/SpringUtilities.java	(revision 32533)
@@ -28,11 +28,13 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */ 
+ */
 
 package tools;
 
-import javax.swing.*;
+import java.awt.Component;
+import java.awt.Container;
+
+import javax.swing.Spring;
 import javax.swing.SpringLayout;
-import java.awt.*;
 
 /**
@@ -42,5 +44,10 @@
  * SpringBox and SpringCompactGrid.
  */
-public class SpringUtilities {
+public final class SpringUtilities {
+
+    private SpringUtilities() {
+        // Hide default constructors for utilities classes
+    }
+
     /**
      * A debugging utility that prints to stdout the component's
@@ -73,5 +80,5 @@
         SpringLayout layout;
         try {
-            layout = (SpringLayout)parent.getLayout();
+            layout = (SpringLayout) parent.getLayout();
         } catch (ClassCastException exc) {
             System.err.println("The first argument to makeGrid must use SpringLayout.");
@@ -176,5 +183,5 @@
         SpringLayout layout;
         try {
-            layout = (SpringLayout)parent.getLayout();
+            layout = (SpringLayout) parent.getLayout();
         } catch (ClassCastException exc) {
             System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
