sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1733045 - /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
Date Tue, 01 Mar 2016 12:11:39 GMT
Author: desruisseaux
Date: Tue Mar  1 12:11:38 2016
New Revision: 1733045

URL: http://svn.apache.org/viewvc?rev=1733045&view=rev
Log:
Do not write the same warning twice.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1733045&r1=1733044&r2=1733045&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Tue Mar  1 12:11:38 2016
@@ -17,7 +17,9 @@
 package org.apache.sis.io.wkt;
 
 import java.util.Map;
+import java.util.Set;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -1643,12 +1645,15 @@ public class Formatter implements Locali
             }
             buffer.append(ln);
             final int n = warnings.getNumMessages();
+            final Set<String> done = new HashSet<>();
             for (int i=0; i<n; i++) {
                 String message = Exceptions.getLocalizedMessage(warnings.getException(i),
locale);
                 if (message == null) {
                     message = warnings.getMessage(i);
                 }
-                buffer.append("  • ").append(message).append(ln);
+                if (done.add(message)) {
+                    buffer.append("  • ").append(message).append(ln);
+                }
             }
         }
     }



Mime
View raw message