axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r559336 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/ApplicationXMLBuilder.java
Date Wed, 25 Jul 2007 06:49:16 GMT
Author: keithc
Date: Tue Jul 24 23:49:15 2007
New Revision: 559336

URL: http://svn.apache.org/viewvc?view=rev&rev=559336
Log:
precautionary null check in case uses mess with message builders. eg. Axis2-3007


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/ApplicationXMLBuilder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/ApplicationXMLBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/ApplicationXMLBuilder.java?view=diff&rev=559336&r1=559335&r2=559336
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/ApplicationXMLBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/ApplicationXMLBuilder.java
Tue Jul 24 23:49:15 2007
@@ -48,25 +48,27 @@
             throws AxisFault {
         SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope soapEnvelope = soapFactory.getDefaultEnvelope();
-        try {
-            PushbackInputStream pushbackInputStream = new PushbackInputStream(inputStream);
-            int b;
-            if ((b = pushbackInputStream.read()) > 0) {
-                pushbackInputStream.unread(b);
-                StAXBuilder builder =
-                        BuilderUtil.getPOXBuilder(pushbackInputStream,
-                                                  (String) messageContext.getProperty(
-                                                          Constants.Configuration.CHARACTER_SET_ENCODING));
-                OMNodeEx documentElement = (OMNodeEx) builder.getDocumentElement();
-                documentElement.setParent(null);
-                SOAPBody body = soapEnvelope.getBody();
-                body.addChild(documentElement);
-            }
+        if (inputStream != null) {
+            try {
+                PushbackInputStream pushbackInputStream = new PushbackInputStream(inputStream);
+                int b;
+                if ((b = pushbackInputStream.read()) > 0) {
+                    pushbackInputStream.unread(b);
+                    StAXBuilder builder =
+                            BuilderUtil.getPOXBuilder(pushbackInputStream,
+                                    (String) messageContext.getProperty(
+                                            Constants.Configuration.CHARACTER_SET_ENCODING));
+                    OMNodeEx documentElement = (OMNodeEx) builder.getDocumentElement();
+                    documentElement.setParent(null);
+                    SOAPBody body = soapEnvelope.getBody();
+                    body.addChild(documentElement);
+                }
 
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+            } catch (XMLStreamException e) {
+                throw AxisFault.makeFault(e);
+            } catch (IOException e) {
+                throw AxisFault.makeFault(e);
+            }
         }
         return soapEnvelope;
     }



---------------------------------------------------------------------
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