Index: applications/editors/josm/plugins/poly/src/poly/PolyExporter.java
===================================================================
--- applications/editors/josm/plugins/poly/src/poly/PolyExporter.java	(revision 34965)
+++ applications/editors/josm/plugins/poly/src/poly/PolyExporter.java	(revision 34966)
@@ -4,7 +4,7 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.BufferedWriter;
 import java.io.File;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -43,5 +43,5 @@
                 throw new IOException(tr("Data contains unclosed ways."));
             }
-            try (BufferedWriter writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) {
+            try (PrintWriter writer = new PrintWriter(Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8))) {
                 DataSet ds = ((OsmDataLayer) layer).getDataSet();
                 HashSet<Way> written = new HashSet<>();
@@ -56,5 +56,5 @@
                     if (rel.isMultipolygon()) {
                         if (!firstFile) {
-                            writer.newLine();
+                            writer.println();
                         }
                         writeRelation(writer, fileName, rel, written);
@@ -64,5 +64,5 @@
                 
                 if (firstFile) {
-                    writer.write(fileName);
+                    writer.println(fileName);
                 }
                 int counter = 1;
@@ -72,16 +72,14 @@
                     }
                 }
-                writer.write("END");
-                writer.newLine();
+                writer.println("END");
             }
         }
     }
 
-    private static void writeRelation(BufferedWriter writer, String fileName, Relation rel, Set<Way> written) throws IOException {
+    private static void writeRelation(PrintWriter writer, String fileName, Relation rel, Set<Way> written) {
         String polygonName = fileName;
         if (rel.getName() != null)
             polygonName = rel.getName();
-        writer.write(polygonName);
-        writer.newLine();
+        writer.println(polygonName);
         int counter = 1;
         for (RelationMember rm: rel.getMembers()) {
@@ -96,18 +94,15 @@
     }
 
-    private static int writeWay(BufferedWriter writer, Way w, int counter) throws IOException {
+    private static int writeWay(PrintWriter writer, Way w, int counter) {
         String name = w.getName();
         if (name == null) {
             name = String.valueOf(counter++);
         } 
-        writer.write(name);
-        writer.newLine();
+        writer.println(name);
 
         for (Node n : w.getNodes()) {
-            writer.write(String.format(Locale.ENGLISH, "   %f   %f", n.getCoor().lon(), n.getCoor().lat()));
-            writer.newLine();
+            writer.println(String.format(Locale.ENGLISH, "   %f   %f", n.getCoor().lon(), n.getCoor().lat()));
         }
-        writer.write("END");
-        writer.newLine();
+        writer.println("END");
         return counter;
     }
Index: applications/editors/josm/plugins/poly/test/unit/poly/PolyExporterTest.java
===================================================================
--- applications/editors/josm/plugins/poly/test/unit/poly/PolyExporterTest.java	(revision 34965)
+++ applications/editors/josm/plugins/poly/test/unit/poly/PolyExporterTest.java	(revision 34966)
@@ -32,4 +32,27 @@
      */
     @Test
+    public void testSimpleExport() throws Exception {
+        DataSet dsIn1 = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/simple.poly");
+        assertNotNull(dsIn1);
+        assertEquals(4, dsIn1.getNodes().size());
+        assertEquals(1, dsIn1.getWays().size());
+        assertEquals(0, dsIn1.getRelations().size());
+
+        Path out = Files.createTempFile("simple-out", "poly");
+        new PolyExporter().exportData(out.toFile(), new OsmDataLayer(dsIn1, null, null));
+        DataSet dsIn2 = new PolyImporter().parseDataSet(out.toString());
+        assertNotNull(dsIn2);
+        assertEquals(4, dsIn2.getNodes().size());
+        assertEquals(1, dsIn2.getWays().size());
+        assertEquals(0, dsIn2.getRelations().size());
+        
+        Files.delete(out);
+    }
+
+    /**
+     * Import file, export it, import the exported file and compare content
+     * @throws Exception if an error occurs
+     */
+    @Test
     public void testExport() throws Exception {
         DataSet dsIn1 = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/holes.poly");
