src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 1068,1090 ****
Element te = (Element) t.getTarget();
elemName = te.getElementName();
}
Collection<TypeInfo> refs = propInfo.ref();
! TypeInfo ti;
! if ((refs != null) && (!refs.isEmpty()) && (elemName != null)
! && ((ti = refs.iterator().next()) == null || ti instanceof ClassInfoImpl)) {
! ClassInfoImpl cImpl = (ClassInfoImpl)ti;
! if ((cImpl != null) && (cImpl.getElementName() != null)) {
e.ref(new QName(cImpl.getElementName().getNamespaceURI(), tn.getLocalPart()));
! } else {
e.ref(new QName("", tn.getLocalPart()));
! }
! } else {
e.ref(tn);
}
- }
} else {
e.name(tn.getLocalPart());
writeTypeRef(e,t, "type");
elementFormDefault.writeForm(e,tn);
}
--- 1068,1094 ----
Element te = (Element) t.getTarget();
elemName = te.getElementName();
}
Collection<TypeInfo> refs = propInfo.ref();
! if ((refs != null) && (!refs.isEmpty()) && (elemName != null)){
! ClassInfoImpl cImpl = null;
! for (TypeInfo ref : refs) {
! if (ref == null || ref instanceof ClassInfoImpl) {
! if (elemName.equals(((ClassInfoImpl)ref).getElementName())) {
! cImpl = (ClassInfoImpl) ref;
! break;
! }
! }
! }
! if (cImpl != null)
e.ref(new QName(cImpl.getElementName().getNamespaceURI(), tn.getLocalPart()));
! else
e.ref(new QName("", tn.getLocalPart()));
! } else
e.ref(tn);
}
} else {
e.name(tn.getLocalPart());
writeTypeRef(e,t, "type");
elementFormDefault.writeForm(e,tn);
}