diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/property/PropertyFactory.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/property/PropertyFactory.java index 616f9b827..2563ce4a7 100644 --- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/property/PropertyFactory.java +++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/property/PropertyFactory.java @@ -44,6 +44,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import com.sun.xml.bind.v2.model.core.ClassInfo; import com.sun.xml.bind.v2.model.core.ID; import com.sun.xml.bind.v2.model.core.PropertyKind; import com.sun.xml.bind.v2.model.runtime.RuntimeAttributePropertyInfo; @@ -152,6 +153,9 @@ static boolean isLeaf(RuntimePropertyInfo info) { RuntimeTypeInfo rti = types.iterator().next(); if(!(rti instanceof RuntimeNonElement)) return false; + //if hasSubClasses it's not a leaf and we can't optimize, see #1135 + if (rti instanceof ClassInfo && ((ClassInfo) rti).hasSubClasses()) return false; + if(info.id()==ID.IDREF) // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object return true;