servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r657289 - /servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Date Sat, 17 May 2008 03:23:39 GMT
Author: ffang
Date: Fri May 16 20:23:38 2008
New Revision: 657289

URL: http://svn.apache.org/viewvc?rev=657289&view=rev
Log:
[SM-1356]cxf-bc tests failing due to CxfBcProvider schema import handling throws null pointer
exception.

Modified:
    servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java

Modified: servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=657289&r1=657288&r2=657289&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
(original)
+++ servicemix/smx3/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Fri May 16 20:23:38 2008
@@ -38,6 +38,8 @@
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
 import com.ibm.wsdl.Constants;
 
 import org.apache.cxf.Bus;
@@ -304,12 +306,12 @@
                 for (String key : schemaList.keySet()) {
                     Element ele = schemaList.get(key);
                     for (SchemaInfo sInfo : serInfo.getSchemas()) {
+                        Node nl = sInfo.getElement().getElementsByTagNameNS(
+                                  "http://www.w3.org/2001/XMLSchema", "import").item(0);
                         if (sInfo.getNamespaceURI() == null //it's import schema 
-                            && ((Element)sInfo.getElement().getElementsByTagNameNS(
-                                    "http://www.w3.org/2001/XMLSchema",
-                                    "import").item(0)).
-                                getAttribute("namespace").
-                                    equals(ele.getAttribute("targetNamespace"))) {
+                            && nl != null 
+                            && ((Element)nl).getAttribute("namespace")
+                                .equals(ele.getAttribute("targetNamespace"))) {
                             
                             sInfo.setElement(ele);
                         }



Mime
View raw message