ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r153342 - webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
Date Fri, 11 Feb 2005 04:04:47 GMT
Author: geirm
Date: Thu Feb 10 20:04:46 2005
New Revision: 153342

URL: http://svn.apache.org/viewcvs?view=rev&rev=153342
Log:
be defensive :)

Modified:
    webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
URL: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java?view=diff&r1=153341&r2=153342
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
Thu Feb 10 20:04:46 2005
@@ -292,8 +292,10 @@
             /*
              * first do primary, and then filter that out in the loop
              */
-            Contact ct = getContactFromJAXRUser(primaryContact);
-            cvect.add(ct);
+            if (primaryContact != null) {
+                Contact ct = getContactFromJAXRUser(primaryContact);
+                cvect.add(ct);
+            }
 
             Iterator it = users.iterator();
             while (it.hasNext())
@@ -301,7 +303,7 @@
                 User u = (User) it.next();
 
                 if (u != primaryContact) {
-                    ct = getContactFromJAXRUser(u);
+                    Contact ct = getContactFromJAXRUser(u);
                     cvect.add(ct);
                 }
             }
@@ -328,12 +330,20 @@
     }
 
     /**
+     *  TODO - should we really return new Contact() rather than null on
+     *     null input?
+     *
      * Convert JAXR User Object to UDDI  Contact
      */
     public static Contact getContactFromJAXRUser(User user)
             throws JAXRException
     {
         Contact ct = new Contact();
+
+        if (user == null) {
+            return ct;
+        }
+
         Vector addvect = new Vector();
         Vector phonevect = new Vector();
         Vector emailvect = new Vector();



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


Mime
View raw message