Revision: 5372
          http://sourceforge.net/p/jump-pilot/code/5372
Author:   michaudm
Date:     2017-03-13 23:44:01 +0000 (Mon, 13 Mar 2017)
Log Message:
-----------
Fix a NullPointerException in Dissolve2PlugIn (ConcatenateUnique)

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/src/org/openjump/core/ui/plugin/tools/aggregate/Aggregators.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2017-03-13 22:45:10 UTC (rev 5371)
+++ core/trunk/ChangeLog        2017-03-13 23:44:01 UTC (rev 5372)
@@ -5,6 +5,7 @@
 
 2017-03-13 mmichaud <[email protected]>
   * Small improvements in UpdateWithJoinPlugIn
+  * Fix a NullPointerException in Dissolve2PlugIn (ConcatenateUnique)
 
 2017-03-12 ede
   * fix regression "#455 UI problem with decimal parameters and Locale" 

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/tools/aggregate/Aggregators.java
===================================================================
--- core/trunk/src/org/openjump/core/ui/plugin/tools/aggregate/Aggregators.java 
2017-03-13 22:45:10 UTC (rev 5371)
+++ core/trunk/src/org/openjump/core/ui/plugin/tools/aggregate/Aggregators.java 
2017-03-13 23:44:01 UTC (rev 5372)
@@ -138,11 +138,14 @@
         }
         public String getResult() {
             StringBuilder sb = new StringBuilder();
-            Set set = new TreeSet<Object>(getValues());
+            List<Object> values = getValues();
+            for (int i = 0 ; i < values.size() ; i++) {
+                if (values.get(i) == null) values.set(i, "<NULL>");
+            }
+            Set set = new TreeSet<>(values);
             for (Object value : set) {
-                String v = value == null ? "<NULL>" : value.toString();
-                if (sb.length()==0) sb.append(v);
-                else sb.append(getParameter(SEPARATOR_NAME)).append(v);
+                if (sb.length()==0) sb.append(value);
+                else sb.append(getParameter(SEPARATOR_NAME)).append(value);
             }
             return sb.toString();
         }


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to