diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-20 17:49:34 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-20 17:49:34 +0000 |
commit | 7540c704f96b1f23c8ffe6200669cc1eec283a16 (patch) | |
tree | 5b0615b7ec64a66f068601582f20e33d8ae8df0c /java/sca/modules | |
parent | b3becb54d01c159866d6d3ea8472b0a28d8387e1 (diff) |
Fix for TUSCANY-3162
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@795933 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r-- | java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java b/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java index cf330d67c0..4eaaf3db7f 100644 --- a/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java +++ b/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java @@ -47,6 +47,11 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; import javax.xml.transform.Source; import org.apache.tuscany.sca.databinding.util.LRUCache; @@ -417,9 +422,20 @@ public class JAXBContextCache { } // Adding classes that are not part of JAXB packages for (Class<?> cls : classes) { + Package pkg = getPackage(cls); if (pkg == null || nonJAXBPackages.contains(pkg)) { classSet.add(cls); + } else { + // TUSCANY-3162: Test if a class is generated by JAXB + // There might be the case that non-JAXB classes are in the same package as the JAXB classes + if (!cls.isAnnotationPresent(XmlType.class) + && !cls.isAnnotationPresent(XmlEnum.class) + && !cls.isAnnotationPresent(XmlSeeAlso.class) + && !cls.isAnnotationPresent(XmlRootElement.class) + && !cls.isAnnotationPresent(XmlTransient.class)) { + classSet.add(cls); + } } } return classSet; |