# HG changeset patch # User asaha # Date 1461862616 25200 # Node ID 79124f60ecc0a77f016f76c5939775c28a5826ed # Parent 1427fdd8d4502400b6a96e82e393baaa1c083ccf# Parent b8a220c4b436f83f655ff82aea9eaa31ef82bd6a Merge diff -r 1427fdd8d450 -r 79124f60ecc0 .hgtags --- a/.hgtags Mon Apr 11 12:32:25 2016 -0700 +++ b/.hgtags Thu Apr 28 09:56:56 2016 -0700 @@ -588,4 +588,18 @@ 0bff22fbd91f48c37f7c5a4544929231b92bd9bf jdk8u101-b01 31e437ae0354e628a675bc4eb6b9ca67af552fc2 jdk8u101-b02 2a5ea5a78ae7332b3d13af5580418ca9d186cda7 jdk8u101-b03 +d3b054313ed2d29f9dbbdfd71a7ab3c4ad4eb5b6 jdk8u101-b04 +0a657e4d5ed57bf3216b96915633b661f6532be5 jdk8u101-b05 +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 d3b054313ed2d29f9dbbdfd71a7ab3c4ad4eb5b6 jdk8u111-b00 diff -r 1427fdd8d450 -r 79124f60ecc0 src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java --- a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java Mon Apr 11 12:32:25 2016 -0700 +++ b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeRef.java Thu Apr 28 09:56:56 2016 -0700 @@ -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 @@ */ 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 -r 1427fdd8d450 -r 79124f60ecc0 src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java Mon Apr 11 12:32:25 2016 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java Thu Apr 28 09:56:56 2016 -0700 @@ -231,22 +231,11 @@ @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 -r 1427fdd8d450 -r 79124f60ecc0 src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java Mon Apr 11 12:32:25 2016 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java Thu Apr 28 09:56:56 2016 -0700 @@ -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.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 @@ 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 @@ systemIds.put(n,output.getSystemId()); } } + //Clear the namespace specific set with already written classes + n.resetWritten(); } // then write'em all @@ -542,6 +545,11 @@ */ private boolean useMimeNs; + /** + * Container for already processed classes + */ + private final Set written = new HashSet(); + public Namespace(String uri) { this.uri = uri; assert !XmlSchemaGenerator.this.namespaces.containsKey(uri); @@ -549,6 +557,13 @@ } /** + * 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 @@ * @param parent the writer of the parent element into which the type will be defined */ private void writeClass(ClassInfo 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) {