提交 93d76170 编写于 作者: A aefimov

8145039: JAXB marshaller fails with ClassCastException on classes generated by xjc

Reviewed-by: lancea
上级 31adde3b
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
......@@ -100,10 +100,15 @@ public final class CTypeRef implements TypeRef<NType,NClass> {
*/
private static QName resolveSimpleTypeName(XSType declType) {
QName name = BGMBuilder.getName(declType);
if (name != null && !XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(name.getNamespaceURI()))
return resolveSimpleTypeName(declType.getBaseType());
else
return name;
QName result = null;
if (name != null && !XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(name.getNamespaceURI())) {
result = resolveSimpleTypeName(declType.getBaseType());
} else {
if ( !"anySimpleType".equals(declType.getName()) ) {
result = name;
}
}
return result;
}
public CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册