Index: applications/editors/josm/plugins/imagery-xml-bounds/.project
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/.project	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/.project	(revision 30735)
@@ -13,4 +13,5 @@
 	</buildSpec>
 	<natures>
+		<nature>org.sonar.ide.eclipse.core.sonarNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
Index: applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.eclipse.jdt.core.prefs	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.eclipse.jdt.core.prefs	(revision 30735)
@@ -1,3 +1,4 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
@@ -6,4 +7,5 @@
 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -12,4 +14,5 @@
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
@@ -23,5 +26,5 @@
 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
@@ -35,4 +38,9 @@
 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -41,4 +49,12 @@
 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
@@ -48,4 +64,5 @@
 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
 org.eclipse.jdt.core.compiler.problem.nullReference=warning
@@ -60,5 +77,5 @@
 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
@@ -68,4 +85,5 @@
 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
@@ -91,4 +109,5 @@
 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
Index: applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.eclipse.jdt.ui.prefs	(revision 30735)
+++ applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.eclipse.jdt.ui.prefs	(revision 30735)
@@ -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=false
+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/imagery-xml-bounds/.settings/org.sonar.ide.eclipse.core.prefs
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.sonar.ide.eclipse.core.prefs	(revision 30735)
+++ applications/editors/josm/plugins/imagery-xml-bounds/.settings/org.sonar.ide.eclipse.core.prefs	(revision 30735)
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+extraProperties=
+lastAnalysisDate=1413655063823
+projectKey=josm-plugins
+serverUrl=http\://donvip.fr/sonar
+version=2
Index: applications/editors/josm/plugins/imagery-xml-bounds/build.xml
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/build.xml	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/build.xml	(revision 30735)
@@ -5,5 +5,5 @@
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="7248"/>
-	
+    
     <!-- Configure these properties (replace "..." accordingly).
          See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlEditorKit.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlEditorKit.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlEditorKit.java	(revision 30735)
@@ -19,9 +19,7 @@
 import javax.swing.text.ViewFactory;
 
-
 /**
  * @author kees
  * @date 12-jan-2006
- *
  */
 public class XmlEditorKit extends StyledEditorKit {
@@ -30,8 +28,11 @@
     private ViewFactory xmlViewFactory;
 
+    /**
+     * Constructs a new {@code XmlEditorKit}.
+     */
     public XmlEditorKit() {
         xmlViewFactory = new XmlViewFactory();
     }
-    
+
     @Override
     public ViewFactory getViewFactory() {
@@ -43,5 +44,3 @@
         return "text/xml";
     }
-
-    
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlTextPane.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlTextPane.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlTextPane.java	(revision 30735)
@@ -24,11 +24,9 @@
 import javax.swing.text.BadLocationException;
 
-import net.boplicity.xmleditor.XmlEditorKit;
-
 
 /**
  * JTextPane implementation that can handle xml text. The IndentKeyListener
  * implements smart indenting.
- *  
+ *
  * @author kees
  * @date 27-jan-2006
@@ -37,91 +35,93 @@
 public class XmlTextPane extends JTextPane {
 
-    private static final long serialVersionUID = 6270183148379328084L;
-    private Logger logger = Logger.getLogger(getClass().getName());
+    private static final Logger LOGGER = Logger.getLogger(XmlTextPane.class.getName());
+    private static final Character NEW_LINE = '\n';
 
+    /**
+     * Constructs a new {@code XmlTextPane}.
+     */
     public XmlTextPane() {
-        
+
         // Set editor kit
         this.setEditorKitForContentType("text/xml", new XmlEditorKit());
         this.setContentType("text/xml");
-        
+
         addKeyListener(new IndentKeyListener());
     }
-    
-	private class IndentKeyListener implements KeyListener {
 
-		private boolean enterFlag;
-		private final Character NEW_LINE = '\n';
+    private class IndentKeyListener implements KeyListener {
 
-		public void keyPressed(KeyEvent event) {
-			enterFlag = false;
-			if ((event.getKeyCode() == KeyEvent.VK_ENTER)
-					&& (event.getModifiers() == 0)) {
-				if (getSelectionStart() == getSelectionEnd()) {
-					enterFlag = true;
-					event.consume();
-				}
-			}
-		}
+        private boolean enterFlag;
 
-		public void keyReleased(KeyEvent event) {
-			if ((event.getKeyCode() == KeyEvent.VK_ENTER)
-					&& (event.getModifiers() == 0)) {
-				if (enterFlag) {
-					event.consume();
+        @Override
+        public void keyPressed(KeyEvent event) {
+            enterFlag = false;
+            if ((event.getKeyCode() == KeyEvent.VK_ENTER)
+                && (event.getModifiers() == 0)
+                && getSelectionStart() == getSelectionEnd()) {
+                enterFlag = true;
+                event.consume();
+            }
+        }
 
-					int start, end;
-					String text = getText();
+        @Override
+        public void keyReleased(KeyEvent event) {
+            if ((event.getKeyCode() == KeyEvent.VK_ENTER)
+                && (event.getModifiers() == 0) && enterFlag) {
+                event.consume();
 
-					int caretPosition = getCaretPosition();
-					try {
-						if (text.charAt(caretPosition) == NEW_LINE) {
-							caretPosition--;
-						}
-					} catch (IndexOutOfBoundsException e) {
-					}
+                int start, end;
+                String text = getText();
 
-					start = text.lastIndexOf(NEW_LINE, caretPosition) + 1;
-					end = start;
-					try {
-						if (text.charAt(start) != NEW_LINE) {
-							while ((end < text.length())
-									&& (Character
-											.isWhitespace(text.charAt(end)))
-									&& (text.charAt(end) != NEW_LINE)) {
-								end++;
-							}
-							if (end > start) {
-								getDocument()
-										.insertString(
-												getCaretPosition(),
-												NEW_LINE
-														+ text.substring(start,
-																end), null);
-							} else {
-								getDocument().insertString(getCaretPosition(),
-										NEW_LINE.toString(), null);
-							}
-						} else {
-							getDocument().insertString(getCaretPosition(),
-									NEW_LINE.toString(), null);
-						}
-					} catch (IndexOutOfBoundsException e) {
-						try {
-							getDocument().insertString(getCaretPosition(),
-									NEW_LINE.toString(), null);
-						} catch (BadLocationException e1) {
-							logger.log(Level.WARNING, e1.toString());
-						}
-					} catch (BadLocationException e) {
-						logger.log(Level.WARNING, e.toString());
-					}
-				}
-			}
-		}
+                int caretPosition = getCaretPosition();
+                try {
+                    if (text.charAt(caretPosition) == NEW_LINE) {
+                        caretPosition--;
+                    }
+                } catch (IndexOutOfBoundsException e) {
+                    LOGGER.log(Level.FINE, e.toString());
+                }
 
-		public void keyTyped(KeyEvent e) {
-		}
-	}
-    
+                start = text.lastIndexOf(NEW_LINE, caretPosition) + 1;
+                end = start;
+                try {
+                    if (text.charAt(start) != NEW_LINE) {
+                        while ((end < text.length())
+                                && (Character.isWhitespace(text.charAt(end)))
+                                && (text.charAt(end) != NEW_LINE)) {
+                            end++;
+                        }
+                        if (end > start) {
+                            getDocument()
+                                    .insertString(
+                                            getCaretPosition(),
+                                            NEW_LINE
+                                                    + text.substring(start,
+                                                            end), null);
+                        } else {
+                            getDocument().insertString(getCaretPosition(),
+                                    NEW_LINE.toString(), null);
+                        }
+                    } else {
+                        getDocument().insertString(getCaretPosition(),
+                                NEW_LINE.toString(), null);
+                    }
+                } catch (IndexOutOfBoundsException e) {
+                    try {
+                        getDocument().insertString(getCaretPosition(),
+                                NEW_LINE.toString(), null);
+                    } catch (BadLocationException e1) {
+                        LOGGER.log(Level.WARNING, e1.toString());
+                    }
+                } catch (BadLocationException e) {
+                    LOGGER.log(Level.WARNING, e.toString());
+                }
+            }
+        }
+
+        @Override
+        public void keyTyped(KeyEvent e) {
+            // Do nothing
+        }
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java	(revision 30735)
@@ -18,5 +18,4 @@
 import java.awt.Color;
 import java.awt.Graphics;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -47,5 +46,5 @@
 public class XmlView extends PlainView {
 
-    private static HashMap<Pattern, Color> patternColors;
+    private static Map<Pattern, Color> patternColors;
     private static String GENERIC_XML_NAME = "[A-Za-z]+[A-Za-z0-9\\-_]*(:[A-Za-z]+[A-Za-z0-9\\-_]+)?";
     private static String TAG_PATTERN = "(</?" + GENERIC_XML_NAME + ")";
@@ -58,5 +57,5 @@
     static {
         // NOTE: the order is important!
-        patternColors = new LinkedHashMap<Pattern, Color>();
+        patternColors = new LinkedHashMap<>();
         patternColors
                 .put(Pattern.compile(TAG_PATTERN), new Color(63, 127, 127));
@@ -71,4 +70,8 @@
     }
 
+    /**
+     * Constructs a new {@code XmlView}.
+     * @param element the element
+     */
     public XmlView(Element element) {
 
@@ -80,6 +83,6 @@
 
     @Override
-    protected int drawUnselectedText(Graphics graphics, int x, int y, int p0,
-            int p1) throws BadLocationException {
+    protected int drawUnselectedText(Graphics graphics, int x, int y, int p0, int p1)
+            throws BadLocationException {
 
         Document doc = getDocument();
@@ -88,6 +91,6 @@
         Segment segment = getLineBuffer();
 
-        SortedMap<Integer, Integer> startMap = new TreeMap<Integer, Integer>();
-        SortedMap<Integer, Color> colorMap = new TreeMap<Integer, Color>();
+        SortedMap<Integer, Integer> startMap = new TreeMap<>();
+        SortedMap<Integer, Color> colorMap = new TreeMap<>();
 
         // Match all regexes on this snippet, store positions
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlViewFactory.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlViewFactory.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlViewFactory.java	(revision 30735)
@@ -20,5 +20,4 @@
 import javax.swing.text.ViewFactory;
 
-
 /**
  * @author kees
@@ -28,11 +27,7 @@
 public class XmlViewFactory extends Object implements ViewFactory {
 
-    /**
-     * @see javax.swing.text.ViewFactory#create(javax.swing.text.Element)
-     */
+    @Override
     public View create(Element element) {
-
         return new XmlView(element);
     }
-
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java	(revision 30735)
@@ -30,5 +30,5 @@
      * Action showing bounds of the selected closed ways in Selection dialog 
      */
-	private final ShowBoundsAction selectionListAction = new ShowBoundsAction();
+    private final ShowBoundsAction selectionListAction = new ShowBoundsAction();
 
     /**
@@ -37,36 +37,36 @@
     private final ShowBoundsAction propertiesListAction = new ShowBoundsAction();
     
-	/**
+    /**
      * Action showing bounds of the selected multipolygons in Relations dialog
      */
-	private final ShowBoundsAction relationListAction = new ShowBoundsAction();
+    private final ShowBoundsAction relationListAction = new ShowBoundsAction();
 
     /**
      * Action showing bounds of the current selection
      */
-	private final ShowBoundsSelectionAction selectionAction = new ShowBoundsSelectionAction();
-	
-	/**
-	 * Class modifying the Imagery preferences panel
-	 */
-	private final XmlBoundsPreferenceSetting preferenceSetting = new XmlBoundsPreferenceSetting();
-	
-	/**
-	 * Initializes the plugin.
-	 * @param info
-	 */
-	public ImageryXmlBoundsPlugin(PluginInformation info) {
-		super(info);
-		// Allow JOSM to import *.imagery.xml files
-		ExtensionFileFilter.importers.add(0, new XmlBoundsImporter());
+    private final ShowBoundsSelectionAction selectionAction = new ShowBoundsSelectionAction();
+    
+    /**
+     * Class modifying the Imagery preferences panel
+     */
+    private final XmlBoundsPreferenceSetting preferenceSetting = new XmlBoundsPreferenceSetting();
+    
+    /**
+     * Initializes the plugin.
+     * @param info
+     */
+    public ImageryXmlBoundsPlugin(PluginInformation info) {
+        super(info);
+        // Allow JOSM to import *.imagery.xml files
+        ExtensionFileFilter.importers.add(0, new XmlBoundsImporter());
         // Allow JOSM to export *.imagery.xml files
-		ExtensionFileFilter.exporters.add(0, new XmlBoundsExporter());
+        ExtensionFileFilter.exporters.add(0, new XmlBoundsExporter());
         // Initialize the selection action
-		DataSet.addSelectionListener(selectionAction);
-		Main.toolbar.register(selectionAction);
-		// Allow JOSM to download *.imagery.xml files
-		Main.main.menu.openLocation.addDownloadTaskClass(DownloadXmlBoundsTask.class);
-	}
-	
+        DataSet.addSelectionListener(selectionAction);
+        Main.toolbar.register(selectionAction);
+        // Allow JOSM to download *.imagery.xml files
+        Main.main.menu.openLocation.addDownloadTaskClass(DownloadXmlBoundsTask.class);
+    }
+    
     @Override
     public PreferenceSetting getPreferenceSetting() {
@@ -74,26 +74,26 @@
     }
 
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (newFrame != null) {
-		    // Initialize dialogs actions only after the main frame is created 
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (newFrame != null) {
+            // Initialize dialogs actions only after the main frame is created 
             newFrame.selectionListDialog.getPopupMenuHandler().addSeparator();
             newFrame.selectionListDialog.getPopupMenuHandler().addAction(selectionListAction);
             newFrame.propertiesDialog.getMembershipPopupMenuHandler().addSeparator();
             newFrame.propertiesDialog.getMembershipPopupMenuHandler().addAction(propertiesListAction);
-			newFrame.relationListDialog.getPopupMenuHandler().addSeparator();
-			newFrame.relationListDialog.getPopupMenuHandler().addAction(relationListAction);
-		} else if (oldFrame != null) {
+            newFrame.relationListDialog.getPopupMenuHandler().addSeparator();
+            newFrame.relationListDialog.getPopupMenuHandler().addAction(relationListAction);
+        } else if (oldFrame != null) {
             // Remove listeners from previous frame to avoid memory leaks
-		    if (oldFrame.relationListDialog != null) {
-		        oldFrame.relationListDialog.getPopupMenuHandler().removeAction(relationListAction);
-		    }
-		    if (oldFrame.propertiesDialog != null) {
-		        oldFrame.propertiesDialog.getMembershipPopupMenuHandler().removeAction(propertiesListAction);
-		    }
-		    if (oldFrame.selectionListDialog != null) {
-		        oldFrame.selectionListDialog.getPopupMenuHandler().removeAction(selectionListAction);
-		    }
-		}
-	}
+            if (oldFrame.relationListDialog != null) {
+                oldFrame.relationListDialog.getPopupMenuHandler().removeAction(relationListAction);
+            }
+            if (oldFrame.propertiesDialog != null) {
+                oldFrame.propertiesDialog.getMembershipPopupMenuHandler().removeAction(propertiesListAction);
+            }
+            if (oldFrame.selectionListDialog != null) {
+                oldFrame.selectionListDialog.getPopupMenuHandler().removeAction(selectionListAction);
+            }
+        }
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsConstants.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsConstants.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsConstants.java	(revision 30735)
@@ -16,13 +16,13 @@
 public interface XmlBoundsConstants {
 
-	/**
-	 * Plugin version.
-	 */
-	public static final String PLUGIN_VERSION = "1.3";
-	
-	/**
-	 * XML namespace for JOSM Imagery schema.
-	 */
-	public static final String XML_NAMESPACE = "http://josm.openstreetmap.de/maps-1.0";
+    /**
+     * Plugin version.
+     */
+    public static final String PLUGIN_VERSION = "1.3";
+
+    /**
+     * XML namespace for JOSM Imagery schema.
+     */
+    public static final String XML_NAMESPACE = "http://josm.openstreetmap.de/maps-1.0";
 
     /**
@@ -31,26 +31,38 @@
     public static final String XML_LOCATION = "https?://josm.openstreetmap.de/maps";
 
-	/**
-	 * XML Schema
-	 */
-	public static final String XML_SCHEMA = "resource://data/maps.xsd";
-	
     /**
-     * XML tags
+     * XML Schema
      */
+    public static final String XML_SCHEMA = "resource://data/maps.xsd";
+
+    /** XML name tag */
     public static final String XML_NAME = "name";
+    /** XML type tag */
     public static final String XML_TYPE = "type";
+    /** XML url tag */
     public static final String XML_URL = "url";
+    /** XML default tag */
     public static final String XML_DEFAULT = "default";
+    /** XML eula tag */
     public static final String XML_EULA = "eula";
+    /** XML attribution-text tag */
     public static final String XML_ATTR_TEXT = "attribution-text";
+    /** XML attribution-url tag */
     public static final String XML_ATTR_URL = "attribution-url";
+    /** XML terms-of-use-text tag */
     public static final String XML_TERMS_TEXT = "terms-of-use-text";
+    /** XML terms-of-use-url tag */
     public static final String XML_TERMS_URL = "terms-of-use-url";
+    /** XML projections tag */
     public static final String XML_PROJECTIONS = "projections";
+    /** XML max-zoom tag */
     public static final String XML_MAX_ZOOM = "max-zoom";
+    /** XML min-zoom tag */
     public static final String XML_MIN_ZOOM = "min-zoom";
+    /** XML country-code tag */
     public static final String XML_COUNTRY_CODE = "country-code";
-    public static final String XML_LOGO_IMAGE = "logo-image";// TODO
+    /** XML logo-image tag */
+    public static final String XML_LOGO_IMAGE = "logo-image";
+    /** XML logo-url tag */
     public static final String XML_LOGO_URL = "logo-url";
 
@@ -60,42 +72,47 @@
     public static final String PREFIX = "imagery:";
 
-	/**
-	 * OSM keys, equivalent to those used in XML schema, but prefixed (except for name).
-	 */
-	public static final String KEY_NAME = XML_NAME;
-	public static final String KEY_TYPE = PREFIX + XML_TYPE;
-	public static final String KEY_URL = PREFIX + XML_URL;
-	public static final String KEY_DEFAULT = PREFIX + XML_DEFAULT;
-	public static final String KEY_EULA = PREFIX + XML_EULA;
-	public static final String KEY_ATTR_TEXT = PREFIX + XML_ATTR_TEXT;
-	public static final String KEY_ATTR_URL = PREFIX + XML_ATTR_URL;
+    /**
+     * OSM keys, equivalent to those used in XML schema, but prefixed (except for name).
+     */
+    public static final String KEY_NAME = XML_NAME;
+    public static final String KEY_TYPE = PREFIX + XML_TYPE;
+    public static final String KEY_URL = PREFIX + XML_URL;
+    public static final String KEY_DEFAULT = PREFIX + XML_DEFAULT;
+    public static final String KEY_EULA = PREFIX + XML_EULA;
+    public static final String KEY_ATTR_TEXT = PREFIX + XML_ATTR_TEXT;
+    public static final String KEY_ATTR_URL = PREFIX + XML_ATTR_URL;
     public static final String KEY_TERMS_TEXT = PREFIX + XML_TERMS_TEXT;
-	public static final String KEY_TERMS_URL = PREFIX + XML_TERMS_URL;
-	public static final String KEY_PROJECTIONS = PREFIX + XML_PROJECTIONS;
-	public static final String KEY_MAX_ZOOM = PREFIX + XML_MAX_ZOOM;
-	public static final String KEY_MIN_ZOOM = PREFIX + XML_MIN_ZOOM;
-	public static final String KEY_COUNTRY_CODE = PREFIX + XML_COUNTRY_CODE;
+    public static final String KEY_TERMS_URL = PREFIX + XML_TERMS_URL;
+    public static final String KEY_PROJECTIONS = PREFIX + XML_PROJECTIONS;
+    public static final String KEY_MAX_ZOOM = PREFIX + XML_MAX_ZOOM;
+    public static final String KEY_MIN_ZOOM = PREFIX + XML_MIN_ZOOM;
+    public static final String KEY_COUNTRY_CODE = PREFIX + XML_COUNTRY_CODE;
     public static final String KEY_LOGO_IMAGE = PREFIX + XML_LOGO_IMAGE;// TODO
     public static final String KEY_LOGO_URL = PREFIX + XML_LOGO_URL;
-	
-	/**
-	 * File extension.
-	 */
-	public static final String EXTENSION = "imagery.xml";
-	
-	/**
-	 * File encoding.
-	 */
-	public static final String ENCODING = "UTF-8";
-	
-	/**
-	 * File filter used in import/export dialogs.
-	 */
-	public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(EXTENSION, EXTENSION, tr("Imagery XML Files") + " (*."+EXTENSION+")");
 
-	/**
-	 * Plugin icons.
-	 */
-	public static ImageIcon XML_ICON_16 = ImageProvider.get("xml_16.png");
-	public static ImageIcon XML_ICON_24 = ImageProvider.get("xml_24.png");
+    /**
+     * File extension.
+     */
+    public static final String EXTENSION = "imagery.xml";
+
+    /**
+     * File encoding.
+     */
+    public static final String ENCODING = "UTF-8";
+
+    /**
+     * File filter used in import/export dialogs.
+     */
+    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
+            EXTENSION, EXTENSION, tr("Imagery XML Files") + " (*."+EXTENSION+")");
+
+    /**
+     * Plugin 16x16 icon.
+     */
+    public static ImageIcon XML_ICON_16 = ImageProvider.get("xml_16.png");
+
+    /**
+     * Plugin 24x24 icon.
+     */
+    public static ImageIcon XML_ICON_24 = ImageProvider.get("xml_24.png");
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsLayer.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsLayer.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsLayer.java	(revision 30735)
@@ -24,92 +24,104 @@
 /**
  * An "OSM data" layer that cannot be uploaded, merged, and in which real OSM data cannot be imported.
- * Its sole purpose is to allow "classic" OSM edition tools to edit Imagery bounds (as XML files) without compromising OSM database integrity. 
- * 
+ * Its sole purpose is to allow "classic" OSM edition tools to edit Imagery bounds (as XML files)
+ * without compromising OSM database integrity.
+ *
  * @author Don-vip
  */
 public class XmlBoundsLayer extends OsmDataLayer implements LayerChangeListener, XmlBoundsConstants {
 
-	@Override
-	public Action[] getMenuEntries() {
-		List<Action> result = new ArrayList<Action>();
-		for (Action action : super.getMenuEntries()) {
-			if (action instanceof LayerSaveAction) {
-				result.add(new BoundsLayerSaveAction(this));
+    @Override
+    public Action[] getMenuEntries() {
+        List<Action> result = new ArrayList<>();
+        for (Action action : super.getMenuEntries()) {
+            if (action instanceof LayerSaveAction) {
+                result.add(new BoundsLayerSaveAction(this));
 
-			} else if (action instanceof LayerSaveAsAction) {
-				result.add(new BoundsLayerSaveAsAction(this));
-				
-			} else if (!(action instanceof LayerGpxExportAction) && !(action instanceof ConvertToGpxLayerAction)) {
-				// Add everything else, expect GPX-related action
-				result.add(action);
-			}
-		}
-		result.add(new ShowBoundsAction(this));
-		return result.toArray(new Action[0]);
-	}
+            } else if (action instanceof LayerSaveAsAction) {
+                result.add(new BoundsLayerSaveAsAction(this));
 
-	private static final JosmAction[] actionsToDisable = new JosmAction[] {
-		Main.main.menu.download,
-		Main.main.menu.downloadPrimitive,
-		Main.main.menu.downloadReferrers,
-		Main.main.menu.upload,
-		Main.main.menu.uploadSelection,
-		Main.main.menu.update,
-		Main.main.menu.updateModified,
-		Main.main.menu.updateSelection,
-		Main.main.menu.openLocation
-	};
-	
-	private static final Map<JosmAction, Boolean> actionsStates = new HashMap<JosmAction, Boolean>();
-	
-	public XmlBoundsLayer(DataSet data) {
-		this(data, OsmDataLayer.createNewName(), null);
-	}
+            } else if (!(action instanceof LayerGpxExportAction) && !(action instanceof ConvertToGpxLayerAction)) {
+                // Add everything else, expect GPX-related action
+                result.add(action);
+            }
+        }
+        result.add(new ShowBoundsAction(this));
+        return result.toArray(new Action[0]);
+    }
 
-	public XmlBoundsLayer(DataSet data, String name, File associatedFile) {
-		super(data, name, associatedFile);
-		MapView.addLayerChangeListener(this);
-	}
-	
-	@Override
-	public boolean isMergable(Layer other) {
-		return other instanceof XmlBoundsLayer;
-	}
+    private static final JosmAction[] ACTIONS_TO_DISABLE = new JosmAction[] {
+        Main.main.menu.download,
+        Main.main.menu.downloadPrimitive,
+        Main.main.menu.downloadReferrers,
+        Main.main.menu.upload,
+        Main.main.menu.uploadSelection,
+        Main.main.menu.update,
+        Main.main.menu.updateModified,
+        Main.main.menu.updateSelection,
+        Main.main.menu.openLocation
+    };
 
-	@Override
-	public Icon getIcon() {
-		return XML_ICON_16;
-	}
+    private static final Map<JosmAction, Boolean> ACTIONS_STATES = new HashMap<>();
 
-	@Override
-	public boolean requiresUploadToServer() {
-		return false; // Never !
-	}
+    /**
+     * Constructs a new {@code XmlBoundsLayer}.
+     * @param data data
+     */
+    public XmlBoundsLayer(DataSet data) {
+        this(data, OsmDataLayer.createNewName(), null);
+    }
 
-	@Override
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		if (newLayer == this && !(oldLayer instanceof XmlBoundsLayer)) {
-			for (JosmAction action : actionsToDisable) {
-				actionsStates.put(action, action.isEnabled());
-				action.setEnabled(false);
-			}
-		} else if (oldLayer == this && !(newLayer instanceof XmlBoundsLayer)) {
-			for (JosmAction action : actionsToDisable) {
-				action.setEnabled(actionsStates.get(action));
-			}
-		}
-	}
+    /**
+     * Constructs a new {@code XmlBoundsLayer}.
+     * @param data data
+     * @param name Layer name
+     * @param associatedFile Associated file (can be null)
+     */
+    public XmlBoundsLayer(DataSet data, String name, File associatedFile) {
+        super(data, name, associatedFile);
+        MapView.addLayerChangeListener(this);
+    }
 
-	@Override
-	public void layerAdded(Layer newLayer) {
-	}
+    @Override
+    public boolean isMergable(Layer other) {
+        return other instanceof XmlBoundsLayer;
+    }
 
-	@Override
-	public void layerRemoved(Layer oldLayer) {
-	    if (Main.main.getEditLayer() instanceof XmlBoundsLayer) {
-	        for (JosmAction action : actionsToDisable) {
+    @Override
+    public Icon getIcon() {
+        return XML_ICON_16;
+    }
+
+    @Override
+    public boolean requiresUploadToServer() {
+        return false; // Never !
+    }
+
+    @Override
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+        if (newLayer == this && !(oldLayer instanceof XmlBoundsLayer)) {
+            for (JosmAction action : ACTIONS_TO_DISABLE) {
+                ACTIONS_STATES.put(action, action.isEnabled());
                 action.setEnabled(false);
             }
-	    }
-	}
+        } else if (oldLayer == this && !(newLayer instanceof XmlBoundsLayer)) {
+            for (JosmAction action : ACTIONS_TO_DISABLE) {
+                action.setEnabled(ACTIONS_STATES.get(action));
+            }
+        }
+    }
+
+    @Override
+    public void layerAdded(Layer newLayer) {
+        // Do nothing
+    }
+
+    @Override
+    public void layerRemoved(Layer oldLayer) {
+        if (Main.main.getEditLayer() instanceof XmlBoundsLayer) {
+            for (JosmAction action : ACTIONS_TO_DISABLE) {
+                action.setEnabled(false);
+            }
+        }
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsPreferenceSetting.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsPreferenceSetting.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsPreferenceSetting.java	(revision 30735)
@@ -11,7 +11,6 @@
 
 /**
- *
+ * Plugin preferences.
  * @author Don-vip
- *
  */
 public class XmlBoundsPreferenceSetting implements SubPreferenceSetting {
@@ -34,7 +33,7 @@
     }
 
+    @Override
     public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) {
         return gui.getImageryPreference();
     }
-
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/BoundsLayerSaveAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/BoundsLayerSaveAction.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/BoundsLayerSaveAction.java	(revision 30735)
@@ -14,35 +14,45 @@
 
 /**
- *
+ * Save the current data.
  * @author Don-vip
- *
  */
-@SuppressWarnings("serial")
 public class BoundsLayerSaveAction extends LayerSaveAction {
 
-	public static class SaveBoundsAction extends SaveActionBase {
+    /**
+     * Save the current data.
+     */
+    public static class SaveBoundsAction extends SaveActionBase {
 
-		public SaveBoundsAction() {
-	        super(tr("Save"), "save", tr("Save the current data."), null);
-	        putValue("help", ht("/Action/Save"));
-		}
+        /**
+         * Constructs a new {@code SaveBoundsAction}.
+         */
+        public SaveBoundsAction() {
+            super(tr("Save"), "save", tr("Save the current data."), null);
+            putValue("help", ht("/Action/Save"));
+        }
 
-		@Override public File getFile(Layer layer) {
-	        File f = layer.getAssociatedFile();
-	        if (f != null && ! f.exists()) {
-	            f = null;
-	        }
-	        return f == null ? BoundsLayerSaveAsAction.SaveBoundsAsAction.openFileDialog(layer) : f;
-	    }
-	}
+        @Override
+        public File getFile(Layer layer) {
+            File f = layer.getAssociatedFile();
+            if (f != null && ! f.exists()) {
+                f = null;
+            }
+            return f == null ? BoundsLayerSaveAsAction.SaveBoundsAsAction.openFileDialog(layer) : f;
+        }
+    }
 
-	protected XmlBoundsLayer layer;
+    protected final XmlBoundsLayer layer;
 
-	public BoundsLayerSaveAction(XmlBoundsLayer layer) {
-		super(layer);
-	}
+    /**
+     * Constructs a new {@code BoundsLayerSaveAction}.
+     * @param layer XML bounds layer
+     */
+    public BoundsLayerSaveAction(XmlBoundsLayer layer) {
+        super(layer);
+        this.layer = layer;
+    }
 
     @Override
-	public void actionPerformed(ActionEvent e) {
+    public void actionPerformed(ActionEvent e) {
         new SaveBoundsAction().doSave(layer);
     }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/BoundsLayerSaveAsAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/BoundsLayerSaveAsAction.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/BoundsLayerSaveAsAction.java	(revision 30735)
@@ -14,36 +14,47 @@
 
 /**
- * 
+ * Save Imagery XML file.
  * @author Don-vip
- *
  */
-@SuppressWarnings("serial")
 public class BoundsLayerSaveAsAction extends LayerSaveAsAction {
 
-	public static class SaveBoundsAsAction extends SaveAsAction {
+    /**
+     * Save Imagery XML file
+     */
+    public static class SaveBoundsAsAction extends SaveAsAction {
 
-		@Override public File getFile(Layer layer) {
-	        return openFileDialog(layer);
-	    }
-		
-	    public static File openFileDialog(Layer layer) {
-	    	if (layer instanceof XmlBoundsLayer) {
-	    		return createAndOpenSaveFileChooser(tr("Save Imagery XML file"), XmlBoundsConstants.EXTENSION);
-	    	} else {
-	    		return null;
-	    	}
-	    }
-	}
-	
-	protected XmlBoundsLayer layer;
-	
-	public BoundsLayerSaveAsAction(XmlBoundsLayer layer) {
-		super(layer);
-		this.layer = layer;
-	}
+        @Override
+        public File getFile(Layer layer) {
+            return openFileDialog(layer);
+        }
 
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		new SaveBoundsAsAction().doSave(layer);
-	}
+        /**
+         * Opens a "File/Save as" dialog if the given layer is an XML bounds layer
+         * @param layer layer
+         * @return chosen destination file, or {@code null}
+         */
+        public static File openFileDialog(Layer layer) {
+            if (layer instanceof XmlBoundsLayer) {
+                return createAndOpenSaveFileChooser(tr("Save Imagery XML file"), XmlBoundsConstants.EXTENSION);
+            } else {
+                return null;
+            }
+        }
+    }
+
+    protected final XmlBoundsLayer layer;
+
+    /**
+     * Constructs a new {@code BoundsLayerSaveAsAction}.
+     * @param layer XML Bounds layer
+     */
+    public BoundsLayerSaveAsAction(XmlBoundsLayer layer) {
+        super(layer);
+        this.layer = layer;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        new SaveBoundsAsAction().doSave(layer);
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java	(revision 30735)
@@ -19,4 +19,5 @@
 import javax.swing.AbstractAction;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.BBox;
@@ -29,87 +30,99 @@
 
 /**
- * 
+ *
  * @author Don-vip
  *
  */
-@SuppressWarnings("serial")
 public class ComputeBoundsAction extends AbstractAction implements XmlBoundsConstants {
 
-	protected static final DecimalFormat df = new DecimalFormat("#0.0000000", new DecimalFormatSymbols(Locale.UK));
-
-	protected static final String ACTION_NAME = tr("XML Imagery Bounds");
-	
-	private final Set<Relation> multipolygons;
-	private final Set<Way> closedWays;
-	
-	public ComputeBoundsAction() {
-		this(null);
-	}
-	
-	public ComputeBoundsAction(OsmDataLayer layer) {
-		this.multipolygons = new HashSet<Relation>();
-		this.closedWays = new HashSet<Way>();
-		
+    protected static final DecimalFormat DF = new DecimalFormat("#0.0000000", new DecimalFormatSymbols(Locale.UK));
+
+    protected static final String ACTION_NAME = tr("XML Imagery Bounds");
+
+    protected static final String EIGHT_SP = "        ";
+
+    private final Set<Relation> multipolygons;
+    private final Set<Way> closedWays;
+
+    /**
+     * Constructs a new {@code ComputeBoundsAction}.
+     */
+    public ComputeBoundsAction() {
+        this(null);
+    }
+
+    /**
+     * Constructs a new {@code ComputeBoundsAction}.
+     * @param layer data layer
+     */
+    public ComputeBoundsAction(OsmDataLayer layer) {
+        this.multipolygons = new HashSet<>();
+        this.closedWays = new HashSet<>();
+
         putValue(SHORT_DESCRIPTION, tr("Generate Imagery XML bounds for the selection"));
         putValue(NAME, ACTION_NAME);
         try {
-        	putValue(SMALL_ICON, XML_ICON_24);
+            putValue(SMALL_ICON, XML_ICON_24);
         } catch (Exception e) {
-        	e.printStackTrace();
-        }
-    	setEnabled(false);
-    	
-		if (layer != null) {
-			List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
-			primitives.addAll(layer.data.getRelations());
-			primitives.addAll(layer.data.getWays());
-			updateOsmPrimitives(primitives);
-		}
-	}
-	
-	protected void updateOsmPrimitives(Collection<? extends OsmPrimitive> primitives) {
-		multipolygons.clear();
-		closedWays.clear();
-		// Store selected multipolygons and closed ways
-		for (OsmPrimitive value : primitives) {
-			if (value instanceof Relation) {
-				Relation r = (Relation) value;
-				if (r.isMultipolygon()) {
-					multipolygons.add(r);
-				}
-			} else if (value instanceof Way) {
-				Way w = (Way) value;
-				if (w.isClosed()) {
-					closedWays.add(w);
-				}
-			}
-		}
-		// Remove closed ways already inside a selected multipolygon
-		for (Iterator<Way> it = closedWays.iterator(); it.hasNext(); ) {
-			processIterator(it);
-		}
-		// Enable the action if at least one area is found
-		setEnabled(!multipolygons.isEmpty() || !closedWays.isEmpty());
-	}
+            Main.error(e);
+        }
+        setEnabled(false);
+
+        if (layer != null) {
+            List<OsmPrimitive> primitives = new ArrayList<>();
+            primitives.addAll(layer.data.getRelations());
+            primitives.addAll(layer.data.getWays());
+            updateOsmPrimitives(primitives);
+        }
+    }
+
+    protected void updateOsmPrimitives(Collection<? extends OsmPrimitive> primitives) {
+        multipolygons.clear();
+        closedWays.clear();
+        // Store selected multipolygons and closed ways
+        for (OsmPrimitive value : primitives) {
+            if (value instanceof Relation) {
+                Relation r = (Relation) value;
+                if (r.isMultipolygon()) {
+                    multipolygons.add(r);
+                }
+            } else if (value instanceof Way) {
+                Way w = (Way) value;
+                if (w.isClosed()) {
+                    closedWays.add(w);
+                }
+            }
+        }
+        // Remove closed ways already inside a selected multipolygon
+        for (Iterator<Way> it = closedWays.iterator(); it.hasNext(); ) {
+            processIterator(it);
+        }
+        // Enable the action if at least one area is found
+        setEnabled(!multipolygons.isEmpty() || !closedWays.isEmpty());
+    }
 
     private void processIterator(Iterator<Way> it) {
         Way way = it.next();
         for (Relation mp : multipolygons) {
-        	for (RelationMember mb : mp.getMembers()) {
-        		if (mb.getMember().equals(way)) {
-        			it.remove();
-        			return;
-        		}
-        	}
-        }
-    }
-
-	public final String getXml() {
-		List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
-		primitives.addAll(multipolygons);
-		primitives.addAll(closedWays);
-		return getXml(primitives.toArray(new OsmPrimitive[0]));
-	}
-	
+            for (RelationMember mb : mp.getMembers()) {
+                if (mb.getMember().equals(way)) {
+                    it.remove();
+                    return;
+                }
+            }
+        }
+    }
+
+    /**
+     * Replies XML code.
+     * @return XML code
+     */
+    public final String getXml() {
+        List<OsmPrimitive> primitives = new ArrayList<>();
+        primitives.addAll(multipolygons);
+        primitives.addAll(closedWays);
+        return getXml(primitives.toArray(new OsmPrimitive[0]));
+    }
+
     protected static final String startTag(String tag) {
         return "<" + tag + ">";
@@ -137,6 +150,6 @@
 
     protected static final String simpleTag(String tag, String content, String def, boolean escape) {
-        return startTag(tag) + (content != null 
-                ? (escape ? escapeReservedCharacters(content) : content) 
+        return startTag(tag) + (content != null
+                ? (escape ? escapeReservedCharacters(content) : content)
                 : def
                 ) + endTag(tag);
@@ -151,205 +164,215 @@
     }
 
+    /**
+     * Escapes HTML entities.
+     * @param s The string to update
+     * @return String with escaped entities
+     */
     public static String escapeReservedCharacters(String s) {
         return s == null ? "" : s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
     }
-    
-	protected static final String getXml(OsmPrimitive ... primitives) {
-		List<String> entries = new ArrayList<String>();
-		for (OsmPrimitive p : primitives) {
-			if (p instanceof Relation) {
-				entries.add(getEntry(p, getMultiPolygonBounds((Relation) p)));
-			} else if (p instanceof Way) {
-				entries.add(getEntry(p, getClosedWayBounds((Way) p)));
-			}
-		}
-		return getImagery(entries.toArray(new String[0]));
-	}
-
-	protected static final String getImagery(String ... entries) {
-		String result = "<?xml version=\"1.0\" encoding=\""+ENCODING+"\" ?>\n";
-		result += "<!-- Generated with JOSM Imagery XML Plugin version "+PLUGIN_VERSION+" -->\n";
-		result += "<imagery xmlns=\""+XML_NAMESPACE+"\">\n";
-		for (String entry : entries) {
-			result += entry+"\n";
-		}
-	    result += "</imagery>";
-	    return result;
-	}
-	
-	protected static final String getEntry(OsmPrimitive p, String bounds) {
-		return getEntry(p.get(KEY_NAME), p.get(KEY_TYPE), p.get(KEY_DEFAULT), p.get(KEY_URL), bounds, p.get(KEY_PROJECTIONS), p.get(KEY_LOGO_URL),
-		        p.get(KEY_EULA), p.get(KEY_ATTR_TEXT), p.get(KEY_ATTR_URL),  p.get(KEY_TERMS_TEXT), p.get(KEY_TERMS_URL), p.get(KEY_COUNTRY_CODE), p.get(KEY_MAX_ZOOM), p.get(KEY_MIN_ZOOM));
-	}
-	
-	protected static final boolean isSet(String tag) {
-	    return tag != null && !tag.isEmpty();
-	}
-	
-	protected static final String getEntry(String name, String type, String def, String url, String bounds, String projections, String logoURL,
-	        String eula, String attributionText, String attributionUrl, String termsText, String termsUrl, String countryCode, String maxZoom, String minZoom) {
-		String result =
-	    "    <entry>\n"+
-        "        " + simpleTag(XML_NAME, name) + "\n"+
-        "        " + simpleTag(XML_TYPE, type, "wms") + "\n"+
-        "        " + simpleTag(XML_URL, url != null ? encodeUrl(url) : "", false) + "\n"+
-	             bounds+"\n";
-		if (projections != null && !projections.isEmpty()) {
-			result += "        "+startTag(XML_PROJECTIONS)+"\n";
-			int i = 0;
-			String[] codes = projections.split(";");
-			for (String code : codes) {
-				if (i%6 == 0) {
-					result += "            ";
-				}
-				result += simpleTag("code", code.trim());
-				if (i%6 == 5 || i == codes.length-1 ) {
-					result += "\n";
-				}
-				i++;
-			}
-			result += "        "+endTag(XML_PROJECTIONS)+"\n";
-		}
-        if (isSet(def) && def.equals("true")) {
-            result += "        " + simpleTag(XML_DEFAULT, def) + "\n";
-        }
-		if (isSet(eula)) {
-			result += "        " + mandatoryTag(XML_EULA, encodeUrl(eula), false) + "\n";
-		}
-		if (isSet(attributionText)) {
-            result += "        " + mandatoryTag(XML_ATTR_TEXT, attributionText) + "\n";
-		}
-		if (isSet(attributionUrl)) {
-            result += "        " + simpleTag(XML_ATTR_URL, encodeUrl(attributionUrl), false) + "\n";
-		}
+
+    protected static final String getXml(OsmPrimitive ... primitives) {
+        List<String> entries = new ArrayList<>();
+        for (OsmPrimitive p : primitives) {
+            if (p instanceof Relation) {
+                entries.add(getEntry(p, getMultiPolygonBounds((Relation) p)));
+            } else if (p instanceof Way) {
+                entries.add(getEntry(p, getClosedWayBounds((Way) p)));
+            }
+        }
+        return getImagery(entries.toArray(new String[0]));
+    }
+
+    protected static final String getImagery(String ... entries) {
+        StringBuilder result = new StringBuilder();
+        result.append("<?xml version=\"1.0\" encoding=\"").append(ENCODING).append("\" ?>\n");
+        result.append("<!-- Generated with JOSM Imagery XML Plugin version ").append(PLUGIN_VERSION).append(" -->\n");
+        result.append("<imagery xmlns=\"").append(XML_NAMESPACE).append("\">\n");
+        for (String entry : entries) {
+            result.append(entry).append("\n");
+        }
+        result.append("</imagery>");
+        return result.toString();
+    }
+
+    protected static final String getEntry(OsmPrimitive p, String bounds) {
+        return getEntry(p.get(KEY_NAME), p.get(KEY_TYPE), p.get(KEY_DEFAULT), p.get(KEY_URL), bounds, p.get(KEY_PROJECTIONS),
+                p.get(KEY_LOGO_URL), p.get(KEY_EULA), p.get(KEY_ATTR_TEXT), p.get(KEY_ATTR_URL),  p.get(KEY_TERMS_TEXT),
+                p.get(KEY_TERMS_URL), p.get(KEY_COUNTRY_CODE), p.get(KEY_MAX_ZOOM), p.get(KEY_MIN_ZOOM));
+    }
+
+    protected static final boolean isSet(String tag) {
+        return tag != null && !tag.isEmpty();
+    }
+
+    protected static final String getEntry(String name, String type, String def, String url, String bounds, String projections,
+            String logoURL, String eula, String attributionText, String attributionUrl, String termsText, String termsUrl,
+            String countryCode, String maxZoom, String minZoom) {
+        StringBuilder result = new StringBuilder();
+        result.append("    <entry>\n"+
+        EIGHT_SP + simpleTag(XML_NAME, name) + "\n"+
+        EIGHT_SP + simpleTag(XML_TYPE, type, "wms") + "\n"+
+        EIGHT_SP + simpleTag(XML_URL, url != null ? encodeUrl(url) : "", false) + "\n"+
+                 bounds+"\n");
+        if (projections != null && !projections.isEmpty()) {
+            result.append(EIGHT_SP+startTag(XML_PROJECTIONS)+"\n");
+            int i = 0;
+            String[] codes = projections.split(";");
+            for (String code : codes) {
+                if (i%6 == 0) {
+                    result.append("            ");
+                }
+                result.append(simpleTag("code", code.trim()));
+                if (i%6 == 5 || i == codes.length-1 ) {
+                    result.append("\n");
+                }
+                i++;
+            }
+            result.append(EIGHT_SP+endTag(XML_PROJECTIONS)+"\n");
+        }
+        if (isSet(def) && "true".equals(def)) {
+            result.append(EIGHT_SP + simpleTag(XML_DEFAULT, def) + "\n");
+        }
+        if (isSet(eula)) {
+            result.append(EIGHT_SP + mandatoryTag(XML_EULA, encodeUrl(eula), false) + "\n");
+        }
+        if (isSet(attributionText)) {
+            result.append(EIGHT_SP + mandatoryTag(XML_ATTR_TEXT, attributionText) + "\n");
+        }
+        if (isSet(attributionUrl)) {
+            result.append(EIGHT_SP + simpleTag(XML_ATTR_URL, encodeUrl(attributionUrl), false) + "\n");
+        }
         if (isSet(termsText)) {
-            result += "        " + simpleTag(XML_TERMS_TEXT, termsText) + "\n";
+            result.append(EIGHT_SP + simpleTag(XML_TERMS_TEXT, termsText) + "\n");
         }
         if (isSet(termsUrl)) {
-            result += "        " + simpleTag(XML_TERMS_URL, encodeUrl(termsUrl), false) + "\n";
+            result.append(EIGHT_SP + simpleTag(XML_TERMS_URL, encodeUrl(termsUrl), false) + "\n");
         }
         if (isSet(logoURL)) {
-            result += "        " + simpleTag(XML_LOGO_URL, encodeUrl(logoURL), false) + "\n";
-        }
-		if (isSet(countryCode)) {
-            result += "        " + simpleTag(XML_COUNTRY_CODE, countryCode) + "\n";
-		}
-		if ("tms".equals(type)) {
-		    if (isSet(maxZoom)) {
-		        result += "        " + simpleTag(XML_MAX_ZOOM, maxZoom) + "\n";
-		    }
+            result.append(EIGHT_SP + simpleTag(XML_LOGO_URL, encodeUrl(logoURL), false) + "\n");
+        }
+        if (isSet(countryCode)) {
+            result.append(EIGHT_SP + simpleTag(XML_COUNTRY_CODE, countryCode) + "\n");
+        }
+        if ("tms".equals(type)) {
+            if (isSet(maxZoom)) {
+                result.append(EIGHT_SP + simpleTag(XML_MAX_ZOOM, maxZoom) + "\n");
+            }
             if (isSet(minZoom)) {
-                result += "        " + simpleTag(XML_MIN_ZOOM, minZoom) + "\n";
-            }
-		}
-	    result += "    </entry>";
-	    return result;
-	}
-	
-	protected static final String encodeUrl(String url) {
-	    return "<![CDATA["+url+"]]>";
-	}
-	
-	protected static final String getBounds(OsmPrimitive p, boolean closeTag) {
-		BBox bbox = p.getBBox();
-		String result = "        <bounds ";
-		result += "min-lat='"+df.format(bbox.getBottomRight().lat())+"' "; 
-		result += "min-lon='"+df.format(bbox.getTopLeft().lon())+"' "; 
-		result += "max-lat='"+df.format(bbox.getTopLeft().lat())+"' "; 
-		result += "max-lon='"+df.format(bbox.getBottomRight().lon())+"'";
-		result += closeTag ? " />" : ">\n";
-		return result;
-	}
-	
-	protected static final boolean isValidOuterMember(RelationMember mb) {
-		return (mb.getRole() == null || mb.getRole().isEmpty() || mb.getRole().equals("outer")) 
-				&& mb.getMember() instanceof Way && ((Way) mb.getMember()).isClosed();
-	}
-	
-	protected static final String getMultiPolygonBounds(Relation mp) {
-		List<Way> outerClosedWays = new ArrayList<Way>();
-		for (RelationMember mb : mp.getMembers()) {
-			if (isValidOuterMember(mb)) {
-				outerClosedWays.add((Way) mb.getMember());
-			}
-		}
-		
-		if (outerClosedWays.isEmpty() || (outerClosedWays.size() == 1 && areClosedWayAndBboxEqual(outerClosedWays.get(0), mp.getBBox()))) {
-			return getBounds(mp, true);
-		} else {
-			String result = getBounds(mp, false);
-			for (Way way : outerClosedWays) {
-				result += getClosedWayShape(way);
-			}
-			result += "        </bounds>";
-			return result;
-		}
-	}
-	
-	protected static final boolean areClosedWayAndBboxEqual(Way way, BBox bBox) {
-		if (way.getNodesCount() == 5) {
-			Map<Double, List<Integer>> latMap = new HashMap<Double, List<Integer>>();
-			Map<Double, List<Integer>> lonMap = new HashMap<Double, List<Integer>>();
-
-			for (int i=0; i<4; i++) {
-				LatLon c = way.getNode(i).getCoor();
-				if (i > 1) {
-					LatLon b = way.getNode(i-1).getCoor();
-					if (b.lat() != c.lat() && b.lon() !=  c.lon()) {
-						return false;
-					}
-				}
-				List<Integer> latList = latMap.get(c.lat());
-				if (latList == null) {
-					latList = new ArrayList<Integer>();
-					latMap.put(c.lat(), latList);
-				}
-				latList.add(i);
-				List<Integer> lonList = lonMap.get(c.lon());
-				if (lonList == null) {
-					lonList = new ArrayList<Integer>();
-					lonMap.put(c.lon(), lonList);
-				}
-				lonList.add(i);
-			}
-			
-			return latMap.size() == 2 && lonMap.size() == 2 
-					&& latMap.containsKey(bBox.getBottomRight().lat()) && latMap.containsKey(bBox.getTopLeft().lat())
-					&& lonMap.containsKey(bBox.getBottomRight().lon()) && lonMap.containsKey(bBox.getTopLeft().lon());
-		}
-		return false;
-	}
-
-	protected static final String getClosedWayBounds(Way cw) {
-		if (areClosedWayAndBboxEqual(cw, cw.getBBox())) {
-			return getBounds(cw, true);
-		} else {
-			return getBounds(cw, false) + getClosedWayShape(cw) + "        </bounds>";
-		}
-	}
-
-	protected static final String getClosedWayShape(Way cw) {
-		String result = "            <shape>\n";
-		for (int i=0; i<cw.getNodesCount(); i++) {
-			if (i%3 == 0) {
-				result += "                ";
-			}
-			int j = i;
-			if(j == cw.getNodesCount())
-			    j = 0;
-			result += "<point ";
-			result += "lat='" + df.format(cw.getNode(i).getCoor().lat()) + "' ";
-			result += "lon='" + df.format(cw.getNode(i).getCoor().lon()) + "'/>";
-			if (i%3 == 2 || i == cw.getNodesCount()-1 ) {
-				result += "\n";
-			}
-		}
-		result += "            </shape>\n";
-		return result;
-	}
-
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		System.out.println(getXml());
-	}
+                result.append(EIGHT_SP + simpleTag(XML_MIN_ZOOM, minZoom) + "\n");
+            }
+        }
+        result.append("    </entry>");
+        return result.toString();
+    }
+
+    protected static final String encodeUrl(String url) {
+        return "<![CDATA["+url+"]]>";
+    }
+
+    protected static final String getBounds(OsmPrimitive p, boolean closeTag) {
+        BBox bbox = p.getBBox();
+        String result = "        <bounds ";
+        result += "min-lat='"+DF.format(bbox.getBottomRight().lat())+"' ";
+        result += "min-lon='"+DF.format(bbox.getTopLeft().lon())+"' ";
+        result += "max-lat='"+DF.format(bbox.getTopLeft().lat())+"' ";
+        result += "max-lon='"+DF.format(bbox.getBottomRight().lon())+"'";
+        result += closeTag ? " />" : ">\n";
+        return result;
+    }
+
+    protected static final boolean isValidOuterMember(RelationMember mb) {
+        return (mb.getRole() == null || mb.getRole().isEmpty() || "outer".equals(mb.getRole()))
+                && mb.getMember() instanceof Way && ((Way) mb.getMember()).isClosed();
+    }
+
+    protected static final String getMultiPolygonBounds(Relation mp) {
+        List<Way> outerClosedWays = new ArrayList<>();
+        for (RelationMember mb : mp.getMembers()) {
+            if (isValidOuterMember(mb)) {
+                outerClosedWays.add((Way) mb.getMember());
+            }
+        }
+
+        if (outerClosedWays.isEmpty() || (outerClosedWays.size() == 1 && areClosedWayAndBboxEqual(outerClosedWays.get(0), mp.getBBox()))) {
+            return getBounds(mp, true);
+        } else {
+            StringBuilder result = new StringBuilder(getBounds(mp, false));
+            for (Way way : outerClosedWays) {
+                result.append(getClosedWayShape(way));
+            }
+            result.append("        </bounds>");
+            return result.toString();
+        }
+    }
+
+    protected static final boolean areClosedWayAndBboxEqual(Way way, BBox bBox) {
+        if (way.getNodesCount() == 5) {
+            Map<Double, List<Integer>> latMap = new HashMap<>();
+            Map<Double, List<Integer>> lonMap = new HashMap<>();
+
+            for (int i=0; i<4; i++) {
+                LatLon c = way.getNode(i).getCoor();
+                if (i > 1) {
+                    LatLon b = way.getNode(i-1).getCoor();
+                    if (b.lat() != c.lat() && b.lon() !=  c.lon()) {
+                        return false;
+                    }
+                }
+                List<Integer> latList = latMap.get(c.lat());
+                if (latList == null) {
+                    latList = new ArrayList<>();
+                    latMap.put(c.lat(), latList);
+                }
+                latList.add(i);
+                List<Integer> lonList = lonMap.get(c.lon());
+                if (lonList == null) {
+                    lonList = new ArrayList<>();
+                    lonMap.put(c.lon(), lonList);
+                }
+                lonList.add(i);
+            }
+
+            return latMap.size() == 2 && lonMap.size() == 2
+                    && latMap.containsKey(bBox.getBottomRight().lat()) && latMap.containsKey(bBox.getTopLeft().lat())
+                    && lonMap.containsKey(bBox.getBottomRight().lon()) && lonMap.containsKey(bBox.getTopLeft().lon());
+        }
+        return false;
+    }
+
+    protected static final String getClosedWayBounds(Way cw) {
+        if (areClosedWayAndBboxEqual(cw, cw.getBBox())) {
+            return getBounds(cw, true);
+        } else {
+            return getBounds(cw, false) + getClosedWayShape(cw) + "        </bounds>";
+        }
+    }
+
+    protected static final String getClosedWayShape(Way cw) {
+        StringBuilder result = new StringBuilder("            <shape>\n");
+        for (int i=0; i<cw.getNodesCount(); i++) {
+            if (i%3 == 0) {
+                result.append("                ");
+            }
+            int j = i;
+            if(j == cw.getNodesCount())
+                j = 0;
+            result.append("<point ");
+            result.append("lat='").append(DF.format(cw.getNode(i).getCoor().lat())).append("' ");
+            result.append("lon='").append(DF.format(cw.getNode(i).getCoor().lon())).append("'/>");
+            if (i%3 == 2 || i == cw.getNodesCount()-1 ) {
+                result.append("\n");
+            }
+        }
+        result.append("            </shape>\n");
+        return result.toString();
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        if (Main.isDebugEnabled()) {
+            Main.debug(getXml());
+        }
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java	(revision 30735)
@@ -9,5 +9,4 @@
 
 import javax.swing.JTable;
-import javax.swing.SwingUtilities;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
@@ -17,37 +16,45 @@
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsConstants;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.data.XmlBoundsConverter;
 
-@SuppressWarnings("serial")
+/**
+ * Edit bounds for selected defaults.
+ */
 public class EditEntriesAction extends JosmAction implements XmlBoundsConstants, ListSelectionListener {
 
-	protected static final String ACTION_NAME = tr("Edit");
+    protected static final String ACTION_NAME = tr("Edit");
 
-	private final JTable defaultTable;
-	private final ImageryDefaultLayerTableModel defaultModel;
+    private final JTable defaultTable;
+    private final ImageryDefaultLayerTableModel defaultModel;
 
-	private final List<ImageryInfo> entries;
+    private final List<ImageryInfo> entries;
 
-	public EditEntriesAction(JTable defaultTable, ImageryDefaultLayerTableModel defaultModel) {
+    /**
+     * Constructs a new {@code EditEntriesAction}.
+     * @param defaultTable table
+     * @param defaultModel table model
+     */
+    public EditEntriesAction(JTable defaultTable, ImageryDefaultLayerTableModel defaultModel) {
         putValue(SHORT_DESCRIPTION, tr("edit bounds for selected defaults"));
         putValue(NAME, ACTION_NAME);
         try {
-        	putValue(SMALL_ICON, XML_ICON_24);
+            putValue(SMALL_ICON, XML_ICON_24);
         } catch (Exception ex) {
-        	ex.printStackTrace();
+            Main.error(ex);
         }
         this.defaultModel = defaultModel;
         this.defaultTable = defaultTable;
         this.defaultTable.getSelectionModel().addListSelectionListener(this);
-        this.entries = new ArrayList<ImageryInfo>();
-    	setEnabled(false);
-	}
+        this.entries = new ArrayList<>();
+        setEnabled(false);
+    }
 
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		final XmlBoundsLayer layer = new XmlBoundsLayer(
-				XmlBoundsConverter.convertImageryEntries(entries));
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        final XmlBoundsLayer layer = new XmlBoundsLayer(
+                XmlBoundsConverter.convertImageryEntries(entries));
         final Runnable uiStuff = new Runnable() {
             @Override
@@ -57,23 +64,19 @@
             }
         };
-        if (SwingUtilities.isEventDispatchThread()) {
-            uiStuff.run();
-        } else {
-            SwingUtilities.invokeLater(uiStuff);
+        GuiHelper.runInEDT(uiStuff);
+    }
+
+    @Override
+    public void valueChanged(ListSelectionEvent e) {
+        if (!e.getValueIsAdjusting()) {
+            entries.clear();
+            for (int row : defaultTable.getSelectedRows()) {
+                ImageryInfo info = defaultModel.getRow(row);
+                if (info != null && info.getBounds() != null) {
+                    entries.add(info);
+                }
+            }
+            setEnabled(!entries.isEmpty());
         }
-	}
-
-	@Override
-	public void valueChanged(ListSelectionEvent e) {
-		if (!e.getValueIsAdjusting()) {
-			entries.clear();
-			for (int row : defaultTable.getSelectedRows()) {
-				ImageryInfo info = defaultModel.getRow(row);
-				if (info != null && info.getBounds() != null) {
-					entries.add(info);
-				}
-			}
-			setEnabled(!entries.isEmpty());
-		}
-	}
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java	(revision 30735)
@@ -19,32 +19,38 @@
 
 /**
+ * Show XML bounds.
  * @author Don-vip
- *
  */
-@SuppressWarnings("serial")
 public class ShowBoundsAction extends ComputeBoundsAction implements OsmPrimitiveAction {
 
-	public ShowBoundsAction() {
-	}
-	
-	public ShowBoundsAction(XmlBoundsLayer xmlBoundsLayer) {
-		super(xmlBoundsLayer);
-	}
+    /**
+     * Constructs a new {@code ShowBoundsAction}.
+     */
+    public ShowBoundsAction() {
+    }
 
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		XmlTextPane pane = new XmlTextPane();
-		Font courierNew = Font.getFont("Courier New"); 
-		if (courierNew != null) {
-			pane.setFont(courierNew);
-		}
-		pane.setText(getXml());
-		pane.setEditable(false);
-		Box box = Box.createVerticalBox();
-		JScrollPane scrollPane = new JScrollPane(pane);
+    /**
+     * Constructs a new {@code ShowBoundsAction}.
+     * @param xmlBoundsLayer XML bounds layer
+     */
+    public ShowBoundsAction(XmlBoundsLayer xmlBoundsLayer) {
+        super(xmlBoundsLayer);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        XmlTextPane pane = new XmlTextPane();
+        Font courierNew = Font.getFont("Courier New");
+        if (courierNew != null) {
+            pane.setFont(courierNew);
+        }
+        pane.setText(getXml());
+        pane.setEditable(false);
+        Box box = Box.createVerticalBox();
+        JScrollPane scrollPane = new JScrollPane(pane);
         scrollPane.setPreferredSize(new Dimension(1024, 600));
         box.add(scrollPane);
         JOptionPane.showMessageDialog(Main.parent, box, ACTION_NAME, JOptionPane.PLAIN_MESSAGE);
-	}
+    }
 
     @Override
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsSelectionAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsSelectionAction.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsSelectionAction.java	(revision 30735)
@@ -8,18 +8,20 @@
 
 /**
- * 
+ *
  * @author Don-vip
  *
  */
-@SuppressWarnings("serial")
 public class ShowBoundsSelectionAction extends ShowBoundsAction implements SelectionChangedListener {
 
-	public ShowBoundsSelectionAction() {
-		putValue("toolbar", "xml-imagery-bounds");
-	}
+    /**
+     * Constructs a new {@code ShowBoundsSelectionAction}.
+     */
+    public ShowBoundsSelectionAction() {
+        putValue("toolbar", "xml-imagery-bounds");
+    }
 
-	@Override
-	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-		updateOsmPrimitives(newSelection);
-	}
+    @Override
+    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+        updateOsmPrimitives(newSelection);
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java	(revision 30735)
@@ -17,4 +17,7 @@
 import org.openstreetmap.josm.plugins.imageryxmlbounds.io.JosmServerLocationReader;
 
+/**
+ * Download imagery XML bounds from JOSM server.
+ */
 public class DownloadXmlBoundsTask extends DownloadOsmTask implements XmlBoundsConstants {
 
@@ -49,8 +52,15 @@
 
     protected class DownloadTask extends DownloadOsmTask.DownloadTask {
+
+        /**
+         * Constructs a new {@code DownloadTask}.
+         * @param newLayer if {@code true}, download to a new layer
+         * @param reader server reader
+         * @param progressMonitor progress monitor
+         */
         public DownloadTask(boolean newLayer, OsmServerReader reader, ProgressMonitor progressMonitor) {
             super(newLayer, reader, progressMonitor);
         }
-        
+
         @Override
         protected OsmDataLayer getEditLayer() {
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java	(revision 30735)
@@ -8,7 +8,7 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
-import org.openstreetmap.josm.data.imagery.Shape;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
+import org.openstreetmap.josm.data.imagery.Shape;
 import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -21,45 +21,49 @@
 
 /**
- * 
+ * Converts imagery entries to bounds data.
  * @author Don-vip
- *
  */
 public class XmlBoundsConverter implements XmlBoundsConstants {
-	
-	public static DataSet convertImageryEntries(List<ImageryInfo> entries) {
-		DataSet dataSet = new DataSet();
-		
-		for (ImageryInfo imagery : entries) {
-			if (!imagery.isBlacklisted()) {
-				ImageryBounds bounds = imagery.getBounds();
-				if (bounds != null) {
-					dataSet.addPrimitive(convertImagery(imagery, bounds, dataSet));
-				}
-			}
-		}
-		return dataSet;
-	}
-	
-	private static void safePut(OsmPrimitive p, String key, Object value) {
-		if (value != null) {
-			if (value instanceof Collection) {
-				String s = "";
-				for (Object elt : (Collection<?>)value) {
-					if (elt != null && elt.toString() != null && !elt.toString().isEmpty()) {
-						if (!s.isEmpty()) {
-							s += ";";
-						}
-						s += elt.toString();
-					}
-				}
-				if (!s.isEmpty()) {
-					p.put(key, s);
-				}
-			} else if (!value.equals(0) && value.toString() != null && !value.toString().isEmpty()) {
-				p.put(key, value.toString());
-			}
-		}
-	}
-	
+
+    /**
+     * Convert a list of imagery entries to a dataset containing associated bounds.
+     * @param entries imagery entries
+     * @return dataset containing associated bounds
+     */
+    public static DataSet convertImageryEntries(List<ImageryInfo> entries) {
+        DataSet dataSet = new DataSet();
+
+        for (ImageryInfo imagery : entries) {
+            if (!imagery.isBlacklisted()) {
+                ImageryBounds bounds = imagery.getBounds();
+                if (bounds != null) {
+                    dataSet.addPrimitive(convertImagery(imagery, bounds, dataSet));
+                }
+            }
+        }
+        return dataSet;
+    }
+
+    private static void safePut(OsmPrimitive p, String key, Object value) {
+        if (value != null) {
+            if (value instanceof Collection) {
+                StringBuilder s = new StringBuilder("");
+                for (Object elt : (Collection<?>)value) {
+                    if (elt != null && elt.toString() != null && !elt.toString().isEmpty()) {
+                        if (s.length() > 0) {
+                            s.append(";");
+                        }
+                        s.append(elt.toString());
+                    }
+                }
+                if (s.length() > 0) {
+                    p.put(key, s.toString());
+                }
+            } else if (!value.equals(0) && value.toString() != null && !value.toString().isEmpty()) {
+                p.put(key, value.toString());
+            }
+        }
+    }
+
     private static Node getNode(LatLon latlon, DataSet dataSet) {
         List<Node> nodes = dataSet.searchNodes(new BBox(latlon, latlon));
@@ -73,63 +77,63 @@
     }
 
-	private static Node getNode(double lat, double lon, DataSet dataSet) {
-	    return getNode(new LatLon(lat, lon), dataSet);
-	}
-	
-	private static void ensureWayIsClosed(Way way) {
-	    if (!way.getNode(0).equals(way.getNode(way.getNodesCount()-1))) {
-	        way.addNode(way.getNode(0));
-	    }
-	}
-	
-	private static OsmPrimitive convertImagery(ImageryInfo imagery, ImageryBounds bounds, DataSet dataSet) {
-		OsmPrimitive osmImagery = null;
-		if (bounds.getShapes().isEmpty()) {
-			LatLon bottomLeft = bounds.getMin();
-			LatLon topRight = bounds.getMax();
-			LatLon topLeft = new LatLon(topRight.lat(), bottomLeft.lon());
-			LatLon bottomRight = new LatLon(bottomLeft.lat(), topRight.lon());
-			
-			Way way = new Way();
-			for (LatLon ll : new LatLon[]{bottomLeft, topLeft, topRight, bottomRight}) {
-				way.addNode(getNode(ll, dataSet));
-			}
-			ensureWayIsClosed(way);
-			osmImagery = way;
-			
-		} else {
-			Relation relation = new Relation();
-			relation.put("type", "multipolygon");
-			for (Shape shape : bounds.getShapes()) {
-				Way way = new Way();
-				for (Coordinate coor : shape.getPoints()) {
-					way.addNode(getNode(coor.getLat(), coor.getLon(), dataSet));
-				}
-				ensureWayIsClosed(way);
-				dataSet.addPrimitive(way);
-				relation.addMember(new RelationMember("outer", way));
-			}
-			osmImagery = relation;
-		}
-		
-		safePut(osmImagery, KEY_NAME, imagery.getOriginalName());
-		safePut(osmImagery, KEY_TYPE, imagery.getImageryType().getTypeString());
-		safePut(osmImagery, KEY_DEFAULT, imagery.isDefaultEntry());
-		safePut(osmImagery, KEY_URL, imagery.getUrl());
-		safePut(osmImagery, KEY_PROJECTIONS, imagery.getServerProjections());
-		safePut(osmImagery, KEY_EULA, imagery.getEulaAcceptanceRequired());
-		safePut(osmImagery, KEY_ATTR_TEXT, imagery.getAttributionText(0, null, null));
-		safePut(osmImagery, KEY_ATTR_URL, imagery.getAttributionLinkURL());
+    private static Node getNode(double lat, double lon, DataSet dataSet) {
+        return getNode(new LatLon(lat, lon), dataSet);
+    }
+
+    private static void ensureWayIsClosed(Way way) {
+        if (!way.getNode(0).equals(way.getNode(way.getNodesCount()-1))) {
+            way.addNode(way.getNode(0));
+        }
+    }
+
+    private static OsmPrimitive convertImagery(ImageryInfo imagery, ImageryBounds bounds, DataSet dataSet) {
+        OsmPrimitive osmImagery = null;
+        if (bounds.getShapes().isEmpty()) {
+            LatLon bottomLeft = bounds.getMin();
+            LatLon topRight = bounds.getMax();
+            LatLon topLeft = new LatLon(topRight.lat(), bottomLeft.lon());
+            LatLon bottomRight = new LatLon(bottomLeft.lat(), topRight.lon());
+
+            Way way = new Way();
+            for (LatLon ll : new LatLon[]{bottomLeft, topLeft, topRight, bottomRight}) {
+                way.addNode(getNode(ll, dataSet));
+            }
+            ensureWayIsClosed(way);
+            osmImagery = way;
+
+        } else {
+            Relation relation = new Relation();
+            relation.put("type", "multipolygon");
+            for (Shape shape : bounds.getShapes()) {
+                Way way = new Way();
+                for (Coordinate coor : shape.getPoints()) {
+                    way.addNode(getNode(coor.getLat(), coor.getLon(), dataSet));
+                }
+                ensureWayIsClosed(way);
+                dataSet.addPrimitive(way);
+                relation.addMember(new RelationMember("outer", way));
+            }
+            osmImagery = relation;
+        }
+
+        safePut(osmImagery, KEY_NAME, imagery.getOriginalName());
+        safePut(osmImagery, KEY_TYPE, imagery.getImageryType().getTypeString());
+        safePut(osmImagery, KEY_DEFAULT, imagery.isDefaultEntry());
+        safePut(osmImagery, KEY_URL, imagery.getUrl());
+        safePut(osmImagery, KEY_PROJECTIONS, imagery.getServerProjections());
+        safePut(osmImagery, KEY_EULA, imagery.getEulaAcceptanceRequired());
+        safePut(osmImagery, KEY_ATTR_TEXT, imagery.getAttributionText(0, null, null));
+        safePut(osmImagery, KEY_ATTR_URL, imagery.getAttributionLinkURL());
         safePut(osmImagery, KEY_TERMS_TEXT, imagery.getTermsOfUseText());
-		safePut(osmImagery, KEY_TERMS_URL, imagery.getTermsOfUseURL());
-		safePut(osmImagery, KEY_COUNTRY_CODE, imagery.getCountryCode());
-		safePut(osmImagery, KEY_LOGO_URL, imagery.getAttributionImageURL());
+        safePut(osmImagery, KEY_TERMS_URL, imagery.getTermsOfUseURL());
+        safePut(osmImagery, KEY_COUNTRY_CODE, imagery.getCountryCode());
+        safePut(osmImagery, KEY_LOGO_URL, imagery.getAttributionImageURL());
 
-		if (imagery.getImageryType().equals(ImageryType.TMS)) {
-			safePut(osmImagery, KEY_MAX_ZOOM, imagery.getMaxZoom());
-			safePut(osmImagery, KEY_MIN_ZOOM, imagery.getMinZoom());
-		}
-		
-		return osmImagery;
-	}
+        if (imagery.getImageryType().equals(ImageryType.TMS)) {
+            safePut(osmImagery, KEY_MAX_ZOOM, imagery.getMaxZoom());
+            safePut(osmImagery, KEY_MIN_ZOOM, imagery.getMinZoom());
+        }
+
+        return osmImagery;
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/JosmServerLocationReader.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/JosmServerLocationReader.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/JosmServerLocationReader.java	(revision 30735)
@@ -9,8 +9,15 @@
 import org.openstreetmap.josm.io.OsmTransferException;
 
+/**
+ * Read XML bounds from JOSM server.
+ */
 public class JosmServerLocationReader extends OsmServerReader {
 
     private String url;
-    
+
+    /**
+     * Constructs a new {@code JosmServerLocationReader}.
+     * @param url URL to read
+     */
     public JosmServerLocationReader(String url) {
         this.url = url;
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/ValidatingImageryReader.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/ValidatingImageryReader.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/ValidatingImageryReader.java	(revision 30735)
@@ -21,19 +21,38 @@
 public class ValidatingImageryReader extends ImageryReader implements XmlBoundsConstants {
 
-	public ValidatingImageryReader(String source) throws SAXException, IOException {
-		this(source, true);
-	}
+    /**
+     * Constructs a new {@code ValidatingImageryReader}.
+     * @param source input source URL
+     * @throws SAXException if a SAX error occurs during parsing
+     * @throws IOException if any I/O error occurs
+     */
+    public ValidatingImageryReader(String source) throws SAXException, IOException {
+        this(source, true);
+    }
 
-	public ValidatingImageryReader(String source, boolean validateFirst) throws SAXException, IOException {
-		super(source);
-		if (validateFirst) {
-			validate(source);
-		}
-	}
+    /**
+     * Constructs a new {@code ValidatingImageryReader}.
+     * @param source input source URL
+     * @param validateFirst if {@code true}, the source if validated first
+     * @throws SAXException if a SAX error occurs during parsing
+     * @throws IOException if any I/O error occurs
+     */
+    public ValidatingImageryReader(String source, boolean validateFirst) throws SAXException, IOException {
+        super(source);
+        if (validateFirst) {
+            validate(source);
+        }
+    }
 
-	public static void validate(String source) throws SAXException, IOException {
+    /**
+     * Validates input against the JOSM Maps XSD.
+     * @param source input source URL
+     * @throws SAXException if a SAX error occurs during parsing
+     * @throws IOException if any I/O error occurs
+     */
+    public static void validate(String source) throws SAXException, IOException {
         SchemaFactory factory =  SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         Schema schema = factory.newSchema(new StreamSource(new CachedFile(XML_SCHEMA).getInputStream()));
         schema.newValidator().validate(new StreamSource(source));
-	}
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsExporter.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsExporter.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsExporter.java	(revision 30735)
@@ -21,18 +21,18 @@
 public class XmlBoundsExporter extends FileExporter implements XmlBoundsConstants {
 
-	public XmlBoundsExporter() {
-		super(FILE_FILTER);
-	}
+    /**
+     * Constructs a new {@code XmlBoundsExporter}.
+     */
+    public XmlBoundsExporter() {
+        super(FILE_FILTER);
+    }
 
-	@Override
-	public void exportData(File file, Layer layer) throws IOException {
-		if (layer instanceof OsmDataLayer) {
-			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), ENCODING));
-			try {
-				writer.write(new ComputeBoundsAction((OsmDataLayer) layer).getXml());
-			} finally {
-				writer.close();
-			}
-		}
-	}
+    @Override
+    public void exportData(File file, Layer layer) throws IOException {
+        if (layer instanceof OsmDataLayer) {
+            try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), ENCODING))) {
+                writer.write(new ComputeBoundsAction((OsmDataLayer) layer).getXml());
+            }
+        }
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java	(revision 30734)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java	(revision 30735)
@@ -9,9 +9,9 @@
 
 import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.FileImporter;
 import org.openstreetmap.josm.io.IllegalDataException;
@@ -28,19 +28,19 @@
 public class XmlBoundsImporter extends FileImporter implements XmlBoundsConstants {
 
-	public XmlBoundsImporter() {
-		super(FILE_FILTER);
-	}
-	
-	public DataSet parseDataSet(final String source) throws IOException, SAXException {
-	    return parseDataSet(source, null);
-	}
+    public XmlBoundsImporter() {
+        super(FILE_FILTER);
+    }
 
-	public DataSet parseDataSet(final File file) throws IOException, SAXException {
+    public DataSet parseDataSet(final String source) throws IOException, SAXException {
+        return parseDataSet(source, null);
+    }
+
+    public DataSet parseDataSet(final File file) throws IOException, SAXException {
         return parseDataSet(null, file);
     }
-	
-	protected DataSet parseDataSet(final String source, final File file) throws IOException, SAXException {
+
+    protected DataSet parseDataSet(final String source, final File file) throws IOException, SAXException {
         ImageryReader reader = null;
-        
+
         try {
             reader = new ValidatingImageryReader(source != null ? source : file.getAbsolutePath());
@@ -48,5 +48,5 @@
             if (JOptionPane.showConfirmDialog(
                     Main.parent,
-                    tr("Validating error in file {0}:\n{1}\nDo you want to continue without validating the file ?", 
+                    tr("Validating error in file {0}:\n{1}\nDo you want to continue without validating the file ?",
                             source != null ? source : file.getPath(), e.getLocalizedMessage()),
                     tr("Open Imagery XML file"),
@@ -57,8 +57,8 @@
             reader = new ImageryReader(source != null ? source : file.getAbsolutePath());
         }
-        
+
         return XmlBoundsConverter.convertImageryEntries(reader.parse());
-	}
-	
+    }
+
     protected void importData(final String source, final String layerName, final File file, ProgressMonitor progressMonitor)
             throws IOException, IllegalDataException {
@@ -78,31 +78,27 @@
                 }
             };
-            if (SwingUtilities.isEventDispatchThread()) {
-                uiStuff.run();
-            } else {
-                SwingUtilities.invokeLater(uiStuff);
-            }
+            GuiHelper.runInEDT(uiStuff);
         } catch (SAXException e) {
             e.printStackTrace();
         }
     }
-	
-	@Override
-	public void importData(final File file, ProgressMonitor progressMonitor)
-			throws IOException, IllegalDataException {
-		importData(null, null, file, progressMonitor);
-	}
-	
-	public void importData(final String source, final String layerName, ProgressMonitor progressMonitor)
-	        throws IOException, IllegalDataException {
-	    importData(source, layerName, null, progressMonitor);
+
+    @Override
+    public void importData(final File file, ProgressMonitor progressMonitor)
+            throws IOException, IllegalDataException {
+        importData(null, null, file, progressMonitor);
     }
 
-	@Override
-	public void importData(List<File> files, ProgressMonitor progressMonitor)
-			throws IOException, IllegalDataException {
-		for (File file : files) {
-			importData(file, progressMonitor);
-		}
-	}
+    public void importData(final String source, final String layerName, ProgressMonitor progressMonitor)
+            throws IOException, IllegalDataException {
+        importData(source, layerName, null, progressMonitor);
+    }
+
+    @Override
+    public void importData(List<File> files, ProgressMonitor progressMonitor)
+            throws IOException, IllegalDataException {
+        for (File file : files) {
+            importData(file, progressMonitor);
+        }
+    }
 }
