diff options
4 files changed, 54 insertions, 23 deletions
@@ -598,3 +598,21 @@ a93b161995a80cf7b0e599cf2f91e755ab1c7098 jdk8u101-b09 ea422e4481f6edfb77bb3a4cd74a73e463143ff3 jdk8u101-b10 5f3dcb815b9715215d086ba0d48a59b23d01d0a4 jdk8u101-b11 6a0347504d4c4171fcc24bc17749c0559518d862 jdk8u101-b12 +6aba0f814a15966e47aeab61b466894b82c03c70 jdk8u76-b00 +60789eebd1fe440255fd3f504221dc8b5553b8c2 jdk8u76-b01 +8c7d476c446940edd913ba5a3ca36975febdac28 jdk8u76-b02 +4b728dce9390e63f60d9ea445c229430ed059174 jdk8u76-b03 +4dfb56754487262e72d2e76900ddb6db51974f2d jdk8u76-b04 +a0c077b39c7a331bda9764a173a2b02d0725f28f jdk8u102-b00 +a0c077b39c7a331bda9764a173a2b02d0725f28f jdk8u82-b00 +c0ad0fa38df0841eaaf81ab40e8b07b42372c5d5 jdk8u102-b01 +face9bd6bac2d43d4c423be4fe733689794c2f08 jdk8u102-b02 +4e12f131bb0dbe0478aecb7ebdfe24b10d3ece75 jdk8u102-b03 +5b1d73ea0eb68cef733eb9379ed71cfb008da72e jdk8u102-b04 +1f512419ae336ce17f1d16384e34669a81db27ae jdk8u102-b05 +c8f5925b8ec9491d95538d94803cf03b2d75d1b6 jdk8u102-b06 +d4bd96ee50976dc9e4cb308d8728e70ecb03a944 jdk8u102-b07 +ca64f5f827251b5c28046f79c3577fbc8991d3d7 jdk8u102-b08 +5b93dc7249127c6beae1a688b6cea204bac3fdd0 jdk8u102-b09 +7a11148c41b867305b153b6b82d75717accea119 jdk8u102-b10 +0305736a8580ad84733878623eda8f770ae04d60 jdk8u102-b11 diff --git a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java index 62416b0d..bcea98fe 100644 --- a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java +++ b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java @@ -1,5 +1,5 @@ /* - * 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) { diff --git a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java index 0d4fa264..941944b0 100644 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java @@ -231,22 +231,11 @@ public final class StructureLoader extends Loader { @Override public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException { ChildLoader child = childUnmarshallers.get(arg.uri,arg.local); - if(child==null) { - if ((beanInfo != null) && (beanInfo.getTypeNames() != null)) { - Iterator typeNamesIt = beanInfo.getTypeNames().iterator(); - QName parentQName = null; - if ((typeNamesIt != null) && (typeNamesIt.hasNext()) && (catchAll == null)) { - parentQName = (QName) typeNamesIt.next(); - String parentUri = parentQName.getNamespaceURI(); - child = childUnmarshallers.get(parentUri, arg.local); - } - } - if (child == null) { - child = catchAll; - if(child==null) { - super.childElement(state,arg); - return; - } + if (child == null) { + child = catchAll; + if (child==null) { + super.childElement(state,arg); + return; } } diff --git a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java index 30c80801..a9cb5bed 100644 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -110,6 +110,7 @@ import com.sun.xml.internal.txw2.TypedXmlWriter; import com.sun.xml.internal.txw2.output.ResultFactory; import com.sun.xml.internal.txw2.output.XmlSerializer; import java.util.Collection; +import java.util.HashSet; import org.xml.sax.SAXParseException; /** @@ -436,7 +437,7 @@ public final class XmlSchemaGenerator<T,C,F,M> { if(logger.isLoggable(Level.FINE)) { // debug logging to see what's going on. - logger.log(Level.FINE,"Wrigin XML Schema for "+toString(),new StackRecorder()); + logger.log(Level.FINE,"Writing XML Schema for "+toString(),new StackRecorder()); } // make it fool-proof @@ -465,6 +466,8 @@ public final class XmlSchemaGenerator<T,C,F,M> { systemIds.put(n,output.getSystemId()); } } + //Clear the namespace specific set with already written classes + n.resetWritten(); } // then write'em all @@ -542,6 +545,11 @@ public final class XmlSchemaGenerator<T,C,F,M> { */ private boolean useMimeNs; + /** + * Container for already processed classes + */ + private final Set<ClassInfo> written = new HashSet<ClassInfo>(); + public Namespace(String uri) { this.uri = uri; assert !XmlSchemaGenerator.this.namespaces.containsKey(uri); @@ -549,6 +557,13 @@ public final class XmlSchemaGenerator<T,C,F,M> { } /** + * Clear out the set of already processed classes for this namespace + */ + void resetWritten() { + written.clear(); + } + + /** * Process the given PropertyInfo looking for references to namespaces that * are foreign to the given namespace. Any foreign namespace references * found are added to the given namespaces dependency list and an <import> @@ -853,6 +868,10 @@ public final class XmlSchemaGenerator<T,C,F,M> { * @param parent the writer of the parent element into which the type will be defined */ private void writeClass(ClassInfo<T,C> c, TypeHost parent) { + if (written.contains(c)) { // to avoid cycles let's check if we haven't already processed the class + return; + } + written.add(c); // special handling for value properties if (containsValueProp(c)) { if (c.getProperties().size() == 1) { |