--- old/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java 2017-09-29 13:58:30.352185243 +0100 +++ new/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java 2017-09-29 13:58:30.072185238 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -30,7 +30,7 @@ /** * {@link XmlAdapter} useful for mapping interfaces. * - * See The JAXB user's guide + * See The JAXB user's guide * for more about this adapter class. * * @author Kohsuke Kawaguchi --- old/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java 2017-09-29 13:58:30.888185253 +0100 +++ new/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java 2017-09-29 13:58:30.596185247 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -32,14 +32,13 @@ * to handle cycles in the object graph. * *

- * As discussed in + * As discussed in * the users' guide, normally a cycle in the object graph causes the marshaller to report an error, * and when an error is found, the JAXB RI recovers by cutting the cycle arbitrarily. * This is not always a desired behavior. * *

* Implementing this interface allows user application to change this behavior. - * Also see this related discussion. * * @since JAXB 2.1 EA2 * @author Kohsuke Kawaguchi --- old/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java 2017-09-29 13:58:31.420185263 +0100 +++ new/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java 2017-09-29 13:58:31.136185257 +0100 @@ -182,6 +182,9 @@ Map properties) throws JAXBException { try { + + ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, spFactory); + /* * javax.xml.bind.context.factory points to a class which has a * static method called 'createContext' that @@ -215,8 +218,6 @@ throw handleClassCastException(context.getClass(), JAXBContext.class); } - ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, spFactory); - return (JAXBContext) context; } catch (InvocationTargetException x) { // throw if it is exception not to be wrapped @@ -274,6 +275,7 @@ Map properties, Class spFactory) throws JAXBException { try { + ModuleUtil.delegateAddOpensToImplModule(classes, spFactory); Method m = spFactory.getMethod("createContext", Class[].class, Map.class); Object obj = instantiateProviderIfNecessary(spFactory); @@ -282,7 +284,6 @@ // the cast would fail, so generate an exception with a nice message throw handleClassCastException(context.getClass(), JAXBContext.class); } - ModuleUtil.delegateAddOpensToImplModule(classes, spFactory); return (JAXBContext) context; } catch (NoSuchMethodException | IllegalAccessException e) { @@ -328,9 +329,8 @@ JAXBContextFactory.class, logger, EXCEPTION_HANDLER); if (obj != null) { - JAXBContext context = obj.createContext(contextPath, classLoader, properties); ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, obj.getClass()); - return context; + return obj.createContext(contextPath, classLoader, properties); } // to ensure backwards compatibility @@ -385,9 +385,8 @@ ServiceLoaderUtil.firstByServiceLoader(JAXBContextFactory.class, logger, EXCEPTION_HANDLER); if (factory != null) { - JAXBContext context = factory.createContext(classes, properties); ModuleUtil.delegateAddOpensToImplModule(classes, factory.getClass()); - return context; + return factory.createContext(classes, properties); } // to ensure backwards compatibility --- old/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java 2017-09-29 13:58:31.968185273 +0100 +++ new/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java 2017-09-29 13:58:31.676185267 +0100 @@ -373,7 +373,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -395,7 +395,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -417,7 +417,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -440,7 +440,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -462,7 +462,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -488,7 +488,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -511,7 +511,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -535,7 +535,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any - * object reachable from {@code jaxbElement}). See + * object reachable from {@code jaxbElement}). See * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null @@ -575,7 +575,7 @@ * {@code Marshaller}. This method can only be used to set one of * the standard JAXB defined properties above or a provider specific * property. Attempting to set an undefined property will result in - * a PropertyException being thrown. See + * a PropertyException being thrown. See * Supported Properties. * * @param name the name of the property to be set. This value can either @@ -596,7 +596,7 @@ * {@code Marshaller}. This method can only be used to get one of * the standard JAXB defined properties above or a provider specific * property. Attempting to get an undefined property will result in - * a PropertyException being thrown. See + * a PropertyException being thrown. See * Supported Properties. * * @param name the name of the property to retrieve --- old/src/java.xml.bind/share/classes/javax/xml/bind/ModuleUtil.java 2017-09-29 13:58:32.512185283 +0100 +++ new/src/java.xml.bind/share/classes/javax/xml/bind/ModuleUtil.java 2017-09-29 13:58:32.220185277 +0100 @@ -130,9 +130,6 @@ */ static void delegateAddOpensToImplModule(Class[] classes, Class factorySPI) throws JAXBException { final Module implModule = factorySPI.getModule(); - if (!implModule.isNamed()) { - return; - } Module jaxbModule = JAXBContext.class.getModule(); --- old/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java 2017-09-29 13:58:33.052185293 +0100 +++ new/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java 2017-09-29 13:58:32.768185287 +0100 @@ -186,13 +186,13 @@ * Unmarshalling can deserialize XML data that represents either an entire XML document * or a subtree of an XML document. Typically, it is sufficient to use the * unmarshalling methods described by - * Unmarshal root element that is declared globally. + * Unmarshal root element that is declared globally. * These unmarshal methods utilize {@link JAXBContext}'s mapping of global XML element * declarations and type definitions to JAXB mapped classes to initiate the * unmarshalling of the root element of XML data. When the {@link JAXBContext}'s * mappings are not sufficient to unmarshal the root element of XML data, * the application can assist the unmarshalling process by using the - * unmarshal by declaredType methods. + * unmarshal by declaredType methods. * These methods are useful for unmarshalling XML data where * the root element corresponds to a local element declaration in the schema. * @@ -251,7 +251,7 @@ * * JAXBElement Property * Value - * + * * * name * {@code xml element name} @@ -276,7 +276,7 @@ * *

* The following is an example of - * unmarshal by declaredType method. + * unmarshal by declaredType method. *

* Unmarshal by declaredType from a {@code org.w3c.dom.Node}: *

@@ -422,7 +422,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the file parameter is null */ @@ -434,7 +434,7 @@ * be incomplete when using this form of the unmarshal API. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * * @param is the InputStream to unmarshal XML data from * @return the newly created root object of the java content tree @@ -445,7 +445,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the InputStream parameter is null */ @@ -458,7 +458,7 @@ * because a Reader does not provide the system ID. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * * @param reader the Reader to unmarshal XML data from * @return the newly created root object of the java content tree @@ -469,7 +469,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the InputStream parameter is null * @since 1.6, JAXB 2.0 @@ -481,7 +481,7 @@ * content tree. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * * @param url the url to unmarshal XML data from * @return the newly created root object of the java content tree @@ -492,7 +492,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the URL parameter is null */ @@ -503,7 +503,7 @@ * resulting content tree. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * * @param source the input source to unmarshal XML data from * @return the newly created root object of the java content tree @@ -514,7 +514,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the InputSource parameter is null */ @@ -525,7 +525,7 @@ * content tree. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * * @param node * the document/element to unmarshal XML data from. @@ -538,7 +538,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the Node parameter is null * @see #unmarshal(org.w3c.dom.Node, Class) @@ -550,7 +550,7 @@ * and return the resulting content tree. * *

- * Implements Unmarshal by Declared Type + * Implements Unmarshal by Declared Type * * @param node * the document/element to unmarshal XML data from. @@ -558,7 +558,7 @@ * @param declaredType * appropriate JAXB mapped class to hold {@code node}'s XML data. * - * @return JAXB Element representation of {@code node} + * @return JAXB Element representation of {@code node} * * @throws JAXBException * If any unexpected errors occur while unmarshalling @@ -566,7 +566,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null * @since 1.6, JAXB 2.0 @@ -578,7 +578,7 @@ * resulting content tree. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * *

* @@ -624,7 +624,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the Source parameter is null * @see #unmarshal(javax.xml.transform.Source, Class) @@ -641,13 +641,13 @@ * Implements Unmarshal by Declared Type * *

- * See SAX 2.0 Parser Pluggability + * See SAX 2.0 Parser Pluggability * * @param source the XML Source to unmarshal XML data from (providers are * only required to support SAXSource, DOMSource, and StreamSource) * @param declaredType * appropriate JAXB mapped class to hold {@code source}'s xml root element - * @return Java content rooted by JAXB Element + * @return Java content rooted by JAXB Element * * @throws JAXBException * If any unexpected errors occur while unmarshalling @@ -655,7 +655,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null * @since 1.6, JAXB 2.0 @@ -668,7 +668,7 @@ * resulting content tree. * *

- * Implements Unmarshal Global Root Element. + * Implements Unmarshal Global Root Element. * *

* This method assumes that the parser is on a START_DOCUMENT or @@ -688,7 +688,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the {@code reader} parameter is null * @throws IllegalStateException @@ -718,7 +718,7 @@ * @param declaredType * appropriate JAXB mapped class to hold {@code reader}'s START_ELEMENT XML data. * - * @return content tree rooted by JAXB Element representation + * @return content tree rooted by JAXB Element representation * * @throws JAXBException * If any unexpected errors occur while unmarshalling @@ -726,7 +726,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null * @since 1.6, JAXB 2.0 @@ -738,7 +738,7 @@ * resulting content tree. * *

- * This method is an Unmarshal Global Root method. + * This method is an Unmarshal Global Root method. * *

* This method assumes that the parser is on a START_DOCUMENT or @@ -758,7 +758,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If the {@code reader} parameter is null * @throws IllegalStateException @@ -775,7 +775,7 @@ * and return the resulting content tree. * *

- * This method implements unmarshal by declaredType. + * This method implements unmarshal by declaredType. * *

* This method assumes that the parser is on a START_DOCUMENT or @@ -789,7 +789,7 @@ * @param declaredType * appropriate JAXB mapped class to hold {@code reader}'s START_ELEMENT XML data. * - * @return content tree rooted by JAXB Element representation + * @return content tree rooted by JAXB Element representation * * @throws JAXBException * If any unexpected errors occur while unmarshalling @@ -797,7 +797,7 @@ * If the {@link ValidationEventHandler ValidationEventHandler} * returns false from its {@code handleEvent} method or the * {@code Unmarshaller} is unable to perform the XML to Java - * binding. See Unmarshalling XML Data + * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null * @since 1.6, JAXB 2.0 @@ -910,7 +910,7 @@ * {@code Unmarshaller}. This method can only be used to set one of * the standard JAXB defined properties above or a provider specific * property. Attempting to set an undefined property will result in - * a PropertyException being thrown. See + * a PropertyException being thrown. See * Supported Properties. * * @param name the name of the property to be set. This value can either @@ -931,7 +931,7 @@ * {@code Unmarshaller}. This method can only be used to get one of * the standard JAXB defined properties above or a provider specific * property. Attempting to get an undefined property will result in - * a PropertyException being thrown. See + * a PropertyException being thrown. See * Supported Properties. * * @param name the name of the property to retrieve --- old/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java 2017-09-29 13:58:33.596185303 +0100 +++ new/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java 2017-09-29 13:58:33.312185297 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, 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 @@ -34,7 +34,7 @@ * * *

Related Documentation

- *

+ * * For overviews, tutorials, examples, guides, and tool documentation, * please see: *