cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1423065 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
Date Mon, 17 Dec 2012 18:01:36 GMT
Author: dkulp
Date: Mon Dec 17 18:01:36 2012
New Revision: 1423065

URL: http://svn.apache.org/viewvc?rev=1423065&view=rev
Log:
[CXF-4699] Fix non-dom level 3 issues in BusDefParser

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java?rev=1423065&r1=1423064&r2=1423065&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java Mon
Dec 17 18:01:36 2012
@@ -79,9 +79,13 @@ public class BusDefinitionParser extends
             bean.addConstructorArgValue(bus);
         } else if (!"cxf".equals(bus)) {
             bean.getRawBeanDefinition().setBeanClass(SpringBus.class);
-            bean.getRawBeanDefinition().getPropertyValues().removePropertyValue("bus");
             bean.setDestroyMethodName("shutdown");
-            element.setUserData("ID", bus, null);
+            try {
+                element.setUserData("ID", bus, null);
+                bean.getRawBeanDefinition().getPropertyValues().removePropertyValue("bus");
+            } catch (Throwable t) {
+                //likely not DOM level 3, ignore
+            }
         } else {
             addBusWiringAttribute(bean, BusWiringType.PROPERTY, bus, ctx);
             bean.getRawBeanDefinition().setAttribute(WIRE_BUS_CREATE, 
@@ -122,7 +126,12 @@ public class BusDefinitionParser extends
     @Override
     protected String resolveId(Element element, AbstractBeanDefinition definition, 
                                ParserContext ctx) {
-        String bus = (String)element.getUserData("ID");
+        String bus = null;
+        try {
+            bus = (String)element.getUserData("ID");
+        } catch (Throwable t) {
+            //ignore
+        }
         if (bus == null) {
             bus = element.getAttribute("bus");        
             if (StringUtils.isEmpty(bus)) {
@@ -133,7 +142,11 @@ public class BusDefinitionParser extends
             } else {
                 bus = bus + ".config";
             }
-            element.setUserData("ID", bus, null);
+            try {
+                element.setUserData("ID", bus, null);
+            } catch (Throwable t) {
+                //maybe no DOM level 3, ignore, but, may have issues with the counter 
+            }
         }
         return bus;
     }



Mime
View raw message