axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r538525 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
Date Wed, 16 May 2007 10:41:51 GMT
Author: keithc
Date: Wed May 16 03:41:47 2007
New Revision: 538525

URL: http://svn.apache.org/viewvc?view=rev&rev=538525
Log:
Avoiding posible NPE

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java?view=diff&rev=538525&r1=538524&r2=538525
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
Wed May 16 03:41:47 2007
@@ -38,6 +38,7 @@
 import java.util.Map;
 import java.util.Iterator;
 import java.util.ArrayList;
+import java.util.Set;
 
 /**
  * Helps the AxisService to WSDL process
@@ -51,11 +52,14 @@
      * @return - The prefix of the namespace
      */
     public static String getPrefix(String namespace, Map nameSpaceMap) {
-        Iterator keys = nameSpaceMap.keySet().iterator();
-        while (keys.hasNext()) {
-            String key = (String) keys.next();
-            if (nameSpaceMap.get(key).equals(namespace)) {
-                return key;
+        Set keySet;
+        if (nameSpaceMap != null && (keySet = nameSpaceMap.keySet()) != null) {
+            Iterator keys = keySet.iterator();
+            while (keys.hasNext()) {
+                String key = (String) keys.next();
+                if (nameSpaceMap.get(key).equals(namespace)) {
+                    return key;
+                }
             }
         }
         return null;



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


Mime
View raw message