Skip to content

Commit

Permalink
Fix (un)marshal bug eclipse-ee4j#1135
Browse files Browse the repository at this point in the history
  • Loading branch information
Viral Gohel committed Dec 27, 2018
1 parent 6f51ad9 commit 727b809
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 @@ -121,6 +122,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
Expand Down

0 comments on commit 727b809

Please sign in to comment.