Index: applications/editors/josm/plugins/poly/src/poly/DownloadPolyTask.java
===================================================================
--- applications/editors/josm/plugins/poly/src/poly/DownloadPolyTask.java	(revision 32287)
+++ applications/editors/josm/plugins/poly/src/poly/DownloadPolyTask.java	(revision 33003)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package poly;
 
@@ -19,10 +20,10 @@
 
     @Override
-    public Future<?> download( boolean newLayer, Bounds downloadArea, ProgressMonitor progressMonitor ) {
+    public Future<?> download(boolean newLayer, Bounds downloadArea, ProgressMonitor progressMonitor) {
         return null;
     }
 
     @Override
-    public Future<?> loadUrl( boolean new_layer, String url, ProgressMonitor progressMonitor ) {
+    public Future<?> loadUrl(boolean new_layer, String url, ProgressMonitor progressMonitor) {
         downloadTask = new DownloadTask(new_layer, new ServerPolyReader(url), progressMonitor);
         return Main.worker.submit(downloadTask);
@@ -42,14 +43,14 @@
         private String url;
 
-        public ServerPolyReader( String url ) {
+        public ServerPolyReader(String url) {
             this.url = url;
         }
 
         @Override
-        public DataSet parseOsm( ProgressMonitor progressMonitor ) throws OsmTransferException {
+        public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException {
             try {
                 progressMonitor.beginTask(tr("Contacting Server...", 10));
                 return new PolyImporter().parseDataSet(url);
-            } catch( Exception e ) {
+            } catch (Exception e) {
                 throw new OsmTransferException(e);
             } finally {
Index: applications/editors/josm/plugins/poly/src/poly/PolyExporter.java
===================================================================
--- applications/editors/josm/plugins/poly/src/poly/PolyExporter.java	(revision 32287)
+++ applications/editors/josm/plugins/poly/src/poly/PolyExporter.java	(revision 33003)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package poly;
 
@@ -35,17 +36,17 @@
 
     @Override
-    public void exportData( File file, Layer layer ) throws IOException {
-        if( layer instanceof OsmDataLayer ) {
+    public void exportData(File file, Layer layer) throws IOException {
+        if (layer instanceof OsmDataLayer) {
             try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF8"))) {
-                DataSet ds = ((OsmDataLayer)layer).data;
+                DataSet ds = ((OsmDataLayer) layer).data;
                 Map<Way, Boolean> ways = new TreeMap<>();
                 String polygonName = file.getName();
-                if( polygonName.indexOf('.') > 0 )
+                if (polygonName.indexOf('.') > 0)
                     polygonName = polygonName.substring(0, polygonName.indexOf('.'));
-                for( Way w : ds.getWays() ) {
-                    if( w.isClosed() ) {
+                for (Way w : ds.getWays()) {
+                    if (w.isClosed()) {
                         boolean outer = isOuter(w);
                         ways.put(w, outer);
-                        if( w.hasKey("name") )
+                        if (w.hasKey("name"))
                             polygonName = w.get("name").replace("\n", " ");
                     }
@@ -56,10 +57,10 @@
                 writer.write(polygonName);
                 writer.newLine();
-                for( Way w : ways.keySet() ) {
-                    if( !ways.get(w) )
+                for (Way w : ways.keySet()) {
+                    if (!ways.get(w))
                         writer.write('!');
                     writer.write(String.valueOf(counter++));
                     writer.newLine();
-                    for( Node n : w.getNodes() ) {
+                    for (Node n : w.getNodes()) {
                         writer.write(String.format(Locale.ENGLISH, "   %f   %f", n.getCoor().lon(), n.getCoor().lat()));
                         writer.newLine();
@@ -74,9 +75,9 @@
     }
 
-    private boolean isOuter( Way w ) {
-        for( OsmPrimitive p : w.getReferrers() ) {
-            if( p instanceof Relation && ((Relation)p).isMultipolygon() ) {
-                for( RelationMember m : ((Relation)p).getMembers() ) {
-                    if( m.refersTo(w) && "inner".equals(m.getRole()) ) {
+    private boolean isOuter(Way w) {
+        for (OsmPrimitive p : w.getReferrers()) {
+            if (p instanceof Relation && ((Relation) p).isMultipolygon()) {
+                for (RelationMember m : ((Relation) p).getMembers()) {
+                    if (m.refersTo(w) && "inner".equals(m.getRole())) {
                         return false;
                     }
@@ -87,16 +88,17 @@
     }
 
-    private Map<Way, Boolean> sortOuterInner( Map<Way, Boolean> ways ) {
+    private Map<Way, Boolean> sortOuterInner(Map<Way, Boolean> ways) {
         LinkedHashMap<Way, Boolean> result = new LinkedHashMap<>(ways.size());
         List<Way> inner = new ArrayList<>();
-        for( Way w : ways.keySet() ) {
+        for (Way w : ways.keySet()) {
             Boolean outer = ways.get(w);
-            if( outer )
+            if (outer)
                 result.put(w, outer);
             else
                 inner.add(w);
         }
-        for( Way w : inner )
+        for (Way w : inner) {
             result.put(w, Boolean.FALSE);
+        }
         return result;
     }
Index: applications/editors/josm/plugins/poly/src/poly/PolyImporter.java
===================================================================
--- applications/editors/josm/plugins/poly/src/poly/PolyImporter.java	(revision 32287)
+++ applications/editors/josm/plugins/poly/src/poly/PolyImporter.java	(revision 33003)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package poly;
 
@@ -37,11 +38,11 @@
     }
 
-    protected DataSet parseDataSet( final String source ) throws IOException, SAXException, IllegalDataException {
+    protected DataSet parseDataSet(final String source) throws IOException, SAXException, IllegalDataException {
         return parseDataSet(new CachedFile(source).getInputStream(), NullProgressMonitor.INSTANCE);
     }
 
     @Override
-    protected DataSet parseDataSet( InputStream in, ProgressMonitor progressMonitor ) throws IllegalDataException {
-        if( progressMonitor == null )
+    protected DataSet parseDataSet(InputStream in, ProgressMonitor progressMonitor) throws IllegalDataException {
+        if (progressMonitor == null)
             progressMonitor = NullProgressMonitor.INSTANCE;
         CheckParameterUtil.ensureParameterNotNull(in, "in");
@@ -57,5 +58,5 @@
             progressMonitor.worked(1);
             return ds;
-        } catch( IOException e ) {
+        } catch (IOException e) {
             throw new IllegalDataException(tr("Error reading poly file: {0}", e.getMessage()), e);
         } finally {
@@ -64,7 +65,7 @@
     }
 
-    private List<Area> loadPolygon( BufferedReader reader ) throws IllegalDataException, IOException {
+    private List<Area> loadPolygon(BufferedReader reader) throws IllegalDataException, IOException {
         String name = reader.readLine();
-        if( name == null || name.trim().length() == 0 )
+        if (name == null || name.trim().length() == 0)
             throw new IllegalDataException(tr("The file must begin with a polygon name"));
         List<Area> areas = new ArrayList<>();
@@ -72,27 +73,27 @@
         boolean parsingSection = false;
         int fixedCoords = 0;
-        while(true) {
+        while (true) {
             String line;
             do {
                 line = reader.readLine();
-                if( line == null )
+                if (line == null)
                     throw new IllegalDataException("File ended prematurely without END record");
                 line = line.trim();
-            } while( line.length() == 0 );
-
-            if( line.equals("END") ) {
-                if( !parsingSection )
+            } while (line.length() == 0);
+
+            if (line.equals("END")) {
+                if (!parsingSection)
                     break;
                 else {
                     // an area has been read
-                    if( area.getNodeCount() < 2 )
+                    if (area.getNodeCount() < 2)
                         throw new IllegalDataException(tr("There are less than 2 points in an area"));
                     areas.add(area);
-                    if( areas.size() == 1 )
+                    if (areas.size() == 1)
                         areas.get(0).setPolygonName(name);
                     parsingSection = false;
                 }
             } else {
-                if( !parsingSection ) {
+                if (!parsingSection) {
                     area = new Area(line);
                     parsingSection = true;
@@ -102,29 +103,29 @@
                     double[] coords = new double[2];
                     int tokenCount = 0;
-                    for( String token : tokens ) {
-                        if( token.length() > 0 ) {
-                            if( tokenCount > 2 )
+                    for (String token : tokens) {
+                        if (token.length() > 0) {
+                            if (tokenCount > 2)
                                 throw new IllegalDataException(tr("A polygon coordinate line must contain exactly 2 numbers"));
                             try {
                                 coords[tokenCount++] = Double.parseDouble(token);
-                            } catch( NumberFormatException e ) {
+                            } catch (NumberFormatException e) {
                                 throw new IllegalDataException(tr("Unable to parse {0} as a number", token));
                             }
                         }
                     }
-                    if( tokenCount < 2 )
+                    if (tokenCount < 2)
                         throw new IllegalDataException(tr("A polygon coordinate line must contain exactly 2 numbers"));
                     LatLon coord = new LatLon(coords[1], coords[0]);
-                    if( !coord.isValid() ) {
+                    if (!coord.isValid()) {
                         // fix small deviations
                         double lat = coord.lat();
                         double lon = coord.lon();
-                        if( lon < -180.0 && lon> -185.0 ) lon = -180.0;
-                        if( lon > 180.0 && lon < 185.0 ) lon = 180.0;
-                        if( lat < -90.0 && lat > -95.0 ) lat = -90.0;
-                        if( lat > 90.0 && lat < 95.0 ) lat = 90.0;
+                        if (lon < -180.0 && lon > -185.0) lon = -180.0;
+                        if (lon > 180.0 && lon < 185.0) lon = 180.0;
+                        if (lat < -90.0 && lat > -95.0) lat = -90.0;
+                        if (lat > 90.0 && lat < 95.0) lat = 90.0;
                         fixedCoords++;
                         coord = new LatLon(lat, lon);
-                        if( !coord.isValid() )
+                        if (!coord.isValid())
                             throw new IllegalDataException(tr("Invalid coordinates were found: {0}, {1}", coord.lat(), coord.lon()));
                     }
@@ -133,24 +134,25 @@
             }
         }
-        if( fixedCoords > 0 )
-            JOptionPane.showMessageDialog(Main.parent, tr("{0} points were outside world bounds and were moved", fixedCoords), "Import poly", JOptionPane.WARNING_MESSAGE);
+        if (fixedCoords > 0)
+            JOptionPane.showMessageDialog(Main.parent, 
+                    tr("{0} points were outside world bounds and were moved", fixedCoords), "Import poly", JOptionPane.WARNING_MESSAGE);
         return areas;
     }
 
-    private DataSet constructDataSet( List<Area> areas ) {
+    private DataSet constructDataSet(List<Area> areas) {
         DataSet ds = new DataSet();
         ds.setUploadDiscouraged(true);
 
         boolean foundInner = false;
-        for( Area area : areas ) {
-            if( !area.isOuter() )
+        for (Area area : areas) {
+            if (!area.isOuter())
                 foundInner = true;
             area.constructWay(ds);
         }
 
-        if( foundInner ) {
+        if (foundInner) {
             Relation mp = new Relation();
             mp.put("type", "multipolygon");
-            for( Area area : areas ) {
+            for (Area area : areas) {
                 mp.addMember(new RelationMember(area.isOuter() ? "outer" : "inner", area.getWay()));
             }
@@ -168,8 +170,8 @@
         private Way way;
 
-        public Area( String name ) {
+        Area(String name) {
             this.name = name;
             outer = name.charAt(0) != '!';
-            if( !outer )
+            if (!outer)
                 this.name = this.name.substring(1);
             nodes = new ArrayList<>();
@@ -178,10 +180,10 @@
         }
 
-        public void setPolygonName( String polygonName ) {
+        public void setPolygonName(String polygonName) {
             this.polygonName = polygonName;
         }
 
-        public void addNode( LatLon node ) {
-            if( nodes.isEmpty() || !(nodes.get(nodes.size()-1).equals(node) || nodes.get(0).equals(node)) )
+        public void addNode(LatLon node) {
+            if (nodes.isEmpty() || !(nodes.get(nodes.size()-1).equals(node) || nodes.get(0).equals(node)))
                 nodes.add(node);
         }
@@ -199,7 +201,7 @@
         }
 
-        public void constructWay( DataSet ds ) {
+        public void constructWay(DataSet ds) {
             way = new Way();
-            for( LatLon coord : nodes ) {
+            for (LatLon coord : nodes) {
                 Node node = new Node(coord);
                 ds.addPrimitive(node);
@@ -207,5 +209,5 @@
             }
             way.addNode(way.getNode(0));
-            if( polygonName != null )
+            if (polygonName != null)
                 way.put("name", polygonName);
             ds.addPrimitive(way);
Index: applications/editors/josm/plugins/poly/src/poly/PolyPlugin.java
===================================================================
--- applications/editors/josm/plugins/poly/src/poly/PolyPlugin.java	(revision 32287)
+++ applications/editors/josm/plugins/poly/src/poly/PolyPlugin.java	(revision 33003)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package poly;
 
Index: applications/editors/josm/plugins/poly/src/poly/PolyType.java
===================================================================
--- applications/editors/josm/plugins/poly/src/poly/PolyType.java	(revision 32287)
+++ applications/editors/josm/plugins/poly/src/poly/PolyType.java	(revision 33003)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package poly;
 
@@ -10,5 +11,6 @@
  */
 public interface PolyType {
-    public static final String EXTENSION = "poly";
-    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(EXTENSION, EXTENSION, tr("Osmosis polygon filter files") + " (*." + EXTENSION + ")");
+    String EXTENSION = "poly";
+    ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
+            EXTENSION, EXTENSION, tr("Osmosis polygon filter files") + " (*." + EXTENSION + ")");
 }
