Skip to content

Commit

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

Move the original fix down after IDREF check

Signed-off-by: Lin Gao <lgao@redhat.com>
  • Loading branch information
gaol committed Jun 10, 2019
1 parent 0a92c0c commit 27ead36
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 @@ -126,6 +127,9 @@ static boolean isLeaf(RuntimePropertyInfo info) {
// IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
return true;

//if hasSubClasses it's not a leaf and we can't optimize, see #1135
if (rti instanceof ClassInfo && ((ClassInfo) rti).hasSubClasses()) return false;

if(((RuntimeNonElement)rti).getTransducer()==null)
// Transducer!=null means definitely binds to PCDATA.
// even if transducer==null, a referene might be IDREF,
Expand Down

0 comments on commit 27ead36

Please sign in to comment.