diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-20 20:20:23 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-20 20:20:23 +0000 |
commit | eb81c9f8248431be4f355dcb547ce1f870bd2be7 (patch) | |
tree | 3295510e094eb5629fc1dd73893e514eb3b5b75e /branches/sca-java-1.5.1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java | |
parent | cde4cff4053a620860b0c2e0f41024bdeb082215 (diff) |
Merge the fix for TUSCANY-3167, TUSCANY-3162 from 1.6-SNAPSHOT
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@795991 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java')
-rw-r--r-- | branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java b/branches/sca-java-1.5.1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java index cf330d67c0..4eaaf3db7f 100644 --- a/branches/sca-java-1.5.1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java +++ b/branches/sca-java-1.5.1/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; |