cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject git commit: Fix problem with parsing blueprint things that sometime result in JAXBElements instead of the actual type
Date Tue, 08 Apr 2014 20:48:34 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0aa3a159b -> cd4adda07


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/cd4adda0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cd4adda0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cd4adda0

Branch: refs/heads/master
Commit: cd4adda07214cb06912872f15b54a991759556a7
Parents: 0aa3a15
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:48:08 2014 -0600

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/cd4adda0/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
b/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
index d2b57de..6be1e3c 100644
--- a/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
+++ b/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