cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r901336 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Date Wed, 20 Jan 2010 19:13:24 GMT
Author: dkulp
Date: Wed Jan 20 19:13:23 2010
New Revision: 901336

URL: http://svn.apache.org/viewvc?rev=901336&view=rev
Log:
[CXF-2627] Check the XmlElement name on the field of the wrapper class
and warn if there is an issue instead of silently ignoring it.

Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=901336&r1=901335&r2=901336&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Wed
Jan 20 19:13:23 2010
@@ -903,10 +903,21 @@
                 // JAXB Type get XmlElement Annotation
                 XmlElement el = elField.getAnnotation(XmlElement.class);
                 if (el != null
-                    && partName.equals(el.name())) {
+                    && (partName.equals(el.name())
+                        || "##default".equals(el.name()))) {
                     elField.setAccessible(true);
                     fields.add(elField);
                 } else {
+                    if (getMethod == null && setMethod == null) {
+                        if (el != null) {
+                            LOG.warning("Could not create accessor for property " + partName

+                                        + " of type " + wrapperType.getName() + " as the
@XmlElement "
+                                        + "defines the name as " + el.name());
+                        } else {
+                            LOG.warning("Could not create accessor for property " + partName

+                                        + " of type " + wrapperType.getName());
+                        }
+                    }
                     fields.add(null);
                 } 
             } else {



Mime
View raw message