--- old/jaxp/src/java.xml/share/classes/module-info.java 2017-02-14 14:25:02.407953333 +0300 +++ new/jaxp/src/java.xml/share/classes/module-info.java 2017-02-14 14:25:02.299952643 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -55,12 +55,6 @@ exports org.xml.sax; exports org.xml.sax.ext; exports org.xml.sax.helpers; - exports com.sun.org.apache.xerces.internal.dom to - java.xml.ws; - exports com.sun.org.apache.xerces.internal.jaxp to - java.xml.ws; - exports com.sun.org.apache.xerces.internal.util to - java.xml.ws; exports com.sun.org.apache.xml.internal.dtm to java.xml.crypto; exports com.sun.org.apache.xml.internal.utils to --- old/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java 2017-02-14 14:25:02.923956633 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java 2017-02-14 14:25:02.819955968 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -54,9 +54,7 @@ public Object[] getArguments(); public String getResourceBundleName(); - public default ResourceBundle getResourceBundle(Locale locale) { - return null; - } + public ResourceBundle getResourceBundle(Locale locale); /** * Special constant that represents a message that --- old/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java 2017-02-14 14:25:03.443959957 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java 2017-02-14 14:25:03.343959318 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -31,6 +31,7 @@ import java.util.Locale; import java.util.ResourceBundle; + /** * @author WS Development Team */ @@ -42,13 +43,9 @@ private final String _key; private final Object[] _args; + @Deprecated public LocalizableMessage(String bundlename, String key, Object... args) { - _bundlename = bundlename; - _rbSupplier = null; - _key = key; - if(args==null) - args = new Object[0]; - _args = args; + this(bundlename, null, key, args); } public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier, @@ -61,15 +58,17 @@ _args = args; } - + @Override public String getKey() { return _key; } + @Override public Object[] getArguments() { return Arrays.copyOf(_args, _args.length); } + @Override public String getResourceBundleName() { return _bundlename; } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java 2017-02-14 14:25:03.939963129 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java 2017-02-14 14:25:03.839962490 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -36,6 +36,7 @@ private final String _bundlename; private final ResourceBundleSupplier _rbSupplier; + @Deprecated public LocalizableMessageFactory(String bundlename) { _bundlename = bundlename; _rbSupplier = null; @@ -58,4 +59,5 @@ */ ResourceBundle getResourceBundle(Locale locale); } + } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java 2017-02-14 14:25:04.471966531 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java 2017-02-14 14:25:04.367965866 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -25,7 +25,6 @@ package com.sun.istack.internal.localization; -import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier; import java.text.MessageFormat; import java.util.HashMap; import java.util.Locale; @@ -41,7 +40,7 @@ public class Localizer { private final Locale _locale; - private final HashMap _resourceBundles; + private final HashMap _resourceBundles; public Localizer() { this(Locale.getDefault()); @@ -49,7 +48,7 @@ public Localizer(Locale l) { _locale = l; - _resourceBundles = new HashMap(); + _resourceBundles = new HashMap<>(); } public Locale getLocale() { --- old/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java 2017-02-14 14:25:04.979969779 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java 2017-02-14 14:25:04.883969165 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -25,6 +25,9 @@ package com.sun.istack.internal.localization; +import java.util.Locale; +import java.util.ResourceBundle; + /** * {@link Localizable} that wraps a non-localizable string. * @@ -39,13 +42,20 @@ this.msg = msg; } + @Override public String getKey() { return Localizable.NOT_LOCALIZABLE; } + @Override public Object[] getArguments() { return new Object[]{msg}; } + @Override public String getResourceBundleName() { return ""; } + @Override + public ResourceBundle getResourceBundle(Locale locale) { + return null; + } } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java 2017-02-14 14:25:05.495973078 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java 2017-02-14 14:25:05.391972413 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -533,4 +533,14 @@ * @since 2.2.6 */ public static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; + + /** + * If true, despite of the specification, unmarshall child element with parent namespace, if child namespace is not specified. + * The default value is false. + * + * Boolean + * @since 2.3.0 + */ + public static final String BACKUP_WITH_PARENT_NAMESPACE = "com.sun.xml.internal.bind.backupWithParentNamespace"; + } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java 2017-02-14 14:25:06.003976326 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java 2017-02-14 14:25:05.903975687 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -112,6 +112,8 @@ "is not active. Using JAXB's implementation"); } + Boolean backupWithParentNamespace = getPropertyValue(properties, JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE, Boolean.class); + RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); @@ -144,6 +146,7 @@ builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); + builder.setBackupWithParentNamespace(backupWithParentNamespace); return builder.build(); } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java 2017-02-14 14:25:06.535979728 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java 2017-02-14 14:25:06.431979063 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -29,24 +29,25 @@ /** * listen to static errors found during building a JAXB model from a set of classes. - * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. + * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}. * *

* All the static errors have to be reported while constructing a - * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder#link} completes. - * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} wraps an {@link ErrorHandler} and all the model + * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} completes. + * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} wraps an {@link ErrorHandler} and all the model * components should report errors through it. * *

* {@link IllegalAnnotationException} is a checked exception to remind * the model classes to report it rather than to throw it. * - * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder + * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI * @author Kohsuke Kawaguchi */ public interface ErrorHandler { /** * Receives a notification for an error in the annotated code. + * @param e */ void error( IllegalAnnotationException e ); } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java 2017-02-14 14:25:07.055983053 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java 2017-02-14 14:25:06.959982439 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -57,7 +57,7 @@ public final boolean isOrdered; /** - * {@link com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to + * {@code com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to * {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order. */ public final int propertyIndex; --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java 2017-02-14 14:25:07.603986557 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java 2017-02-14 14:25:07.499985892 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -34,18 +34,22 @@ * *

* This interface is only meant to be used as a return type from - * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. + * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}. * * @author Kohsuke Kawaguchi + * @param + * @param */ public interface RegistryInfo { /** * Returns all the references to other types in this registry. + * @return */ Set> getReferences(); /** * Returns the class with {@link XmlRegistry}. + * @return */ C getClazz(); } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java 2017-02-14 14:25:08.115989831 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java 2017-02-14 14:25:08.015989191 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -242,6 +242,16 @@ private Set xmlNsSet = null; /** + * If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified. + * The default value is null for System {code}com.sun.xml.internal.bind.backupWithParentNamespace{code} property to be used, + * and false is assumed if it's not set either. + * + * Boolean + * @since 2.3.0 + */ + public Boolean backupWithParentNamespace = null; + + /** * Returns declared XmlNs annotations (from package-level annotation XmlSchema * * @return set of all present XmlNs annotations @@ -263,6 +273,7 @@ this.supressAccessorWarnings = builder.supressAccessorWarnings; this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling; this.disableSecurityProcessing = builder.disableSecurityProcessing; + this.backupWithParentNamespace = builder.backupWithParentNamespace; Collection typeRefs = builder.typeRefs; @@ -1024,6 +1035,7 @@ private boolean allNillable; private boolean improvedXsiTypeHandling = true; private boolean disableSecurityProcessing = true; + private Boolean backupWithParentNamespace = null; // null for System property to be used public JAXBContextBuilder() {}; @@ -1039,6 +1051,7 @@ this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport; this.allNillable = baseImpl.allNillable; this.disableSecurityProcessing = baseImpl.disableSecurityProcessing; + this.backupWithParentNamespace = baseImpl.backupWithParentNamespace; } public JAXBContextBuilder setRetainPropertyInfo(boolean val) { @@ -1101,6 +1114,11 @@ return this; } + public JAXBContextBuilder setBackupWithParentNamespace(Boolean backupWithParentNamespace) { + this.backupWithParentNamespace = backupWithParentNamespace; + return this; + } + public JAXBContextImpl build() throws JAXBException { // fool-proof --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java 2017-02-14 14:25:08.651993258 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java 2017-02-14 14:25:08.551992618 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -39,7 +39,7 @@ private static final Logger logger = Util.getClassLogger(); - protected static final boolean noOptimize = Runtime.version().major() >= 9 || + protected static final boolean noOptimize = Util.getSystemProperty(ClassTailor.class.getName()+".noOptimize")!=null; static { --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java 2017-02-14 14:25:09.159996506 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java 2017-02-14 14:25:09.063995892 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -40,6 +40,11 @@ import com.sun.xml.internal.bind.Util; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; +import java.lang.reflect.Field; +import java.security.CodeSource; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; /** * A {@link ClassLoader} used to "inject" optimized accessor classes @@ -131,7 +136,7 @@ /** * Injected classes keyed by their names. */ - private final Map classes = new HashMap(); + private final Map classes = new HashMap<>(); private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock(); private final Lock r = rwl.readLock(); private final Lock w = rwl.writeLock(); @@ -141,26 +146,59 @@ * False otherwise, which happens if this classloader can't see {@link Accessor}. */ private final boolean loadable; - private static final Method defineClass; - private static final Method resolveClass; - private static final Method findLoadedClass; + private static Method defineClass; + private static Method resolveClass; + private static Method findLoadedClass; + private static Object U; static { - Method[] m = AccessController.doPrivileged( - new PrivilegedAction() { + try { + Method[] m = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Method[] run() { + return new Method[]{ + getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), + getMethod(ClassLoader.class, "resolveClass", Class.class), + getMethod(ClassLoader.class, "findLoadedClass", String.class) + }; + } + } + ); + defineClass = m[0]; + resolveClass = m[1]; + findLoadedClass = m[2]; + } catch (Throwable t) { + try { + U = AccessController.doPrivileged(new PrivilegedExceptionAction() { @Override - public Method[] run() { - return new Method[]{ - getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), - getMethod(ClassLoader.class, "resolveClass", Class.class), - getMethod(ClassLoader.class, "findLoadedClass", String.class) - }; + public Object run() throws Exception { + Class u = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = u.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + return theUnsafe.get(null); } - } - ); - defineClass = m[0]; - resolveClass = m[1]; - findLoadedClass = m[2]; + }); + defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Method run() throws Exception { + try { + return U.getClass().getMethod("defineClass", + new Class[]{String.class, + byte[].class, + Integer.TYPE, + Integer.TYPE, + ClassLoader.class, + ProtectionDomain.class}); + } catch (NoSuchMethodException | SecurityException ex) { + throw ex; + } + } + }); + } catch (SecurityException | PrivilegedActionException ex) { + Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex); + } + } } private static Method getMethod(final Class c, final String methodname, final Class... params) { @@ -210,13 +248,11 @@ rlocked = false; //find loaded class from classloader - if (c == null) { + if (c == null && findLoadedClass != null) { try { c = (Class) findLoadedClass.invoke(parent, className.replace('/', '.')); - } catch (IllegalArgumentException e) { - logger.log(Level.FINE, "Unable to find " + className, e); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { logger.log(Level.FINE, "Unable to find " + className, e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); @@ -253,9 +289,13 @@ // we need to inject a class into the try { - c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length); - resolveClass.invoke(parent, c); - } catch (IllegalAccessException e) { + if (resolveClass != null) { + c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length); + resolveClass.invoke(parent, c); + } else { + c = (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, parent, Injector.class.getProtectionDomain()); + } + } catch (IllegalAccessException e) { logger.log(Level.FINE, "Unable to inject " + className, e); return null; } catch (InvocationTargetException e) { --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java 2017-02-14 14:25:09.708000010 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java 2017-02-14 14:25:09.591999268 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -33,7 +33,7 @@ import org.w3c.dom.Node; /** - * Object that returns the current location that the {@link com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor} + * Object that returns the current location that the {@code com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor} * is parsing. * * @author Kohsuke Kawaguchi @@ -41,6 +41,7 @@ public interface LocatorEx extends Locator { /** * Gets the current location in a {@link ValidationEventLocator} object. + * @return */ ValidationEventLocator getLocation(); --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java 2017-02-14 14:25:10.256003514 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java 2017-02-14 14:25:10.160002900 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -31,7 +31,9 @@ import javax.xml.namespace.QName; +import com.sun.xml.internal.bind.Util; import com.sun.xml.internal.bind.api.AccessorException; +import com.sun.xml.internal.bind.api.JAXBRIContext; import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl; import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; @@ -231,11 +233,26 @@ @Override public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException { ChildLoader child = childUnmarshallers.get(arg.uri,arg.local); - if (child == null) { - child = catchAll; - if (child==null) { - super.childElement(state,arg); - return; + if(child == null) { + Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace; + backupWithParentNamespace = backupWithParentNamespace != null + ? backupWithParentNamespace + : Boolean.parseBoolean(Util.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE)); + if ((beanInfo != null) && (beanInfo.getTypeNames() != null) && backupWithParentNamespace) { + 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; + } } } --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java 2017-02-14 14:25:10.784006890 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java 2017-02-14 14:25:10.680006225 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -23,5 +23,8 @@ * questions. */ +/** + * XML Schema writer generated by TXW. + */ @com.sun.xml.internal.txw2.annotation.XmlNamespace("http://www.w3.org/2001/XMLSchema") package com.sun.xml.internal.bind.v2.schemagen.xmlschema; --- old/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java 2017-02-14 14:25:11.312010266 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java 2017-02-14 14:25:11.212009627 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -158,7 +158,7 @@ Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader); return newInstance(contextPath, spFactory, classLoader, properties); } catch (ClassNotFoundException x) { - throw new JAXBException(Messages.format(Messages.PROVIDER_NOT_FOUND, className), x); + throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), x); } catch (RuntimeException | JAXBException x) { // avoid wrapping RuntimeException to JAXBException, @@ -228,7 +228,7 @@ } } - private static Object instantiateProviderIfNecessary(Class implClass) throws JAXBException { + private static Object instantiateProviderIfNecessary(final Class implClass) throws JAXBException { try { if (JAXBContextFactory.class.isAssignableFrom(implClass)) { return AccessController.doPrivileged(new PrivilegedExceptionAction() { @@ -254,7 +254,7 @@ try { spi = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, getContextClassLoader()); } catch (ClassNotFoundException e) { - throw new JAXBException(e); + throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), e); } if (logger.isLoggable(Level.FINE)) { @@ -525,6 +525,7 @@ } else { return (ClassLoader) java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public java.lang.Object run() { return Thread.currentThread().getContextClassLoader(); } @@ -539,6 +540,7 @@ } else { return (ClassLoader) java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public java.lang.Object run() { return c.getClassLoader(); } @@ -552,6 +554,7 @@ } else { return (ClassLoader) java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public java.lang.Object run() { return ClassLoader.getSystemClassLoader(); } --- old/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java 2017-02-14 14:25:11.860013770 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java 2017-02-14 14:25:11.760013131 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -65,6 +65,9 @@ static final String PROVIDER_NOT_FOUND = // 1 arg "ContextFinder.ProviderNotFound"; + static final String DEFAULT_PROVIDER_NOT_FOUND = // 0 args + "ContextFinder.DefaultProviderNotFound"; + static final String COULD_NOT_INSTANTIATE = // 2 args "ContextFinder.CouldNotInstantiate"; --- old/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties 2017-02-14 14:25:12.352016916 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties 2017-02-14 14:25:12.256016302 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 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 @@ -26,6 +26,9 @@ ContextFinder.ProviderNotFound = \ Provider {0} not found +ContextFinder.DefaultProviderNotFound = \ + Implementation of JAXB-API has not been found on module path or classpath. + ContextFinder.CouldNotInstantiate = \ Provider {0} could not be instantiated: {1} --- old/jaxws/src/java.xml.bind/share/classes/module-info.java 2017-02-14 14:25:12.856020139 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/module-info.java 2017-02-14 14:25:12.760019525 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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,6 +34,7 @@ requires java.compiler; requires java.desktop; requires java.logging; + requires jdk.unsupported; uses javax.xml.bind.JAXBContextFactory; --- old/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/Generated.java 2017-02-14 14:25:13.356023336 +0300 +++ new/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/Generated.java 2017-02-14 14:25:13.256022696 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -29,19 +29,23 @@ import static java.lang.annotation.RetentionPolicy.*; /** - * The Generated annotation is used to mark source code that has been generated. + * The Generated annotation is used to mark source code + * that has been generated. * It can also be used to differentiate user written code from generated code - * in a single file. When used, the value element must have the name of the + * in a single file. + *

The value element must have the name of the * code generator. The recommended convention is to use the fully qualified - * name of the code generator in the value field . - *

For example: com.company.package.classname. - * The date element is used to indicate the date the source was generated. - * The date element must follow the ISO 8601 standard. For example the date - * element would have the following value 2001-07-04T12:08:56.235-0700 + * name of the code generator in the value field, + * for example com.company.package.classname.

+ *

The date element is used to indicate the date the + * source was generated. + * The date element must follow the ISO 8601 standard. + * For example, the date element could have the + * value 2001-07-04T12:08:56.235-0700, * which represents 2001-07-04 12:08:56 local time in the U.S. Pacific - * Time time zone.

- *

The comment element is a place holder for any comments that the code - * generator may want to include in the generated code.

+ * time zone.

+ *

The comment element is a place holder for any comments + * that the code generator may want to include in the generated code.

* * @since 1.6, Common Annotations 1.0 */ @@ -52,9 +56,9 @@ LOCAL_VARIABLE, PARAMETER}) public @interface Generated { /** - * The value element MUST have the name of the code generator. + * The value element must have the name of the code generator. * The recommended convention is to use the fully qualified name of the - * code generator. For example: com.acme.generator.CodeGen. + * code generator. For example: com.acme.generator.CodeGen. */ String[] value(); --- old/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/PostConstruct.java 2017-02-14 14:25:13.880026686 +0300 +++ new/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/PostConstruct.java 2017-02-14 14:25:13.784026073 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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,21 +30,22 @@ import static java.lang.annotation.RetentionPolicy.*; /** - * The PostConstruct annotation is used on a method that needs to be executed - * after dependency injection is done to perform any initialization. This - * method MUST be invoked before the class is put into service. This - * annotation MUST be supported on all classes that support dependency - * injection. The method annotated with PostConstruct MUST be invoked even - * if the class does not request any resources to be injected. Only one - * method can be annotated with this annotation. The method on which the - * PostConstruct annotation is applied MUST fulfill all of the following - * criteria: + * The PostConstruct annotation is used on a method that + * needs to be executed after dependency injection is done to perform + * any initialization. This method must be invoked before the class + * is put into service. This annotation must be supported on all classes + * that support dependency injection. The method annotated with + * PostConstruct must be invoked even if the class does + * not request any resources to be injected. Only one + * method in a given class can be annotated with this annotation. + * The method on which the PostConstruct annotation is + * applied must fulfill all of the following criteria: *
    - *
  • The method MUST NOT have any parameters except in the case of - * interceptors in which case it takes an InvocationContext object as - * defined by the Interceptors specification.
  • - *
  • The method defined on an interceptor class MUST HAVE one of the - * following signatures: + *
  • The method must not have any parameters except in the case of + * interceptors in which case it takes an InvocationContext + * object as defined by the Interceptors specification.
  • + *
  • The method defined on an interceptor class or superclass of an + * interceptor class must have one of the following signatures: *

    * void <METHOD>(InvocationContext) *

    @@ -57,18 +58,18 @@ * PostConstruct interceptor method returns a value, it is ignored by * the container. *

  • - *
  • The method defined on a non-interceptor class MUST HAVE the + *
  • The method defined on a non-interceptor class must have the * following signature: *

    * void <METHOD>() *

  • - *
  • The method on which PostConstruct is applied MAY be public, protected, - * package private or private.
  • - *
  • The method MUST NOT be static except for the application client.
  • - *
  • The method MAY be final.
  • - *
  • If the method throws an unchecked exception the class MUST NOT be put into - * service except in the case of EJBs where the EJB can handle exceptions and - * even recover from them.
+ *
  • The method on which the PostConstruct annotation + * is applied may be public, protected, package private or private.
  • + *
  • The method must not be static except for the application client.
  • + *
  • The method should not be final.
  • + *
  • If the method throws an unchecked exception the class must not be put into + * service except in the case where the exception is handled by an + * interceptor.
  • * * @see javax.annotation.PreDestroy * @see javax.annotation.Resource --- old/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/PreDestroy.java 2017-02-14 14:25:14.372029832 +0300 +++ new/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/PreDestroy.java 2017-02-14 14:25:14.268029167 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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,20 +30,21 @@ import static java.lang.annotation.RetentionPolicy.*; /** - * The PreDestroy annotation is used on methods as a callback notification to - * signal that the instance is in the process of being removed by the - * container. The method annotated with PreDestroy is typically used to - * release resources that it has been holding. This annotation MUST be - * supported by all container managed objects that support PostConstruct - * except the application client container in Java EE 5. The method on which - * the PreDestroy annotation is applied MUST fulfill all of the following - * criteria: + * The PreDestroy annotation is used on a method as a + * callback notification to signal that the instance is in the + * process of being removed by the container. The method annotated + * with PreDestroy is typically used to + * release resources that it has been holding. This annotation must be + * supported by all container-managed objects that support the use of + * the PostConstruct annotation except the Java EE application + * client. The method on which the PreDestroy annotation + * is applied must fulfill all of the following criteria: *
      - *
    • The method MUST NOT have any parameters except in the case of - * interceptors in which case it takes an InvocationContext object as - * defined by the Interceptors specification.
    • - *
    • The method defined on an interceptor class MUST HAVE one of the - * following signatures: + *
    • The method must not have any parameters except in the case of + * interceptors in which case it takes an InvocationContext + * object as defined by the Interceptors specification.
    • + *
    • The method defined on an interceptor class or superclass of an + * interceptor class must have one of the following signatures: *

      * void <METHOD>(InvocationContext) *

      @@ -56,17 +57,17 @@ * PreDestroy interceptor method returns a value, it is ignored by * the container. *

    • - *
    • The method defined on a non-interceptor class MUST HAVE the + *
    • The method defined on a non-interceptor class must have the * following signature: *

      * void <METHOD>() *

    • - *
    • The method on which PreDestroy is applied MAY be public, protected, + *
    • The method on which PreDestroy is applied may be public, protected, * package private or private.
    • - *
    • The method MUST NOT be static.
    • - *
    • The method MAY be final.
    • - *
    • If the method throws an unchecked exception it is ignored except in the - * case of EJBs where the EJB can handle exceptions.
    • + *
    • The method must not be static.
    • + *
    • The method should not be final.
    • + *
    • If the method throws an unchecked exception it is ignored by + * the container.
    • *
    * * @see javax.annotation.PostConstruct --- old/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/Resource.java 2017-02-14 14:25:14.892033157 +0300 +++ new/jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation/Resource.java 2017-02-14 14:25:14.796032543 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ import static java.lang.annotation.RetentionPolicy.*; /** - * The Resource annotation marks a resource that is needed + * The Resource annotation marks a resource that is needed * by the application. This annotation may be applied to an * application component class, or to fields or methods of the * component class. When the annotation is applied to a @@ -38,20 +38,21 @@ * of the requested resource into the application component * when the component is initialized. If the annotation is * applied to the component class, the annotation declares a - * resource that the application will look up at runtime.

    - * - * Even though this annotation is not marked Inherited, deployment + * resource that the application will look up at runtime. + *

    + * Even though this annotation is not marked Inherited, deployment * tools are required to examine all superclasses of any component * class to discover all uses of this annotation in all superclasses. * All such annotation instances specify resources that are needed * by the application component. Note that this annotation may * appear on private fields and methods of superclasses; the container - * is required to perform injection in these cases as well. + * is required to perform injection in these cases as well.

    * * @since 1.6, Common Annotations 1.0 */ @Target({TYPE, FIELD, METHOD}) @Retention(RUNTIME) +@Repeatable(Resources.class) public @interface Resource { /** * The JNDI name of the resource. For field annotations, @@ -106,19 +107,14 @@ boolean shareable() default true; /** - * A product specific name that this resource should be mapped to. - * The name of this resource, as defined by the name - * element or defaulted, is a name that is local to the application - * component using the resource. (It's a name in the JNDI - * java:comp/env namespace.) Many application servers - * provide a way to map these local names to names of resources - * known to the application server. This mapped name is often a - * global JNDI name, but may be a name of any form.

    - * - * Application servers are not required to support any particular + * A product-specific name that this resource should be mapped to. + * The mappedName element provides for mapping the + * resource reference to the name of a resource known to the + * applicaiton server. The mapped name could be of any form. + *

    Application servers are not required to support any particular * form or type of mapped name, nor the ability to use mapped names. * The mapped name is product-dependent and often installation-dependent. - * No use of a mapped name is portable. + * No use of a mapped name is portable.

    */ String mappedName() default ""; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java 2017-02-14 14:25:15.384036303 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java 2017-02-14 14:25:15.288035689 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -39,8 +39,7 @@ public interface LazyEnvelopeSource extends javax.xml.transform.Source { /** * Retrieve payload qname without materializing its contents - * @return - * @throws SOAPException + * @return payload QName */ public QName getPayloadQName(); public XMLStreamReader readToBodyStarTag() throws XMLStreamException; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java 2017-02-14 14:25:15.900039603 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java 2017-02-14 14:25:15.804038989 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -86,6 +86,7 @@ /** * Constructs a SOAPExceptionImpl object initialized * with the given Throwable object. + * @param cause cause */ public SOAPExceptionImpl(Throwable cause) { super (cause.toString()); @@ -106,6 +107,7 @@ * message of the embedded Throwable object, * if there is one */ + @Override public String getMessage() { String message = super.getMessage (); if (message == null && cause != null) { @@ -124,6 +126,7 @@ * if there is none */ + @Override public Throwable getCause() { return cause; } @@ -157,6 +160,7 @@ * method has already been called on this SOAPExceptionImpl * object */ + @Override public synchronized Throwable initCause(Throwable cause) { if(this.cause != null) { @@ -170,6 +174,7 @@ return this; } + @Override public void printStackTrace() { super.printStackTrace(); if (cause != null) { @@ -178,6 +183,7 @@ } } + @Override public void printStackTrace(PrintStream s) { super.printStackTrace(s); if (cause != null) { @@ -186,6 +192,7 @@ } } + @Override public void printStackTrace(PrintWriter s) { super.printStackTrace(s); if (cause != null) { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java 2017-02-14 14:25:16.404042825 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java 2017-02-14 14:25:16.308042211 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -512,9 +512,13 @@ : httpConnection.getInputStream()); // If no reply message is returned, // content-Length header field value is expected to be zero. - // InputStream#available() can't be used here - it just says no data *YET*! + // java SE 6 documentation says : + // available() : an estimate of the number of bytes that can be read + //(or skipped over) from this input stream without blocking + //or 0 when it reaches the end of the input stream. if ((httpIn == null ) - || (httpConnection.getContentLength() == 0)) { + || (httpConnection.getContentLength() == 0) + || (httpIn.available() == 0)) { response = null; log.warning("SAAJ0014.p2p.content.zero"); } else { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java 2017-02-14 14:25:16.928046175 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java 2017-02-14 14:25:16.828045536 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -69,7 +69,7 @@ * @return the MimeBodyPart * @exception IndexOutOfBoundsException if the given index * is out of range. - * @exception MessagingException + * @exception MessagingException thrown in case of error */ public MimeBodyPart getBodyPart(int index) throws MessagingException; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java 2017-02-14 14:25:17.432049398 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java 2017-02-14 14:25:17.336048784 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -115,6 +115,8 @@ * contentType field.

    * * MimeBodyParts may be added later. + * + * @param subtype subtype. */ public BMMimeMultipart(String subtype) { super(subtype); @@ -142,7 +144,9 @@ * skips the 'preamble' and reads bytes till the terminating * boundary and creates MimeBodyParts for each part of the stream. * - * @param ds DataSource, can be a MultipartDataSource + * @param ds DataSource, can be a MultipartDataSource. + * @param ct content type. + * @exception MessagingException in case of error. */ public BMMimeMultipart(DataSource ds, ContentType ct) throws MessagingException { @@ -197,6 +201,7 @@ * * @since JavaMail 1.2 */ + @Override protected void parse() throws MessagingException { if (parsed) return; @@ -694,6 +699,7 @@ * separated by a boundary. */ + @Override public void writeTo(OutputStream os) throws IOException, MessagingException { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java 2017-02-14 14:25:17.948052697 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java 2017-02-14 14:25:17.848052058 +0300 @@ -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 @@ -100,6 +100,7 @@ /** * Return the specified parameter value. Returns null * if this parameter is absent. + * @param name parameter name. * @return parameter value * @since JavaMail 1.2 */ @@ -123,7 +124,7 @@ /** * Set the primary type. Overrides existing primary type. - * @param primaryType primary type + * @param disposition disposition value * @since JavaMail 1.2 */ public void setDisposition(String disposition) { @@ -162,6 +163,7 @@ * @return RFC2045 style string * @since JavaMail 1.2 */ + @Override public String toString() { if (disposition == null) return null; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java 2017-02-14 14:25:18.464055996 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java 2017-02-14 14:25:18.368055383 +0300 @@ -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 @@ -136,6 +136,7 @@ /** * Return the specified parameter value. Returns null * if this parameter is absent. + * @param name parameter name * @return parameter value */ public String getParameter(String name) { @@ -200,6 +201,7 @@ * * @return RFC2045 style string */ + @Override public String toString() { if (primaryType == null || subType == null) // need both return null; @@ -218,7 +220,7 @@ /** * Match with the specified ContentType object. This method * compares only the primaryType and - * subType . The parameters of both operands + * primaryType . The parameters of both operands * are ignored.

    * * For example, this method will return true when @@ -232,6 +234,8 @@ * and "text/*" * * @param cType to compare this against + * @return true if primaryType and subType + * match specified content type. */ public boolean match(ContentType cType) { // Match primaryType @@ -266,6 +270,10 @@ * For example, this method will return true when * comparing the ContentType for "text/plain" * with "text/*" + * + * @param s content type + * @return true if primaryType and subType + * match specified content type. */ public boolean match(String s) { try { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java 2017-02-14 14:25:18.992059373 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java 2017-02-14 14:25:18.884058682 +0300 @@ -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 @@ -95,14 +95,15 @@ * one of the following: *

      *
    • ATOM A sequence of ASCII characters - * delimited by either SPACE, CTL, "(", <"> or the - * specified SPECIALS + * delimited by either SPACE, CTL, "(", <"> or the + * specified SPECIALS
    • *
    • QUOTEDSTRING A sequence of ASCII characters - * within quotes + * within quotes
    • *
    • COMMENT A sequence of ASCII characters - * within "(" and ")". - *
    • EOF End of header + * within "(" and ")".
    • + *
    • EOF End of header
    • *
    + * @return type */ public int getType() { return type; @@ -176,6 +177,7 @@ * Constructor. The RFC822 defined delimiters - RFC822 - are * used to delimit ATOMS. Also comments are skipped and not * returned as tokens + * @param header The header that is tokenized. */ public HeaderTokenizer(String header) { this(header, RFC822); @@ -317,7 +319,7 @@ currentPos++; // re-position currentPos char ch[] = new char[1]; ch[0] = c; - return new Token((int)c, new String(ch)); + return new Token(c, new String(ch)); } // Check for ATOM --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java 2017-02-14 14:25:19.516062723 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java 2017-02-14 14:25:19.420062110 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -48,13 +48,12 @@ * until the blank line that indicates end of header. The input stream * is positioned at the start of the body. The lines are stored * within the object and can be extracted as either Strings or - * {@link Header} objects.

    - *

    + * {@link Header} objects. + *

    * This class is mostly intended for service providers. MimeMessage - * and MimeBody use this class for holding their headers.

    - *

    - *


    A note on RFC822 and MIME headers

    - *

    + * and MimeBody use this class for holding their headers. + *


    A note on RFC822 and MIME headers + *

    * RFC822 and MIME header fields must contain only * US-ASCII characters. If a header contains non US-ASCII characters, * it must be encoded as per the rules in RFC 2047. The MimeUtility @@ -65,7 +64,7 @@ * header fields must be folded (wrapped) before being sent if they * exceed the line length limitation for the transport (1000 bytes for * SMTP). Received headers may have been folded. The application is - * responsible for folding and unfolding headers as appropriate.

    + * responsible for folding and unfolding headers as appropriate. * * @author John Mani * @author Bill Shannon @@ -90,12 +89,13 @@ * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The - * header lines are stored internally.

    - *

    + * header lines are stored internally. + *

    * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. * * @param is RFC822 input stream + * @exception MessagingException in case of error */ public InternetHeaders(InputStream is) throws MessagingException { load(is); @@ -104,13 +104,14 @@ /** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the - * header lines inside this InternetHeaders object.

    - *

    + * header lines inside this InternetHeaders object. + *

    * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. * * @param is RFC822 input stream + * @exception MessagingException in case of error */ public void load(InputStream is) throws MessagingException { // Read header lines until a blank line. It is valid @@ -208,9 +209,9 @@ /** * Change the first header line that matches name * to have value, adding a new header if no existing header - * matches. Remove all matching headers but the first.

    - *

    - * Note that RFC822 headers can only contain US-ASCII characters + * matches. Remove all matching headers but the first. + *

    + * Note that RFC822 headers can only contain US-ASCII characters. * * @param name header name * @param value header value @@ -242,8 +243,7 @@ } /** - * Add a header with the specified name and value to the header list.

    - *

    + * Add a header with the specified name and value to the header list. * Note that RFC822 headers can only contain US-ASCII characters. * * @param name header name @@ -285,15 +285,15 @@ * * @return Header objects */ - public List getAllHeaders() { + public FinalArrayList getAllHeaders() { return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here } /** * Add an RFC822 header line to the header store. * If the line starts with a space or tab (a continuation line), - * add it to the last header line in the list.

    - *

    + * add it to the last header line in the list. + *

    * Note that RFC822 headers can only contain US-ASCII characters * * @param line raw RFC822 header line @@ -316,15 +316,19 @@ /** * Return all the header lines as a collection + * + * @return list of header lines. */ public List getAllHeaderLines() { if(headerValueView==null) headerValueView = new AbstractList() { - public String get(int index) { + @Override + public String get(int index) { return headers.get(index).line; } - public int size() { + @Override + public int size() { return headers.size(); } }; @@ -368,6 +372,7 @@ /* * Return the "name" part of the header line. */ + @Override public String getName() { return name; } @@ -375,6 +380,7 @@ /* * Return the "value" part of the header line. */ + @Override public String getValue() { int i = line.indexOf(':'); if (i < 0) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java 2017-02-14 14:25:20.040066074 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java 2017-02-14 14:25:19.940065434 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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,7 +32,6 @@ package com.sun.xml.internal.messaging.saaj.packaging.mime.internet; -import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException; import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil; import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; @@ -52,12 +51,12 @@ /** * This class represents a MIME body part. * MimeBodyParts are contained in MimeMultipart - * objects.

    - * + * objects. + *

    * MimeBodyPart uses the InternetHeaders class to parse - * and store the headers of that body part.

    + * and store the headers of that body part. * - *


    A note on RFC 822 and MIME headers

    + *


    A note on RFC 822 and MIME headers * * RFC 822 header fields must contain only * US-ASCII characters. MIME allows non ASCII characters to be present @@ -70,7 +69,7 @@ * header fields must be folded (wrapped) before being sent if they * exceed the line length limitation for the transport (1000 bytes for * SMTP). Received headers may have been folded. The application is - * responsible for folding and unfolding headers as appropriate.

    + * responsible for folding and unfolding headers as appropriate. * * @author John Mani * @author Bill Shannon @@ -179,6 +178,8 @@ * the delimiter strings. * * @param is the body part Input Stream + * + * @exception MessagingException in case of error */ public MimeBodyPart(InputStream is) throws MessagingException { if (!(is instanceof ByteArrayInputStream) && @@ -216,6 +217,7 @@ * * @param headers The header of this part * @param content bytes representing the body of this part. + * @param len content length. */ public MimeBodyPart(InternetHeaders headers, byte[] content, int len) { this.headers = headers; @@ -242,6 +244,7 @@ /** * Return the containing MimeMultipart object, * or null if not known. + * @return parent part. */ public MimeMultipart getParent() { return parent; @@ -253,6 +256,7 @@ * addBodyPart method. parent may be * null if the MimeBodyPart is being removed * from its containing MimeMultipart. + * @param parent parent part * @since JavaMail 1.1 */ public void setParent(MimeMultipart parent) { @@ -351,6 +355,9 @@ * If the subType of mimeType is the * special character '*', then the subtype is ignored during the * comparison. + * + * @param mimeType string + * @return true if it is valid mime type */ public boolean isMimeType(String mimeType) { boolean result; @@ -375,6 +382,9 @@ * This implementation uses getHeader(name) * to obtain the requisite header field. * + * @return content disposition + * @exception MessagingException in case of error + * * @see #headers */ public String getDisposition() throws MessagingException { @@ -392,6 +402,9 @@ * If the disposition is null, any existing "Content-Disposition" * header field is removed. * + * @param disposition value + * + * @exception MessagingException in case of error * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. */ @@ -423,6 +436,9 @@ * This implementation uses getHeader(name) * to obtain the requisite header field. * + * @return encoding + * @exception MessagingException in case of error + * * @see #headers */ public String getEncoding() throws MessagingException { @@ -465,6 +481,8 @@ * * This implementation uses getHeader(name) * to obtain the requisite header field. + * + * @return conent id */ public String getContentID() { return getHeader("Content-ID", null); @@ -475,6 +493,7 @@ * If the cid parameter is null, any existing * "Content-ID" is removed. * + * @param cid content id * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. * @since JavaMail 1.3 @@ -493,6 +512,8 @@ * * This implementation uses getHeader(name) * to obtain the requisite header field. + * + * @return content MD5 sum */ public String getContentMD5() { return getHeader("Content-MD5", null); @@ -501,6 +522,8 @@ /** * Set the "Content-MD5" header field of this body part. * + * @param md5 content md5 sum + * * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. */ @@ -516,6 +539,9 @@ * * This implementation uses getHeader(name) * to obtain the requisite header field. + * + * @return array of language tags + * @exception MessagingException in case of error */ public String[] getContentLanguage() throws MessagingException { String s = getHeader("Content-Language", null); @@ -663,6 +689,7 @@ * Returns null if both are absent. * * @return filename + * @exception MessagingException in case of error */ public String getFileName() throws MessagingException { String filename = null; @@ -692,6 +719,9 @@ * Sets the "filename" parameter of the "Content-Disposition" * header field of this body part. * + * @param filename filename + * + * @exception MessagingException in case of error * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. */ @@ -769,9 +799,14 @@ * This implementation simply calls the getContentStream * method. * + * @return input stream + * + * @exception MessagingException in case of error + * * @see #getInputStream * @see #getContentStream * @since JavaMail 1.2 + * */ public InputStream getRawInputStream() throws MessagingException { return getContentStream(); @@ -782,24 +817,30 @@ * * The implementation provided here works just like the * the implementation in MimeMessage. + * + * @return data handler */ public DataHandler getDataHandler() { if (mimePart != null) { //return an inputstream return new DataHandler(new DataSource() { + @Override public InputStream getInputStream() throws IOException { return mimePart.read(); } + @Override public OutputStream getOutputStream() throws IOException { throw new UnsupportedOperationException("getOutputStream cannot be supported : You have enabled LazyAttachments Option"); } + @Override public String getContentType() { return mimePart.getContentType(); } + @Override public String getName() { return "MIMEPart Wrapped DataSource"; } @@ -890,6 +931,8 @@ * If the charset is already known, use the * setText() version that takes the charset parameter. * + * @param text string + * * @see #setText(String text, String charset) */ public void setText(String text) { @@ -902,6 +945,9 @@ * charset. The given Unicode string will be charset-encoded * using the specified charset. The charset is also used to set * the "charset" parameter. + * + * @param text string + * @param charset character set */ public void setText(String text, String charset) { if (charset == null) { @@ -932,7 +978,9 @@ /** * Output the body part as an RFC 822 format stream. * - * @exception MessagingException + * @param os output stream + * + * @exception MessagingException in case of error * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. @@ -1033,6 +1081,8 @@ /** * Remove all headers with this name. + * + * @param name header name */ public void removeHeader(String name) { headers.removeHeader(name); @@ -1041,14 +1091,18 @@ /** * Return all the headers from this Message as an Enumeration of * Header objects. + * + * @return all headers */ - public List getAllHeaders() { + public FinalArrayList getAllHeaders() { return headers.getAllHeaders(); } /** * Add a header line to this body part + * + * @param line header line to add */ public void addHeaderLine(String line) { headers.addHeaderLine(line); @@ -1075,6 +1129,8 @@ *
    * In both cases this method is typically called by the * Message.saveChanges method. + * + * @exception MessagingException in case of error. */ protected void updateHeaders() throws MessagingException { DataHandler dh = getDataHandler(); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java 2017-02-14 14:25:20.580069526 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java 2017-02-14 14:25:20.484068913 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -133,6 +133,7 @@ * contentType field.

    * * MimeBodyParts may be added later. + * @param subtype subtype. */ public MimeMultipart(String subtype) { //super(); @@ -163,6 +164,8 @@ * This must be the same information as {@link DataSource#getContentType()}. * All the callers of this method seem to have this object handy, so * for performance reason this method accepts it. Can be null. + * + * @exception MessagingException in case of error */ public MimeMultipart(DataSource ds, ContentType ct) throws MessagingException { // 'ds' was not a MultipartDataSource, we have @@ -189,7 +192,8 @@ /** * Return the number of enclosed MimeBodyPart objects. * - * @return number of parts + * @return number of parts. + * @throws MessagingException in case of error. */ public int getCount() throws MessagingException { parse(); @@ -202,8 +206,8 @@ /** * Get the specified MimeBodyPart. BodyParts are numbered starting at 0. * - * @param index the index of the desired MimeBodyPart - * @return the MimeBodyPart + * @param index the index of the desired MimeBodyPart. + * @return the MimeBodyPart. * @exception MessagingException if no such MimeBodyPart exists */ public MimeBodyPart getBodyPart(int index) @@ -221,6 +225,7 @@ * * @param CID the ContentID of the desired part * @return the MimeBodyPart + * @exception MessagingException if no such MimeBodyPart exists. */ public MimeBodyPart getBodyPart(String CID) throws MessagingException { @@ -256,6 +261,8 @@ * expensive for a specific MimeMultipart subclass, then it * might itself want to track whether its internal state actually * did change, and do the header updating only if necessary. + * + * @exception MessagingException in case of error. */ protected void updateHeaders() throws MessagingException { for (int i = 0; i < parts.size(); i++) @@ -265,6 +272,11 @@ /** * Iterates through all the parts and outputs each Mime part * separated by a boundary. + * + * @param os output stream. + * + * @exception IOException if an I/O Error occurs. + * @exception MessagingException in case of error. */ public void writeTo(OutputStream os) throws IOException, MessagingException { @@ -291,6 +303,8 @@ * method is called by all other methods that need data for * the body parts, to make sure the data has been parsed. * + * @exception MessagingException in case of error. + * * @since JavaMail 1.2 */ protected void parse() throws MessagingException { @@ -490,8 +504,9 @@ * necessary. This implementation simply constructs and returns * an InternetHeaders object. * - * @param is the InputStream to read the headers from - * @exception MessagingException + * @param is the InputStream to read the headers from. + * @return headers. + * @exception MessagingException in case of error. * @since JavaMail 1.2 */ protected InternetHeaders createInternetHeaders(InputStream is) @@ -506,8 +521,10 @@ * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * - * @param headers the headers for the body part - * @param content the content of the body part + * @param headers the headers for the body part. + * @param content the content of the body part. + * @param len the content length. + * @return MimeBodyPart * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) { @@ -521,8 +538,9 @@ * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * - * @param is InputStream containing the body part - * @exception MessagingException + * @param is InputStream containing the body part. + * @return MimeBodyPart. + * @exception MessagingException in case of error. * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException { @@ -543,8 +561,8 @@ * a specific multipart subtype. * * @param mp MimeMultipart datasource + * @exception MessagingException in case of error. */ - protected void setMultipartDataSource(MultipartDataSource mp) throws MessagingException { contentType = new ContentType(mp.getContentType()); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java 2017-02-14 14:25:21.116072954 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java 2017-02-14 14:25:21.012072289 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -50,6 +50,8 @@ /** * Constructor, that constructs a DataSource from a MimeBodyPart. + * + * @param part body part */ public MimePartDataSource(MimeBodyPart part) { this.part = part; @@ -68,6 +70,7 @@ * * @return decoded input stream */ + @Override public InputStream getInputStream() throws IOException { try { @@ -88,7 +91,8 @@ * * This implementation throws the UnknownServiceException. */ - public OutputStream getOutputStream() throws IOException { + @Override + public OutputStream getOutputStream() throws IOException { throw new UnknownServiceException(); } @@ -98,6 +102,7 @@ * This implementation just invokes the getContentType * method on the MimeBodyPart. */ + @Override public String getContentType() { return part.getContentType(); } @@ -107,7 +112,8 @@ * * This implementation just returns an empty string. */ - public String getName() { + @Override + public String getName() { try { return part.getFileName(); } catch (MessagingException mex) { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java 2017-02-14 14:25:21.624076202 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java 2017-02-14 14:25:21.520075537 +0300 @@ -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 @@ -65,11 +65,11 @@ *

    * Note that to get the actual bytes of a mail-safe String (say, * for sending over SMTP), one must do - *

    + * 
      *
      *      byte[] bytes = string.getBytes("iso-8859-1");
      *
    - * 

    + *

    * * The setHeader and addHeader methods * on MimeMessage and MimeBodyPart assume that the given header values @@ -222,6 +222,10 @@ * DataHandler uses a thread, a pair of pipe streams, * and the writeTo method to produce the data.

    * + * @param dh data handler + * + * @return encoding + * * @since JavaMail 1.2 */ public static String getEncoding(DataHandler dh) { @@ -294,6 +298,7 @@ * @param is input stream * @param encoding the encoding of the stream. * @return decoded input stream. + * @exception MessagingException in case of error */ public static InputStream decode(InputStream is, String encoding) throws MessagingException { @@ -323,6 +328,7 @@ * @param encoding the encoding of the stream. * @return output stream that applies the * specified encoding. + * @exception MessagingException in case of error */ public static OutputStream encode(OutputStream os, String encoding) throws MessagingException { @@ -358,6 +364,7 @@ * with uuencode) * @return output stream that applies the * specified encoding. + * @exception MessagingException in case of error * @since JavaMail 1.2 */ public static OutputStream encode(OutputStream os, String encoding, @@ -397,7 +404,7 @@ * "unstructured" RFC 822 headers.

    * * Example of usage: - *

    +     * 
          *
          *  MimeBodyPart part = ...
          *  String rawvalue = "FooBar Mailer, Japanese version 1.1"
    @@ -411,7 +418,7 @@
          *   // setHeader() failure
          *  }
          *
    -     * 

    + *

    * * @param text unicode string * @return Unicode string containing only US-ASCII characters @@ -446,6 +453,7 @@ * encoded are in the ASCII charset, otherwise "B" encoding * is used. * @return Unicode string containing only US-ASCII characters + * @exception UnsupportedEncodingException in case of unsupported encoding */ public static String encodeText(String text, String charset, String encoding) @@ -464,7 +472,7 @@ * returned as-is

    * * Example of usage: - *

    +     * 
          *
          *  MimeBodyPart part = ...
          *  String rawvalue = null;
    @@ -479,9 +487,10 @@
          *
          *  return value;
          *
    -     * 

    + *

    * * @param etext the possibly encoded value + * @return decoded text * @exception UnsupportedEncodingException if the charset * conversion failed. */ @@ -568,7 +577,7 @@ * The InternetAddress class, for example, uses this to encode * it's 'phrase' component. * - * @param text unicode string + * @param word unicode string * @return Array of Unicode strings containing only US-ASCII * characters. * @exception UnsupportedEncodingException if the encoding fails @@ -590,7 +599,7 @@ * The resulting bytes are then returned as a Unicode string * containing only ASCII characters.

    * - * @param text unicode string + * @param word unicode string * @param charset the MIME charset * @param encoding the encoding to be used. Currently supported * values are "B" and "Q". If this parameter is null, then @@ -720,6 +729,7 @@ * fails, an UnsupportedEncodingException is thrown.

    * * @param eword the possibly encoded value + * @return deocoded word * @exception ParseException if the string is not an * encoded-word as per RFC 2047. * @exception UnsupportedEncodingException if the charset @@ -847,8 +857,8 @@ * @param word word to be quoted * @param specials the set of special characters * @return the possibly quoted word - * @see javax.mail.internet.HeaderTokenizer#MIME - * @see javax.mail.internet.HeaderTokenizer#RFC822 + * @see com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#MIME + * @see com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#RFC822 */ public static String quote(String word, String specials) { int len = word.length(); @@ -1111,7 +1121,8 @@ } catch (SecurityException sex) { class NullInputStream extends InputStream { - public int read() { + @Override + public int read() { return 0; } } @@ -1277,7 +1288,7 @@ int l = s.length(); for (int i = 0; i < l; i++) { - if (nonascii((int)s.charAt(i))) // non-ascii + if (nonascii(s.charAt(i))) // non-ascii non_ascii++; else ascii++; @@ -1444,14 +1455,17 @@ checkEOL = encodeEolStrict && breakOnNonAscii; } + @Override public void write(int b) throws IOException { check(b); } + @Override public void write(byte b[]) throws IOException { write(b, 0, b.length); } + @Override public void write(byte b[], int off, int len) throws IOException { len += off; for (int i = off; i < len ; i++) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java 2017-02-14 14:25:22.192079834 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java 2017-02-14 14:25:22.088079169 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -73,6 +73,9 @@ /** * Writes the specified region to another {@link OutputStream}. + * @param start the starting position + * @param end the ending position + 1 + * @param out output stream */ public void writeTo(long start,long end, OutputStream out); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java 2017-02-14 14:25:22.696083056 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java 2017-02-14 14:25:22.600082443 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -43,9 +43,17 @@ /** * Convert the bytes within the specified range of the given byte * array into a signed integer in the given radix . The range extends - * from start till, but not including end.

    + * from start till, but not including end. + * + * Based on java.lang.Integer.parseInt(). + * + * @param b bytes to convert to integer. + * @param start start of the range. + * @param end end of the range (not including). + * @param radix radix. + * + * @return integer. * - * Based on java.lang.Integer.parseInt() */ public static int parseInt(byte[] b, int start, int end, int radix) throws NumberFormatException { @@ -110,7 +118,14 @@ /** * Convert the bytes within the specified range of the given byte * array into a String. The range extends from start - * till, but not including end.

    + * till, but not including end. + * + * @param b bytes to convert to integer. + * @param start start of the range. + * @param end end of the range (not including). + * + * @return integer. + * */ public static String toString(byte[] b, int start, int end) { int size = end - start; @@ -122,6 +137,15 @@ return new String(theChars); } + /** + * Encodes specified String into a sequence of bytes using the platform's + * default charset, storing the result into a new byte array. + * + * @param s string to encode into byte array. + * + * @return byte array. + * + */ public static byte[] getBytes(String s) { char [] chars= s.toCharArray(); int size = chars.length; @@ -133,6 +157,13 @@ } /** + * Converts input stream to array. + * + * @param is stream to convert to array. + * + * @return byte array. + * + * @throws IOException if an I/O error occurs. * * @deprecated * this is an expensive operation that require an additional @@ -140,6 +171,7 @@ * Unless you absolutely need the exact size array, don't use this. * Use {@link ByteOutputStream} and {@link ByteOutputStream#write(InputStream)}. */ + @Deprecated public static byte[] getBytes(InputStream is) throws IOException { ByteOutputStream bos = null; try { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java 2017-02-14 14:25:23.204086305 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java 2017-02-14 14:25:23.100085640 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -70,6 +70,7 @@ * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ + @Override public int read() throws IOException { if (index >= bufsize) { decode(); // Fills up buffer @@ -94,6 +95,7 @@ * the stream has been reached. * @exception IOException if an I/O error occurs. */ + @Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { @@ -112,6 +114,7 @@ * Tests if this input stream supports marks. Currently this class * does not support marks */ + @Override public boolean markSupported() { return false; // Maybe later .. } @@ -122,6 +125,7 @@ * a close approximation in case the original encoded stream * contains embedded CRLFs; since the CRLFs are discarded, not decoded */ + @Override public int available() throws IOException { // This is only an estimate, since in.available() // might include CRLFs too .. @@ -200,6 +204,10 @@ * in the IMAP AUTHENTICATE protocol, but not to decode the * entire content of a MIME part. * + * @param inbuf byte array to decode + * + * @return decoded byte array + * * NOTE: inbuf may only contain valid base64 characters. * Whitespace is not ignored. */ --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java 2017-02-14 14:25:23.724089629 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java 2017-02-14 14:25:23.624088990 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -80,6 +80,7 @@ * @param len the number of bytes to write. * @exception IOException if an I/O error occurs. */ + @Override public void write(byte[] b, int off, int len) throws IOException { for (int i = 0; i < len; i++) write(b[off + i]); @@ -90,6 +91,7 @@ * @param b the data to be written. * @exception IOException if an I/O error occurs. */ + @Override public void write(byte[] b) throws IOException { write(b, 0, b.length); } @@ -99,6 +101,7 @@ * @param c the byte. * @exception IOException if an I/O error occurs. */ + @Override public void write(int c) throws IOException { buffer[bufsize++] = (byte)c; if (bufsize == 3) { // Encoding unit = 3 bytes @@ -112,6 +115,7 @@ * to be encoded out to the stream. * @exception IOException if an I/O error occurs. */ + @Override public void flush() throws IOException { if (bufsize > 0) { // If there's unencoded characters in the buffer .. encode(); // .. encode them @@ -124,6 +128,7 @@ * Forces any buffered output bytes to be encoded out to the stream * and closes this output stream */ + @Override public void close() throws IOException { flush(); out.close(); @@ -186,6 +191,10 @@ * This method is suitable for short strings, such as those * in the IMAP AUTHENTICATE protocol, but not to encode the * entire content of a MIME part. + * + * @param inbuf byte array to encode. + * + * @return encoded byte array. */ public static byte[] encode(byte[] inbuf) { if (inbuf.length == 0) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java 2017-02-14 14:25:24.228092852 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java 2017-02-14 14:25:24.128092213 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -55,6 +55,10 @@ /** * Returns the length of the encoded version of this byte array. + * + * @param b byte array. + * + * @return length of the byte array. */ public static int encodedLength(byte[] b) { return ((b.length + 2)/3) * 4; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java 2017-02-14 14:25:24.728096050 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java 2017-02-14 14:25:24.628095410 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -64,6 +64,10 @@ * * This class is similar to the deprecated * DataInputStream.readLine() + * + * @return line. + * + * @throws IOException if an I/O error occurs. */ public String readLine() throws IOException { InputStream in = this.in; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java 2017-02-14 14:25:25.248099374 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java 2017-02-14 14:25:25.152098760 +0300 @@ -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 @@ -54,6 +54,11 @@ /** * Writes a string as ASCII string. + * + * @param s string. + * @param out output stream. + * + * @throws IOException if an I/O error occurs. */ public static void writeAsAscii(String s,OutputStream out) throws IOException { int len = s.length(); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java 2017-02-14 14:25:25.760102648 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java 2017-02-14 14:25:25.656101983 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -69,6 +69,7 @@ * @param c the byte. * @exception IOException if an I/O error occurs. */ + @Override public void write(int c) throws IOException { c = c & 0xff; // Turn off the MSB. if (c == ' ') @@ -82,6 +83,11 @@ /** * Returns the length of the encoded version of this byte array. + * + * @param b byte array. + * @param encodingWord whether use word or text specials. + * + * @return length. */ public static int encodedLength(byte[] b, boolean encodingWord) { int len = 0; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java 2017-02-14 14:25:26.272105922 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java 2017-02-14 14:25:26.172105282 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -83,23 +83,29 @@ /** * Set up the buffer name and permission mode. * This method has any effect only if it is invoked before - * you start writing into the output stream + * you start writing into the output stream. + * + * @param name name to set for the buffer. + * @param mode permission mode. */ public void setNameMode(String name, int mode) { this.name = name; this.mode = mode; } + @Override public void write(byte[] b, int off, int len) throws IOException { for (int i = 0; i < len; i++) write(b[off + i]); } + @Override public void write(byte[] data) throws IOException { write(data, 0, data.length); } - public void write(int c) throws IOException { + @Override + public void write(int c) throws IOException { /* buffer up characters till we get a line's worth, then encode * and write them out. Max number of characters allowed per * line is 45. @@ -112,6 +118,7 @@ } } + @Override public void flush() throws IOException { if (bufsize > 0) { // If there's unencoded characters in the buffer writePrefix(); @@ -121,6 +128,7 @@ out.flush(); } + @Override public void close() throws IOException { flush(); out.close(); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java 2017-02-14 14:25:26.780109170 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java 2017-02-14 14:25:26.684108556 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -41,16 +41,25 @@ public interface Envelope extends SOAPEnvelope { /** * Get the content as a JAXP Source. + * + * @return source */ Source getContent(); /** * Output the content. + * + * @param out output stream. + * @exception IOException in case of an I/O error. */ void output(OutputStream out) throws IOException; /** * Output the content. + * + * @param out output stream + * @param isFastInfoset true if it is fast infoset. + * @exception IOException in case of an I/O error. */ void output(OutputStream out, boolean isFastInfoset) throws IOException; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java 2017-02-14 14:25:27.284112392 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java 2017-02-14 14:25:27.184111753 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -47,9 +47,10 @@ } /** - * return the DataFlavors for this DataContentHandler + * Return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; DataFlavor flavors[] = new DataFlavor[1]; flavors[0] = new ActivationDataFlavor( @@ -59,11 +60,13 @@ } /** - * return the Transfer Data of type DataFlavor from InputStream - * @param df The DataFlavor. - * @param ins The InputStream corresponding to the data. + * Return the Transfer Data of type DataFlavor from InputStream + * @param flavor The DataFlavor. + * @param dataSource DataSource. * @return The constructed Object. + * @exception IOException in case of an I/O error */ + @Override public Object getTransferData(DataFlavor flavor, DataSource dataSource) throws IOException { @@ -81,6 +84,7 @@ return null; } + @Override public Object getContent(DataSource dataSource) throws IOException { try { return FastInfosetReflection.FastInfosetSource_new( @@ -92,10 +96,11 @@ } /** - * construct an object from a byte stream + * Construct an object from a byte stream * (similar semantically to previous method, we are deciding * which one to support) */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java 2017-02-14 14:25:27.796115667 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java 2017-02-14 14:25:27.696115027 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -52,6 +52,7 @@ * * @return The DataFlavors */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; return new DataFlavor[] { getDF()}; } @@ -60,9 +61,11 @@ * Return the Transfer Data of type DataFlavor from InputStream. * * @param df The DataFlavor - * @param ins The InputStream corresponding to the data + * @param ds The DataSource * @return String object + * @exception IOException in case of an I/O error */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, @@ -73,6 +76,7 @@ return null; } + @Override public Object getContent(DataSource ds) throws IOException { InputStream is = ds.getInputStream(); int pos = 0; @@ -98,7 +102,11 @@ /** * Write the object to the output stream, using the specified MIME type. + * @param obj object to write + * @param type requested MIME type of the resulting byte stream + * @param os OutputStream */ + @Override public void writeTo(Object obj, String type, OutputStream os) throws IOException { if (obj != null && !(obj instanceof Image)) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java 2017-02-14 14:25:28.320119017 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java 2017-02-14 14:25:28.216118352 +0300 @@ -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 @@ -67,8 +67,9 @@ * * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { - return (DataFlavor[]) Arrays.copyOf(flavor, flavor.length); + return Arrays.copyOf(flavor, flavor.length); } /** @@ -80,6 +81,7 @@ * @param ds The DataSource representing the data to be converted. * @return The constructed Object. */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { for (int i=0; i < flavor.length; i++) { @@ -98,6 +100,7 @@ * @param ds The DataSource representing the data to be converted. * @return The constructed Object. */ + @Override public Object getContent(DataSource ds) throws IOException { return ImageIO.read(new BufferedInputStream(ds.getInputStream())); } @@ -107,11 +110,11 @@ * and write it to the output stream. * * @param obj The object to be converted. - * @param mimeType The requested MIME type of the resulting byte stream. + * @param type The requested MIME type of the resulting byte stream. * @param os The output stream into which to write the converted * byte stream. */ - + @Override public void writeTo(Object obj, String type, OutputStream os) throws IOException { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java 2017-02-14 14:25:28.848122393 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java 2017-02-14 14:25:28.744121728 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -47,9 +47,10 @@ public static final String STR_SRC = "java.awt.Image"; /** - * return the DataFlavors for this DataContentHandler + * Return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; DataFlavor flavors[] = new DataFlavor[1]; @@ -67,11 +68,12 @@ } /** - * return the Transfer Data of type DataFlavor from InputStream - * @param df The DataFlavor. - * @param ins The InputStream corresponding to the data. + * Return the Transfer Data of type DataFlavor from InputStream + * @param df The DataFlavor + * @param ds The DataSource * @return The constructed Object. */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) { // this is sort of hacky, but will work for the @@ -98,6 +100,7 @@ /** * */ + @Override public Object getContent(DataSource ds) { // throws Exception; InputStream inputStream = null; BufferedImage jpegLoadImage = null; @@ -109,14 +112,18 @@ } catch (Exception e) { } - return (Image) jpegLoadImage; + return jpegLoadImage; } /** - * construct an object from a byte stream + * Construct an object from a byte stream * (similar semantically to previous method, we are deciding * which one to support) + * @param obj object to write + * @param mimeType requested MIME type of the resulting byte stream + * @param os OutputStream */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (!mimeType.equals("image/jpeg")) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java 2017-02-14 14:25:29.380125794 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java 2017-02-14 14:25:29.280125155 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -38,24 +38,24 @@ /** * Retrieve payload qname without materializing its contents - * @return - * @throws SOAPException + * @return QName + * @throws SOAPException in case of an error */ public QName getPayloadQName() throws SOAPException; /** * Retrieve payload attribute value without materializing its contents - * @param localName - * @return - * @throws SOAPException + * @param localName local name + * @return payload attribute value + * @throws SOAPException in case of an error */ public String getPayloadAttributeValue(String localName) throws SOAPException; /** * Retrieve payload attribute value without materializing its contents - * @param qName - * @return - * @throws SOAPException + * @param qName QName + * @return payload attribute value + * @throws SOAPException in case of an error */ public String getPayloadAttributeValue(QName qName) throws SOAPException; } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java 2017-02-14 14:25:29.888129042 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java 2017-02-14 14:25:29.784128378 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -95,7 +95,7 @@ /** * True if this part is encoded using Fast Infoset. - * MIME -> application/fastinfoset + * MIME -> application/fastinfoset */ protected boolean isFastInfoset = false; @@ -202,6 +202,9 @@ /** * Construct a new message. This will be invoked before message * sends. + * + * @param isFastInfoset whether it is fast infoset + * @param acceptFastInfoset whether to accept fast infoset */ protected MessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) { this.isFastInfoset = isFastInfoset; @@ -214,6 +217,8 @@ /** * Shallow copy. + * + * @param msg SoapMessage */ protected MessageImpl(SOAPMessage msg) { if (!(msg instanceof MessageImpl)) { @@ -233,14 +238,17 @@ /** * @param stat * the mask value obtained from {@link #identifyContentType(ContentType)} + * @return true if SOAP 1.1 Content */ protected static boolean isSoap1_1Content(int stat) { return (stat & SOAP1_1_FLAG) != 0; } /** + * Check whether it is SOAP 1.2 content. * @param stat * the mask value obtained from {@link #identifyContentType(ContentType)} + * @return true if it is SOAP 1.2 content */ protected static boolean isSoap1_2Content(int stat) { return (stat & SOAP1_2_FLAG) != 0; @@ -298,6 +306,9 @@ * Construct a message from an input stream. When messages are * received, there's two parts -- the transport headers and the * message content in a transport specific stream. + * @param headers MimeHeaders + * @param in InputStream + * @exception SOAPExceptionImpl in case of I/O error */ protected MessageImpl(MimeHeaders headers, final InputStream in) throws SOAPExceptionImpl { @@ -332,6 +343,7 @@ * received, there's two parts -- the transport headers and the * message content in a transport specific stream. * + * @param headers headers * @param contentType * The parsed content type header from the headers variable. * This is redundant parameter, but it avoids reparsing this header again. @@ -339,6 +351,8 @@ * The result of {@link #identifyContentType(ContentType)} over * the contentType parameter. This redundant parameter, but it avoids * recomputing this information again. + * @param in input stream + * @exception SOAPExceptionImpl in case of an error */ protected MessageImpl(MimeHeaders headers, final ContentType contentType, int stat, final InputStream in) throws SOAPExceptionImpl { init(headers, stat, contentType, in); @@ -425,18 +439,22 @@ } else if ((stat & MIME_MULTIPART_FLAG) != 0) { final InputStream finalIn = in; DataSource ds = new DataSource() { + @Override public InputStream getInputStream() { return finalIn; } + @Override public OutputStream getOutputStream() { return null; } + @Override public String getContentType() { return contentType.toString(); } + @Override public String getName() { return ""; } @@ -591,10 +609,12 @@ return Boolean.valueOf(lazyParsingProp.toString()); } } + @Override public Object getProperty(String property) { - return (String) properties.get(property); + return properties.get(property); } + @Override public void setProperty(String property, Object value) { verify(property, value); properties.put(property, value); @@ -722,6 +742,7 @@ return "text/xml"; } + @Override public MimeHeaders getMimeHeaders() { return this.headers; } @@ -805,10 +826,12 @@ saved = false; } + @Override public boolean saveRequired() { return saved != true; } + @Override public String getContentDescription() { String[] values = headers.getHeader("Content-Description"); if (values != null && values.length > 0) @@ -816,13 +839,16 @@ return null; } + @Override public void setContentDescription(String description) { headers.setHeader("Content-Description", description); needsSave(); } + @Override public abstract SOAPPart getSOAPPart(); + @Override public void removeAllAttachments() { try { initializeAllAttachments(); @@ -836,6 +862,7 @@ } } + @Override public int countAttachments() { try { initializeAllAttachments(); @@ -847,6 +874,7 @@ return 0; } + @Override public void addAttachmentPart(AttachmentPart attachment) { try { initializeAllAttachments(); @@ -864,6 +892,7 @@ static private final Iterator nullIter = Collections.EMPTY_LIST.iterator(); + @Override public Iterator getAttachments() { try { initializeAllAttachments(); @@ -897,12 +926,14 @@ private MimeHeaders headers; private AttachmentPart nextAttachment; + @Override public boolean hasNext() { if (nextAttachment == null) nextAttachment = nextMatch(); return nextAttachment != null; } + @Override public AttachmentPart next() { if (nextAttachment != null) { AttachmentPart ret = nextAttachment; @@ -925,11 +956,13 @@ return null; } + @Override public void remove() { iter.remove(); } } + @Override public Iterator getAttachments(MimeHeaders headers) { try { initializeAllAttachments(); @@ -942,6 +975,7 @@ return new MimeMatchingIterator(headers); } + @Override public void removeAttachments(MimeHeaders headers) { try { initializeAllAttachments(); @@ -966,10 +1000,12 @@ // needsSave(); } + @Override public AttachmentPart createAttachmentPart() { return new AttachmentPartImpl(); } + @Override public AttachmentPart getAttachment(SOAPElement element) throws SOAPException { try { @@ -1187,6 +1223,7 @@ } } + @Override public void saveChanges() throws SOAPException { // suck in all the data from the attachments and have it @@ -1340,6 +1377,7 @@ } + @Override public void writeTo(OutputStream out) throws SOAPException, IOException { if (saveRequired()){ this.optimizeAttachmentProcessing = true; @@ -1397,6 +1435,7 @@ needsSave(); } + @Override public SOAPBody getSOAPBody() throws SOAPException { SOAPBody body = getSOAPPart().getEnvelope().getBody(); /*if (body == null) { @@ -1405,6 +1444,7 @@ return body; } + @Override public SOAPHeader getSOAPHeader() throws SOAPException { SOAPHeader hdr = getSOAPPart().getEnvelope().getHeader(); /*if (hdr == null) { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java 2017-02-14 14:25:30.440132572 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java 2017-02-14 14:25:30.336131907 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -43,6 +43,7 @@ * * @return The DataFlavors */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; return new DataFlavor[] { myDF }; } @@ -51,9 +52,10 @@ * Return the Transfer Data of type DataFlavor from InputStream. * * @param df The DataFlavor - * @param ins The InputStream corresponding to the data + * @param ds The DataSource * @return String object */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) { // use myDF.equals to be sure to get ActivationDataFlavor.equals, // which properly ignores Content-Type parameters in comparison @@ -65,7 +67,11 @@ /** * Return the content. + * + * @param ds The DataSource + * @return content */ + @Override public Object getContent(DataSource ds) { try { return new MimeMultipart( @@ -78,6 +84,7 @@ /** * Write the object to the output stream, using the specific MIME type. */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (obj instanceof MimeMultipart) { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java 2017-02-14 14:25:30.956135871 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java 2017-02-14 14:25:30.852135207 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -29,16 +29,42 @@ */ package com.sun.xml.internal.messaging.saaj.soap; -import java.util.logging.Logger; - -import com.sun.org.apache.xerces.internal.dom.DocumentImpl; -import org.w3c.dom.*; - -import com.sun.xml.internal.messaging.saaj.soap.impl.*; +import com.sun.xml.internal.messaging.saaj.soap.impl.CDATAImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.ElementFactory; +import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPCommentImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPTextImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import org.w3c.dom.Attr; +import org.w3c.dom.CDATASection; +import org.w3c.dom.Comment; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.EntityReference; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.dom.UserDataHandler; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.soap.SOAPElement; +import javax.xml.soap.SOAPException; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; -public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { +public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Document { private static final String XMLNS = "xmlns".intern(); protected static final Logger log = @@ -47,8 +73,24 @@ SOAPPartImpl enclosingSOAPPart; + private Document document; + + private Map domToSoap = new HashMap<>(); + public SOAPDocumentImpl(SOAPPartImpl enclosingDocument) { + document = createDocument(); this.enclosingSOAPPart = enclosingDocument; + register(this); + } + + private Document createDocument() { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader()); + try { + final DocumentBuilder documentBuilder = docFactory.newDocumentBuilder(); + return documentBuilder.newDocument(); + } catch (ParserConfigurationException e) { + throw new RuntimeException("Error creating xml document", e); + } } // public SOAPDocumentImpl(boolean grammarAccess) { @@ -81,7 +123,7 @@ } public DOMImplementation getImplementation() { - return super.getImplementation(); + return document.getImplementation(); } public Element getDocumentElement() { @@ -91,7 +133,7 @@ } protected Element doGetDocumentElement() { - return super.getDocumentElement(); + return document.getDocumentElement(); } public Element createElement(String tagName) throws DOMException { @@ -103,7 +145,7 @@ } public DocumentFragment createDocumentFragment() { - return new SOAPDocumentFragment(this); + return document.createDocumentFragment(); } public org.w3c.dom.Text createTextNode(String data) { @@ -139,7 +181,7 @@ } } - return super.createAttribute(name); + return document.createAttribute(name); } public EntityReference createEntityReference(String name) @@ -149,12 +191,15 @@ } public NodeList getElementsByTagName(String tagname) { - return super.getElementsByTagName(tagname); + return document.getElementsByTagName(tagname); } public org.w3c.dom.Node importNode(Node importedNode, boolean deep) throws DOMException { - return super.importNode(importedNode, deep); + final Node node = document.importNode(getDomNode(importedNode), deep); + return node instanceof Element ? + ElementFactory.createElement(this, (Element) node) + : node; } public Element createElementNS(String namespaceURI, String qualifiedName) @@ -168,26 +213,386 @@ public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { - return super.createAttributeNS(namespaceURI, qualifiedName); + return document.createAttributeNS(namespaceURI, qualifiedName); } public NodeList getElementsByTagNameNS( String namespaceURI, String localName) { - return super.getElementsByTagNameNS(namespaceURI, localName); + return document.getElementsByTagNameNS(namespaceURI, localName); } public Element getElementById(String elementId) { - return super.getElementById(elementId); + return document.getElementById(elementId); + } + + @Override + public String getInputEncoding() { + return document.getInputEncoding(); + } + + @Override + public String getXmlEncoding() { + return document.getXmlEncoding(); + } + + @Override + public boolean getXmlStandalone() { + return document.getXmlStandalone(); + } + + @Override + public void setXmlStandalone(boolean xmlStandalone) throws DOMException { + document.setXmlStandalone(xmlStandalone); + } + + @Override + public String getXmlVersion() { + return document.getXmlVersion(); + } + + @Override + public void setXmlVersion(String xmlVersion) throws DOMException { + document.setXmlVersion(xmlVersion); + } + + @Override + public boolean getStrictErrorChecking() { + return document.getStrictErrorChecking(); + } + + @Override + public void setStrictErrorChecking(boolean strictErrorChecking) { + document.setStrictErrorChecking(strictErrorChecking); + } + + @Override + public String getDocumentURI() { + return document.getDocumentURI(); + } + + @Override + public void setDocumentURI(String documentURI) { + document.setDocumentURI(documentURI); + } + + @Override + public Node adoptNode(Node source) throws DOMException { + return document.adoptNode(source); + } + + @Override + public DOMConfiguration getDomConfig() { + return document.getDomConfig(); + } + + @Override + public void normalizeDocument() { + document.normalizeDocument(); + } + + @Override + public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { + return document.renameNode(n, namespaceURI, qualifiedName); + } + + @Override + public String getNodeName() { + return document.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return document.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + document.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return document.getNodeType(); + } + + @Override + public Node getParentNode() { + return document.getParentNode(); + } + + @Override + public NodeList getChildNodes() { + return document.getChildNodes(); + } + + @Override + public Node getFirstChild() { + return document.getFirstChild(); + } + + @Override + public Node getLastChild() { + return document.getLastChild(); + } + + @Override + public Node getPreviousSibling() { + return document.getPreviousSibling(); + } + + @Override + public Node getNextSibling() { + return document.getNextSibling(); + } + + @Override + public NamedNodeMap getAttributes() { + return document.getAttributes(); + } + + @Override + public Document getOwnerDocument() { + return document.getOwnerDocument(); + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return document.insertBefore(getDomNode(newChild), getDomNode(refChild)); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return document.replaceChild(getDomNode(newChild), getDomNode(oldChild)); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return document.removeChild(getDomNode(oldChild)); } + @Override + public Node appendChild(Node newChild) throws DOMException { + return document.appendChild(getDomNode(newChild)); + } + + @Override + public boolean hasChildNodes() { + return document.hasChildNodes(); + } + + @Override public Node cloneNode(boolean deep) { - SOAPPartImpl newSoapPart = getSOAPPart().doCloneNode(); - super.cloneNode(newSoapPart.getDocument(), deep); - return newSoapPart; + return document.cloneNode(deep); + } + + @Override + public void normalize() { + document.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return document.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return document.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return document.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + document.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return document.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return document.hasAttributes(); + } + + @Override + public String getBaseURI() { + return document.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return document.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return document.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + document.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return document.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return document.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return document.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return document.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return document.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return document.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return document.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return document.getUserData(key); + } + + public Document getDomDocument() { + return document; + } + + /** + * Insert a mapping information for {@link org.w3c.dom.Node} - {@link javax.xml.soap.Node}. + * + * In SAAJ, elements in DOM are expected to be interfaces of SAAJ, on the other hand in JDKs Xerces, + * they are casted to internal impl classes. After removal of SAAJ dependency + * to JDKs internal classes elements in DOM can never be both of them. + * + * @param node SAAJ wrapper node for w3c DOM node + */ + public void register(javax.xml.soap.Node node) { + final Node domElement = getDomNode(node); + if (domToSoap.containsKey(domElement)) { + throw new IllegalStateException("Element " + domElement.getNodeName() + + " is already registered"); + } + domToSoap.put(domElement, node); + } + + /** + * Find a soap wrapper for w3c dom node. + * + * @param node w3c dom node nullable + * @return soap wrapper for w3c dom node + * + * @throws + */ + public javax.xml.soap.Node find(Node node) { + return find(node, true); + } + + private javax.xml.soap.Node find(Node node, boolean required) { + if (node == null) { + return null; + } + if (node instanceof javax.xml.soap.Node) { + return (javax.xml.soap.Node) node; + } + final javax.xml.soap.Node found = domToSoap.get(node); + if (found == null && required) { + throw new IllegalArgumentException(MessageFormat.format("Cannot find SOAP wrapper for element {0}", node)); + } + return found; + } + + /** + * If corresponding soap wrapper exists for w3c dom node it is returned, + * if not passed dom element is returned. + * + * @param node w3c dom node + * @return soap wrapper or passed w3c dom node if not found + */ + public Node findIfPresent(Node node) { + final javax.xml.soap.Node found = find(node, false); + return found != null ? found : node; + } + + /** + * Extracts w3c dom node from corresponding soap wrapper. + * + * @param node soap or dom nullable + * @return dom node + */ + public Node getDomNode(Node node) { + if (node instanceof SOAPDocumentImpl) { + return ((SOAPDocumentImpl)node).getDomElement(); + } else if (node instanceof ElementImpl) { + return ((ElementImpl) node).getDomElement(); + } else if (node instanceof SOAPTextImpl) { + return ((SOAPTextImpl)node).getDomElement(); + } else if (node instanceof SOAPCommentImpl) { + return ((SOAPCommentImpl)node).getDomElement(); + } else if (node instanceof CDATAImpl) { + return ((CDATAImpl) node).getDomElement(); + } + return node; + } + + public Document getDomElement() { + return document; + } + + @Override + public String getValue() { + throw new UnsupportedOperationException(); + } + + @Override + public void setValue(String value) { + throw new UnsupportedOperationException(); + } + + @Override + public void setParentElement(SOAPElement parent) throws SOAPException { + throw new UnsupportedOperationException(); + } + + @Override + public SOAPElement getParentElement() { + throw new UnsupportedOperationException(); + } + + @Override + public void detachNode() { + throw new UnsupportedOperationException(); } - public void cloneNode(SOAPDocumentImpl newdoc, boolean deep) { - super.cloneNode(newdoc, deep); + @Override + public void recycleNode() { + throw new UnsupportedOperationException(); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java 2017-02-14 14:25:31.488139273 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java 2017-02-14 14:25:31.392138659 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -25,29 +25,56 @@ package com.sun.xml.internal.messaging.saaj.soap; -import java.io.*; -import java.util.Iterator; -import java.util.logging.Logger; -import java.util.logging.Level; - -import javax.activation.DataHandler; -import javax.activation.DataSource; -import javax.xml.soap.*; -import javax.xml.transform.Source; -import javax.xml.transform.stream.StreamSource; - -import org.w3c.dom.*; - -import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart; - import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; +import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart; import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; -import com.sun.xml.internal.messaging.saaj.util.*; +import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; +import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; +import com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection; +import com.sun.xml.internal.messaging.saaj.util.JAXMStreamSource; +import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import com.sun.xml.internal.messaging.saaj.util.MimeHeadersUtil; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser; +import org.w3c.dom.Attr; +import org.w3c.dom.CDATASection; +import org.w3c.dom.Comment; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.EntityReference; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.NodeList; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.dom.UserDataHandler; +import javax.activation.DataHandler; +import javax.activation.DataSource; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPElement; +import javax.xml.soap.SOAPEnvelope; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PushbackReader; +import java.io.Reader; +import java.io.UnsupportedEncodingException; +import java.util.Iterator; +import java.util.logging.Level; +import java.util.logging.Logger; /** * SOAPPartImpl is the first attachment. This contains the XML/SOAP document. @@ -128,20 +155,21 @@ envelope = createEnvelopeFromSource(); } else { envelope = createEmptyEnvelope(null); - document.insertBefore(envelope, null); + document.insertBefore(((EnvelopeImpl) envelope).getDomElement(), null); } return envelope; } protected void lookForEnvelope() throws SOAPException { Element envelopeChildElement = document.doGetDocumentElement(); - if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) { - envelope = (EnvelopeImpl) envelopeChildElement; - } else if (!(envelopeChildElement instanceof ElementImpl)) { + org.w3c.dom.Node soapEnvelope = document.findIfPresent(envelopeChildElement); + if (soapEnvelope == null || soapEnvelope instanceof Envelope) { + envelope = (EnvelopeImpl) soapEnvelope; + } else if (document.find(envelopeChildElement) == null) { log.severe("SAAJ0512.soap.incorrect.factory.used"); throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction"); } else { - ElementImpl soapElement = (ElementImpl) envelopeChildElement; + ElementImpl soapElement = (ElementImpl) document.find(envelopeChildElement); if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) { String prefix = soapElement.getPrefix(); String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix); @@ -498,7 +526,7 @@ } public NamedNodeMap getAttributes() { - return document.getAttributes(); + return document.getDomDocument().getAttributes(); } public NodeList getChildNodes() { @@ -517,11 +545,11 @@ } public String getLocalName() { - return document.getLocalName(); + return document.getDomDocument().getLocalName(); } public String getNamespaceURI() { - return document.getNamespaceURI(); + return document.getDomDocument().getNamespaceURI(); } public org.w3c.dom.Node getNextSibling() { @@ -530,11 +558,11 @@ } public String getNodeName() { - return document.getNodeName(); + return document.getDomDocument().getNodeName(); } public short getNodeType() { - return document.getNodeType(); + return document.getDomDocument().getNodeType(); } public String getNodeValue() throws DOMException { @@ -542,23 +570,23 @@ } public Document getOwnerDocument() { - return document.getOwnerDocument(); + return document.getDomDocument().getOwnerDocument(); } public org.w3c.dom.Node getParentNode() { - return document.getParentNode(); + return document.getDomDocument().getParentNode(); } public String getPrefix() { - return document.getPrefix(); + return document.getDomDocument().getPrefix(); } public org.w3c.dom.Node getPreviousSibling() { - return document.getPreviousSibling(); + return document.getDomDocument().getPreviousSibling(); } public boolean hasAttributes() { - return document.hasAttributes(); + return document.getDomDocument().hasAttributes(); } public boolean hasChildNodes() { @@ -575,7 +603,7 @@ } public boolean isSupported(String arg0, String arg1) { - return document.isSupported(arg0, arg1); + return document.getDomDocument().isSupported(arg0, arg1); } public void normalize() { @@ -686,7 +714,7 @@ } public DOMConfiguration getDomConfig() { - return document.getDomConfig(); + return document.getDomDocument().getDomConfig(); } public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException { @@ -699,7 +727,7 @@ } public String getDocumentURI() { - return document.getDocumentURI(); + return document.getDomDocument().getDocumentURI(); } public void setStrictErrorChecking(boolean strictErrorChecking) { @@ -707,15 +735,15 @@ } public String getInputEncoding() { - return document.getInputEncoding(); + return document.getDomDocument().getInputEncoding(); } public String getXmlEncoding() { - return document.getXmlEncoding(); + return document.getDomDocument().getXmlEncoding(); } public boolean getXmlStandalone() { - return document.getXmlStandalone(); + return document.getDomDocument().getXmlStandalone(); } public void setXmlStandalone(boolean xmlStandalone) throws DOMException { @@ -723,7 +751,7 @@ } public String getXmlVersion() { - return document.getXmlVersion(); + return document.getDomDocument().getXmlVersion(); } public void setXmlVersion(String xmlVersion) throws DOMException { @@ -731,12 +759,12 @@ } public boolean getStrictErrorChecking() { - return document.getStrictErrorChecking(); + return document.getDomDocument().getStrictErrorChecking(); } // DOM L3 methods from org.w3c.dom.Node public String getBaseURI() { - return document.getBaseURI(); + return document.getDomDocument().getBaseURI(); } public short compareDocumentPosition(org.w3c.dom.Node other) @@ -758,7 +786,7 @@ } public String lookupPrefix(String namespaceURI) { - return document.lookupPrefix(namespaceURI); + return document.getDomDocument().lookupPrefix(namespaceURI); } public boolean isDefaultNamespace(String namespaceURI) { @@ -770,7 +798,7 @@ } public boolean isEqualNode(org.w3c.dom.Node arg) { - return document.isEqualNode(arg); + return document.getDomDocument().isEqualNode(arg); } public Object getFeature(String feature, @@ -785,7 +813,7 @@ } public Object getUserData(String key) { - return document.getUserData(key); + return document.getDomDocument().getUserData(key); } public void recycleNode() { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java 2017-02-14 14:25:32.028142726 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java 2017-02-14 14:25:31.932142113 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -63,6 +63,9 @@ /** * Constructs a SOAPExceptionImpl object initialized * with the given Throwable object. + * + * @param cause a Throwable object that is to + * be embedded in this SOAPExceptionImpl object */ public SOAPVersionMismatchException(Throwable cause) { super(cause); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java 2017-02-14 14:25:32.564146153 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java 2017-02-14 14:25:32.464145514 +0300 @@ -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 @@ -33,7 +33,7 @@ import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType; /** - * JAF data content handler for text/plain --> String + * JAF data content handler for text/plain --> String * */ public class StringDataContentHandler implements DataContentHandler { @@ -51,6 +51,7 @@ * * @return The DataFlavors */ + @Override public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[] { getDF() }; } @@ -62,6 +63,7 @@ * @param ds The DataSource corresponding to the data * @return String object */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, @@ -72,6 +74,7 @@ return null; } + @Override public Object getContent(DataSource ds) throws IOException { String enc = null; InputStreamReader is = null; @@ -120,6 +123,7 @@ /** * Write the object to the output stream, using the specified MIME type. */ + @Override public void writeTo(Object obj, String type, OutputStream os) throws IOException { if (!(obj instanceof String)) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java 2017-02-14 14:25:33.104149606 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java 2017-02-14 14:25:33.004148967 +0300 @@ -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 @@ -56,6 +56,7 @@ * return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; DataFlavor flavors[] = new DataFlavor[2]; @@ -69,10 +70,11 @@ /** * return the Transfer Data of type DataFlavor from InputStream - * @param df The DataFlavor. - * @param ins The InputStream corresponding to the data. + * @param flavor The DataFlavor. + * @param dataSource The DataSource. * @return The constructed Object. */ + @Override public Object getTransferData(DataFlavor flavor, DataSource dataSource) throws IOException { if (flavor.getMimeType().startsWith("text/xml") || @@ -87,6 +89,7 @@ /** * */ + @Override public Object getContent(DataSource dataSource) throws IOException { return new StreamSource(dataSource.getInputStream()); } @@ -96,6 +99,7 @@ * (similar semantically to previous method, we are deciding * which one to support) */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (!mimeType.startsWith("text/xml") && !mimeType.startsWith("application/xml")) --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java 2017-02-14 14:25:33.636153008 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java 2017-02-14 14:25:33.540152394 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -36,6 +36,7 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; import org.w3c.dom.*; import org.w3c.dom.Node; @@ -60,6 +61,10 @@ super(ownerDoc, bodyName); } + public BodyImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract NameImpl getFaultName(String name); protected abstract boolean isFault(SOAPElement child); protected abstract SOAPBodyElement createBodyElement(Name name); @@ -155,7 +160,7 @@ if (hasFault()) { if (fault == null) { //initialize fault member - fault = (SOAPFault) getFirstChildElement(); + fault = (SOAPFault) getSoapDocument().find(getFirstChildElement()); } return fault; } @@ -259,11 +264,12 @@ } protected SOAPElement convertToSoapElement(Element element) { - if ((element instanceof SOAPBodyElement) && + final Node soapNode = getSoapDocument().findIfPresent(element); + if ((soapNode instanceof SOAPBodyElement) && //this check is required because ElementImpl currently // implements SOAPBodyElement - !(element.getClass().equals(ElementImpl.class))) { - return (SOAPElement) element; + !(soapNode.getClass().equals(ElementImpl.class))) { + return (SOAPElement) soapNode; } else { return replaceElementWithSOAPElement( element, @@ -314,7 +320,7 @@ Document document = null; try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader()); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.newDocument(); @@ -440,7 +446,7 @@ //not lazy -Just get first child element and return its attribute Element elem = getFirstChildElement(); if (elem != null) { - return elem.getAttribute(localName); + return elem.getAttribute(getLocalName()); } } return null; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java 2017-02-14 14:25:34.144156256 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java 2017-02-14 14:25:34.044155617 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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,10 +32,17 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import org.w3c.dom.CDATASection; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.w3c.dom.UserDataHandler; -public class CDATAImpl - extends com.sun.org.apache.xerces.internal.dom.CDATASectionImpl - implements javax.xml.soap.Text { +public class CDATAImpl implements CDATASection, javax.xml.soap.Text { protected static final Logger log = Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, @@ -44,8 +51,256 @@ static final String cdataUC = " 0); + //this is because of BugfixTest#testCR7020991, after removal internal dependencies + //SOAPDocumentImpl#createAttribute is not called anymore from xerces parent + if (isQualifiedName) { + String nsUri = null; + String prefix = name.substring(0, name.indexOf(":")); + //cannot do anything to resolve the URI if prefix is not + //XMLNS. + if (XMLNS.equals(prefix)) { + nsUri = ElementImpl.XMLNS_URI; + setAttributeNS(nsUri, name, value); + return; + } + } + element.setAttribute(name, value); + } + + @Override + public void removeAttribute(String name) throws DOMException { + element.removeAttribute(name); + } + + @Override + public Attr getAttributeNode(String name) { + return element.getAttributeNode(name); + } + + @Override + public Attr setAttributeNode(Attr newAttr) throws DOMException { + return element.setAttributeNode(newAttr); + } + + @Override + public Attr removeAttributeNode(Attr oldAttr) throws DOMException { + return element.removeAttributeNode(oldAttr); + } + + @Override + public NodeList getElementsByTagName(String name) { + return new NodeListImpl(getSoapDocument(), element.getElementsByTagName(name)); + } + + @Override + public String getAttributeNS(String namespaceURI, String localName) throws DOMException { + return element.getAttributeNS(namespaceURI, localName); + } + protected static final Logger log = Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); @@ -72,22 +133,27 @@ */ public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern(); + private final static String XMLNS = "xmlns".intern(); + public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) { - super( - ownerDoc, - name.getURI(), - name.getQualifiedName(), - name.getLocalName()); + this.soapDocument = ownerDoc; + this.element = ownerDoc.getDomDocument().createElementNS(name.getURI(), name.getQualifiedName()); elementQName = NameImpl.convertToQName(name); + getSoapDocument().register(this); } public ElementImpl(SOAPDocumentImpl ownerDoc, QName name) { - super( - ownerDoc, - name.getNamespaceURI(), - getQualifiedName(name), - name.getLocalPart()); + this.soapDocument = ownerDoc; + this.element = ownerDoc.getDomDocument().createElementNS(name.getNamespaceURI(), getQualifiedName(name)); elementQName = name; + getSoapDocument().register(this); + } + + public ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + this.element = domElement; + this.soapDocument = ownerDoc; + this.elementQName = new QName(domElement.getNamespaceURI(), domElement.getLocalName()); + getSoapDocument().register(this); } public ElementImpl( @@ -95,9 +161,11 @@ String uri, String qualifiedName) { - super(ownerDoc, uri, qualifiedName); + this.soapDocument = ownerDoc; + this.element = ownerDoc.getDomDocument().createElementNS(uri, qualifiedName); elementQName = new QName(uri, getLocalPart(qualifiedName), getPrefix(qualifiedName)); + getSoapDocument().register(this); } public void ensureNamespaceIsDeclared(String prefix, String uri) { @@ -111,11 +179,132 @@ } public Document getOwnerDocument() { - Document doc = super.getOwnerDocument(); - if (doc instanceof SOAPDocument) - return ((SOAPDocument) doc).getDocument(); - else - return doc; + return soapDocument; + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return element.insertBefore(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(refChild)); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return element.replaceChild(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(oldChild)); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return element.removeChild(getSoapDocument().getDomNode(oldChild)); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return element.appendChild(getSoapDocument().getDomNode(newChild)); + } + + @Override + public boolean hasChildNodes() { + return element.hasChildNodes(); + } + + @Override + public Node cloneNode(boolean deep) { + return element.cloneNode(deep); + } + + @Override + public void normalize() { + element.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return element.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return element.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return element.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + element.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return element.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return element.hasAttributes(); + } + + @Override + public String getBaseURI() { + return element.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return element.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return element.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + element.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return element.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return element.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return element.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return element.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return element.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return element.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return element.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return element.getUserData(key); } public SOAPElement addChildElement(Name name) throws SOAPException { @@ -353,13 +542,16 @@ // preserve the encodingStyle attr as it may get lost in the import String encodingStyle = element.getEncodingStyle(); - ElementImpl importedElement = (ElementImpl) importElement(element); + final Element domElement = ((ElementImpl) element).getDomElement(); + final Element importedElement = importElement(domElement); addNode(importedElement); + final SOAPElement converted = convertToSoapElement(importedElement); + if (encodingStyle != null) - importedElement.setEncodingStyle(encodingStyle); + converted.setEncodingStyle(encodingStyle); - return convertToSoapElement(importedElement); + return converted; } protected Element importElement(Element element) { @@ -374,7 +566,7 @@ protected SOAPElement addElement(Name name) throws SOAPException { SOAPElement newElement = createElement(name); - addNode(newElement); + addNode(((ElementImpl) newElement).getDomElement()); return newElement; } @@ -411,7 +603,7 @@ } protected void addNode(org.w3c.dom.Node newElement) throws SOAPException { - insertBefore(newElement, null); + insertBefore(getSoapDocument().getDomNode(newElement), null); if (getOwnerDocument() instanceof DocumentFragment) return; @@ -431,7 +623,7 @@ Node child = getFirstChild(); while (child != null) { if (child instanceof Element) { - return ((Element) child); + return (Element) getSoapDocument().find(child); } child = child.getNextSibling(); } @@ -441,10 +633,12 @@ protected SOAPElement findChild(NameImpl name) { Node eachChild = getFirstChild(); while (eachChild != null) { - if (eachChild instanceof SOAPElement) { - SOAPElement eachChildSoap = (SOAPElement) eachChild; - if (eachChildSoap.getElementName().equals(name)) { - return eachChildSoap; + if (eachChild instanceof Element) { + SOAPElement eachChildSoap = (SOAPElement) getSoapDocument().find(eachChild); + if (eachChildSoap != null) { + if (eachChildSoap.getElementName().equals(name)) { + return eachChildSoap; + } } } eachChild = eachChild.getNextSibling(); @@ -474,14 +668,14 @@ protected SOAPElement addCDATA(String text) throws SOAPException { org.w3c.dom.Text cdata = - (org.w3c.dom.Text) getOwnerDocument().createCDATASection(text); + getOwnerDocument().createCDATASection(text); addNode(cdata); return this; } protected SOAPElement addText(String text) throws SOAPException { org.w3c.dom.Text textNode = - (org.w3c.dom.Text) getOwnerDocument().createTextNode(text); + getOwnerDocument().createTextNode(text); addNode(textNode); return this; } @@ -684,8 +878,9 @@ } protected SOAPElement convertToSoapElement(Element element) { - if (element instanceof SOAPElement) { - return (SOAPElement) element; + final Node soapNode = getSoapDocument().findIfPresent(element); + if (soapNode instanceof SOAPElement) { + return (SOAPElement) soapNode; } else { return replaceElementWithSOAPElement( element, @@ -693,7 +888,7 @@ } } - protected static SOAPElement replaceElementWithSOAPElement( + protected SOAPElement replaceElementWithSOAPElement( Element element, ElementImpl copy) { @@ -709,7 +904,7 @@ copy.insertBefore(nextChild, null); } - Node parent = element.getParentNode(); + Node parent = getSoapDocument().find(element.getParentNode()); if (parent != null) { parent.replaceChild(copy, element); } // XXX else throw an exception? @@ -727,8 +922,8 @@ if (next == null) { while (eachNode.hasNext()) { Node node = eachNode.next(); - if (node instanceof SOAPElement) { - next = node; + if (node instanceof Element) { + next = getSoapDocument().findIfPresent(node); break; } } @@ -899,14 +1094,14 @@ protected javax.xml.soap.Node getValueNode() { Iterator i = getChildElements(); while (i.hasNext()) { - javax.xml.soap.Node n = (javax.xml.soap.Node) i.next(); + Node n = i.next(); if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE || n.getNodeType() == org.w3c.dom.Node.CDATA_SECTION_NODE) { // TODO: Hack to fix text node split into multiple lines. normalize(); // Should remove the normalization step when this gets fixed in // DOM/Xerces. - return (javax.xml.soap.Node) n; + return getSoapDocument().find(n); } } return null; @@ -948,7 +1143,7 @@ if (parentNode instanceof SOAPDocument) { return null; } - return (SOAPElement) parentNode; + return (SOAPElement) getSoapDocument().find(parentNode); } protected String getSOAPNamespace() { @@ -975,7 +1170,7 @@ public void detachNode() { Node parent = getParentNode(); if (parent != null) { - parent.removeChild(this); + parent.removeChild(element); } encodingStyleAttribute.clearNameAndValue(); // Fix for CR: 6474641 @@ -1136,17 +1331,18 @@ return attribute == null ? null : attribute.getValue(); } - protected static Iterator getChildElementsFrom(final Element element) { + protected Iterator getChildElementsFrom(final Element element) { return new Iterator() { Node next = element.getFirstChild(); Node nextNext = null; Node last = null; + Node soapElement = getSoapDocument().findIfPresent(element); public boolean hasNext() { if (next != null) { return true; } - if (next == null && nextNext != null) { + if (nextNext != null) { next = nextNext; } @@ -1158,15 +1354,15 @@ last = next; next = null; - if ((element instanceof ElementImpl) - && (last instanceof Element)) { + if ((soapElement instanceof ElementImpl) + && (last instanceof Element)) { last = - ((ElementImpl) element).convertToSoapElement( - (Element) last); + ((ElementImpl) soapElement).convertToSoapElement( + (Element) last); } nextNext = last.getNextSibling(); - return last; + return getSoapDocument().findIfPresent(last); } throw new NoSuchElementException(); } @@ -1251,7 +1447,7 @@ // SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value))) // return; - super.setAttributeNS(namespaceURI,qualifiedName,value); + element.setAttributeNS(namespaceURI,qualifiedName,value); //String tmpLocalName = this.getLocalName(); String tmpURI = this.getNamespaceURI(); boolean isIDNS = false; @@ -1270,4 +1466,116 @@ } + @Override + public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { + element.removeAttributeNS(namespaceURI, localName); + } + + @Override + public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException { + return element.getAttributeNodeNS(namespaceURI, localName); + } + + @Override + public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { + return element.setAttributeNodeNS(newAttr); + } + + @Override + public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException { + return new NodeListImpl(getSoapDocument(), element.getElementsByTagNameNS(namespaceURI, localName)); + } + + @Override + public boolean hasAttribute(String name) { + return element.hasAttribute(name); + } + + @Override + public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException { + return element.hasAttributeNS(namespaceURI, localName); + } + + @Override + public TypeInfo getSchemaTypeInfo() { + return element.getSchemaTypeInfo(); + } + + @Override + public void setIdAttribute(String name, boolean isId) throws DOMException { + element.setIdAttribute(name, isId); + } + + @Override + public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { + element.setIdAttributeNS(namespaceURI, localName, isId); + } + + @Override + public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException { + element.setIdAttributeNode(idAttr, isId); + } + + @Override + public String getNodeName() { + return element.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return element.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + element.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return element.getNodeType(); + } + + @Override + public Node getParentNode() { + return getSoapDocument().find(element.getParentNode()); + } + + @Override + public NodeList getChildNodes() { + return new NodeListImpl(getSoapDocument(), element.getChildNodes()); + } + + @Override + public Node getFirstChild() { + return getSoapDocument().findIfPresent(element.getFirstChild()); + } + + @Override + public Node getLastChild() { + return getSoapDocument().findIfPresent(element.getLastChild()); + } + + @Override + public Node getPreviousSibling() { + return getSoapDocument().findIfPresent(element.getPreviousSibling()); + } + + @Override + public Node getNextSibling() { + return getSoapDocument().findIfPresent(element.getNextSibling()); + } + + @Override + public NamedNodeMap getAttributes() { + return element.getAttributes(); + } + + public Element getDomElement() { + return element; + } + + public SOAPDocumentImpl getSoapDocument() { + return soapDocument; + } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java 2017-02-14 14:25:36.204169428 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java 2017-02-14 14:25:36.108168814 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -52,6 +52,7 @@ import com.sun.xml.internal.org.jvnet.staxex.util.DOMStreamReader; import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter; +import org.w3c.dom.Element; /** * Our implementation of the SOAP envelope. @@ -92,6 +93,10 @@ addBody(); } + public EnvelopeImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract NameImpl getHeaderName(String prefix); protected abstract NameImpl getBodyName(String prefix); @@ -122,7 +127,7 @@ } header = (HeaderImpl) createElement(headerName); - insertBefore(header, firstChild); + insertBefore(header.getDomElement(), firstChild); header.ensureNamespaceIsDeclared(headerName.getPrefix(), headerName.getURI()); return header; @@ -161,7 +166,7 @@ if (body == null) { NameImpl bodyName = getBodyName(prefix); body = (BodyImpl) createElement(bodyName); - insertBefore(body, null); + insertBefore(body.getDomElement(), null); body.ensureNamespaceIsDeclared(bodyName.getPrefix(), bodyName.getURI()); } else { log.severe("SAAJ0122.impl.body.already.exists"); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java 2017-02-14 14:25:36.724172752 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java 2017-02-14 14:25:36.624172113 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -34,6 +34,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public abstract class FaultElementImpl extends ElementImpl @@ -47,6 +48,10 @@ super(ownerDoc, qname); } + public FaultElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract boolean isStandardFaultElement(); public SOAPElement setElementQName(QName newName) throws SOAPException { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java 2017-02-14 14:25:37.220175924 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java 2017-02-14 14:25:37.124175311 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -31,6 +31,7 @@ import javax.xml.namespace.QName; import javax.xml.soap.*; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; import org.w3c.dom.Element; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; @@ -53,6 +54,9 @@ super(ownerDoc, name); } + public FaultImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } protected abstract NameImpl getDetailName(); protected abstract NameImpl getFaultCodeName(); @@ -83,6 +87,7 @@ (SOAPFaultElement) findAndConvertChildElement(getFaultStringName()); } + @Override public void setFaultCode(String faultCode) throws SOAPException { setFaultCode( NameImpl.getLocalNameFromTagName(faultCode), @@ -131,6 +136,7 @@ } } + @Override public void setFaultCode(Name faultCodeQName) throws SOAPException { setFaultCode( faultCodeQName.getLocalName(), @@ -138,6 +144,7 @@ faultCodeQName.getURI()); } + @Override public void setFaultCode(QName faultCodeQName) throws SOAPException { setFaultCode( faultCodeQName.getLocalPart(), @@ -165,6 +172,7 @@ detail = (Detail) findAndConvertChildElement(detailName); } + @Override public Detail getDetail() { if (detail == null) initializeDetail(); @@ -175,6 +183,7 @@ return detail; } + @Override public Detail addDetail() throws SOAPException { if (detail == null) initializeDetail(); @@ -188,12 +197,15 @@ } } + @Override public boolean hasDetail() { return (getDetail() != null); } + @Override public abstract void setFaultActor(String faultActor) throws SOAPException; + @Override public String getFaultActor() { if (this.faultActorElement == null) findFaultActorElement(); @@ -203,6 +215,7 @@ return null; } + @Override public SOAPElement setElementQName(QName newName) throws SOAPException { log.log( @@ -213,11 +226,13 @@ "Cannot change name for " + elementQName.getLocalPart() + " to " + newName.getLocalPart()); } + @Override protected SOAPElement convertToSoapElement(Element element) { - if (element instanceof SOAPFaultElement) { - return (SOAPElement) element; - } else if (element instanceof SOAPElement) { - SOAPElement soapElement = (SOAPElement) element; + final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element); + if (soapNode instanceof SOAPFaultElement) { + return (SOAPElement) soapNode; + } else if (soapNode instanceof SOAPElement) { + SOAPElement soapElement = (SOAPElement) soapNode; if (getDetailName().equals(soapElement.getElementName())) { return replaceElementWithSOAPElement(element, createDetail()); } else { @@ -233,12 +248,12 @@ Name elementName = NameImpl.copyElementName(element); ElementImpl newElement; if (getDetailName().equals(elementName)) { - newElement = (ElementImpl) createDetail(); + newElement = createDetail(); } else { String localName = elementName.getLocalName(); if (isStandardFaultElement(localName)) newElement = - (ElementImpl) createSOAPFaultElement(elementName); + createSOAPFaultElement(elementName); else newElement = (ElementImpl) createElement(elementName); } @@ -284,6 +299,7 @@ } } + @Override protected SOAPElement addElement(Name name) throws SOAPException { if (getDetailName().equals(name)) { return addDetail(); @@ -297,6 +313,7 @@ return super.addElement(name); } + @Override protected SOAPElement addElement(QName name) throws SOAPException { return addElement(NameImpl.convertToName(name)); } @@ -311,6 +328,8 @@ /** * Convert an xml:lang attribute value into a Locale object + * @param xmlLang xml:lang attribute value + * @return Locale */ protected static Locale xmlLangToLocale(String xmlLang) { if (xmlLang == null) { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java 2017-02-14 14:25:37.736179224 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java 2017-02-14 14:25:37.640178610 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -31,6 +31,7 @@ import javax.xml.namespace.QName; import javax.xml.soap.*; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; import org.w3c.dom.Element; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; @@ -45,6 +46,10 @@ super(ownerDoc, name); } + public HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract SOAPHeaderElement createHeaderElement(Name name) throws SOAPException; protected abstract SOAPHeaderElement createHeaderElement(QName name) @@ -276,8 +281,9 @@ } protected SOAPElement convertToSoapElement(Element element) { - if (element instanceof SOAPHeaderElement) { - return (SOAPElement) element; + final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element); + if (soapNode instanceof SOAPHeaderElement) { + return (SOAPElement) soapNode; } else { SOAPHeaderElement headerElement; try { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java 2017-02-14 14:25:38.236182421 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java 2017-02-14 14:25:38.132181755 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -31,14 +31,20 @@ import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPException; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import org.w3c.dom.Comment; import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; import org.w3c.dom.Text; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.UserDataHandler; public class SOAPCommentImpl - extends com.sun.org.apache.xerces.internal.dom.CommentImpl implements javax.xml.soap.Text, org.w3c.dom.Comment { protected static final Logger log = @@ -47,8 +53,236 @@ protected static ResourceBundle rb = log.getResourceBundle(); + @Override + public String getData() throws DOMException { + return comment.getData(); + } + + @Override + public void setData(String data) throws DOMException { + comment.setData(data); + } + + @Override + public int getLength() { + return comment.getLength(); + } + + @Override + public String substringData(int offset, int count) throws DOMException { + return comment.substringData(offset, count); + } + + @Override + public void appendData(String arg) throws DOMException { + comment.appendData(arg); + } + + @Override + public void insertData(int offset, String arg) throws DOMException { + comment.insertData(offset, arg); + } + + @Override + public void deleteData(int offset, int count) throws DOMException { + comment.deleteData(offset, count); + } + + @Override + public void replaceData(int offset, int count, String arg) throws DOMException { + comment.replaceData(offset, count, arg); + } + + @Override + public String getNodeName() { + return comment.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return comment.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + comment.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return comment.getNodeType(); + } + + @Override + public Node getParentNode() { + return comment.getParentNode(); + } + + @Override + public NodeList getChildNodes() { + return comment.getChildNodes(); + } + + @Override + public Node getFirstChild() { + return comment.getFirstChild(); + } + + @Override + public Node getLastChild() { + return comment.getLastChild(); + } + + @Override + public Node getPreviousSibling() { + return comment.getPreviousSibling(); + } + + @Override + public Node getNextSibling() { + return comment.getNextSibling(); + } + + @Override + public NamedNodeMap getAttributes() { + return comment.getAttributes(); + } + + @Override + public Document getOwnerDocument() { + return comment.getOwnerDocument(); + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return comment.insertBefore(newChild, refChild); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return comment.replaceChild(newChild, oldChild); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return comment.removeChild(oldChild); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return comment.appendChild(newChild); + } + + @Override + public boolean hasChildNodes() { + return comment.hasChildNodes(); + } + + @Override + public Node cloneNode(boolean deep) { + return comment.cloneNode(deep); + } + + @Override + public void normalize() { + comment.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return comment.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return comment.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return comment.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + comment.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return comment.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return comment.hasAttributes(); + } + + @Override + public String getBaseURI() { + return comment.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return comment.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return comment.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + comment.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return comment.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return comment.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return comment.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return comment.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return comment.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return comment.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return comment.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return comment.getUserData(key); + } + + private Comment comment; + public SOAPCommentImpl(SOAPDocumentImpl ownerDoc, String text) { - super(ownerDoc, text); + comment = ownerDoc.getDomDocument().createComment(text); + ownerDoc.register(this); } public String getValue() { @@ -111,4 +345,7 @@ throw new UnsupportedOperationException("Not Supported"); } + public Comment getDomElement() { + return comment; + } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java 2017-02-14 14:25:38.756185745 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java 2017-02-14 14:25:38.656185106 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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,17 +32,271 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.w3c.dom.UserDataHandler; public class SOAPTextImpl - extends com.sun.org.apache.xerces.internal.dom.TextImpl implements javax.xml.soap.Text, org.w3c.dom.Text { + @Override + public Text splitText(int offset) throws DOMException { + return textNode.splitText(offset); + } + + @Override + public boolean isElementContentWhitespace() { + return textNode.isElementContentWhitespace(); + } + + @Override + public String getWholeText() { + return textNode.getWholeText(); + } + + @Override + public Text replaceWholeText(String content) throws DOMException { + return textNode.replaceWholeText(content); + } + + @Override + public String getData() throws DOMException { + return textNode.getData(); + } + + @Override + public void setData(String data) throws DOMException { + textNode.setData(data); + } + + @Override + public int getLength() { + return textNode.getLength(); + } + + @Override + public String substringData(int offset, int count) throws DOMException { + return textNode.substringData(offset, count); + } + + @Override + public void appendData(String arg) throws DOMException { + textNode.appendData(arg); + } + + @Override + public void insertData(int offset, String arg) throws DOMException { + textNode.insertData(offset, arg); + } + + @Override + public void deleteData(int offset, int count) throws DOMException { + textNode.deleteData(offset, count); + } + + @Override + public void replaceData(int offset, int count, String arg) throws DOMException { + textNode.replaceData(offset, count, arg); + } + + @Override + public String getNodeName() { + return textNode.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return textNode.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + textNode.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return textNode.getNodeType(); + } + + @Override + public Node getParentNode() { + return textNode.getParentNode(); + } + + @Override + public NodeList getChildNodes() { + return textNode.getChildNodes(); + } + + @Override + public Node getFirstChild() { + return textNode.getFirstChild(); + } + + @Override + public Node getLastChild() { + return textNode.getLastChild(); + } + + @Override + public Node getPreviousSibling() { + return textNode.getPreviousSibling(); + } + + @Override + public Node getNextSibling() { + return textNode.getNextSibling(); + } + + @Override + public NamedNodeMap getAttributes() { + return textNode.getAttributes(); + } + + @Override + public Document getOwnerDocument() { + return textNode.getOwnerDocument(); + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return textNode.insertBefore(newChild, refChild); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return textNode.replaceChild(newChild, oldChild); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return textNode.removeChild(oldChild); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return textNode.appendChild(newChild); + } + + @Override + public boolean hasChildNodes() { + return textNode.hasChildNodes(); + } + + @Override + public Node cloneNode(boolean deep) { + return textNode.cloneNode(deep); + } + + @Override + public void normalize() { + textNode.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return textNode.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return textNode.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return textNode.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + textNode.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return textNode.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return textNode.hasAttributes(); + } + + @Override + public String getBaseURI() { + return textNode.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return textNode.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return textNode.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + textNode.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return textNode.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return textNode.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return textNode.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return textNode.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return textNode.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return textNode.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return textNode.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return textNode.getUserData(key); + } + protected static final Logger log = Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); + private Text textNode; + public SOAPTextImpl(SOAPDocumentImpl ownerDoc, String text) { - super(ownerDoc, text); + textNode = ownerDoc.getDomDocument().createTextNode(text); + ownerDoc.register(this); } public String getValue() { @@ -70,7 +324,7 @@ public void detachNode() { org.w3c.dom.Node parent = getParentNode(); if (parent != null) { - parent.removeChild(this); + parent.removeChild(getDomElement()); } } @@ -88,4 +342,8 @@ } return txt.startsWith(""); } + + public Text getDomElement() { + return textNode; + } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java 2017-02-14 14:25:39.288189147 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java 2017-02-14 14:25:39.192188533 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -218,6 +218,7 @@ return prefix + ":" + localName; } + @Override public boolean equals(Object obj) { if (!(obj instanceof Name)) { return false; @@ -236,6 +237,7 @@ return true; } + @Override public int hashCode() { return localName.hashCode(); } @@ -245,6 +247,7 @@ * * @return a string for the local name. */ + @Override public String getLocalName() { return localName; } @@ -256,6 +259,7 @@ * * @return the prefix as a string. */ + @Override public String getPrefix() { return prefix; } @@ -265,6 +269,7 @@ * * @return the uri as a string. */ + @Override public String getURI() { return uri; } @@ -272,6 +277,7 @@ /** * Returns a String version of the name suitable for use in an XML document. */ + @Override public String getQualifiedName() { if (qualifiedName == null) { if (prefix != null && prefix.length() > 0) { @@ -285,6 +291,9 @@ /** * Create a name object for a SOAP1.1 Envelope. + * + * @param prefix prefix + * @return Envelope Name */ public static NameImpl createEnvelope1_1Name(String prefix) { return new Envelope1_1Name(prefix); @@ -292,6 +301,9 @@ /** * Create a name object for a SOAP1.2 Envelope. + * + * @param prefix prefix + * @return Envelope Name */ public static NameImpl createEnvelope1_2Name(String prefix) { return new Envelope1_2Name(prefix); @@ -299,6 +311,8 @@ /** * Create a name object for a SOAP1.1 Header. + * @param prefix prefix + * @return Header Name */ public static NameImpl createHeader1_1Name(String prefix) { return new Header1_1Name(prefix); @@ -306,6 +320,8 @@ /** * Create a name object for a SOAP1.2 Header. + * @param prefix prefix + * @return Header Name */ public static NameImpl createHeader1_2Name(String prefix) { return new Header1_2Name(prefix); @@ -313,6 +329,8 @@ /** * Create a name object for a SOAP1.1 Body. + * @param prefix prefix + * @return Body Name */ public static NameImpl createBody1_1Name(String prefix) { return new Body1_1Name(prefix); @@ -320,6 +338,8 @@ /** * Create a name object for a SOAP1.2 Body. + * @param prefix prefix + * @return Body Name */ public static NameImpl createBody1_2Name(String prefix) { return new Body1_2Name(prefix); @@ -327,20 +347,26 @@ /** * Create a name object for a SOAP1.1 Fault. + * @param prefix prefix + * @return Fault Name */ public static NameImpl createFault1_1Name(String prefix) { return new Fault1_1Name(prefix); } /** - * Create a name object for a SOAP1.2 NotUnderstood element. - */ + * Create a name object for a SOAP1.2 NotUnderstood element. + * @param prefix prefix + * @return NotUnderstood Name + */ public static NameImpl createNotUnderstood1_2Name(String prefix) { return new NotUnderstood1_2Name(prefix); } /** * Create a name object for a SOAP1.2 Upgrade element. + * @param prefix prefix + * @return Upgrade Name */ public static NameImpl createUpgrade1_2Name(String prefix) { return new Upgrade1_2Name(prefix); @@ -348,6 +374,8 @@ /** * Create a name object for a SOAP1.2 SupportedEnvelope Upgrade element. + * @param prefix prefix + * @return Supported Envelope Name */ public static NameImpl createSupportedEnvelope1_2Name(String prefix) { return new SupportedEnvelope1_2Name(prefix); @@ -358,6 +386,8 @@ * Fault, Reason or Detail. * * @param localName Local Name of element + * @param prefix prefix + * @return Fault Name */ public static NameImpl createFault1_2Name( String localName, @@ -369,6 +399,8 @@ * Create a name object for a SOAP1.2 Fault/Code or Subcode. * * @param localName Either "Code" or "Subcode" + * @param prefix prefix + * @return CodeSubcode Name */ public static NameImpl createCodeSubcode1_2Name( String prefix, @@ -378,6 +410,7 @@ /** * Create a name object for a SOAP1.1 Fault Detail. + * @return Detail Name */ public static NameImpl createDetail1_1Name() { return new Detail1_1Name(); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java 2017-02-14 14:25:39.812192498 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java 2017-02-14 14:25:39.708191833 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -38,12 +38,17 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.BodyImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Body1_1Impl extends BodyImpl { public Body1_1Impl(SOAPDocumentImpl ownerDocument, String prefix) { super(ownerDocument, NameImpl.createBody1_1Name(prefix)); } + public Body1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + public SOAPFault addSOAP12Fault(QName faultCode, String faultReason, Locale locale) { // log message here throw new UnsupportedOperationException("Not supported in SOAP 1.1"); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java 2017-02-14 14:25:40.324195772 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java 2017-02-14 14:25:40.228195158 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -36,6 +36,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Detail1_1Impl extends DetailImpl { @@ -45,6 +46,11 @@ public Detail1_1Impl(SOAPDocumentImpl ownerDoc) { super(ownerDoc, NameImpl.createDetail1_1Name()); } + + public Detail1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected DetailEntry createDetailEntry(Name name) { return new DetailEntry1_1Impl( (SOAPDocumentImpl) getOwnerDocument(), --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java 2017-02-14 14:25:40.828198994 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java 2017-02-14 14:25:40.732198380 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -34,6 +34,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Envelope1_1Impl extends EnvelopeImpl { @@ -52,6 +53,11 @@ createHeader, createBody); } + + public Envelope1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getBodyName(String prefix) { return NameImpl.createBody1_1Name(prefix); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java 2017-02-14 14:25:41.348202319 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java 2017-02-14 14:25:41.244201654 +0300 @@ -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 @@ -46,6 +46,7 @@ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; +import org.w3c.dom.Element; public class Fault1_1Impl extends FaultImpl { @@ -59,6 +60,10 @@ super(ownerDocument, NameImpl.createFault1_1Name(prefix)); } + public Fault1_1Impl(Element domElement, SOAPDocumentImpl ownerDoc) { + super(ownerDoc, domElement); + } + protected NameImpl getDetailName() { return NameImpl.createDetail1_1Name(); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java 2017-02-14 14:25:41.912205925 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java 2017-02-14 14:25:41.800205209 +0300 @@ -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 @@ -40,6 +40,7 @@ import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.Element; public class Header1_1Impl extends HeaderImpl { @@ -51,6 +52,10 @@ super(ownerDocument, NameImpl.createHeader1_1Name(prefix)); } + public Header1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getNotUnderstoodName() { log.log( Level.SEVERE, --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java 2017-02-14 14:25:42.476209532 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java 2017-02-14 14:25:42.372208866 +0300 @@ -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 @@ -34,6 +34,7 @@ import javax.xml.namespace.QName; import javax.xml.soap.*; +import org.w3c.dom.Element; import org.w3c.dom.Node; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; @@ -52,6 +53,10 @@ super(ownerDocument, NameImpl.createBody1_2Name(prefix)); } + public Body1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getFaultName(String name) { return NameImpl.createFault1_2Name(name, null); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java 2017-02-14 14:25:42.996212856 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java 2017-02-14 14:25:42.896212217 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -39,6 +39,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Detail1_2Impl extends DetailImpl { @@ -54,6 +55,10 @@ super(ownerDocument, NameImpl.createSOAP12Name("Detail")); } + public Detail1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected DetailEntry createDetailEntry(Name name) { return new DetailEntry1_2Impl( ((SOAPDocument) getOwnerDocument()).getDocument(), --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java 2017-02-14 14:25:43.524216233 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java 2017-02-14 14:25:43.420215568 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -39,6 +39,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Envelope1_2Impl extends EnvelopeImpl { @@ -50,6 +51,10 @@ super(ownerDoc, NameImpl.createEnvelope1_2Name(prefix)); } + public Envelope1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + public Envelope1_2Impl( SOAPDocumentImpl ownerDoc, String prefix, --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java 2017-02-14 14:25:44.040219532 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java 2017-02-14 14:25:43.940218892 +0300 @@ -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 @@ -42,6 +42,7 @@ import com.sun.xml.internal.messaging.saaj.soap.impl.*; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.Element; public class Fault1_2Impl extends FaultImpl { @@ -68,6 +69,10 @@ super(ownerDocument, NameImpl.createFault1_2Name(null, prefix)); } + public Fault1_2Impl(Element domElement, SOAPDocumentImpl ownerDoc) { + super(ownerDoc, domElement); + } + protected NameImpl getDetailName() { return NameImpl.createSOAP12Name("Detail", getPrefix()); } @@ -521,7 +526,7 @@ } } if (element instanceof Detail1_2Impl) { - ElementImpl importedElement = (ElementImpl) importElement(element); + Element importedElement = importElement(element); addNode(importedElement); return convertToSoapElement(importedElement); } else --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java 2017-02-14 14:25:44.576222959 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java 2017-02-14 14:25:44.468222269 +0300 @@ -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 @@ -41,6 +41,7 @@ import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.Element; public class Header1_2Impl extends HeaderImpl { @@ -54,6 +55,10 @@ super(ownerDocument, NameImpl.createHeader1_2Name(prefix)); } + public Header1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getNotUnderstoodName() { return NameImpl.createNotUnderstood1_2Name(null); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java 2017-02-14 14:25:45.076226156 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java 2017-02-14 14:25:44.972225491 +0300 @@ -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 @@ -37,7 +37,6 @@ * This class is used by XML Schema binary format validation * * @author Jeffrey Rodriguez - * @version */ public final class Base64 { @@ -173,7 +172,7 @@ /** * Decodes Base64 data into octects * - * @param binaryData Byte array containing Base64 data + * @param base64Data Byte array containing Base64 data * @return Array containind decoded data. */ public byte[] decode( byte[] base64Data ) { --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java 2017-02-14 14:25:45.600229506 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java 2017-02-14 14:25:45.500228867 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -42,6 +42,7 @@ *

  • doesn't do synchronization *
  • allows access to the raw buffer *
  • almost no parameter check + * */ public final class ByteOutputStream extends OutputStream { /** @@ -64,6 +65,9 @@ /** * Copies all the bytes from this input into this buffer. + * + * @param in input stream. + * @exception IOException in case of an I/O error. */ public void write(InputStream in) throws IOException { if (in instanceof ByteArrayInputStream) { @@ -84,6 +88,7 @@ } } + @Override public void write(int b) { ensureCapacity(1); buf[count] = (byte) b; @@ -102,18 +107,22 @@ } } + @Override public void write(byte[] b, int off, int len) { ensureCapacity(len); System.arraycopy(b, off, buf, count, len); count += len; } + @Override public void write(byte[] b) { write(b, 0, b.length); } /** * Writes a string as ASCII string. + * + * @param s string to write. */ public void writeAsAscii(String s) { int len = s.length(); @@ -138,9 +147,12 @@ * Evil buffer reallocation method. * Don't use it unless you absolutely have to. * + * @return byte array + * * @deprecated * because this is evil! */ + @Deprecated public byte toByteArray()[] { byte[] newbuf = new byte[count]; System.arraycopy(buf, 0, newbuf, 0, count); @@ -162,10 +174,12 @@ * @return String translated from the buffer's contents. * @since JDK1.1 */ + @Override public String toString() { return new String(buf, 0, count); } + @Override public void close() { } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java 2017-02-14 14:25:46.100232704 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java 2017-02-14 14:25:46.000232065 +0300 @@ -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 @@ -39,8 +39,9 @@ * string and fragment) that may constitute a URI. *

    * Parsing of a URI specification is done according to the URI -* syntax described in RFC 2396. -* Every URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific +* syntax described in +* RFC 2396. Every URI consists +* of a scheme, followed by a colon (':'), followed by a scheme-specific * part. For URIs that follow the "generic URI" syntax, the scheme- * specific part begins with two slashes ("//") and may be followed * by an authority segment (comprised of user information, host, and @@ -60,8 +61,6 @@ * default port for a specific scheme). Rather, it only knows the * grammar and basic set of operations that can be applied to a URI. * -* @version -* **********************************************************************/ public class JaxmURI implements Serializable { @@ -1106,6 +1105,7 @@ * @return true if p_test is a URI with all values equal to this * URI, false otherwise */ + @Override public boolean equals(Object p_test) { if (p_test instanceof JaxmURI) { JaxmURI testURI = (JaxmURI) p_test; @@ -1134,6 +1134,7 @@ return false; } + @Override public int hashCode() { // No members safe to use, just default to a constant. return 153214; @@ -1144,6 +1145,7 @@ * * @return the URI string specification */ + @Override public String toString() { StringBuilder uriSpecString = new StringBuilder(); @@ -1173,6 +1175,8 @@ * A scheme is conformant if it starts with an alphanumeric, and * contains only alphanumerics, '+','-' and '.'. * + * @param p_scheme scheme name + * * @return true if the scheme is conformant, false otherwise */ public static boolean isConformantSchemeName(String p_scheme) { @@ -1202,7 +1206,9 @@ * IPv4 address consists of four decimal digit groups separated by a * '.'. A hostname consists of domain labels (each of which must * begin and end with an alphanumeric but may contain '-') separated - & by a '.'. See RFC 2396 Section 3.2.2. + * by a '.'. See RFC 2396 Section 3.2.2. + * + * @param p_address address * * @return true if the string is a syntactically valid IPv4 address * or hostname --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java 2017-02-14 14:25:46.624236054 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java 2017-02-14 14:25:46.524235415 +0300 @@ -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 @@ -40,6 +40,10 @@ * Returns a new String constructed from the specified String by replacing * the URL escape sequences and UTF8 encoding with the characters they * represent. + * + * @param s string + * + * @return decoded string */ public static String decode(String s) { StringBuilder sb = new StringBuilder(); --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java 2017-02-14 14:25:47.132239302 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java 2017-02-14 14:25:47.032238663 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -45,8 +45,7 @@ public ParserPool(int capacity) { queue = new ArrayBlockingQueue(capacity); - //factory = SAXParserFactory.newInstance(); - factory = new com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl(); + factory = SAXParserFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", SAAJUtil.getSystemClassLoader()); factory.setNamespaceAware(true); for (int i = 0; i < capacity; i++) { try { @@ -79,7 +78,8 @@ public void returnParser(SAXParser saxParser) { saxParser.reset(); - resetSaxParser(saxParser); + //TODO!! Ask about jaxp issue (https://jaxp.dev.java.net/issues/show_bug.cgi?id=59) multirelease if needed +// resetSaxParser(saxParser); put(saxParser); } @@ -92,7 +92,7 @@ * is fixed. * @param parser the parser from the pool whose Symbol Table needs to be reset. */ - private void resetSaxParser(SAXParser parser) { + /*private void resetSaxParser(SAXParser parser) { try { //Object obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table"); com.sun.org.apache.xerces.internal.util.SymbolTable table = new com.sun.org.apache.xerces.internal.util.SymbolTable(); @@ -103,6 +103,6 @@ } catch (SAXNotSupportedException ex) { //nothing to do } - } + }*/ } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java 2017-02-14 14:25:47.648242602 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java 2017-02-14 14:25:47.544241937 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -26,6 +26,8 @@ package com.sun.xml.internal.messaging.saaj.util; import java.security.AccessControlException; +import java.security.AccessController; +import java.security.PrivilegedAction; /** * @@ -48,4 +50,17 @@ return null; } } + + public static ClassLoader getSystemClassLoader() { + if (System.getSecurityManager() == null) { + return ClassLoader.getSystemClassLoader(); + } else { + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + return ClassLoader.getSystemClassLoader(); + } + }); + } + } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java 2017-02-14 14:25:48.156245850 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java 2017-02-14 14:25:48.060245236 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -107,11 +107,13 @@ } } + @Override public void clearParameters() { if (m_realTransformer != null) m_realTransformer.clearParameters(); } + @Override public javax.xml.transform.ErrorListener getErrorListener() { try { materialize(); @@ -122,6 +124,7 @@ return null; } + @Override public java.util.Properties getOutputProperties() { try { materialize(); @@ -132,6 +135,7 @@ return null; } + @Override public String getOutputProperty(String str) throws java.lang.IllegalArgumentException { try { @@ -143,6 +147,7 @@ return null; } + @Override public Object getParameter(String str) { try { materialize(); @@ -153,6 +158,7 @@ return null; } + @Override public javax.xml.transform.URIResolver getURIResolver() { try { materialize(); @@ -163,6 +169,7 @@ return null; } + @Override public void setErrorListener( javax.xml.transform.ErrorListener errorListener) throws java.lang.IllegalArgumentException { @@ -174,6 +181,7 @@ } } + @Override public void setOutputProperties(java.util.Properties properties) throws java.lang.IllegalArgumentException { try { @@ -184,6 +192,7 @@ } } + @Override public void setOutputProperty(String str, String str1) throws java.lang.IllegalArgumentException { try { @@ -194,6 +203,7 @@ } } + @Override public void setParameter(String str, Object obj) { try { materialize(); @@ -203,6 +213,7 @@ } } + @Override public void setURIResolver(javax.xml.transform.URIResolver uRIResolver) { try { materialize(); @@ -272,6 +283,7 @@ //------------------------------------------------------------------------ + @Override public void transform( javax.xml.transform.Source source, javax.xml.transform.Result result) @@ -409,6 +421,8 @@ * Return Transformer instance for this thread, allocating a new one if * necessary. Note that this method does not clear global parameters, * properties or any other data set on a previously used transformer. + * + * @return Transformer instance */ public static Transformer newTransformer() { //CR : 6813167 --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java 2017-02-14 14:25:48.680249200 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java 2017-02-14 14:25:48.580248561 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -40,6 +40,8 @@ import javax.xml.soap.SOAPHeaderElement; import javax.xml.soap.SOAPMessage; +import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.message.Header; @@ -234,11 +236,12 @@ if (soapHeader == null) { return null; } + SOAPDocumentImpl soapDocument = ((HeaderImpl)soapHeader).getSoapDocument(); SOAPHeaderElement headerElem = find(nsUri, localName); if (headerElem == null) { return null; } - headerElem = (SOAPHeaderElement) soapHeader.removeChild(headerElem); + headerElem = (SOAPHeaderElement) soapDocument.find(soapHeader.removeChild(headerElem)); //it might have been a nonSAAJHeader - remove from that map removeNonSAAJHeader(headerElem); @@ -330,7 +333,7 @@ private void addNonSAAJHeader(SOAPHeaderElement headerElem, Header header) { if (nonSAAJHeaders == null) { - nonSAAJHeaders = new HashMap(); + nonSAAJHeaders = new HashMap<>(); } nonSAAJHeaders.put(headerElem, header); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java 2017-02-14 14:25:49.196252500 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java 2017-02-14 14:25:49.100251886 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -68,9 +68,7 @@ Class cls = Class.forName(SAFE_THREAD_NAME); Constructor ctr = cls.getConstructor(Runnable.class); return new SunMiscThreadFactory(ctr); - } catch (ClassNotFoundException ignored) { - } catch (NoSuchMethodException ignored) { - } + } catch (ClassNotFoundException | NoSuchMethodException ignored) {} return new LegacyThreadFactory(); } } @@ -90,7 +88,9 @@ try { return ctr.newInstance(null, r, "toBeReplaced", 0, false); } catch (ReflectiveOperationException x) { - throw new InternalError(x); + InternalError ie = new InternalError(x.getMessage()); + ie.initCause(ie); + throw ie; } } } @@ -99,7 +99,7 @@ private static class SunMiscThreadFactory implements ThreadFactory { final Constructor ctr; SunMiscThreadFactory(Constructor ctr) { this.ctr = ctr; } - @Override public Thread newThread(Runnable r) { + @Override public Thread newThread(final Runnable r) { return AccessController.doPrivileged( new PrivilegedAction() { @Override --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java 2017-02-14 14:25:49.704255748 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java 2017-02-14 14:25:49.604255108 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -39,43 +39,17 @@ class MethodUtil { private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); - private static final Method INVOKE_METHOD; - - static { - Method method; - try { - Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); - method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); - } - } catch (Throwable t) { - method = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); - } - } - INVOKE_METHOD = method; - } static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { - if (INVOKE_METHOD != null) { - // sun.reflect.misc.MethodUtil.invoke(method, owner, args) - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); - } - try { - return INVOKE_METHOD.invoke(null, method, target, args); - } catch (InvocationTargetException ite) { - // unwrap invocation exception added by reflection code ... - throw unwrapException(ite); - } - } else { - // other then Oracle JDK ... - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); - } - return method.invoke(target, args); + // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil"); + } + try { + return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java 2017-02-14 14:25:50.224259073 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java 2017-02-14 14:25:50.120258408 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -26,9 +26,9 @@ package com.sun.xml.internal.ws.api.server; import com.sun.xml.internal.stream.buffer.XMLStreamBuffer; +import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.server.ServerRtException; import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader; -import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; @@ -42,7 +42,7 @@ * SPI that provides the source of {@link SDDocument}. * *

    - * This abstract class could be implemented by appliations, or one of the + * This abstract class could be implemented by applications, or one of the * {@link #create} methods can be used. * * @author Kohsuke Kawaguchi @@ -85,28 +85,38 @@ /** * System ID of this document. + * @return */ public abstract URL getSystemId(); + public static SDDocumentSource create(final Class implClass, final String url) { + return create(url, implClass); + } + /** * Creates {@link SDDocumentSource} from an URL. + * @param url + * @return */ public static SDDocumentSource create(final URL url) { return new SDDocumentSource() { private final URL systemId = url; + @Override public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException { InputStream is = url.openStream(); return new TidyXMLStreamReader( xif.createXMLStreamReader(systemId.toExternalForm(),is), is); } + @Override public XMLStreamReader read() throws IOException, XMLStreamException { InputStream is = url.openStream(); return new TidyXMLStreamReader( XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is); } + @Override public URL getSystemId() { return systemId; } @@ -120,19 +130,22 @@ * @param resolvingClass class used to read resource * @param path resource path */ - public static SDDocumentSource create(final Class resolvingClass, final String path) { + private static SDDocumentSource create(final String path, final Class resolvingClass) { return new SDDocumentSource() { + @Override public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException { InputStream is = inputStream(); return new TidyXMLStreamReader(xif.createXMLStreamReader(path,is), is); } + @Override public XMLStreamReader read() throws IOException, XMLStreamException { InputStream is = inputStream(); return new TidyXMLStreamReader(XMLStreamReaderFactory.create(path,is,false), is); } + @Override public URL getSystemId() { try { return new URL("file://" + path); @@ -157,17 +170,23 @@ /** * Creates a {@link SDDocumentSource} from {@link XMLStreamBuffer}. + * @param systemId + * @param xsb + * @return */ public static SDDocumentSource create(final URL systemId, final XMLStreamBuffer xsb) { return new SDDocumentSource() { + @Override public XMLStreamReader read(XMLInputFactory xif) throws XMLStreamException { return xsb.readAsXMLStreamReader(); } + @Override public XMLStreamReader read() throws XMLStreamException { return xsb.readAsXMLStreamReader(); } + @Override public URL getSystemId() { return systemId; } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java 2017-02-14 14:25:50.752262449 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java 2017-02-14 14:25:50.652261809 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -25,10 +25,10 @@ package com.sun.xml.internal.ws.api.streaming; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java 2017-02-14 14:25:51.272265774 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java 2017-02-14 14:25:51.172265135 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -75,7 +75,7 @@ //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called. private HandlerConfiguration handlerConfig; private final Set addedHeaders = new HashSet(); - private final Set knownHeaders = new HashSet(); + private final Set knownHeaders = Collections.synchronizedSet(new HashSet()); private final Set unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders); private final BindingID bindingId; // Features that are set(enabled/disabled) on the binding --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java 2017-02-14 14:25:51.792269099 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java 2017-02-14 14:25:51.680268383 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -42,6 +42,8 @@ import javax.xml.ws.soap.MTOMFeature; import javax.xml.ws.soap.SOAPBinding; import java.util.*; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; /** * @author WS Development Team @@ -57,6 +59,7 @@ private Set portKnownHeaders = Collections.emptySet(); private Set bindingUnderstoodHeaders = new HashSet(); + private final Lock lock = new ReentrantLock(); /** * Use {@link BindingImpl#create(BindingID)} to create this. @@ -95,7 +98,13 @@ * @param headers SOAP header names */ public void setPortKnownHeaders(@NotNull Set headers) { - this.portKnownHeaders = headers; + + try{ + lock.lock(); + this.portKnownHeaders = headers; + } finally { + lock.unlock(); + } } /** --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java 2017-02-14 14:25:52.300272347 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java 2017-02-14 14:25:52.204271733 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -39,43 +39,17 @@ class MethodUtil { private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); - private static final Method INVOKE_METHOD; - - static { - Method method; - try { - Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); - method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); - } - } catch (Throwable t) { - method = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); - } - } - INVOKE_METHOD = method; - } static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { - if (INVOKE_METHOD != null) { - // sun.reflect.misc.MethodUtil.invoke(method, owner, args) - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); - } - try { - return INVOKE_METHOD.invoke(null, method, target, args); - } catch (InvocationTargetException ite) { - // unwrap invocation exception added by reflection code ... - throw unwrapException(ite); - } - } else { - // other then Oracle JDK ... - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); - } - return method.invoke(target, args); + // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java 2017-02-14 14:25:52.804275569 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java 2017-02-14 14:25:52.708274956 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -25,10 +25,10 @@ package com.sun.xml.internal.ws.commons.xmlutil; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java 2017-02-14 14:25:53.324278895 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java 2017-02-14 14:25:53.224278255 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -25,10 +25,10 @@ package com.sun.xml.internal.ws.developer; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java 2017-02-14 14:25:53.836282168 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java 2017-02-14 14:25:53.736281529 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -25,12 +25,16 @@ package com.sun.xml.internal.ws.model; +import java.lang.reflect.Field; import javax.xml.ws.WebServiceException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; import java.util.logging.Level; import java.util.logging.Logger; @@ -44,31 +48,68 @@ private static final Logger LOGGER = Logger.getLogger(Injector.class.getName()); - private static final Method defineClass; - private static final Method resolveClass; - private static final Method getPackage; - private static final Method definePackage; + private static Method defineClass; + private static Method resolveClass; + private static Method getPackage; + private static Method definePackage; + private static Object U; static { - Method[] m = AccessController.doPrivileged( - new PrivilegedAction() { + try { + Method[] m = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Method[] run() { + return new Method[]{ + getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), + getMethod(ClassLoader.class, "resolveClass", Class.class), + getMethod(ClassLoader.class, "getPackage", String.class), + getMethod(ClassLoader.class, "definePackage", + String.class, String.class, String.class, String.class, + String.class, String.class, String.class, URL.class) + }; + } + } + ); + defineClass = m[0]; + resolveClass = m[1]; + getPackage = m[2]; + definePackage = m[3]; + + } catch (Throwable t) { + try { + U = AccessController.doPrivileged(new PrivilegedExceptionAction() { @Override - public Method[] run() { - return new Method[]{ - getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), - getMethod(ClassLoader.class, "resolveClass", Class.class), - getMethod(ClassLoader.class, "getPackage", String.class), - getMethod(ClassLoader.class, "definePackage", - String.class, String.class, String.class, String.class, - String.class, String.class, String.class, URL.class) - }; + public Object run() throws Exception { + Class u = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = u.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + return theUnsafe.get(null); } - } - ); - defineClass = m[0]; - resolveClass = m[1]; - getPackage = m[2]; - definePackage = m[3]; + }); + defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Method run() throws Exception { + try { + return U.getClass().getMethod("defineClass", + new Class[]{String.class, + byte[].class, + Integer.TYPE, + Integer.TYPE, + ClassLoader.class, + ProtectionDomain.class}); + } catch (NoSuchMethodException | SecurityException ex) { + throw ex; + } + } + }); + } catch (SecurityException | PrivilegedActionException ex) { + Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex); + WebServiceException we = new WebServiceException(ex); + we.addSuppressed(t); + throw we; + } + } } private static Method getMethod(final Class c, final String methodname, final Class... params) { @@ -91,24 +132,26 @@ // nothing to do } try { + if (definePackage == null) { + return (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, cl, Injector.class.getProtectionDomain()); + } int packIndex = className.lastIndexOf('.'); if (packIndex != -1) { String pkgname = className.substring(0, packIndex); // Check if package already loaded. - Package pkg = (Package)getPackage.invoke(cl, pkgname); + Package pkg = (Package) getPackage.invoke(cl, pkgname); if (pkg == null) { definePackage.invoke(cl, pkgname, null, null, null, null, null, null, null); } } - Class c = (Class)defineClass.invoke(cl,className.replace('/','.'),image,0,image.length); + Class c = (Class) defineClass.invoke(cl, className.replace('/', '.'), image, 0, image.length); resolveClass.invoke(cl, c); return c; - } catch (IllegalAccessException e) { - LOGGER.log(Level.FINE,"Unable to inject "+className,e); - throw new WebServiceException(e); - } catch (InvocationTargetException e) { - LOGGER.log(Level.FINE,"Unable to inject "+className,e); + } catch (IllegalAccessException | InvocationTargetException e) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unable to inject " + className, e); + } throw new WebServiceException(e); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java 2017-02-14 14:25:54.352285468 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java 2017-02-14 14:25:54.252284829 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -346,7 +346,6 @@ } private boolean noWrapperGen() { - if (Runtime.version().major() >= 9) return true; Object o = config.properties().get(SuppressDocLitWrapperGeneration); return (o!= null && o instanceof Boolean) ? ((Boolean) o) : false; } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java 2017-02-14 14:25:54.876288818 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java 2017-02-14 14:25:54.776288179 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -33,6 +33,8 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; /** * Creates SOAP specific RuntimeModel @@ -41,6 +43,8 @@ */ public class SOAPSEIModel extends AbstractSEIModelImpl { + private final Lock lock = new ReentrantLock(); + public SOAPSEIModel(WebServiceFeatureList features) { super(features); } @@ -72,15 +76,22 @@ public Set getKnownHeaders() { Set headers = new HashSet(); - for (JavaMethodImpl method : getJavaMethods()) { - // fill in request headers - Iterator params = method.getRequestParameters().iterator(); - fillHeaders(params, headers, Mode.IN); + + try{ + lock.lock(); + for (JavaMethodImpl method : getJavaMethods()) { + // fill in request headers + Iterator params = method.getRequestParameters().iterator(); + fillHeaders(params, headers, Mode.IN); // fill in response headers - params = method.getResponseParameters().iterator(); - fillHeaders(params, headers, Mode.OUT); - } + params = method.getResponseParameters().iterator(); + fillHeaders(params, headers, Mode.OUT); + } + }finally + { + lock.unlock(); + } return headers; } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java 2017-02-14 14:25:55.376292015 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java 2017-02-14 14:25:55.280291401 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -37,43 +37,16 @@ class MethodUtil { private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); - private static final Method INVOKE_METHOD; - - static { - Method method; - try { - Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); - method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); - } - } catch (Throwable t) { - method = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); - } - } - INVOKE_METHOD = method; - } static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { - if (INVOKE_METHOD != null) { - // sun.reflect.misc.MethodUtil.invoke(method, owner, args) - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); - } - try { - return INVOKE_METHOD.invoke(null, method, target, args); - } catch (InvocationTargetException ite) { - // unwrap invocation exception added by reflection code ... - throw unwrapException(ite); - } - } else { - // other then Oracle JDK ... - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); - } - return method.invoke(target, args); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return com.sun.xml.internal.ws.policy.util.MethodUtil.invoke(method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java 2017-02-14 14:25:55.884295263 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java 2017-02-14 14:25:55.784294624 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -25,10 +25,10 @@ package com.sun.xml.internal.ws.spi; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java 2017-02-14 14:25:56.412298640 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java 2017-02-14 14:25:56.312298000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -69,13 +69,11 @@ /** * Implements {@link Endpoint}. - *

    - *

    + * * This class accumulates the information necessary to create * {@link WSEndpoint}, and then when {@link #publish} method * is called it will be created. - *

    - *

    + * * This object also allows accumulated information to be retrieved. * * @author Jitendra Kotamraju @@ -205,14 +203,17 @@ invoker = null; } + @Override public Binding getBinding() { return binding; } + @Override public Object getImplementor() { return implementor; } + @Override public void publish(String address) { canPublish(); URL url; @@ -232,6 +233,7 @@ ((HttpEndpoint) actualEndpoint).publish(address); } + @Override public void publish(Object serverContext) { canPublish(); if (!com.sun.net.httpserver.HttpContext.class.isAssignableFrom(serverContext.getClass())) { @@ -241,12 +243,14 @@ ((HttpEndpoint) actualEndpoint).publish(serverContext); } + @Override public void publish(HttpContext serverContext) { canPublish(); createEndpoint(serverContext.getPath()); ((HttpEndpoint) actualEndpoint).publish(serverContext); } + @Override public void stop() { if (isPublished()) { ((HttpEndpoint) actualEndpoint).stop(); @@ -255,14 +259,17 @@ } } + @Override public boolean isPublished() { return actualEndpoint != null; } + @Override public List getMetadata() { return metadata; } + @Override public void setMetadata(java.util.List metadata) { if (isPublished()) { throw new IllegalStateException("Cannot set Metadata. Endpoint is already published"); @@ -270,20 +277,24 @@ this.metadata = metadata; } + @Override public Executor getExecutor() { return executor; } + @Override public void setExecutor(Executor executor) { this.executor = executor; } + @Override public Map getProperties() { - return new HashMap(properties); + return new HashMap<>(properties); } + @Override public void setProperties(Map map) { - this.properties = new HashMap(map); + this.properties = new HashMap<>(map); } /* @@ -335,7 +346,7 @@ * reuse the Source object multiple times. */ private List buildDocList() { - List r = new ArrayList(); + List r = new ArrayList<>(); if (metadata != null) { for (Source source : metadata) { @@ -344,14 +355,8 @@ String systemId = source.getSystemId(); r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer())); - } catch (TransformerException te) { - throw new ServerRtException("server.rt.err", te); - } catch (IOException te) { + } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) { throw new ServerRtException("server.rt.err", te); - } catch (SAXException e) { - throw new ServerRtException("server.rt.err", e); - } catch (ParserConfigurationException e) { - throw new ServerRtException("server.rt.err", e); } } } @@ -367,11 +372,6 @@ EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { - ClassLoader cl = implClass.getClassLoader(); - URL url = cl.getResource(wsdlLocation); - if (url != null) { - return SDDocumentSource.create(url); - } return SDDocumentSource.create(implClass, wsdlLocation); } return null; @@ -388,10 +388,12 @@ } } + @Override public EndpointReference getEndpointReference(Element...referenceParameters) { return getEndpointReference(W3CEndpointReference.class, referenceParameters); } + @Override public T getEndpointReference(Class clazz, Element...referenceParameters) { if (!isPublished()) { throw new WebServiceException("Endpoint is not published yet"); @@ -458,13 +460,12 @@ public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) { try { spiInvoker.inject(wsc); - } catch (IllegalAccessException e) { - throw new WebServiceException(e); - } catch (InvocationTargetException e) { + } catch (IllegalAccessException | InvocationTargetException e) { throw new WebServiceException(e); } } + @Override public Object invoke(@NotNull Packet p, @NotNull Method m, @NotNull Object... args) throws InvocationTargetException, IllegalAccessException { return spiInvoker.invoke(m, args); } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java 2017-02-14 14:25:56.940302015 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java 2017-02-14 14:25:56.840301376 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -37,8 +37,8 @@ import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.logging.Level; import java.util.logging.Logger; -import java.util.Optional; /** @@ -49,10 +49,10 @@ final class ServerMgr { private static final ServerMgr serverMgr = new ServerMgr(); - private static final Logger logger = + private static final Logger LOGGER = Logger.getLogger( com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http"); - private final Map servers = new HashMap(); + private final Map servers = new HashMap<>(); private ServerMgr() {} @@ -83,25 +83,26 @@ synchronized(servers) { state = servers.get(inetAddress); if (state == null) { - final int finalPortNum = port; - Optional stateOpt = - servers.values() - .stream() - .filter(s -> s.getServer() - .getAddress() - .getPort() == finalPortNum) - .findAny(); - - if (inetAddress.getAddress().isAnyLocalAddress() && - stateOpt.isPresent()) { - state = stateOpt.get(); + ServerState free = null; + for (ServerState ss : servers.values()) { + if (port == ss.getServer().getAddress().getPort()) { + free = ss; + break; + } + } + if (inetAddress.getAddress().isAnyLocalAddress() && free != null) { + state = free; } else { - logger.fine("Creating new HTTP Server at "+inetAddress); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Creating new HTTP Server at "+inetAddress); + } // Creates server with default socket backlog server = HttpServer.create(inetAddress, 0); server.setExecutor(Executors.newCachedThreadPool()); String path = url.toURI().getPath(); - logger.fine("Creating HTTP Context at = "+path); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Creating HTTP Context at = "+path); + } HttpContext context = server.createContext(path); server.start(); @@ -110,7 +111,9 @@ // or IP: 0.0.0.0 - which is used to monitor network traffic from any valid IP address inetAddress = server.getAddress(); - logger.fine("HTTP server started = "+inetAddress); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("HTTP server started = "+inetAddress); + } state = new ServerState(server, path); servers.put(inetAddress, state); return context; @@ -121,11 +124,15 @@ if (state.getPaths().contains(url.getPath())) { String err = "Context with URL path "+url.getPath()+ " already exists on the server "+server.getAddress(); - logger.fine(err); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine(err); + } throw new IllegalArgumentException(err); } - logger.fine("Creating HTTP Context at = "+url.getPath()); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Creating HTTP Context at = "+url.getPath()); + } HttpContext context = server.createContext(url.getPath()); state.oneMoreContext(url.getPath()); return context; @@ -157,7 +164,7 @@ private static final class ServerState { private final HttpServer server; private int instances; - private Set paths = new HashSet(); + private final Set paths = new HashSet<>(); ServerState(HttpServer server, String path) { this.server = server; --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties 2017-02-14 14:25:57.484305494 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties 2017-02-14 14:25:57.384304854 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 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 @@ -26,4 +26,4 @@ build-id=2.3.0-SNAPSHOT build-version=JAX-WS RI 2.3.0-SNAPSHOT major-version=2.3.0 -svn-revision=5c2c1fd2f2ab3b5c7cea25f79aa49e54cb84b7cc +svn-revision=85fa96c632b8c2c0b23afc20889aedb9c5ee91aa --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java 2017-02-14 14:25:57.992308742 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java 2017-02-14 14:25:57.896308128 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -25,10 +25,10 @@ package com.sun.xml.internal.ws.util.xml; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2017-02-14 14:25:58.512312067 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2017-02-14 14:25:58.416311453 +0300 @@ -26,30 +26,21 @@ package com.sun.xml.internal.ws.util.xml; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.server.ServerRtException; import com.sun.xml.internal.ws.util.ByteArrayBuffer; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; -import java.lang.reflect.Method; -import java.net.URI; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; import javax.xml.XMLConstants; -import javax.xml.catalog.CatalogFeatures; -import javax.xml.catalog.CatalogFeatures.Feature; -import javax.xml.catalog.CatalogManager; import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -65,7 +56,6 @@ import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.SchemaFactory; -import javax.xml.ws.WebServiceException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPathFactoryConfigurationException; import org.w3c.dom.Attr; @@ -78,6 +68,8 @@ import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; @@ -184,7 +176,7 @@ } public static List parseTokenList(String tokenList) { - List result = new ArrayList(); + List result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(tokenList, " "); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.nextToken()); @@ -247,6 +239,7 @@ /** * Creates a new identity transformer. + * @return */ public static Transformer newTransformer() { try { @@ -258,9 +251,17 @@ /** * Performs identity transformation. + * @param + * @param src + * @param result + * @return + * @throws javax.xml.transform.TransformerException + * @throws java.io.IOException + * @throws org.xml.sax.SAXException + * @throws javax.xml.parsers.ParserConfigurationException */ - public static - T identityTransform(Source src, T result) throws TransformerException, SAXException, ParserConfigurationException, IOException { + public static T identityTransform(Source src, T result) + throws TransformerException, SAXException, ParserConfigurationException, IOException { if (src instanceof StreamSource) { // work around a bug in JAXP in JDK6u4 and earlier where the namespace processing // is not turned on by default @@ -286,68 +287,25 @@ return is; } - /* - * Gets an EntityResolver using XML catalog - */ - public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) { - ArrayList urlsArray = new ArrayList(); - EntityResolver er; - if (catalogUrl != null) { - urlsArray.add(catalogUrl); - } - try { - er = createCatalogResolver(urlsArray); - } catch (Exception e) { - throw new ServerRtException("server.rt.err",e); - } - return er; - } - /** - * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml + * Gets an EntityResolver using XML catalog + * + * @param catalogUrl + * @return */ - public static EntityResolver createDefaultCatalogResolver() { - EntityResolver er; - try { - /** - * Gets a URLs for catalog defined at META-INF/jaxws-catalog.xml - */ - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - Enumeration catalogEnum; - if (cl == null) { - catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml"); - } else { - catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml"); - } - er = createCatalogResolver(Collections.list(catalogEnum)); - } catch (Exception e) { - throw new WebServiceException(e); - } - - return er; + public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) { + return XmlCatalogUtil.createEntityResolver(catalogUrl); } /** - * Instantiate catalog resolver using new catalog API (javax.xml.catalog.*) - * added in JDK9. Usage of new API removes dependency on internal API - * (com.sun.org.apache.xml.internal) for modular runtime. + * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml + * + * @return */ - private static EntityResolver createCatalogResolver(ArrayList urls) throws Exception { - // Prepare array of catalog URIs - URI[] uris = urls.stream() - .map(u -> URI.create(u.toExternalForm())) - .toArray(URI[]::new); - - //Create CatalogResolver with new JDK9+ API - return (EntityResolver) CatalogManager.catalogResolver(catalogFeatures, uris); + public static EntityResolver createDefaultCatalogResolver() { + return XmlCatalogUtil.createDefaultCatalogResolver(); } - // Cache CatalogFeatures instance for future usages. - // Resolve feature is set to "continue" value for backward compatibility. - private static CatalogFeatures catalogFeatures = CatalogFeatures.builder() - .with(Feature.RESOLVE, "continue") - .build(); - /** * {@link ErrorHandler} that always treat the error as fatal. */ @@ -391,7 +349,7 @@ SAXParserFactory factory = SAXParserFactory.newInstance(); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity)); - } catch (Exception e) { + } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); } return factory; --- old/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java 2017-02-14 14:25:59.052315520 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java 2017-02-14 14:25:58.948314855 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, 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 @@ -245,10 +245,14 @@ return null; } - private static String getSystemProperty(String property) { + private static String getSystemProperty(final String property) { logger.log(Level.FINE, "Checking system property {0}", property); - String value = AccessController.doPrivileged( - (PrivilegedAction) () -> System.getProperty(property)); + String value = AccessController.doPrivileged(new PrivilegedAction() { + @Override + public String run() { + return System.getProperty(property); + } + }); logFound(value); return value; } --- old/jaxws/src/java.xml.ws/share/classes/module-info.java 2017-02-14 14:25:59.560318768 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/module-info.java 2017-02-14 14:25:59.464318155 +0300 @@ -38,6 +38,7 @@ requires java.logging; requires java.management; requires jdk.httpserver; + requires jdk.unsupported; uses javax.xml.ws.spi.Provider; uses javax.xml.soap.MessageFactory; --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java 2017-02-14 14:26:00.080322093 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java 2017-02-14 14:25:59.976321428 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -85,8 +85,8 @@ * ("my_children","MyChildren","myChildren", and "MY-CHILDREN", "CODE003-children" respectively) *

    * Although this method only works for English words, it handles non-English - * words gracefully (by just returning it as-is.) For example, "日本語" - * will be returned as-is without modified, not "日本語s" + * words gracefully (by just returning it as-is.) For example, "{@literal 日本語}" + * will be returned as-is without modified, not "{@literal 日本語s}" *

    * This method doesn't handle suffixes very well. For example, passing * "person56" will return "person56s", not "people56". --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java 2017-02-14 14:26:00.628325597 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java 2017-02-14 14:26:00.524324932 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -101,7 +101,7 @@ */ @Override public int hashCode() { - return 97 * (Integer.hashCode(getType().ordinal() + 1)) + name.hashCode(); + return 97 * (Integer.valueOf(getType().ordinal() + 1)).hashCode() + name.hashCode(); } /** --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java 2017-02-14 14:26:01.196329229 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java 2017-02-14 14:26:01.072328436 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, 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 @@ -37,7 +37,7 @@ * *

    * Note that this class doesn't escape other Unicode characters - * that are typically unsafe. For example, 愛 (A kanji + * that are typically unsafe. For example, {@literal 愛} (A kanji * that means "love") can be considered as unsafe because * javac with English Windows cannot accept this character in the * source code. --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java 2017-02-14 14:26:01.768332886 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java 2017-02-14 14:26:01.664332221 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -33,6 +33,7 @@ import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.net.Authenticator; import java.net.Authenticator.RequestorType; import java.net.MalformedURLException; @@ -42,6 +43,8 @@ import java.net.URLEncoder; import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -56,11 +59,12 @@ */ public class DefaultAuthenticator extends Authenticator { + private static final Logger LOGGER = Logger.getLogger(DefaultAuthenticator.class.getName()); private static DefaultAuthenticator instance; private static Authenticator systemAuthenticator = getCurrentAuthenticator(); private String proxyUser; private String proxyPasswd; - private final List authInfo = new ArrayList(); + private final List authInfo = new ArrayList<>(); private static int counter = 0; DefaultAuthenticator() { @@ -145,10 +149,7 @@ fi = new FileInputStream(f); is = new InputStreamReader(fi, "UTF-8"); in = new BufferedReader(is); - } catch (UnsupportedEncodingException e) { - listener.onError(e, locator); - return; - } catch (FileNotFoundException e) { + } catch (UnsupportedEncodingException | FileNotFoundException e) { listener.onError(e, locator); return; } @@ -170,7 +171,7 @@ } } catch (IOException e) { listener.onError(e, locator); - Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, e.getMessage(), e); + LOGGER.log(Level.SEVERE, e.getMessage(), e); } } finally { try { @@ -184,7 +185,7 @@ fi.close(); } } catch (IOException ex) { - Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, null, ex); + LOGGER.log(Level.SEVERE, null, ex); } } } @@ -225,6 +226,29 @@ } static Authenticator getCurrentAuthenticator() { + try { + return AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Authenticator run() throws Exception { + Method method = Authenticator.class.getMethod("getDefault"); + return (Authenticator) method.invoke(null); + } + + }); + } catch (PrivilegedActionException pae) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, null, pae); + } + Exception ex = pae.getException(); + if (!(ex instanceof NoSuchMethodException)) { + // if Authenticator.getDefault has not been found, + // we likely didn't get through sec, so return null + // and don't care about JDK version we're on + return null; + } + // or we're on JDK <9, so let's continue the old way... + } + final Field f = getTheAuthenticator(); if (f == null) { return null; @@ -239,7 +263,7 @@ } }); return (Authenticator) f.get(null); - } catch (Exception ex) { + } catch (IllegalAccessException | IllegalArgumentException ex) { return null; } finally { AccessController.doPrivileged(new PrivilegedAction() { @@ -255,7 +279,7 @@ private static Field getTheAuthenticator() { try { return Authenticator.class.getDeclaredField("theAuthenticator"); - } catch (Exception ex) { + } catch (NoSuchFieldException | SecurityException ex) { return null; } } @@ -277,7 +301,7 @@ @Override public void onError(Exception e, Locator loc) { System.err.println(getLocationString(loc) + ": " + e.getMessage()); - Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, e.getMessage(), e); + LOGGER.log(Level.SEVERE, e.getMessage(), e); } private String getLocationString(Locator l) { --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java 2017-02-14 14:26:02.320336416 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java 2017-02-14 14:26:02.212335725 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -25,6 +25,9 @@ package com.sun.istack.internal.tools; +import java.security.AccessController; +import java.security.PrivilegedAction; + /** * Class defined for safe calls of getClassLoader methods of any kind (context/system/class * classloader. This MUST be package private and defined in every package which @@ -37,9 +40,10 @@ if (System.getSecurityManager() == null) { return Thread.currentThread().getContextClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +54,10 @@ if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +68,10 @@ if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); @@ -76,9 +82,10 @@ if (System.getSecurityManager() == null) { return cl.getParent(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return cl.getParent(); } }); @@ -89,9 +96,10 @@ if (System.getSecurityManager() == null) { Thread.currentThread().setContextClassLoader(cl); } else { - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { Thread.currentThread().setContextClassLoader(cl); return null; } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties 2017-02-14 14:26:02.916340227 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties 2017-02-14 14:26:02.800339485 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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,10 +30,10 @@ Non-existent directory: {0} VERSION = \ - schemagen 2.3.0-SNAPSHOT + schemagen 2.3.0-b170211.0402 FULLVERSION = \ - schemagen full version "2.3.0-SNAPSHOT" + schemagen full version "2.3.0-b170211.0402" USAGE = \ Usage: schemagen [-options ...] \n\ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties 2017-02-14 14:26:03.512344037 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties 2017-02-14 14:26:03.372343142 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = schemagen vollst\u00E4ndige Version "2.3.0-SNAPSHOT" +FULLVERSION = schemagen vollst\u00E4ndige Version "2.3.0-b170211.0402" USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties 2017-02-14 14:26:04.076347644 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties 2017-02-14 14:26:03.968346953 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Directorio no existente: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = versi\u00F3n completa de schemagen "2.3.0-SNAPSHOT" +FULLVERSION = versi\u00F3n completa de schemagen "2.3.0-b170211.0402" USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties 2017-02-14 14:26:04.628351174 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties 2017-02-14 14:26:04.528350534 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = version compl\u00E8te de schemagen "2.3.0-SNAPSHOT" +FULLVERSION = version compl\u00E8te de schemagen "2.3.0-b170211.0402" USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties 2017-02-14 14:26:05.136354422 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties 2017-02-14 14:26:05.040353808 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Directory non esistente: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = versione completa schemagen "2.3.0-SNAPSHOT" +FULLVERSION = versione completa schemagen "2.3.0-b170211.0402" USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties 2017-02-14 14:26:05.672357849 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties 2017-02-14 14:26:05.568357184 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-SNAPSHOT" +FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-b170211.0402" USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059 --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties 2017-02-14 14:26:06.180361097 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties 2017-02-14 14:26:06.084360483 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.3.0-SNAPSHOT" +FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.3.0-b170211.0402" USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4. --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties 2017-02-14 14:26:06.756364780 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties 2017-02-14 14:26:06.640364039 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0} -VERSION = gera\u00E7\u00E3o do esquema 2.3.0-SNAPSHOT +VERSION = gera\u00E7\u00E3o do esquema 2.3.0-b170211.0402 -FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.3.0-SNAPSHOT" +FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.3.0-b170211.0402" USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties 2017-02-14 14:26:07.320368386 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties 2017-02-14 14:26:07.220367747 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-b170211.0402" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties 2017-02-14 14:26:07.884371992 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties 2017-02-14 14:26:07.784371353 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -27,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170211.0402 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-b170211.0402" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties 2017-02-14 14:26:08.464375701 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties 2017-02-14 14:26:08.360375036 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, 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 @@ -173,20 +173,20 @@ Driver.FailedToGenerateCode = \ Failed to produce code. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn Driver.FilePrologComment = \ - This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT \n\ + This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170211.0402 \n\ See https://jaxb.java.net/ \n\ Any modifications to this file will be lost upon recompilation of the source schema. \n\ Generated on: {0} \n Driver.Version = \ - xjc 2.3.0-SNAPSHOT + xjc 2.3.0-b170211.0402 Driver.FullVersion = \ - xjc full version "2.3.0-SNAPSHOT" + xjc full version "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties 2017-02-14 14:26:09.036379359 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties 2017-02-14 14:26:08.928378668 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT generiert \nSiehe https://jaxb.java.net/ \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170211.0402 generiert \nSiehe https://jaxb.java.net/ \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = xjc vollst\u00E4ndige Version "2.3.0-SNAPSHOT" +Driver.FullVersion = xjc vollst\u00E4ndige Version "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties 2017-02-14 14:26:09.556382683 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties 2017-02-14 14:26:09.456382044 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.3.0-SNAPSHOT \nVisite https://jaxb.java.net/ \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.3.0-b170211.0402 \nVisite https://jaxb.java.net/ \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = versi\u00F3n completa de xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = versi\u00F3n completa de xjc "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties 2017-02-14 14:26:10.092386111 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties 2017-02-14 14:26:09.980385395 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -131,14 +131,14 @@ Driver.FailedToGenerateCode = Echec de la production du code. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.3.0-SNAPSHOT \nVoir https://jaxb.java.net/ \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.3.0-b170211.0402 \nVoir https://jaxb.java.net/ \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = version compl\u00E8te xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = version compl\u00E8te xjc "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties 2017-02-14 14:26:10.832390842 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties 2017-02-14 14:26:10.652389692 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = Produzione del codice non riuscita. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.3.0-SNAPSHOT \nVedere https://jaxb.java.net/ \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.3.0-b170211.0402 \nVedere https://jaxb.java.net/ \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = versione completa xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = versione completa xjc "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties 2017-02-14 14:26:11.460394858 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties 2017-02-14 14:26:11.356394193 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.3.0-SNAPSHOT\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttps://jaxb.java.net/\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.3.0-b170211.0402\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttps://jaxb.java.net/\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-SNAPSHOT" +Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties 2017-02-14 14:26:12.032398515 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties 2017-02-14 14:26:11.920397799 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.3.0-SNAPSHOT \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttps://jaxb.java.net/\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.3.0-b170211.0402 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttps://jaxb.java.net/\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n -Driver.Version = XJC 2.3.0-SNAPSHOT +Driver.Version = XJC 2.3.0-b170211.0402 -Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.3.0-SNAPSHOT" +Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties 2017-02-14 14:26:12.644402429 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties 2017-02-14 14:26:12.508401559 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.3.0-SNAPSHOT \nConsulte https://jaxb.java.net/ \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.3.0-b170211.0402 \nConsulte https://jaxb.java.net/ \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = vers\u00E3o completa de xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = vers\u00E3o completa de xjc "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties 2017-02-14 14:26:13.244406265 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties 2017-02-14 14:26:13.128405523 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -131,14 +131,14 @@ Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002 -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.3.0-SNAPSHOT \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee https://jaxb.java.net/ \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.3.0-b170211.0402 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee https://jaxb.java.net/ \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties 2017-02-14 14:26:13.800409820 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties 2017-02-14 14:26:13.692409129 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, 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 @@ -127,14 +127,14 @@ Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 https://jaxb.java.net/ \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n +# DO NOT localize the 2.3.0-b170211.0402 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170211.0402 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 https://jaxb.java.net/ \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170211.0402 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-b170211.0402" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170211.0402 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java 2017-02-14 14:26:14.360413401 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java 2017-02-14 14:26:14.260412761 +0300 @@ -181,9 +181,7 @@ public File targetDir = new File("."); /** - * Actually stores {@link CatalogResolver}, but the field - * type is made to {@link EntityResolver} so that XJC can be - * used even if resolver.jar is not available in the classpath. + * Stores {@link EntityResolver}. */ public EntityResolver entityResolver = null; @@ -639,7 +637,9 @@ return 2; } if( args[i].equals("-catalog") ) { - // use javax.xml.catalog to resolve external entities. + // use Sun's "XML Entity and URI Resolvers" by Norman Walsh + // to resolve external entities. + // https://xerces.apache.org/xml-commons/components/resolver/resolver-article.html File catalogFile = new File(requireArgument("-catalog",args,++i)); try { --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java 2017-02-14 14:26:14.912416930 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java 2017-02-14 14:26:14.804416240 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -94,7 +94,9 @@ schema = schemaFactory.newSchema(source); } catch (IOException | SAXException e) { - throw new InternalError(e); + InternalError ie = new InternalError(e.getMessage()); + ie.initCause(e); + throw ie; } finally { if (resourceResolver != null) resourceResolver.closeStreams(); } @@ -221,5 +223,3 @@ public void setCertifiedText(boolean certifiedText) { } } - - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java 2017-02-14 14:26:15.468420485 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java 2017-02-14 14:26:15.372419872 +0300 @@ -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 @@ -23,6 +23,12 @@ * questions. */ +/** + * Object Model that represents customization declarations. + * RelaxNGCC is used to parse + * XML syntax into this representation, and the other parts of XJC will use + * this object model. + */ @XmlSchema(elementFormDefault = QUALIFIED, namespace=Const.JAXB_NSURI) package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo; --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java 2017-02-14 14:26:16.004423913 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java 2017-02-14 14:26:15.892423196 +0300 @@ -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 @@ -70,7 +70,7 @@ this.substHead = _substHead; this.substDisallowed = _substDisallowed; this.substExcluded = _substExcluded; - this.idConstraints = Collections.unmodifiableList((List)idConstraints); + this.idConstraints = (List) Collections.unmodifiableList((List)idConstraints); for (IdentityConstraintImpl idc : idConstraints) idc.setParent(this); @@ -80,42 +80,52 @@ } private XmlString defaultValue; + @Override public XmlString getDefaultValue() { return defaultValue; } private XmlString fixedValue; + @Override public XmlString getFixedValue() { return fixedValue; } private boolean nillable; + @Override public boolean isNillable() { return nillable; } private boolean _abstract; + @Override public boolean isAbstract() { return _abstract; } private Ref.Type type; + @Override public XSType getType() { return type.getType(); } private Ref.Element substHead; + @Override public XSElementDecl getSubstAffiliation() { if(substHead==null) return null; return substHead.get(); } private int substDisallowed; + @Override public boolean isSubstitutionDisallowed( int method ) { return (substDisallowed&method)!=0; } private int substExcluded; + @Override public boolean isSubstitutionExcluded( int method ) { return (substExcluded&method)!=0; } private final List idConstraints; + @Override public List getIdentityConstraints() { return idConstraints; } private Boolean form; + @Override public Boolean getForm() { return form; } @@ -124,6 +134,7 @@ /** * @deprecated */ + @Override public XSElementDecl[] listSubstitutables() { Set s = getSubstitutables(); return s.toArray(new XSElementDecl[s.size()]); @@ -135,6 +146,7 @@ /** Unmodifieable view of {@link #substitutables}. */ private Set substitutablesView = null; + @Override public Set getSubstitutables() { if( substitutables==null ) { // if the field is null by the time this method @@ -194,42 +206,57 @@ } } + @Override public boolean canBeSubstitutedBy(XSElementDecl e) { return getSubstitutables().contains(e); } + @Override public boolean isWildcard() { return false; } + @Override public boolean isModelGroupDecl() { return false; } + @Override public boolean isModelGroup() { return false; } + @Override public boolean isElementDecl() { return true; } + @Override public XSWildcard asWildcard() { return null; } + @Override public XSModelGroupDecl asModelGroupDecl() { return null; } + @Override public XSModelGroup asModelGroup() { return null; } + @Override public XSElementDecl asElementDecl() { return this; } + @Override public void visit( XSVisitor visitor ) { visitor.elementDecl(this); } + @Override public void visit( XSTermVisitor visitor ) { visitor.elementDecl(this); } + @Override public Object apply( XSTermFunction function ) { return function.elementDecl(this); } + @Override public T apply(XSTermFunctionWithParam function, P param) { return function.elementDecl(this,param); } + @Override public Object apply( XSFunction function ) { return function.elementDecl(this); } // Ref.Term implementation + @Override public XSTerm getTerm() { return this; } } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java 2017-02-14 14:26:16.592427672 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java 2017-02-14 14:26:16.480426956 +0300 @@ -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 @@ -59,17 +59,19 @@ this.name = name; this.selector = selector; selector.setParent(this); - this.fields = Collections.unmodifiableList((List)fields); + this.fields = (List) Collections.unmodifiableList((List)fields); for( XPathImpl xp : fields ) xp.setParent(this); this.refer = refer; } + @Override public void visit(XSVisitor visitor) { visitor.identityConstraint(this); } + @Override public T apply(XSFunction function) { return function.identityConstraint(this); } @@ -79,30 +81,37 @@ parent.getOwnerSchema().addIdentityConstraint(this); } + @Override public XSElementDecl getParent() { return parent; } + @Override public String getName() { return name; } + @Override public String getTargetNamespace() { return getParent().getTargetNamespace(); } + @Override public short getCategory() { return category; } + @Override public XSXPath getSelector() { return selector; } + @Override public List getFields() { return fields; } + @Override public XSIdentityConstraint getReferencedKey() { if(category==KEYREF) return refer.get(); @@ -110,6 +119,7 @@ throw new IllegalStateException("not a keyref"); } + @Override public XSIdentityConstraint get() { return this; } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java 2017-02-14 14:26:17.148431228 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java 2017-02-14 14:26:17.048430588 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -34,7 +34,6 @@ import com.sun.xml.internal.xsom.impl.Const; import com.sun.xml.internal.xsom.impl.parser.state.NGCCRuntime; import com.sun.xml.internal.xsom.impl.parser.state.Schema; -import com.sun.xml.internal.xsom.impl.util.Uri; import com.sun.xml.internal.xsom.parser.AnnotationParser; import com.sun.xml.internal.org.relaxng.datatype.ValidationContext; import org.xml.sax.Attributes; @@ -48,8 +47,10 @@ import java.io.IOException; import java.net.URI; +import java.net.URL; import java.text.MessageFormat; import java.util.Stack; +import java.util.regex.Pattern; /** * NGCCRuntime extended with various utility methods for @@ -150,12 +151,15 @@ /* registers a patcher that will run after all the parsing has finished. */ + @Override public void addPatcher( Patch patcher ) { parser.patcherManager.addPatcher(patcher); } + @Override public void addErrorChecker( Patch patcher ) { parser.patcherManager.addErrorChecker(patcher); } + @Override public void reportError( String msg, Locator loc ) throws SAXException { parser.patcherManager.reportError(msg,loc); } @@ -188,8 +192,15 @@ EntityResolver er = parser.getEntityResolver(); String systemId = null; - if (relativeUri!=null) - systemId = Uri.resolve(baseUri,relativeUri); + if (relativeUri!=null) { + if (isAbsolute(relativeUri)) { + systemId = relativeUri; + } + if (baseUri == null || !isAbsolute(baseUri)) { + throw new IOException("Unable to resolve relative URI " + relativeUri + " because base URI is not absolute: " + baseUri); + } + systemId = new URL(new URL(baseUri), relativeUri).toString(); + } if (er!=null) { InputSource is = er.resolveEntity(namespaceURI,systemId); @@ -217,7 +228,20 @@ } } - /** Includes the specified schema. */ + private static final Pattern P = Pattern.compile(".*[/#?].*"); + + private static boolean isAbsolute(String uri) { + int i = uri.indexOf(':'); + if (i < 0) { + return false; + } + return !P.matcher(uri.substring(0, i)).matches(); + } + + /** + * Includes the specified schema. + * @param schemaLocation + * @throws org.xml.sax.SAXException */ public void includeSchema( String schemaLocation ) throws SAXException { NGCCRuntimeEx runtime = new NGCCRuntimeEx(parser,chameleonMode,this); runtime.currentSchema = this.currentSchema; @@ -235,7 +259,11 @@ true, currentSchema.getTargetNamespace(), getLocator() ); } - /** Imports the specified schema. */ + /** + * Imports the specified schema. + * @param ns + * @param schemaLocation + * @throws org.xml.sax.SAXException */ public void importSchema( String ns, String schemaLocation ) throws SAXException { NGCCRuntimeEx newRuntime = new NGCCRuntimeEx(parser,false,this); InputSource source = resolveRelativeURL(ns,schemaLocation); @@ -317,9 +345,13 @@ /** * Parses the specified entity. * + * @param source * @param importLocation * The source location of the import/include statement. * Used for reporting errors. + * @param includeMode + * @param expectedNamespace + * @throws org.xml.sax.SAXException */ public void parseEntity( InputSource source, boolean includeMode, String expectedNamespace, Locator importLocation ) throws SAXException { @@ -342,6 +374,7 @@ /** * Creates a new instance of annotation parser. + * @return */ public AnnotationParser createAnnotationParser() { if(parser.getAnnotationParserFactory()==null) @@ -351,14 +384,15 @@ } /** - * Gets the element name that contains the annotation element. - * This method works correctly only when called by the annotation handler. + * Gets the element name that contains the annotation element.This method works correctly only when called by the annotation handler. + * @return */ public String getAnnotationContextElementName() { return elementNames.get( elementNames.size()-2 ); } - /** Creates a copy of the current locator object. */ + /** Creates a copy of the current locator object. + * @return */ public Locator copyLocator() { return new LocatorImpl(getLocator()); } @@ -397,6 +431,7 @@ this.uri = _uri; } + @Override public String resolveNamespacePrefix(String p) { if(p.equals(prefix)) return uri; if(previous==null) return null; @@ -408,14 +443,18 @@ private final Context previous; // XSDLib don't use those methods, so we cut a corner here. + @Override public String getBaseUri() { return null; } + @Override public boolean isNotation(String arg0) { return false; } + @Override public boolean isUnparsedEntity(String arg0) { return false; } } private Context currentContext=null; - /** Returns an immutable snapshot of the current context. */ + /** Returns an immutable snapshot of the current context. + * @return */ public ValidationContext createValidationContext() { return currentContext; } @@ -446,6 +485,7 @@ * Parses UName under the given context. * @param qname Attribute name. * @return New {@link UName} instance based on attribute name. + * @throws org.xml.sax.SAXException */ public UName parseUName(final String qname ) throws SAXException { int idx = qname.indexOf(':'); --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties 2017-02-14 14:26:17.696434731 +0300 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties 2017-02-14 14:26:17.600434118 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 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 @@ -26,4 +26,4 @@ build-id=2.3.0-SNAPSHOT build-version=JAX-WS RI 2.3.0-SNAPSHOT major-version=2.3.0 -svn-revision=5c2c1fd2f2ab3b5c7cea25f79aa49e54cb84b7cc +svn-revision=85fa96c632b8c2c0b23afc20889aedb9c5ee91aa --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2017-02-14 14:26:18.220438082 +0300 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2017-02-14 14:26:18.112437391 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, 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 @@ -144,12 +144,9 @@ public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException { final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener); - List args = new ArrayList(6 + (options.nocompile ? 1 : 0) + List args = new ArrayList<>(6 + (options.nocompile ? 1 : 0) + (options.encoding != null ? 2 : 0)); - args.add("--add-modules"); - args.add("java.xml.ws"); - args.add("-d"); args.add(options.destDir.getAbsolutePath()); args.add("-classpath"); @@ -163,8 +160,27 @@ args.add("-encoding"); args.add(options.encoding); } + + boolean addModules = true; if (options.javacOptions != null) { - args.addAll(options.getJavacOptions(args, listener)); + List javacOptions = options.getJavacOptions(args, listener); + for (int i = 0; i < javacOptions.size(); i++) { + String opt = javacOptions.get(i); + if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) { + addModules = false; + } + if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) { + addModules = false; + } + if ("-release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) { + addModules = false; + } + args.add(opt); + } + } + if (addModules) { + args.add("--add-modules"); + args.add("java.xml.ws"); } JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); @@ -227,7 +243,7 @@ com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl) fac.createRuntime(config); final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file. - final Map schemaFiles = new HashMap(); + final Map schemaFiles = new HashMap<>(); WSDLGenInfo wsdlGenInfo = new WSDLGenInfo(); wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity); @@ -299,7 +315,7 @@ } private List getExternalFiles(List exts) { - List files = new ArrayList(); + List files = new ArrayList<>(); for (String ext : exts) { // first try absolute path ... File file = new File(ext); @@ -341,6 +357,10 @@ } } + private float getVersion(String s) { + return Float.parseFloat(s); + } + /** * "Namespace" for code needed to generate the report file. */ --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2017-02-14 14:26:18.772441611 +0300 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2017-02-14 14:26:18.676440998 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -63,8 +63,8 @@ * @author Vivek Pandey */ public class WsimportTool { - /** JAXWS module name. JAXWS dependency is mandatory in generated Java module. */ - private static final String JAXWS_MODULE = "java.xml.ws"; + /** JAXB module name. JAXB dependency is mandatory in generated Java module. */ + private static final String JAXWS_PACKAGE = "java.xml.ws"; private static final String WSIMPORT = "wsimport"; private final PrintStream out; @@ -246,7 +246,7 @@ } private void deleteGeneratedFiles() { - Set trackedRootPackages = new HashSet(); + Set trackedRootPackages = new HashSet<>(); if (options.clientjar != null) { //remove all non-java artifacts as they will packaged in jar. @@ -282,7 +282,7 @@ private void addClassesToGeneratedFiles() throws IOException { Iterable generatedFiles = options.getGeneratedFiles(); - final List trackedClassFiles = new ArrayList(); + final List trackedClassFiles = new ArrayList<>(); for(File f: generatedFiles) { if(f.getName().endsWith(".java")) { String relativeDir = DirectoryUtil.getRelativePathfromCommonBase(f.getParentFile(),options.sourceDir); @@ -477,7 +477,7 @@ } if (options.getModuleName() != null) { - options.getCodeModel()._prepareModuleInfo(options.getModuleName(), JAXWS_MODULE); + options.getCodeModel()._prepareModuleInfo(options.getModuleName(), JAXWS_PACKAGE); } CodeWriter cw; @@ -504,7 +504,7 @@ } protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){ - List sourceFiles = new ArrayList(); + List sourceFiles = new ArrayList<>(); for (File f : options.getGeneratedFiles()) { if (f.exists() && f.getName().endsWith(".java")) { @@ -515,10 +515,7 @@ if (sourceFiles.size() > 0) { String classDir = options.destDir.getAbsolutePath(); String classpathString = createClasspathString(); - List args = new ArrayList(); - - args.add("--add-modules"); - args.add("java.xml.ws"); + List args = new ArrayList<>(); args.add("-d"); args.add(classDir); @@ -534,8 +531,26 @@ args.add(options.encoding); } + boolean addModules = true; if (options.javacOptions != null) { - args.addAll(options.getJavacOptions(args, listener)); + List javacOptions = options.getJavacOptions(args, listener); + for (int i = 0; i < javacOptions.size(); i++) { + String opt = javacOptions.get(i); + if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) { + addModules = false; + } + if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) { + addModules = false; + } + if ("-release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) { + addModules = false; + } + args.add(opt); + } + } + if (addModules) { + args.add("--add-modules"); + args.add("java.xml.ws"); } for (int i = 0; i < sourceFiles.size(); ++i) { @@ -572,4 +587,8 @@ System.out.println(WscompileMessages.WSIMPORT_USAGE_EXTENSIONS()); System.out.println(WscompileMessages.WSIMPORT_USAGE_EXAMPLES()); } + + private float getVersion(String s) { + return Float.parseFloat(s); + } } --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java 2017-02-14 14:26:19.288444911 +0300 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java 2017-02-14 14:26:19.184444246 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -25,10 +25,10 @@ package com.sun.tools.internal.ws.wsdl.parser; +import com.sun.tools.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } --- old/jdk/src/java.base/share/lib/security/default.policy 2017-02-14 14:26:20.020449591 +0300 +++ new/jdk/src/java.base/share/lib/security/default.policy 2017-02-14 14:26:19.844448466 +0300 @@ -70,6 +70,8 @@ grant codeBase "jrt:/java.xml.bind" { permission java.lang.RuntimePermission + "accessClassInPackage.sun.misc"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.*"; permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal"; @@ -105,17 +107,13 @@ permission java.net.NetPermission "getProxySelector"; permission java.lang.RuntimePermission - "accessClassInPackage.com.sun.org.apache.xml.internal.resolver"; - permission java.lang.RuntimePermission - "accessClassInPackage.com.sun.org.apache.xml.internal.resolver.tools"; + "accessClassInPackage.sun.misc"; permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.*"; permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal"; permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal.*"; - permission java.lang.RuntimePermission - "accessClassInPackage.com.sun.org.apache.xerces.internal.*"; permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.util.PropertyPermission "*", "read"; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java 2017-02-14 14:26:20.528452839 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Code that deals with low level byte code manipulation. + */ +package com.sun.xml.internal.bind.v2.bytecode; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java 2017-02-14 14:26:20.880455090 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Abstraction around reading annotations, to support internal/external annotations. + */ +package com.sun.xml.internal.bind.v2.model.annotation; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java 2017-02-14 14:26:21.240457392 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Implementation of the com.sun.xml.internal.bind.j2s.model package. + */ +package com.sun.xml.internal.bind.v2.model.impl; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java 2017-02-14 14:26:21.600459694 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing). + */ +package com.sun.xml.internal.bind.v2.model.nav; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java 2017-02-14 14:26:21.960461996 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Code that implements JAXBContext, Unmarshaller, and Marshaller. + */ +package com.sun.xml.internal.bind.v2.runtime; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java 2017-02-14 14:26:22.332464375 +0300 @@ -0,0 +1,36 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Hosts optimized + * {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor}, + * {@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and {@link com.sun.xml.internal.bind.v2.runtime.Transducer}. + * + *

    How it works

    + *

    + * Most of the classes in this package are "templates." At run-time, A template class file is slightly modified to match + * the target Java Bean, then it will be loaded into the VM. + */ +package com.sun.xml.internal.bind.v2.runtime.reflect.opt; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java 2017-02-14 14:26:22.748467034 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Abstraction around accessing data of actual objects. + */ +package com.sun.xml.internal.bind.v2.runtime.reflect; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java 2017-02-14 14:26:23.140469541 +0300 @@ -0,0 +1,46 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined + * sub-classes to allow arbitrary Java classes to be used with JAXB. + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

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

    + * + * @see JAXB Website + */ +package javax.xml.bind.annotation.adapters; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java 2017-02-14 14:26:23.520471971 +0300 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JAXB Provider Use Only: Provides partial default implementations for + * some of the javax.xml.bind interfaces. + *

    + *

    + * JAXB Providers can extend these classes and implement the abstract + * methods. + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

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

    + * + * @see JAXB Website + */ +package javax.xml.bind.helpers; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java 2017-02-14 14:26:23.876474247 +0300 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Provides a runtime binding framework for client applications including + * unmarshalling, marshalling, and validation capabilities. + *

    + *

    + * JAXBContext is the client-entry point to the runtime binding + * framework. + *

    + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

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

    + * + * @see JAXB Website + */ +package javax.xml.bind; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java 2017-02-14 14:26:24.280476830 +0300 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Useful client utility classes. + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

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

    + * + * @see JAXB Website + */ +package javax.xml.bind.util; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java 2017-02-14 14:26:24.684479413 +0300 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.messaging.saaj.soap.impl; + +import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.util.Objects; + +/** + * Node list wrapper, finding SOAP elements automatically when possible. + * + * @author Roman Grigoriadi + */ +public class NodeListImpl implements NodeList { + + private final SOAPDocumentImpl soapDocument; + + private final NodeList nodeList; + + public NodeListImpl(SOAPDocumentImpl soapDocument, NodeList nodeList) { + Objects.requireNonNull(soapDocument); + Objects.requireNonNull(soapDocument); + this.soapDocument = soapDocument; + this.nodeList = nodeList; + } + + @Override + public Node item(int index) { + return soapDocument.findIfPresent(nodeList.item(index)); + } + + @Override + public int getLength() { + return nodeList.getLength(); + } +} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java 2017-02-14 14:26:25.092482022 +0300 @@ -0,0 +1,299 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.policy.util; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.security.AccessController; +import java.security.AllPermission; +import java.security.CodeSource; +import java.security.PermissionCollection; +import java.security.PrivilegedExceptionAction; +import java.security.SecureClassLoader; +import java.util.Arrays; + +/* + * This copies from sun.reflect.misc.MethodUtil to implement the trampoline + * code such that when a Method is invoked, it will be called through + * the trampoline that is defined by this MethodUtil class loader. + */ +class Trampoline { + static { + if (Trampoline.class.getClassLoader() == null) { + throw new Error( + "Trampoline must not be defined by the bootstrap classloader"); + } + } + + private static void ensureInvocableMethod(Method m) + throws InvocationTargetException + { + Class clazz = m.getDeclaringClass(); + if (clazz.equals(AccessController.class) || + clazz.equals(Method.class) || + clazz.getName().startsWith("java.lang.invoke.")) + throw new InvocationTargetException( + new UnsupportedOperationException("invocation not supported")); + } + + private static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException + { + ensureInvocableMethod(m); + return m.invoke(obj, params); + } +} + +/* + * Create a trampoline class. + */ +public final class MethodUtil extends SecureClassLoader { + private static final String WS_UTIL_POLICY_PKG = "com.sun.xml.internal.ws.policy.util."; + private static final String TRAMPOLINE = WS_UTIL_POLICY_PKG + "Trampoline"; + private static final Method bounce = getTrampoline(); + private static final int DEFAULT_BUFFER_SIZE = 8192; + private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8; + + + private MethodUtil() { + super(); + } + + /* + * Bounce through the trampoline. + */ + public static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException { + try { + return bounce.invoke(null, m, obj, params); + } catch (InvocationTargetException ie) { + Throwable t = ie.getCause(); + + if (t instanceof InvocationTargetException) { + throw (InvocationTargetException)t; + } else if (t instanceof IllegalAccessException) { + throw (IllegalAccessException)t; + } else if (t instanceof RuntimeException) { + throw (RuntimeException)t; + } else if (t instanceof Error) { + throw (Error)t; + } else { + throw new Error("Unexpected invocation error", t); + } + } catch (IllegalAccessException iae) { + // this can't happen + throw new Error("Unexpected invocation error", iae); + } + } + + private static Method getTrampoline() { + try { + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Method run() throws Exception { + Class t = getTrampolineClass(); + Method b = t.getDeclaredMethod("invoke", + Method.class, Object.class, Object[].class); + b.setAccessible(true); + return b; + } + }); + } catch (Exception e) { + throw new InternalError("bouncer cannot be found", e); + } + } + + + protected synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException + { + // First, check if the class has already been loaded + checkPackageAccess(name); + Class c = findLoadedClass(name); + if (c == null) { + try { + c = findClass(name); + } catch (ClassNotFoundException e) { + // Fall through ... + } + if (c == null) { + c = getParent().loadClass(name); + } + } + if (resolve) { + resolveClass(c); + } + return c; + } + + + protected Class findClass(final String name) + throws ClassNotFoundException + { + if (!name.startsWith(WS_UTIL_POLICY_PKG)) { + throw new ClassNotFoundException(name); + } + String path = "/".concat(name.replace('.', '/').concat(".class")); + try (InputStream in = MethodUtil.class.getResourceAsStream(path)) { + byte[] b = readAllBytes(in); + return defineClass(name, b); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } + + /** + * JDK9 {@link InputStream#readAllBytes()} substitution. + */ + private byte[] readAllBytes(InputStream in) throws IOException { + byte[] buf = new byte[DEFAULT_BUFFER_SIZE]; + int capacity = buf.length; + int nread = 0; + int n; + for (;;) { + // read to EOF which may read more or less than initial buffer size + while ((n = in.read(buf, nread, capacity - nread)) > 0) + nread += n; + + // if the last call to read returned -1, then we're done + if (n < 0) + break; + + // need to allocate a larger buffer + if (capacity <= MAX_BUFFER_SIZE - capacity) { + capacity = capacity << 1; + } else { + if (capacity == MAX_BUFFER_SIZE) + throw new OutOfMemoryError("Required array size too large"); + capacity = MAX_BUFFER_SIZE; + } + buf = Arrays.copyOf(buf, capacity); + } + return (capacity == nread) ? buf : Arrays.copyOf(buf, nread); + } + + + + /* + * Define the proxy classes + */ + private Class defineClass(String name, byte[] b) throws IOException { + CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[])null); + if (!name.equals(TRAMPOLINE)) { + throw new IOException("MethodUtil: bad name " + name); + } + return defineClass(name, b, 0, b.length, cs); + } + + protected PermissionCollection getPermissions(CodeSource codesource) + { + PermissionCollection perms = super.getPermissions(codesource); + perms.add(new AllPermission()); + return perms; + } + + private static Class getTrampolineClass() { + try { + return Class.forName(TRAMPOLINE, true, new MethodUtil()); + } catch (ClassNotFoundException e) { + } + return null; + } + + /** + * Checks package access on the given classname. + * This method is typically called when the Class instance is not + * available and the caller attempts to load a class on behalf + * the true caller (application). + */ + private static void checkPackageAccess(String name) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + String cname = name.replace('/', '.'); + if (cname.startsWith("[")) { + int b = cname.lastIndexOf('[') + 2; + if (b > 1 && b < cname.length()) { + cname = cname.substring(b); + } + } + int i = cname.lastIndexOf('.'); + if (i != -1) { + s.checkPackageAccess(cname.substring(0, i)); + } + } + } + + /** + * Checks package access on the given class. + * + * If it is a {@link Proxy#isProxyClass(Class)} that implements + * a non-public interface (i.e. may be in a non-restricted package), + * also check the package access on the proxy interfaces. + */ + private static void checkPackageAccess(Class clazz) { + checkPackageAccess(clazz.getName()); + if (isNonPublicProxyClass(clazz)) { + checkProxyPackageAccess(clazz); + } + } + + // Note that bytecode instrumentation tools may exclude 'sun.*' + // classes but not generated proxy classes and so keep it in com.sun.* + private static final String PROXY_PACKAGE = "com.sun.proxy"; + + /** + * Test if the given class is a proxy class that implements + * non-public interface. Such proxy class may be in a non-restricted + * package that bypasses checkPackageAccess. + */ + private static boolean isNonPublicProxyClass(Class cls) { + String name = cls.getName(); + int i = name.lastIndexOf('.'); + String pkg = (i != -1) ? name.substring(0, i) : ""; + return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE); + } + + /** + * Check package access on the proxy interfaces that the given proxy class + * implements. + * + * @param clazz Proxy class object + */ + private static void checkProxyPackageAccess(Class clazz) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + // check proxy interfaces if the given class is a proxy class + if (Proxy.isProxyClass(clazz)) { + for (Class intf : clazz.getInterfaces()) { + checkPackageAccess(intf); + } + } + } + } +} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties 2017-02-14 14:26:25.464484401 +0300 @@ -0,0 +1,26 @@ +# +# Copyright (c) 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java 2017-02-14 14:26:25.876487035 +0300 @@ -0,0 +1,71 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.resources; + +import java.util.Locale; +import java.util.ResourceBundle; +import javax.annotation.Generated; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier; +import com.sun.istack.internal.localization.Localizer; + + +/** + * Defines string formatting method for each constant in the resource file + * + */ +@Generated("com.sun.istack.internal.maven.ResourceGenMojo") +public final class ContextClassloaderLocalMessages { + + private final static String BUNDLE_NAME = "com.sun.xml.internal.ws.resources.ContextClassloaderLocal"; + private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier()); + private final static Localizer LOCALIZER = new Localizer(); + + public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) { + return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0); + } + + /** + * Failed to create new instance of {0} + * + */ + public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) { + return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0)); + } + + private static class BundleSupplier + implements ResourceBundleSupplier + { + + + public ResourceBundle getResourceBundle(Locale locale) { + return ResourceBundle.getBundle(BUNDLE_NAME, locale); + } + + } + +} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java 2017-02-14 14:26:26.240489363 +0300 @@ -0,0 +1,299 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.util; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.security.AccessController; +import java.security.AllPermission; +import java.security.CodeSource; +import java.security.PermissionCollection; +import java.security.PrivilegedExceptionAction; +import java.security.SecureClassLoader; +import java.util.Arrays; + +/* + * This copies from sun.reflect.misc.MethodUtil to implement the trampoline + * code such that when a Method is invoked, it will be called through + * the trampoline that is defined by this MethodUtil class loader. + */ +class Trampoline { + static { + if (Trampoline.class.getClassLoader() == null) { + throw new Error( + "Trampoline must not be defined by the bootstrap classloader"); + } + } + + private static void ensureInvocableMethod(Method m) + throws InvocationTargetException + { + Class clazz = m.getDeclaringClass(); + if (clazz.equals(AccessController.class) || + clazz.equals(Method.class) || + clazz.getName().startsWith("java.lang.invoke.")) + throw new InvocationTargetException( + new UnsupportedOperationException("invocation not supported")); + } + + private static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException + { + ensureInvocableMethod(m); + return m.invoke(obj, params); + } +} + +/* + * Create a trampoline class. + */ +public final class MethodUtil extends SecureClassLoader { + private static final String WS_UTIL_PKG = "com.sun.xml.internal.ws.util."; + private static final String TRAMPOLINE = WS_UTIL_PKG + "Trampoline"; + private static final Method bounce = getTrampoline(); + private static final int DEFAULT_BUFFER_SIZE = 8192; + private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8; + + + private MethodUtil() { + super(); + } + + /* + * Bounce through the trampoline. + */ + public static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException { + try { + return bounce.invoke(null, m, obj, params); + } catch (InvocationTargetException ie) { + Throwable t = ie.getCause(); + + if (t instanceof InvocationTargetException) { + throw (InvocationTargetException)t; + } else if (t instanceof IllegalAccessException) { + throw (IllegalAccessException)t; + } else if (t instanceof RuntimeException) { + throw (RuntimeException)t; + } else if (t instanceof Error) { + throw (Error)t; + } else { + throw new Error("Unexpected invocation error", t); + } + } catch (IllegalAccessException iae) { + // this can't happen + throw new Error("Unexpected invocation error", iae); + } + } + + private static Method getTrampoline() { + try { + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Method run() throws Exception { + Class t = getTrampolineClass(); + Method b = t.getDeclaredMethod("invoke", + Method.class, Object.class, Object[].class); + b.setAccessible(true); + return b; + } + }); + } catch (Exception e) { + throw new InternalError("bouncer cannot be found", e); + } + } + + + protected synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException + { + // First, check if the class has already been loaded + checkPackageAccess(name); + Class c = findLoadedClass(name); + if (c == null) { + try { + c = findClass(name); + } catch (ClassNotFoundException e) { + // Fall through ... + } + if (c == null) { + c = getParent().loadClass(name); + } + } + if (resolve) { + resolveClass(c); + } + return c; + } + + + protected Class findClass(final String name) + throws ClassNotFoundException + { + if (!name.startsWith(WS_UTIL_PKG)) { + throw new ClassNotFoundException(name); + } + String path = "/".concat(name.replace('.', '/').concat(".class")); + try (InputStream in = MethodUtil.class.getResourceAsStream(path)) { + byte[] b = readAllBytes(in); + return defineClass(name, b); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } + + /** + * JDK9 {@link InputStream#readAllBytes()} substitution. + */ + private byte[] readAllBytes(InputStream in) throws IOException { + byte[] buf = new byte[DEFAULT_BUFFER_SIZE]; + int capacity = buf.length; + int nread = 0; + int n; + for (;;) { + // read to EOF which may read more or less than initial buffer size + while ((n = in.read(buf, nread, capacity - nread)) > 0) + nread += n; + + // if the last call to read returned -1, then we're done + if (n < 0) + break; + + // need to allocate a larger buffer + if (capacity <= MAX_BUFFER_SIZE - capacity) { + capacity = capacity << 1; + } else { + if (capacity == MAX_BUFFER_SIZE) + throw new OutOfMemoryError("Required array size too large"); + capacity = MAX_BUFFER_SIZE; + } + buf = Arrays.copyOf(buf, capacity); + } + return (capacity == nread) ? buf : Arrays.copyOf(buf, nread); + } + + + + /* + * Define the proxy classes + */ + private Class defineClass(String name, byte[] b) throws IOException { + CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[])null); + if (!name.equals(TRAMPOLINE)) { + throw new IOException("MethodUtil: bad name " + name); + } + return defineClass(name, b, 0, b.length, cs); + } + + protected PermissionCollection getPermissions(CodeSource codesource) + { + PermissionCollection perms = super.getPermissions(codesource); + perms.add(new AllPermission()); + return perms; + } + + private static Class getTrampolineClass() { + try { + return Class.forName(TRAMPOLINE, true, new MethodUtil()); + } catch (ClassNotFoundException e) { + } + return null; + } + + /** + * Checks package access on the given classname. + * This method is typically called when the Class instance is not + * available and the caller attempts to load a class on behalf + * the true caller (application). + */ + private static void checkPackageAccess(String name) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + String cname = name.replace('/', '.'); + if (cname.startsWith("[")) { + int b = cname.lastIndexOf('[') + 2; + if (b > 1 && b < cname.length()) { + cname = cname.substring(b); + } + } + int i = cname.lastIndexOf('.'); + if (i != -1) { + s.checkPackageAccess(cname.substring(0, i)); + } + } + } + + /** + * Checks package access on the given class. + * + * If it is a {@link Proxy#isProxyClass(Class)} that implements + * a non-public interface (i.e. may be in a non-restricted package), + * also check the package access on the proxy interfaces. + */ + private static void checkPackageAccess(Class clazz) { + checkPackageAccess(clazz.getName()); + if (isNonPublicProxyClass(clazz)) { + checkProxyPackageAccess(clazz); + } + } + + // Note that bytecode instrumentation tools may exclude 'sun.*' + // classes but not generated proxy classes and so keep it in com.sun.* + private static final String PROXY_PACKAGE = "com.sun.proxy"; + + /** + * Test if the given class is a proxy class that implements + * non-public interface. Such proxy class may be in a non-restricted + * package that bypasses checkPackageAccess. + */ + private static boolean isNonPublicProxyClass(Class cls) { + String name = cls.getName(); + int i = name.lastIndexOf('.'); + String pkg = (i != -1) ? name.substring(0, i) : ""; + return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE); + } + + /** + * Check package access on the proxy interfaces that the given proxy class + * implements. + * + * @param clazz Proxy class object + */ + private static void checkProxyPackageAccess(Class clazz) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + // check proxy interfaces if the given class is a proxy class + if (Proxy.isProxyClass(clazz)) { + for (Class intf : clazz.getInterfaces()) { + checkPackageAccess(intf); + } + } + } + } +} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java 2017-02-14 14:26:26.596491639 +0300 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.util.xml; + +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.server.ServerRtException; +import java.io.File; +import java.net.URI; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import javax.xml.catalog.CatalogFeatures; +import javax.xml.catalog.CatalogFeatures.Feature; +import javax.xml.catalog.CatalogManager; +import javax.xml.ws.WebServiceException; +import org.xml.sax.EntityResolver; + +/** + * + * @author lukas + */ +public class XmlCatalogUtil { + + // Cache CatalogFeatures instance for future usages. + // Resolve feature is set to "continue" value for backward compatibility. + private static final CatalogFeatures CATALOG_FEATURES + = CatalogFeatures.builder().with(Feature.RESOLVE, "continue").build(); + + /** + * Gets an EntityResolver using XML catalog + * + * @param catalogUrl + * @return + */ + public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) { + ArrayList urlsArray = new ArrayList<>(); + EntityResolver er; + if (catalogUrl != null) { + urlsArray.add(catalogUrl); + } + try { + er = createCatalogResolver(urlsArray); + } catch (Exception e) { + throw new ServerRtException("server.rt.err", e); + } + return er; + } + + /** + * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml + * + * @return + */ + public static EntityResolver createDefaultCatalogResolver() { + EntityResolver er; + try { + /** + * Gets a URLs for catalog defined at META-INF/jaxws-catalog.xml + */ + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + Enumeration catalogEnum; + if (cl == null) { + catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml"); + } else { + catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml"); + } + er = createCatalogResolver(Collections.list(catalogEnum)); + } catch (Exception e) { + throw new WebServiceException(e); + } + + return er; + } + + /** + * Instantiate catalog resolver using new catalog API (javax.xml.catalog.*) + * added in JDK9. Usage of new API removes dependency on internal API + * (com.sun.org.apache.xml.internal) for modular runtime. + */ + private static EntityResolver createCatalogResolver(ArrayList urls) throws Exception { + // Prepare array of catalog URIs + URI[] uris = urls.stream() + .map(u -> URI.create(u.toExternalForm())) + .toArray(URI[]::new); + + //Create CatalogResolver with new JDK9+ API + return (EntityResolver) CatalogManager.catalogResolver(CATALOG_FEATURES, uris); + } + +} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java 2017-02-14 14:26:26.964493992 +0300 @@ -0,0 +1,32 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Annotation Processing related code. + * + * This package hosts a driver that runs annotation processing for java-to-schema processing, + * and additional implementations that deal primarily with AP. + */ +package com.sun.tools.internal.jxc.ap; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package-info.java 2017-02-14 14:26:27.376496626 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * implementation of the XJC API for schema to java. + */ +package com.sun.tools.internal.xjc.api.impl.s2j; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package-info.java 2017-02-14 14:26:27.808499388 +0300 @@ -0,0 +1,59 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * API for programmatic invocation of XJC and schemagen. + * + *

    + * This package provides a way to invoke XJC from within another program. The primary target of this API is the JAX-WS + * RI, but we hope that this API would be useful for other integration purposes as well. + * + *

    Getting Started: Using XJC

    + *

    + * To invoke XJC, a typical client would do something like this: + *

    + *    SchemaCompiler sc = XJC.createSchemaCompiler();
    + *    sc.parseSchema(new InputSource(schema1Url.toExternalForm()));
    + *    sc.parseSchema(new InputSource(schema2Url.toExternalForm()));
    + *    ...
    + *    S2JModel model = sc.bind();
    + * 
    + *

    + * The bind operation causes XJC to do the bulk of the work, such as figuring out what classes to generate, what + * methods/fields to generate, etc. The obtained model contains useful introspective information about how the binding + * was performed (such as the mapping between XML types and generated Java classes) + * + *

    + * Once the model is obtained, generate the code into the file system as follows: + *

    + *   JCodeModel cm = model.generateCode( null, ... );
    + *   cm.build(new FileCodeWriter(outputDir));
    + * 
    + * + *

    Implementation Note

    + *

    + * This package shouldn't contain any implementation code. + */ +package com.sun.tools.internal.xjc.api; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java 2017-02-14 14:26:28.196501869 +0300 @@ -0,0 +1,31 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * FieldRenderer and its implementation classes. + * Unless you are deriving from these classes to define your own custom renderer, + * you shouldn't be using these classes directly. Use the outline package. + */ +package com.sun.tools.internal.xjc.generator.bean.field; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java 2017-02-14 14:26:28.556504171 +0300 @@ -0,0 +1,41 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + *

    + * Compile-time representation of Java type system. + * + *

    + * These classes are used as TypeT and ClassDeclT of the model parameterization. This implementaion is designed to be + * capable of representing pre-existing classes (such as java.lang.String) as well as the generated classes (represented + * as JDefinedClass.) + * + *

    Handling of Primitive Types

    + *

    + * Primitive types have two forms (int and Integer), and this complicates the binding process. For this reason, inside + * the front end, we always use the boxed types. We'll use the unboxed form only in the back end when we know the field + * doesn't need to represent the null value. + */ +package com.sun.tools.internal.xjc.model.nav; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java 2017-02-14 14:26:28.920506499 +0300 @@ -0,0 +1,35 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Provides the outline of the generated Java source code so that + * additional processing (such as adding more annotations) can be + * done on the generated code. + * + *

    + * Code generation phase builds an outline little by little, while each step is using the outline built by the prior + * steps. + */ +package com.sun.tools.internal.xjc.outline; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java 2017-02-14 14:26:29.280508800 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Object Model that represents DTD binding information. + */ +package com.sun.tools.internal.xjc.reader.dtd.bindinfo; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java 2017-02-14 14:26:29.640511102 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C)). + */ +package com.sun.tools.internal.xjc.reader.gbind; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java 2017-02-14 14:26:30.000513404 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * internalization of external binding files and <jaxb:bindings> customizations. + */ +package com.sun.tools.internal.xjc.reader.internalizer; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java 2017-02-14 14:26:30.396515936 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Front-end that reads schema(s) and produce BGM. + */ +package com.sun.tools.internal.xjc.reader; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java 2017-02-14 14:26:30.748518187 +0300 @@ -0,0 +1,29 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Code generated into the user's packages in certain compilation mode. + */ +package com.sun.tools.internal.xjc.runtime; --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties 2017-02-14 14:26:31.124520591 +0300 @@ -0,0 +1,26 @@ +# +# Copyright (c) 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} --- /dev/null 2017-02-13 23:04:34.903538264 +0300 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java 2017-02-14 14:26:31.524523149 +0300 @@ -0,0 +1,69 @@ +/* + * 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.internal.ws.resources; + +import java.util.Locale; +import java.util.ResourceBundle; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier; +import com.sun.istack.internal.localization.Localizer; + + +/** + * Defines string formatting method for each constant in the resource file + * + */ +public final class ContextClassloaderLocalMessages { + + private final static String BUNDLE_NAME = "com.sun.tools.internal.ws.resources.ContextClassloaderLocal"; + private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier()); + private final static Localizer LOCALIZER = new Localizer(); + + public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) { + return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0); + } + + /** + * Failed to create new instance of {0} + * + */ + public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) { + return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0)); + } + + private static class BundleSupplier + implements ResourceBundleSupplier + { + + + public ResourceBundle getResourceBundle(Locale locale) { + return ResourceBundle.getBundle(BUNDLE_NAME, locale); + } + + } + +} --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html 2017-02-14 14:26:32.028526372 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,32 +0,0 @@ - - - - - - - Code that deals with low level byte code manipulation. - - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html 2017-02-14 14:26:32.304528136 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,30 +0,0 @@ - - - - - - Abstraction around reading annotations, to support internal/external annotations. - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html 2017-02-14 14:26:32.564529798 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,32 +0,0 @@ - - - - - - -Implementation of the com.sun.xml.internal.bind.j2s.model package. - - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html 2017-02-14 14:26:32.816531410 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,30 +0,0 @@ - - - - - - Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing). - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html 2017-02-14 14:26:33.096533201 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,32 +0,0 @@ - - - - - - -Code that implements JAXBContext, Unmarshaller, and Marshaller. - - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html 2017-02-14 14:26:33.360534888 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,39 +0,0 @@ - - - - - -Hosts optimized -{@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor}, -{@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and -{@link com.sun.xml.internal.bind.v2.runtime.Transducer}. - -

    How it works

    -

    - Most of the classes in this package are "templates." At run-time, - A template class file is slightly modified to match the target Java Bean, - then it will be loaded into the VM. - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html 2017-02-14 14:26:33.600536423 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,30 +0,0 @@ - - - - - - Abstraction around accessing data of actual objects. - --- old/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html 2017-02-14 14:26:33.852538034 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,32 +0,0 @@ - - - - - - -XML Schema writer generated by TXW. - - --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java 2017-02-14 14:26:34.096539594 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,45 +0,0 @@ -/* - * 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 - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** -* -* @author SAAJ RI Development Team -*/ -package com.sun.xml.internal.messaging.saaj.soap; - -import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl; -import com.sun.org.apache.xerces.internal.dom.DocumentFragmentImpl; - -public class SOAPDocumentFragment extends DocumentFragmentImpl { - - public SOAPDocumentFragment(CoreDocumentImpl ownerDoc) { - super(ownerDoc); - } - - public SOAPDocumentFragment() { - super(); - } - -} --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties 2017-02-14 14:26:34.344541180 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ -# -# Copyright (c) 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 -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties 2017-02-14 14:26:34.612542894 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ -# -# Copyright (c) 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 -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties 2017-02-14 14:26:34.864544505 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ -# -# Copyright (c) 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 -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} --- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties 2017-02-14 14:26:35.128546193 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ -# -# Copyright (c) 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 -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html 2017-02-14 14:26:35.392547881 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,33 +0,0 @@ - - - - - Annotation Processing related code. - - This package hosts a driver that runs annotation processing for java-to-schema processing, - and additional implementations that deal primarily with AP. - - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html 2017-02-14 14:26:35.648549518 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,30 +0,0 @@ - - - - - -implementation of the XJC API for schema to java. - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html 2017-02-14 14:26:35.904551155 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,64 +0,0 @@ - - - - - -API for programmatic invocation of XJC and schemagen. - -

    -This package provides a way to invoke XJC from within another program. -The primary target of this API is the JAX-WS RI, but we hope that -this API would be useful for other integration purposes as well. - -

    Getting Started: Using XJC

    -

    -To invoke XJC, a typical client would do something like this: -

    -    SchemaCompiler sc = XJC.createSchemaCompiler();
    -    sc.parseSchema(new InputSource(schema1Url.toExternalForm()));
    -    sc.parseSchema(new InputSource(schema2Url.toExternalForm()));
    -    ...
    -    S2JModel model = sc.bind();
    -
    -

    -The bind operation causes XJC to do the bulk of the work, such as -figuring out what classes to generate, what methods/fields to generate, etc. -The obtained model contains useful introspective information about -how the binding was performed (such as the mapping between XML types -and generated Java classes) - -

    -Once the model is obtained, generate the code into the file system as follows: -

    -    JCodeModel cm = model.generateCode( null, ... );
    -    cm.build(new FileCodeWriter(outputDir));
    -
    - - -

    Implementation Note

    -

    -This package shouldn't contain any implementation code. - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html 2017-02-14 14:26:36.156552767 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,30 +0,0 @@ - - -

    -FieldRenderer and its implementation classes. -Unless you are deriving from these classes to define your own custom renderer, -you shouldn't be using these classes directly. Use the outline package. -

    --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html 2017-02-14 14:26:36.404554352 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,42 +0,0 @@ - - - - - -

    - Compile-time representation of Java type system. - -

    - These classes are used as TypeT and ClassDeclT of the model parameterization. - This implementaion is designed to be capable of representing pre-existing classes - (such as java.lang.String) as well as the generated classes (represented as JDefinedClass.) - -

    Handling of Primitive Types

    -

    - Primitive types have two forms (int and Integer), and this complicates the binding process. - For this reason, inside the front end, we always use the boxed types. We'll use the unboxed - form only in the back end when we know the field doesn't need to represent the null value. - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html 2017-02-14 14:26:36.652555938 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,36 +0,0 @@ - - - - - - Provides the outline of the generated Java source code so that - additional processings (such as adding more annotations) can be - done on the generated code. - -

    - Code generation phase builds an outline little by little, while - each step is using the outline built by the prior steps. - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html 2017-02-14 14:26:36.900557523 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ - - -

    Object Model that represents DTD binding information.

    --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html 2017-02-14 14:26:37.148559109 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,32 +0,0 @@ - - - - - - - Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C)) - - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html 2017-02-14 14:26:37.396560696 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ - - -

    internalization of external binding files and <jaxb:bindings> customizations.

    --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html 2017-02-14 14:26:37.648562307 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ - - -

    Front-end that reads schema(s) and produce BGM.

    --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html 2017-02-14 14:26:37.944564199 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,34 +0,0 @@ - - - -Object Model that represents customization declarations. - -

    - RelaxNGCC is used to parse - XML syntax into this representation, and the other parts of XJC will use - this object model. -

    - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html 2017-02-14 14:26:38.220565965 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,31 +0,0 @@ - - - - - - Code generated into the user's packages in certain compilation mode. - - --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java 2017-02-14 14:26:38.480567627 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,187 +0,0 @@ -/* -Copyright (c) 2001, 2002 Thai Open Source Software Center Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of the Thai Open Source Software Center Ltd nor - the names of its contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -// @@3RD PARTY CODE@@ - -package com.sun.xml.internal.xsom.impl.util; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URL; - -public class Uri { - private static String utf8 = "UTF-8"; - - public static boolean isValid(String s) { - return isValidPercent(s) && isValidFragment(s) && isValidScheme(s); - } - - private static final String HEX_DIGITS = "0123456789abcdef"; - - public static String escapeDisallowedChars(String s) { - StringBuffer buf = null; - int len = s.length(); - int done = 0; - for (;;) { - int i = done; - for (;;) { - if (i == len) { - if (done == 0) - return s; - break; - } - if (isExcluded(s.charAt(i))) - break; - i++; - } - if (buf == null) - buf = new StringBuffer(); - if (i > done) { - buf.append(s.substring(done, i)); - done = i; - } - if (i == len) - break; - for (i++; i < len && isExcluded(s.charAt(i)); i++) - ; - String tem = s.substring(done, i); - byte[] bytes; - try { - bytes = tem.getBytes(utf8); - } - catch (UnsupportedEncodingException e) { - utf8 = "UTF8"; - try { - bytes = tem.getBytes(utf8); - } - catch (UnsupportedEncodingException e2) { - // Give up - return s; - } - } - for (int j = 0; j < bytes.length; j++) { - buf.append('%'); - buf.append(HEX_DIGITS.charAt((bytes[j] & 0xFF) >> 4)); - buf.append(HEX_DIGITS.charAt(bytes[j] & 0xF)); - } - done = i; - } - return buf.toString(); - } - - private static String excluded = "<>\"{}|\\^`"; - - private static boolean isExcluded(char c) { - return c <= 0x20 || c >= 0x7F || excluded.indexOf(c) >= 0; - } - - private static boolean isAlpha(char c) { - return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'); - } - - private static boolean isHexDigit(char c) { - return ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F') || isDigit(c); - } - - private static boolean isDigit(char c) { - return '0' <= c && c <= '9'; - } - - private static boolean isSchemeChar(char c) { - return isAlpha(c) || isDigit(c) || c == '+' || c == '-' || c =='.'; - } - - private static boolean isValidPercent(String s) { - int len = s.length(); - for (int i = 0; i < len; i++) - if (s.charAt(i) == '%') { - if (i + 2 >= len) - return false; - else if (!isHexDigit(s.charAt(i + 1)) - || !isHexDigit(s.charAt(i + 2))) - return false; - } - return true; - } - - private static boolean isValidFragment(String s) { - int i = s.indexOf('#'); - return i < 0 || s.indexOf('#', i + 1) < 0; - } - - private static boolean isValidScheme(String s) { - if (!isAbsolute(s)) - return true; - int i = s.indexOf(':'); - if (i == 0 - || i + 1 == s.length() - || !isAlpha(s.charAt(0))) - return false; - while (--i > 0) - if (!isSchemeChar(s.charAt(i))) - return false; - return true; - } - - public static String resolve(String baseUri, String uriReference) throws IOException { - if (isAbsolute(uriReference)) - return uriReference; - - if(baseUri==null) - throw new IOException("Unable to resolve relative URI "+uriReference+" without a base URI"); - - if(!isAbsolute(baseUri)) - throw new IOException("Unable to resolve relative URI "+uriReference+" because base URI is not absolute: "+baseUri); - - return new URL(new URL(baseUri), uriReference).toString(); - } - - public static boolean hasFragmentId(String uri) { - return uri.indexOf('#') >= 0; - } - - public static boolean isAbsolute(String uri) { - int i = uri.indexOf(':'); - if (i < 0) - return false; - while (--i >= 0) { - switch (uri.charAt(i)) { - case '#': - case '/': - case '?': - return false; - } - } - return true; - } -} --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties 2017-02-14 14:26:38.736569263 +0300 +++ /dev/null 2017-02-13 23:04:34.903538264 +0300 @@ -1,26 +0,0 @@ -# -# Copyright (c) 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 -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}