james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1711975 - in /james/project/trunk/server: container/cli/src/main/java/org/apache/james/cli/ data/data-api/src/main/java/org/apache/james/rrt/lib/ data/data-library/src/main/java/org/apache/james/rrt/lib/
Date Mon, 02 Nov 2015 13:43:44 GMT
Author: matthieu
Date: Mon Nov  2 13:43:44 2015
New Revision: 1711975

URL: http://svn.apache.org/viewvc?rev=1711975&view=rev
Log:
JAMES-1595 Remove toArray needs on Mappings object

Modified:
    james/project/trunk/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
    james/project/trunk/server/data/data-api/src/main/java/org/apache/james/rrt/lib/Mappings.java
    james/project/trunk/server/data/data-library/src/main/java/org/apache/james/rrt/lib/MappingsImpl.java

Modified: james/project/trunk/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java?rev=1711975&r1=1711974&r2=1711975&view=diff
==============================================================================
--- james/project/trunk/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
(original)
+++ james/project/trunk/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
Mon Nov  2 13:43:44 2015
@@ -20,6 +20,7 @@ package org.apache.james.cli;
 
 import java.io.IOException;
 import java.io.PrintStream;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -189,7 +190,7 @@ public class ServerCmd {
             break;
         case LISTUSERDOMAINMAPPINGS:
             Mappings userDomainMappings = probe.listUserDomainMappings(arguments[1], arguments[2]);
-            print(userDomainMappings.toArray(new String[0]), System.out);
+            print(userDomainMappings, System.out);
             break;
         case ADDADDRESSMAPPING:
             probe.addAddressMapping(arguments[1], arguments[2], arguments[3]);
@@ -264,6 +265,10 @@ public class ServerCmd {
     }
 
     private static void print(String[] data, PrintStream out) {
+        print(Arrays.asList(data), out);
+    }
+    
+    private static void print(Iterable<String> data, PrintStream out) {
         if (data != null) {
             for (String u : data) {
                 out.println(u);

Modified: james/project/trunk/server/data/data-api/src/main/java/org/apache/james/rrt/lib/Mappings.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/data/data-api/src/main/java/org/apache/james/rrt/lib/Mappings.java?rev=1711975&r1=1711974&r2=1711975&view=diff
==============================================================================
--- james/project/trunk/server/data/data-api/src/main/java/org/apache/james/rrt/lib/Mappings.java
(original)
+++ james/project/trunk/server/data/data-api/src/main/java/org/apache/james/rrt/lib/Mappings.java
Mon Nov  2 13:43:44 2015
@@ -41,6 +41,4 @@ public interface Mappings extends Iterab
 
     boolean isEmpty();
 
-    String[] toArray(String[] strings);
-
 }
\ No newline at end of file

Modified: james/project/trunk/server/data/data-library/src/main/java/org/apache/james/rrt/lib/MappingsImpl.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/data/data-library/src/main/java/org/apache/james/rrt/lib/MappingsImpl.java?rev=1711975&r1=1711974&r2=1711975&view=diff
==============================================================================
--- james/project/trunk/server/data/data-library/src/main/java/org/apache/james/rrt/lib/MappingsImpl.java
(original)
+++ james/project/trunk/server/data/data-library/src/main/java/org/apache/james/rrt/lib/MappingsImpl.java
Mon Nov  2 13:43:44 2015
@@ -100,9 +100,4 @@ public class MappingsImpl implements Map
         return mappings.isEmpty();
     }
 
-    @Override
-    public String[] toArray(String[] strings) {
-        return mappings.toArray(strings);
-    }
-
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message