Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
Fix (un)marshal bug #1135
Browse files Browse the repository at this point in the history
  • Loading branch information
NiasSt90 committed Nov 8, 2017
1 parent f54663a commit d367678
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d367678

Please sign in to comment.