cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/2] git commit: Fix problem with parsing blueprint things that sometime result in JAXBElements instead of the actual type
Date Tue, 08 Apr 2014 20:53:44 GMT
Fix problem with parsing blueprint things that sometime result in JAXBElements instead of the
actual type


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7229f99e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7229f99e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7229f99e

Branch: refs/heads/2.6.x-fixes
Commit: 7229f99eb563f4def02bcb404a9faf133d2e3ff8
Parents: d5c4794
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Apr 8 14:48:08 2014 -0600
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Tue Apr 8 14:53:23 2014 -0600

----------------------------------------------------------------------
 .../blueprint/AbstractBPBeanDefinitionParser.java             | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7229f99e/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
b/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
index d2b57de..6be1e3c 100644
--- a/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
+++ b/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
@@ -337,7 +337,12 @@ public abstract class AbstractBPBeanDefinitionParser {
         public Object createJAXBBean(String v) {
             XMLStreamReader reader = StaxUtils.createXMLStreamReader(new StringReader(v));
             try {
-                return ctx.createUnmarshaller().unmarshal(reader, cls);
+                Object o = ctx.createUnmarshaller().unmarshal(reader, cls);
+                if (o instanceof JAXBElement<?>) {
+                    JAXBElement<?> el = (JAXBElement<?>)o;
+                    o = el.getValue();
+                }
+                return o;
             } catch (JAXBException e) {
                 throw new RuntimeException(e);
             } finally {


Mime
View raw message