Author: dkulp
Date: Wed Oct 26 21:18:12 2011
New Revision: 1189469

URL: http://svn.apache.org/viewvc?rev=1189469&view=rev
Log:
Merged revisions 1189467 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1189467 | dkulp | 2011-10-26 17:15:20 -0400 (Wed, 26 Oct 2011) | 2 lines
  
  Trap the calls to factory.setProperty so unsupported properties can be
  ignored.
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java

Propchange: cxf/branches/2.4.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1189469&r1=1189468&r2=1189469&view=diff
==============================================================================
--- 
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
 (original)
+++ 
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
 Wed Oct 26 21:18:12 2011
@@ -191,10 +191,10 @@ public final class StaxUtils {
      */
     public static XMLInputFactory createXMLInputFactory(boolean nsAware) {
         XMLInputFactory factory = XMLInputFactory.newInstance();
-        factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, nsAware);
-        factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
-        factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, 
Boolean.FALSE);
-        factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, 
Boolean.FALSE);
+        setProperty(factory, XMLInputFactory.IS_NAMESPACE_AWARE, nsAware);
+        setProperty(factory, XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
+        setProperty(factory, XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, 
Boolean.FALSE);
+        setProperty(factory, XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, 
Boolean.FALSE);
         factory.setXMLResolver(new XMLResolver() {
             public Object resolveEntity(String publicID, String systemID,
                                         String baseURI, String namespace)
@@ -204,6 +204,14 @@ public final class StaxUtils {
         });
         return factory;
     }
+    
+    private static void setProperty(XMLInputFactory f, String p, Object o) {
+        try {
+            f.setProperty(p,  o);
+        } catch (Throwable t) {
+            //ignore
+        }
+    }
 
     
 


Reply via email to