Skip to content

Commit

Permalink
Fix (un)marshal bug #1135
Browse files Browse the repository at this point in the history
Original PR: javaee/jaxb-v2#1155

Signed-off-by: Lin Gao <lgao@redhat.com>
  • Loading branch information
gaol committed Feb 18, 2019
1 parent 2ac45c7 commit 14f308b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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;
Expand Down Expand Up @@ -122,6 +123,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;
Expand Down

0 comments on commit 14f308b

Please sign in to comment.