cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1505727 - in /cxf/trunk: api/src/main/java/org/apache/cxf/configuration/jsse/ api/src/main/java/org/apache/cxf/configuration/spring/ api/src/main/java/org/apache/cxf/interceptor/ api/src/main/java/org/apache/cxf/staxutils/ rt/bindings/colo...
Date Mon, 22 Jul 2013 16:06:14 GMT
Author: coheigea
Date: Mon Jul 22 16:06:13 2013
New Revision: 1505727

URL: http://svn.apache.org/r1505727
Log:
Propagate exception from closing the reader in StaxUtils

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
    cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/JAXBBeanFactory.java
    cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java
    cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocUtil.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelIdParser.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelService.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/SoapTcpUtils.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/transform/XSLTInInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
    cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/Stax2DOM.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
Mon Jul 22 16:06:13 2013
@@ -30,6 +30,7 @@ import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.common.injection.NoJSR250Annotations;
@@ -150,7 +151,11 @@ public final class TLSClientParametersCo
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {
-            StaxUtils.close(data);
+            try {
+                StaxUtils.close(data);
+            } catch (XMLStreamException ex) {
+                throw new RuntimeException(ex);
+            }
         }
     }
     

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Mon Jul 22 16:06:13 2013
@@ -38,7 +38,6 @@ import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
-
 import org.apache.cxf.common.jaxb.JAXBContextCache;
 import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
 import org.apache.cxf.common.logging.LogUtils;
@@ -436,7 +435,11 @@ public abstract class AbstractBeanDefini
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {
-            StaxUtils.close(data);
+            try {
+                StaxUtils.close(data);
+            } catch (XMLStreamException ex) {
+                throw new RuntimeException(ex);
+            }
         }
     }
     

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/JAXBBeanFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/JAXBBeanFactory.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/JAXBBeanFactory.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/JAXBBeanFactory.java Mon
Jul 22 16:06:13 2013
@@ -25,6 +25,7 @@ import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.staxutils.StaxUtils;
@@ -61,7 +62,11 @@ public final class JAXBBeanFactory {
         } catch (JAXBException e) {
             throw new RuntimeException(e);
         } finally {
-            StaxUtils.close(data);
+            try {
+                StaxUtils.close(data);
+            } catch (XMLStreamException ex) {
+                throw new RuntimeException(ex);
+            }
         }
     }
 

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java Mon
Jul 22 16:06:13 2013
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.interceptor;
 
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.message.Message;
@@ -44,7 +45,11 @@ public class StaxInEndingInterceptor ext
     public void handleMessage(Message message) throws Fault {
         XMLStreamReader xtr = message.getContent(XMLStreamReader.class);
         if (xtr != null && !MessageUtils.getContextualBoolean(message, STAX_IN_NOCLOSE,
false)) {
-            StaxUtils.close(xtr);
+            try {
+                StaxUtils.close(xtr);
+            } catch (XMLStreamException ex) {
+                throw new Fault(ex);
+            }
             message.removeContent(XMLStreamReader.class);
         }
     }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Mon Jul 22 16:06:13
2013
@@ -1768,13 +1768,9 @@ public final class StaxUtils {
         }        
         return sw.toString();        
     }
-    public static void close(XMLStreamReader reader) {
+    public static void close(XMLStreamReader reader) throws XMLStreamException {
         if (reader != null) {
-            try {
-                reader.close();
-            } catch (Exception e) {
-                //ignore
-            }
+            reader.close();
         }
     }
     

Modified: cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocUtil.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocUtil.java
(original)
+++ cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocUtil.java
Mon Jul 22 16:06:13 2013
@@ -28,6 +28,7 @@ import java.util.SortedSet;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
@@ -265,7 +266,11 @@ public final class ColocUtil {
             streamReader = StaxUtils.createXMLStreamReader(source);
             wrappedObject = reader.read(mpi, streamReader);
         } finally {
-            StaxUtils.close(streamReader);
+            try {
+                StaxUtils.close(streamReader);
+            } catch (XMLStreamException e) {
+                // Ignore
+            }
         }
         MessageContentsList parameters = new MessageContentsList();
         parameters.put(mpi, wrappedObject);

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Mon Jul 22 16:06:13 2013
@@ -254,7 +254,12 @@ public class ReadHeadersInterceptor exte
                                 message.getVersion().getSender());
         } finally {
             if (closeNeeded) {
-                StaxUtils.close(xmlReader);
+                try {
+                    StaxUtils.close(xmlReader);
+                } catch (XMLStreamException e) {
+                    throw new SoapFault(new Message("XML_STREAM_EXC", LOG, e.getMessage()),
e, 
+                                        message.getVersion().getSender());
+                }
             }
         }
     }

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelIdParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelIdParser.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelIdParser.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelIdParser.java
Mon Jul 22 16:06:13 2013
@@ -59,7 +59,11 @@ public final class ChannelIdParser {
         } catch (XMLStreamException e) {
             e.printStackTrace();
         } finally {
-            StaxUtils.close(streamReader);
+            try {
+                StaxUtils.close(streamReader);
+            } catch (XMLStreamException e) {
+                e.printStackTrace();
+            }
         }
         
         return 0;

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelService.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelService.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/ChannelService.java
Mon Jul 22 16:06:13 2013
@@ -79,7 +79,11 @@ public final class ChannelService {
         } catch (XMLStreamException e) {
             e.printStackTrace();
         } finally {
-            StaxUtils.close(xmlReader);
+            try {
+                StaxUtils.close(xmlReader);
+            } catch (XMLStreamException e) {
+                e.printStackTrace();
+            }
         }
     }
     

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/SoapTcpUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/SoapTcpUtils.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/SoapTcpUtils.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/tcp/SoapTcpUtils.java
Mon Jul 22 16:06:13 2013
@@ -169,7 +169,11 @@ public final class SoapTcpUtils {
             } catch (XMLStreamException e) {
                 e.printStackTrace();
             } finally {
-                StaxUtils.close(xmlReader);
+                try {
+                    StaxUtils.close(xmlReader);
+                } catch (XMLStreamException e) {
+                    e.printStackTrace();
+                }
             }
         }
         return false;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/transform/XSLTInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/transform/XSLTInInterceptor.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/transform/XSLTInInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/feature/transform/XSLTInInterceptor.java
Mon Jul 22 16:06:13 2013
@@ -88,7 +88,11 @@ public class XSLTInInterceptor extends A
         } catch (IOException e) {
             throw new Fault("GET_CACHED_INPUT_STREAM", LOG, e, e.getMessage());
         } finally {
-            StaxUtils.close(xReader);
+            try {
+                StaxUtils.close(xReader);
+            } catch (XMLStreamException ex) {
+                throw new Fault(ex);
+            }
             try {
                 cachedOS.close();
             } catch (IOException e) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingProvider.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingProvider.java
Mon Jul 22 16:06:13 2013
@@ -33,6 +33,7 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.MessageBodyReader;
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Provider;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
@@ -75,7 +76,11 @@ public class DataBindingProvider<T> impl
         } catch (Exception ex) {
             throw new BadRequestException(ex);
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+                // Ignore
+            }
         }
     }
 

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
Mon Jul 22 16:06:13 2013
@@ -204,7 +204,11 @@ public class JAXBElementProvider<T> exte
             LOG.warning(getStackTrace(e));
             throw new BadRequestException(e);        
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+                // Ignore
+            }
         }
         // unreachable
         return null;
@@ -219,7 +223,11 @@ public class JAXBElementProvider<T> exte
             } catch (JAXBException e) {
                 throw e;
             } finally {
-                StaxUtils.close(reader);
+                try {
+                    StaxUtils.close(reader);
+                } catch (XMLStreamException e) {
+                    // Ignore
+                }
             }
         }
         return unmarshalFromInputStream(unmarshaller, is, mt);
@@ -271,7 +279,11 @@ public class JAXBElementProvider<T> exte
             }
             return unmarshaller.unmarshal(xmlReader);
         } finally {
-            StaxUtils.close(xmlReader);
+            try {
+                StaxUtils.close(xmlReader);
+            } catch (XMLStreamException e) {
+                // Ignore
+            }
         }
     }
 

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Mon Jul
22 16:06:13 2013
@@ -498,7 +498,11 @@ public class DispatchImpl<T> implements 
         } catch (XMLStreamException e) {
             // ignore
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+             // ignore
+            }
             StaxUtils.close(resultWriter);
         }
         return null;

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java Mon
Jul 22 16:06:13 2013
@@ -30,6 +30,7 @@ import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMResult;
@@ -42,7 +43,6 @@ import javax.xml.ws.wsaddressing.W3CEndp
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
@@ -380,7 +380,11 @@ public class ProviderImpl extends javax.
             throw new WebServiceException(new Message("ERROR_UNMARSHAL_ENDPOINTREFERENCE",
LOG).toString(),
                                           e);
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+                // Ignore
+            }
         }
     }
 

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
Mon Jul 22 16:06:13 2013
@@ -35,6 +35,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.Provider;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
@@ -72,7 +73,11 @@ public class AegisElementProvider<T> ext
         } catch (Exception e) {
             throw new BadRequestException(e);
         } finally {
-            StaxUtils.close(xmlStreamReader);
+            try {
+                StaxUtils.close(xmlStreamReader);
+            } catch (XMLStreamException e) {
+                throw new BadRequestException(e);
+            }
         }
     }
 

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
Mon Jul 22 16:06:13 2013
@@ -257,7 +257,11 @@ public class JSONProvider<T> extends Abs
         } catch (Exception e) {
             throw new BadRequestException(e);
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+                throw new BadRequestException(e);
+            }
         }
         // unreachable
         return null;

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
Mon Jul 22 16:06:13 2013
@@ -457,7 +457,11 @@ public class PolicyAnnotationListener im
             LOG.log(Level.WARNING, e.getMessage());
             return null;
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+                LOG.log(Level.WARNING, e.getMessage());
+            }
         }
     }
     

Modified: cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java (original)
+++ cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java Mon Jul 22
16:06:13 2013
@@ -55,12 +55,12 @@ import javax.xml.bind.annotation.XmlRoot
 import javax.xml.bind.annotation.XmlSchema;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.stream.util.StreamReaderDelegate;
 
 import org.w3c.dom.Element;
-
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.jaxb.JAXBContextCache;
 import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
@@ -363,7 +363,11 @@ public class JAXBExtensionHelper impleme
                                     "Error reading element " + qname,
                                     ex);
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException ex) {
+                throw new WSDLException(WSDLException.PARSER_ERROR, ex.getMessage(), ex);
+            }
         }
     }
     

Modified: cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Mon Jul 22
16:06:13 2013
@@ -36,13 +36,12 @@ import javax.wsdl.extensions.mime.MIMEPa
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-
 import org.xml.sax.InputSource;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
@@ -236,7 +235,11 @@ public class WSDLManagerImpl implements 
             } catch (Exception e) {
                 throw new WSDLException(WSDLException.PARSER_ERROR, e.getMessage(), e);
             } finally {
-                StaxUtils.close(xmlReader);
+                try {
+                    StaxUtils.close(xmlReader);
+                } catch (XMLStreamException ex) {
+                    throw new WSDLException(WSDLException.PARSER_ERROR, ex.getMessage(),
ex);
+                }
             }
             def = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
         } else {

Modified: cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/Stax2DOM.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/Stax2DOM.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/Stax2DOM.java
(original)
+++ cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/Stax2DOM.java
Mon Jul 22 16:06:13 2013
@@ -65,7 +65,11 @@ public class Stax2DOM {
         } catch (Exception e) {
             throw new ToolException(e);
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e1) {
+                throw new ToolException(e1);
+            }
             if (input != null) {
                 try {
                     input.close();

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=1505727&r1=1505726&r2=1505727&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Mon Jul 22 16:06:13 2013
@@ -161,7 +161,11 @@ public final class CustomizationParser {
             Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {uri});
             throw new ToolException(msg, e);
         } finally {
-            StaxUtils.close(reader);
+            try {
+                StaxUtils.close(reader);
+            } catch (XMLStreamException e) {
+                //ignore
+            }
             try {
                 ins.close();
             } catch (IOException ex) {



Mime
View raw message