--- old/src/share/jaxws_classes/com/sun/istack/internal/Builder.java 2013-04-04 15:25:42.856611455 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/Builder.java 2013-04-04 15:25:42.808611454 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/ByteArrayDataSource.java 2013-04-04 15:25:43.096611458 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/ByteArrayDataSource.java 2013-04-04 15:25:43.048611458 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/FinalArrayList.java 2013-04-04 15:25:43.344611462 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/FinalArrayList.java 2013-04-04 15:25:43.284611461 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/FragmentContentHandler.java 2013-04-04 15:25:43.612611466 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/FragmentContentHandler.java 2013-04-04 15:25:43.564611466 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/Interned.java 2013-04-04 15:25:43.860611470 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/Interned.java 2013-04-04 15:25:43.808611469 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/NotNull.java 2013-04-04 15:25:44.140611475 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/NotNull.java 2013-04-04 15:25:44.076611474 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/Nullable.java 2013-04-04 15:25:44.408611478 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/Nullable.java 2013-04-04 15:25:44.356611478 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/Pool.java 2013-04-04 15:25:44.652611483 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/Pool.java 2013-04-04 15:25:44.600611481 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/SAXException2.java 2013-04-04 15:25:44.900611486 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/SAXException2.java 2013-04-04 15:25:44.852611485 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/SAXParseException2.java 2013-04-04 15:25:45.136611490 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/SAXParseException2.java 2013-04-04 15:25:45.084611489 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/XMLStreamException2.java 2013-04-04 15:25:45.360611494 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/XMLStreamException2.java 2013-04-04 15:25:45.312611493 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java 2013-04-04 15:25:45.580611497 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java 2013-04-04 15:25:45.532611496 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/localization/Localizable.java 2013-04-04 15:25:45.784611500 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/localization/Localizable.java 2013-04-04 15:25:45.740611499 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,5 +59,5 @@ *

* Use of "new" is to create an unique instance. */ - public static final String NOT_LOCALIZABLE = new String("\u0000"); + public static final String NOT_LOCALIZABLE = "\u0000"; } --- old/src/share/jaxws_classes/com/sun/istack/internal/localization/LocalizableMessage.java 2013-04-04 15:25:45.984611503 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/localization/LocalizableMessage.java 2013-04-04 15:25:45.936611503 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 @@ package com.sun.istack.internal.localization; +import java.util.Arrays; + /** * @author WS Development Team */ @@ -47,7 +49,7 @@ } public Object[] getArguments() { - return _args; + return Arrays.copyOf(_args, _args.length); } public String getResourceBundleName() { --- old/src/share/jaxws_classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java 2013-04-04 15:25:46.216611507 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java 2013-04-04 15:25:46.168611506 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/localization/Localizer.java 2013-04-04 15:25:46.468611511 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/localization/Localizer.java 2013-04-04 15:25:46.412611510 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -88,8 +88,14 @@ alternateBundleName, _locale); } catch (MissingResourceException e2) { - // give up - return getDefaultMessage(l); + //try context classloader + try { + bundle = ResourceBundle.getBundle(bundlename, _locale, Thread.currentThread().getContextClassLoader()); + } catch (MissingResourceException e3) { + // give up + return getDefaultMessage(l); + } + } } } --- old/src/share/jaxws_classes/com/sun/istack/internal/logging/Logger.java 2013-04-04 15:25:46.716611514 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/logging/Logger.java 2013-04-04 15:25:46.656611513 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ import java.util.logging.Level; /** - * This is a helper class that provides some conveniece methods wrapped around the + * This is a helper class that provides some convenience methods wrapped around the * standard {@link java.util.logging.Logger} interface. * * The class also makes sure that logger names of each Metro subsystem are consistent @@ -129,6 +129,20 @@ logger.logp(level, componentClassName, getCallerMethodName(), message); } + public void log(final Level level, final String message, Object param1) { + if (!this.logger.isLoggable(level)) { + return; + } + logger.logp(level, componentClassName, getCallerMethodName(), message, param1); + } + + public void log(final Level level, final String message, Object[] params) { + if (!this.logger.isLoggable(level)) { + return; + } + logger.logp(level, componentClassName, getCallerMethodName(), message, params); + } + public void log(final Level level, final String message, final Throwable thrown) { if (!this.logger.isLoggable(level)) { return; @@ -143,6 +157,13 @@ logger.logp(Level.FINEST, componentClassName, getCallerMethodName(), message); } + public void finest(final String message, Object[] params) { + if (!this.logger.isLoggable(Level.FINEST)) { + return; + } + logger.logp(Level.FINEST, componentClassName, getCallerMethodName(), message, params); + } + public void finest(final String message, final Throwable thrown) { if (!this.logger.isLoggable(Level.FINEST)) { return; @@ -157,6 +178,13 @@ logger.logp(Level.FINER, componentClassName, getCallerMethodName(), message); } + public void finer(final String message, Object[] params) { + if (!this.logger.isLoggable(Level.FINER)) { + return; + } + logger.logp(Level.FINER, componentClassName, getCallerMethodName(), message, params); + } + public void finer(final String message, final Throwable thrown) { if (!this.logger.isLoggable(Level.FINER)) { return; @@ -185,6 +213,13 @@ logger.logp(Level.INFO, componentClassName, getCallerMethodName(), message); } + public void info(final String message, Object[] params) { + if (!this.logger.isLoggable(Level.INFO)) { + return; + } + logger.logp(Level.INFO, componentClassName, getCallerMethodName(), message, params); + } + public void info(final String message, final Throwable thrown) { if (!this.logger.isLoggable(Level.INFO)) { return; @@ -199,6 +234,13 @@ logger.logp(Level.CONFIG, componentClassName, getCallerMethodName(), message); } + public void config(final String message, Object[] params) { + if (!this.logger.isLoggable(Level.CONFIG)) { + return; + } + logger.logp(Level.CONFIG, componentClassName, getCallerMethodName(), message, params); + } + public void config(final String message, final Throwable thrown) { if (!this.logger.isLoggable(Level.CONFIG)) { return; @@ -213,6 +255,13 @@ logger.logp(Level.WARNING, componentClassName, getCallerMethodName(), message); } + public void warning(final String message, Object[] params) { + if (!this.logger.isLoggable(Level.WARNING)) { + return; + } + logger.logp(Level.WARNING, componentClassName, getCallerMethodName(), message, params); + } + public void warning(final String message, final Throwable thrown) { if (!this.logger.isLoggable(Level.WARNING)) { return; @@ -227,6 +276,13 @@ logger.logp(Level.SEVERE, componentClassName, getCallerMethodName(), message); } + public void severe(final String message, Object[] params) { + if (!this.logger.isLoggable(Level.SEVERE)) { + return; + } + logger.logp(Level.SEVERE, componentClassName, getCallerMethodName(), message, params); + } + public void severe(final String message, final Throwable thrown) { if (!this.logger.isLoggable(Level.SEVERE)) { return; --- old/src/share/jaxws_classes/com/sun/istack/internal/package-info.java 2013-04-04 15:25:46.928611517 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/package-info.java 2013-04-04 15:25:46.876611517 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/tools/MaskingClassLoader.java 2013-04-04 15:25:47.152611521 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/tools/MaskingClassLoader.java 2013-04-04 15:25:47.100611520 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java 2013-04-04 15:25:47.388611525 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java 2013-04-04 15:25:47.340611524 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/istack/internal/tools/SecureLoader.java 2013-04-04 15:25:47.624611529 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/tools/SecureLoader.java 2013-04-04 15:25:47.576611528 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,19 @@ } }); } + } + + static ClassLoader getParentClassLoader(final ClassLoader cl) { + if (System.getSecurityManager() == null) { + return cl.getParent(); + } else { + return (ClassLoader) java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public java.lang.Object run() { + return cl.getParent(); + } + }); + } } static void setContextClassLoader(final ClassLoader cl) { --- old/src/share/jaxws_classes/com/sun/istack/internal/tools/package-info.java 2013-04-04 15:25:47.856611532 +0200 +++ new/src/share/jaxws_classes/com/sun/istack/internal/tools/package-info.java 2013-04-04 15:25:47.800611532 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/AMX.java 2013-04-04 15:25:48.128611536 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/AMX.java 2013-04-04 15:25:48.068611535 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.amx; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/AMXGlassfish.java 2013-04-04 15:25:48.368611540 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/AMXGlassfish.java 2013-04-04 15:25:48.316611540 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.amx; import javax.management.ObjectName; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/AMXUtil.java 2013-04-04 15:25:48.612611544 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/AMXUtil.java 2013-04-04 15:25:48.560611543 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.amx; import javax.management.MBeanServerConnection; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/BootAMXMBean.java 2013-04-04 15:25:48.856611547 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/BootAMXMBean.java 2013-04-04 15:25:48.788611546 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.amx; import javax.management.ObjectName; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/MBeanListener.java 2013-04-04 15:25:49.116611552 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/amx/MBeanListener.java 2013-04-04 15:25:49.056611551 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.amx; import java.util.Set; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/arc/Stability.java 2013-04-04 15:25:49.348611556 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/arc/Stability.java 2013-04-04 15:25:49.296611555 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,9 +23,8 @@ * questions. */ -package com.sun.org.glassfish.external.arc; - +package com.sun.org.glassfish.external.arc; /** Taxonomy values. --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/arc/Taxonomy.java 2013-04-04 15:25:49.604611560 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/arc/Taxonomy.java 2013-04-04 15:25:49.556611559 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.arc; import java.lang.annotation.Documented; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/PluginPoint.java 2013-04-04 15:25:49.856611564 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/PluginPoint.java 2013-04-04 15:25:49.796611563 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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 @@ -22,10 +22,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ + + package com.sun.org.glassfish.external.probe.provider; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProvider.java 2013-04-04 15:25:50.096611567 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProvider.java 2013-04-04 15:25:50.044611566 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.probe.provider; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProviderInfo.java 2013-04-04 15:25:50.332611570 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProviderInfo.java 2013-04-04 15:25:50.276611570 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.probe.provider; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProviderManager.java 2013-04-04 15:25:50.576611574 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProviderManager.java 2013-04-04 15:25:50.516611574 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.probe.provider; import java.util.Vector; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProviderManagerDelegate.java 2013-04-04 15:25:50.820611579 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/StatsProviderManagerDelegate.java 2013-04-04 15:25:50.764611577 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.probe.provider; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/Probe.java 2013-04-04 15:25:51.024611581 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/Probe.java 2013-04-04 15:25:50.976611580 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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 @@ -24,6 +24,7 @@ */ + package com.sun.org.glassfish.external.probe.provider.annotations; import java.lang.annotation.Retention; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/ProbeListener.java 2013-04-04 15:25:51.224611585 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/ProbeListener.java 2013-04-04 15:25:51.172611584 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.probe.provider.annotations; import java.lang.annotation.Retention; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/ProbeParam.java 2013-04-04 15:25:51.440611588 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/ProbeParam.java 2013-04-04 15:25:51.380611587 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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 @@ -24,6 +24,7 @@ */ + package com.sun.org.glassfish.external.probe.provider.annotations; import java.lang.annotation.Retention; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/ProbeProvider.java 2013-04-04 15:25:51.652611591 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/probe/provider/annotations/ProbeProvider.java 2013-04-04 15:25:51.600611590 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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 @@ -24,6 +24,7 @@ */ + package com.sun.org.glassfish.external.probe.provider.annotations; import java.lang.annotation.Retention; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/AverageRangeStatistic.java 2013-04-04 15:25:51.876611595 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/AverageRangeStatistic.java 2013-04-04 15:25:51.824611594 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, 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,8 @@ * questions. */ + + /* * AverageRangeStatistic.java * --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/BoundaryStatistic.java 2013-04-04 15:25:52.080611598 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/BoundaryStatistic.java 2013-04-04 15:25:52.032611597 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/BoundedRangeStatistic.java 2013-04-04 15:25:52.280611601 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/BoundedRangeStatistic.java 2013-04-04 15:25:52.228611600 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/CountStatistic.java 2013-04-04 15:25:52.520611605 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/CountStatistic.java 2013-04-04 15:25:52.464611604 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/RangeStatistic.java 2013-04-04 15:25:52.740611608 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/RangeStatistic.java 2013-04-04 15:25:52.684611608 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/Statistic.java 2013-04-04 15:25:52.984611612 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/Statistic.java 2013-04-04 15:25:52.928611611 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/Stats.java 2013-04-04 15:25:53.192611615 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/Stats.java 2013-04-04 15:25:53.140611614 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics; public interface Stats { --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/StringStatistic.java 2013-04-04 15:25:53.404611619 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/StringStatistic.java 2013-04-04 15:25:53.348611617 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/TimeStatistic.java 2013-04-04 15:25:53.612611622 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/TimeStatistic.java 2013-04-04 15:25:53.564611621 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics; /** --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/annotations/Reset.java 2013-04-04 15:25:53.836611625 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/annotations/Reset.java 2013-04-04 15:25:53.784611624 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.annotations; import java.lang.annotation.Retention; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/AverageRangeStatisticImpl.java 2013-04-04 15:25:54.068611629 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/AverageRangeStatisticImpl.java 2013-04-04 15:25:54.012611628 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; import java.util.concurrent.atomic.AtomicLong; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/BoundaryStatisticImpl.java 2013-04-04 15:25:54.292611633 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/BoundaryStatisticImpl.java 2013-04-04 15:25:54.236611631 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.BoundaryStatistic; import java.util.concurrent.atomic.AtomicLong; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/BoundedRangeStatisticImpl.java 2013-04-04 15:25:54.504611635 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/BoundedRangeStatisticImpl.java 2013-04-04 15:25:54.456611635 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.BoundedRangeStatistic; import java.util.concurrent.atomic.AtomicLong; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/CountStatisticImpl.java 2013-04-04 15:25:54.728611639 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/CountStatisticImpl.java 2013-04-04 15:25:54.672611638 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.CountStatistic; import java.util.concurrent.atomic.AtomicLong; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/RangeStatisticImpl.java 2013-04-04 15:25:54.940611642 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/RangeStatisticImpl.java 2013-04-04 15:25:54.888611642 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.RangeStatistic; import java.util.concurrent.atomic.AtomicLong; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StatisticImpl.java 2013-04-04 15:25:55.168611646 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StatisticImpl.java 2013-04-04 15:25:55.112611645 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 @@ * questions. */ + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.Statistic; import java.io.Serializable; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StatsImpl.java 2013-04-04 15:25:55.376611649 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StatsImpl.java 2013-04-04 15:25:55.324611648 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.Stats; import com.sun.org.glassfish.external.statistics.Statistic; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StringStatisticImpl.java 2013-04-04 15:25:55.604611653 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/StringStatisticImpl.java 2013-04-04 15:25:55.548611652 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,8 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; import com.sun.org.glassfish.external.statistics.StringStatistic; import java.util.Map; --- old/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/TimeStatisticImpl.java 2013-04-04 15:25:55.824611656 +0200 +++ new/src/share/jaxws_classes/com/sun/org/glassfish/external/statistics/impl/TimeStatisticImpl.java 2013-04-04 15:25:55.768611656 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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,7 +23,10 @@ * questions. */ + + package com.sun.org.glassfish.external.statistics.impl; + import com.sun.org.glassfish.external.statistics.TimeStatistic; import java.util.concurrent.atomic.AtomicLong; import java.util.Map; --- old/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin 2013-04-04 15:25:56.060611660 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin 2013-04-04 15:25:56.000611659 +0200 @@ -3,3 +3,4 @@ com.sun.tools.internal.xjc.addon.sync.SynchronizedMethodAddOn com.sun.tools.internal.xjc.addon.at_generated.PluginImpl com.sun.tools.internal.xjc.addon.episode.PluginImpl +com.sun.tools.internal.xjc.addon.accessors.PluginImpl --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/ConfigReader.java 2013-04-04 15:25:56.296611664 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/ConfigReader.java 2013-04-04 15:25:56.228611662 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.tools.internal.jxc; +import com.sun.tools.internal.jxc.ap.Options; import java.io.File; import java.io.IOException; import java.util.Collection; @@ -51,6 +52,7 @@ import com.sun.tools.internal.xjc.api.Reference; import com.sun.tools.internal.xjc.util.ForkContentHandler; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -94,7 +96,7 @@ */ public ConfigReader(ProcessingEnvironment env, Collection classes, File xmlFile, ErrorHandler errorHandler) throws SAXException, IOException { this.env = env; - Config config = parseAndGetConfig(xmlFile,errorHandler); + Config config = parseAndGetConfig(xmlFile, errorHandler, env.getOptions().containsKey(Options.DISABLE_XML_SECURITY)); checkAllClasses(config,classes); String path = xmlFile.getAbsolutePath(); String xmlPath = path.substring(0,path.lastIndexOf(File.separatorChar)); @@ -150,14 +152,14 @@ private SchemaOutputResolver createSchemaOutputResolver(Config config, String xmlpath) { File baseDir = new File(xmlpath, config.getBaseDir().getPath()); - SchemaOutputResolverImpl schemaOutputResolver = new SchemaOutputResolverImpl (baseDir); + SchemaOutputResolverImpl outResolver = new SchemaOutputResolverImpl (baseDir); for( Schema schema : (List)config.getSchema() ) { String namespace = schema.getNamespace(); File location = schema.getLocation(); - schemaOutputResolver.addSchemaInfo(namespace,location); + outResolver.addSchemaInfo(namespace,location); } - return schemaOutputResolver; + return outResolver; } /** @@ -190,11 +192,10 @@ * @return * A non null Config object */ - private Config parseAndGetConfig (File xmlFile, ErrorHandler errorHandler) throws SAXException, IOException { + private Config parseAndGetConfig (File xmlFile, ErrorHandler errorHandler, boolean disableSecureProcessing) throws SAXException, IOException { XMLReader reader; try { - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setNamespaceAware(true); + SAXParserFactory factory = XmlFactory.createParserFactory(disableSecureProcessing); reader = factory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException e) { // in practice this will never happen --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties 2013-04-04 15:25:56.528611667 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties 2013-04-04 15:25:56.472611667 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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.2.5-b10 + schemagen 2.2.7-b63 FULLVERSION = \ - schemagen full version "2.2.5-b10" + schemagen full version "2.2.7-b63" USAGE = \ Usage: schemagen [-options ...] \n\ @@ -43,6 +43,7 @@ \ \ \ \ -classpath : specify where to find user specified files\n\ \ \ \ \ -encoding : specify encoding to be used for annotation processing/javac invocation \n\ \ \ \ \ -episode : generate episode file for separate compilation\n\ +\ \ \ \ -disableXmlSecurity : disables XML security features for usage on xml parsing apis \n\ \ \ \ \ -version : display version information\n\ \ \ \ \ -fullversion : display full version information\n\ \ \ \ \ -help : display this usage message --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java 2013-04-04 15:25:56.792611671 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java 2013-04-04 15:25:56.732611671 +0200 @@ -83,10 +83,9 @@ * @return * A list of regular expression patterns {@link Pattern} */ - public List getIncludePatterns(List includeContent ) { + public List getIncludePatterns(List includeContent ) { List includeRegexList = new ArrayList(); - for (int i = 0 ; i < includeContent.size(); i ++){ - String includes = (String)includeContent.get(i); + for (String includes : includeContent) { String regex = convertToRegex(includes); Pattern pattern = Pattern.compile(regex); includeRegexList.add(pattern); @@ -103,10 +102,9 @@ * @return * A list of regular expression patterns {@link Pattern} */ - public List getExcludePatterns(List excludeContent ) { - List excludeRegexList = new ArrayList(); - for (int i = 0 ; i < excludeContent.size(); i ++){ - String excludes = (String)excludeContent.get(i); + public List getExcludePatterns(List excludeContent ) { + List excludeRegexList = new ArrayList(); + for (String excludes : excludeContent) { String regex = convertToRegex(excludes); Pattern pattern = Pattern.compile(regex); excludeRegexList.add(pattern); @@ -126,17 +124,16 @@ for ( int i = 0 ; i < pattern.length(); i ++ ) { char c = pattern.charAt(i); - int j = i; nc = ' '; - if ((j+1) != pattern.length()) { - nc = pattern.charAt(j+1); + if ((i +1) != pattern.length()) { + nc = pattern.charAt(i +1); } //escape single '.' - if ((c=='.') && ( nc !='.')){ + if (c == '.' && nc != '.'){ regex.append('\\'); regex.append('.'); //do not allow patterns like a..b - } else if ((c=='.') && ( nc =='.')){ + } else if (c == '.'){ continue; // "**" gets replaced by ".*" } else if ((c=='*') && (nc == '*')) { --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGenerator.java 2013-04-04 15:25:57.012611675 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGenerator.java 2013-04-04 15:25:56.956611674 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,8 +27,6 @@ import com.sun.tools.internal.jxc.ap.Options; import com.sun.tools.internal.xjc.BadCommandLineException; -import com.sun.tools.internal.xjc.api.util.ApClassLoader; -import com.sun.tools.internal.xjc.api.util.ToolsJarNotFoundException; import com.sun.xml.internal.bind.util.Which; import javax.lang.model.SourceVersion; @@ -45,7 +43,9 @@ import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; +import java.net.URLClassLoader; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.logging.Level; @@ -70,7 +70,6 @@ if (cl==null) { cl = SecureLoader.getSystemClassLoader(); } -// ClassLoader classLoader = new ApClassLoader(cl, packagePrefixes); // todo: check if can be removed return run(args, cl); } catch(Exception e) { System.err.println(e.getMessage()); @@ -79,19 +78,6 @@ } /** - * List of package prefixes we want to load in the same package - */ - private static final String[] packagePrefixes = { - "com.sun.tools.internal.jxc.", - "com.sun.tools.internal.xjc.", - "com.sun.istack.internal.tools.", - "com.sun.tools.javac.", - "com.sun.tools.javadoc.", - "javax.annotation.processing.", - "javax.lang.model." - }; - - /** * Runs the schema generator. * * @param classLoader @@ -148,18 +134,8 @@ aptargs.add(options.encoding); } - // make jaxb-api.jar visible to classpath - File jaxbApi = findJaxbApiJar(); - if(jaxbApi!=null) { - if(options.classpath!=null) { - options.classpath = options.classpath+File.pathSeparatorChar+jaxbApi; - } else { - options.classpath = jaxbApi.getPath(); - } - } - aptargs.add("-cp"); - aptargs.add(options.classpath); + aptargs.add(setClasspath(options.classpath)); // set original classpath + jaxb-api to be visible to annotation processor if(options.targetDir!=null) { aptargs.add("-d"); @@ -172,6 +148,31 @@ return ((Boolean) compileMethod.invoke(null, argsarray, options.episodeFile)) ? 0 : 1; } + private static String setClasspath(String givenClasspath) { + StringBuilder cp = new StringBuilder(); + appendPath(cp, givenClasspath); + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + while (cl != null) { + if (cl instanceof URLClassLoader) { + for (URL url : ((URLClassLoader) cl).getURLs()) { + appendPath(cp, url.getPath()); + } + } + cl = cl.getParent(); + } + + appendPath(cp, findJaxbApiJar()); + return cp.toString(); + } + + private static void appendPath(StringBuilder cp, String url) { + if (url == null || url.trim().isEmpty()) + return; + if (cp.length() != 0) + cp.append(File.pathSeparatorChar); + cp.append(url); + } + /** * Computes the file system path of jaxb-api.jar so that * Annotation Processing will see them in the -cp option. @@ -183,7 +184,7 @@ * @return * null if failed to locate it. */ - private static File findJaxbApiJar() { + private static String findJaxbApiJar() { String url = Which.which(JAXBContext.class); if(url==null) return null; // impossible, but hey, let's be defensive @@ -198,11 +199,11 @@ try { File f = new File(new URL(jarFileUrl).toURI()); if (f.exists() && f.getName().endsWith(".jar")) { // see 6510966 - return f; + return f.getPath(); } f = new File(new URL(jarFileUrl).getFile()); if (f.exists() && f.getName().endsWith(".jar")) { // this is here for potential backw. compatibility issues - return f; + return f.getPath(); } } catch (URISyntaxException ex) { Logger.getLogger(SchemaGenerator.class.getName()).log(Level.SEVERE, null, ex); @@ -212,18 +213,6 @@ return null; } - /** - * Returns true if the list of arguments have an argument - * that looks like a class name. - */ - private static boolean hasClass(List args) { - for (String arg : args) { - if(!arg.endsWith(".java")) - return true; - } - return false; - } - private static void usage( ) { System.out.println(Messages.USAGE.format()); } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGeneratorFacade.java 2013-04-04 15:25:57.256611678 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGeneratorFacade.java 2013-04-04 15:25:57.196611678 +0200 @@ -25,7 +25,6 @@ package com.sun.tools.internal.jxc; -import com.sun.tools.internal.jxc.SecureLoader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/SecureLoader.java 2013-04-04 15:25:57.476611682 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/SecureLoader.java 2013-04-04 15:25:57.424611681 +0200 @@ -37,9 +37,9 @@ 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 java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +50,9 @@ if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +63,9 @@ if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/AnnotationParser.java 2013-04-04 15:25:57.700611685 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/AnnotationParser.java 2013-04-04 15:25:57.652611684 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,10 +26,10 @@ package com.sun.tools.internal.jxc.ap; import com.sun.tools.internal.jxc.ConfigReader; +import com.sun.tools.internal.jxc.api.JXC; import com.sun.tools.internal.xjc.ErrorReceiver; import com.sun.tools.internal.xjc.api.J2SJAXBModel; import com.sun.tools.internal.xjc.api.Reference; -import com.sun.tools.internal.xjc.api.XJC; import org.xml.sax.SAXException; import javax.annotation.processing.AbstractProcessor; @@ -37,7 +37,6 @@ import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedOptions; -import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; @@ -50,7 +49,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.Set; import java.util.StringTokenizer; @@ -60,11 +58,12 @@ * and the config files * It also reads config files * + * Used in unit tests + * * @author Bhakti Mehta (bhakti.mehta@sun.com) */ @SupportedAnnotationTypes("javax.xml.bind.annotation.*") -@SupportedOptions("jaxb.config") // Const.CONFIG_FILE_OPTION.getValue() -@SupportedSourceVersion(SourceVersion.RELEASE_6) +@SupportedOptions("jaxb.config") public final class AnnotationParser extends AbstractProcessor { private ErrorReceiver errorListener; @@ -110,7 +109,7 @@ ); Collection classesToBeIncluded = configReader.getClassesToBeIncluded(); - J2SJAXBModel model = XJC.createJavaCompiler().bind( + J2SJAXBModel model = JXC.createJavaCompiler().bind( classesToBeIncluded, Collections.emptyMap(), null, processingEnv); SchemaOutputResolver schemaOutputResolver = configReader.getSchemaOutputResolver(); @@ -128,10 +127,19 @@ private void filterClass(Collection rootElements, Collection elements) { for (Element element : elements) { - if (element.getKind().equals(ElementKind.CLASS) || element.getKind().equals(ElementKind.INTERFACE)) { + if (element.getKind().equals(ElementKind.CLASS) || element.getKind().equals(ElementKind.INTERFACE) || + element.getKind().equals(ElementKind.ENUM)) { rootElements.add((TypeElement) element); filterClass(rootElements, ElementFilter.typesIn(element.getEnclosedElements())); } } } + + @Override + public SourceVersion getSupportedSourceVersion() { + if (SourceVersion.latest().compareTo(SourceVersion.RELEASE_6) > 0) + return SourceVersion.valueOf("RELEASE_7"); + else + return SourceVersion.RELEASE_6; + } } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/Options.java 2013-04-04 15:25:57.928611689 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/Options.java 2013-04-04 15:25:57.876611688 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 @@ */ public class Options { + public static final String DISABLE_XML_SECURITY = "-disableXmlSecurity"; + // honor CLASSPATH environment variable, but it will be overrided by -cp public String classpath = System.getenv("CLASSPATH"); @@ -46,6 +48,8 @@ public File episodeFile = null; + private boolean disableXmlSecurity = false; + // encoding is not required for JDK5, 6, but JDK 7 javac is much more strict - see issue 6859289 public String encoding = null; @@ -85,6 +89,14 @@ return 1; } + if (args[i].equals(DISABLE_XML_SECURITY)) { + if (i == args.length - 1) + throw new BadCommandLineException( + (Messages.OPERAND_MISSING.format(args[i]))); + disableXmlSecurity = true; + return 1; + } + if (args[i].equals("-encoding")) { if (i == args.length - 1) throw new BadCommandLineException( @@ -106,5 +118,13 @@ } + /** + * @return the disableXmlSecurity + */ + public boolean isDisableXmlSecurity() { + return disableXmlSecurity; + } + + } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/SchemaGenerator.java 2013-04-04 15:25:58.156611692 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/SchemaGenerator.java 2013-04-04 15:25:58.096611692 +0200 @@ -27,15 +27,14 @@ package com.sun.tools.internal.jxc.ap; +import com.sun.tools.internal.jxc.api.JXC; import com.sun.tools.internal.xjc.api.J2SJAXBModel; import com.sun.tools.internal.xjc.api.Reference; -import com.sun.tools.internal.xjc.api.XJC; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Processor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; -import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; @@ -66,7 +65,6 @@ * @author Kohsuke Kawaguchi */ @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_6) public class SchemaGenerator extends AbstractProcessor { /** @@ -96,7 +94,7 @@ // so that users won't have to manually exclude interfaces, which is silly. filterClass(classes, roundEnv.getRootElements()); - J2SJAXBModel model = XJC.createJavaCompiler().bind(classes, Collections.emptyMap(), null, processingEnv); + J2SJAXBModel model = JXC.createJavaCompiler().bind(classes, Collections.emptyMap(), null, processingEnv); if (model == null) return false; // error @@ -143,4 +141,12 @@ } } } + + @Override + public SourceVersion getSupportedSourceVersion() { + if (SourceVersion.latest().compareTo(SourceVersion.RELEASE_6) > 0) + return SourceVersion.valueOf("RELEASE_7"); + else + return SourceVersion.RELEASE_6; + } } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/SecureLoader.java 2013-04-04 15:25:58.372611696 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/ap/SecureLoader.java 2013-04-04 15:25:58.320611695 +0200 @@ -37,9 +37,9 @@ 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 java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +50,9 @@ if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +63,9 @@ if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java 2013-04-04 15:25:58.604611699 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java 2013-04-04 15:25:58.552611698 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Classes.java 2013-04-04 15:25:58.832611703 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Classes.java 2013-04-04 15:25:58.788611703 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -78,11 +78,22 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 12: + case 0: { - if(($__uri.equals("") && $__local.equals("classes"))) { + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); + } + break; + case 4: + { + $_ngcc_current_state = 3; + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); + } + break; + case 11: + { + if(($__uri.equals("") && $__local.equals("includes"))) { $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); - $_ngcc_current_state = 11; + $_ngcc_current_state = 10; } else { unexpectedEnterElement($__qname); @@ -101,22 +112,11 @@ } } break; - case 0: - { - revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); - } - break; - case 4: - { - $_ngcc_current_state = 3; - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); - } - break; - case 11: + case 12: { - if(($__uri.equals("") && $__local.equals("includes"))) { + if(($__uri.equals("") && $__local.equals("classes"))) { $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); - $_ngcc_current_state = 10; + $_ngcc_current_state = 11; } else { unexpectedEnterElement($__qname); @@ -137,11 +137,11 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 3: + case 8: { - if(($__uri.equals("") && $__local.equals("excludes"))) { + if(($__uri.equals("") && $__local.equals("includes"))) { $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); - $_ngcc_current_state = 1; + $_ngcc_current_state = 2; } else { unexpectedLeaveElement($__qname); @@ -159,12 +159,6 @@ } } break; - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); - } - break; case 0: { revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); @@ -176,17 +170,23 @@ $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); } break; - case 8: + case 3: { - if(($__uri.equals("") && $__local.equals("includes"))) { + if(($__uri.equals("") && $__local.equals("excludes"))) { $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); - $_ngcc_current_state = 2; + $_ngcc_current_state = 1; } else { unexpectedLeaveElement($__qname); } } break; + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedLeaveElement($__qname); @@ -201,12 +201,6 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); - } - break; case 0: { revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); @@ -218,6 +212,12 @@ $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); } break; + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedEnterAttribute($__qname); @@ -232,12 +232,6 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); - } - break; case 0: { revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); @@ -249,6 +243,12 @@ $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); } break; + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedLeaveAttribute($__qname); @@ -260,27 +260,14 @@ public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { - case 6: - { - __text = $value; - $_ngcc_current_state = 4; - action1(); - } - break; - case 3: - { - exclude_content = $value; - $_ngcc_current_state = 3; - action0(); - } - break; - case 2: + case 9: { - $_ngcc_current_state = 1; - $runtime.sendText(super._cookie, $value); + include_content = $value; + $_ngcc_current_state = 8; + action2(); } break; - case 9: + case 8: { include_content = $value; $_ngcc_current_state = 8; @@ -299,18 +286,31 @@ action0(); } break; - case 10: + case 3: + { + exclude_content = $value; + $_ngcc_current_state = 3; + action0(); + } + break; + case 6: { __text = $value; - $_ngcc_current_state = 9; - action3(); + $_ngcc_current_state = 4; + action1(); } break; - case 8: + case 2: { - include_content = $value; - $_ngcc_current_state = 8; - action2(); + $_ngcc_current_state = 1; + $runtime.sendText(super._cookie, $value); + } + break; + case 10: + { + __text = $value; + $_ngcc_current_state = 9; + action3(); } break; } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Config.java 2013-04-04 15:25:59.060611707 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Config.java 2013-04-04 15:25:59.012611706 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -74,11 +74,11 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 7: + case 1: { - if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { - $runtime.consumeAttribute($ai); - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); + if(($__uri.equals("") && $__local.equals("schema"))) { + NGCCHandler h = new Schema(this, super._source, $runtime, 31, baseDir); + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); } else { unexpectedEnterElement($__qname); @@ -90,37 +90,37 @@ revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); } break; - case 1: + case 7: { - if(($__uri.equals("") && $__local.equals("schema"))) { - NGCCHandler h = new Schema(this, super._source, $runtime, 31, baseDir); - spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); + if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); } else { unexpectedEnterElement($__qname); } } break; - case 2: + case 8: { - if(($__uri.equals("") && $__local.equals("schema"))) { - NGCCHandler h = new Schema(this, super._source, $runtime, 32, baseDir); - spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); + if(($__uri.equals("") && $__local.equals("config"))) { + $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); + $_ngcc_current_state = 7; } else { - $_ngcc_current_state = 1; - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); + unexpectedEnterElement($__qname); } } break; - case 8: + case 2: { - if(($__uri.equals("") && $__local.equals("config"))) { - $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); - $_ngcc_current_state = 7; + if(($__uri.equals("") && $__local.equals("schema"))) { + NGCCHandler h = new Schema(this, super._source, $runtime, 32, baseDir); + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); } else { - unexpectedEnterElement($__qname); + $_ngcc_current_state = 1; + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); } } break; @@ -149,11 +149,11 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 7: + case 1: { - if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { - $runtime.consumeAttribute($ai); - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + if(($__uri.equals("") && $__local.equals("config"))) { + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); + $_ngcc_current_state = 0; } else { unexpectedLeaveElement($__qname); @@ -165,11 +165,11 @@ revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); } break; - case 1: + case 7: { - if(($__uri.equals("") && $__local.equals("config"))) { - $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); - $_ngcc_current_state = 0; + if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); } else { unexpectedLeaveElement($__qname); @@ -196,6 +196,11 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { + case 0: + { + revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); + } + break; case 7: { if(($__uri.equals("") && $__local.equals("baseDir"))) { @@ -206,11 +211,6 @@ } } break; - case 0: - { - revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); - } - break; case 2: { $_ngcc_current_state = 1; @@ -236,6 +236,12 @@ revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); } break; + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); + } + break; case 5: { if(($__uri.equals("") && $__local.equals("baseDir"))) { @@ -246,12 +252,6 @@ } } break; - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); - } - break; default: { unexpectedLeaveAttribute($__qname); @@ -263,6 +263,18 @@ public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { + case 0: + { + revertToParentFromText(this, super._cookie, $value); + } + break; + case 6: + { + bd = $value; + $_ngcc_current_state = 5; + action1(); + } + break; case 7: { if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { @@ -271,24 +283,12 @@ } } break; - case 0: - { - revertToParentFromText(this, super._cookie, $value); - } - break; case 2: { $_ngcc_current_state = 1; $runtime.sendText(super._cookie, $value); } break; - case 6: - { - bd = $value; - $_ngcc_current_state = 5; - action1(); - } - break; } } @@ -301,6 +301,12 @@ $_ngcc_current_state = 1; } break; + case 34: + { + this.classes = ((Classes)result); + $_ngcc_current_state = 2; + } + break; case 32: { this._schema = ((Schema)result); @@ -308,12 +314,6 @@ $_ngcc_current_state = 1; } break; - case 34: - { - this.classes = ((Classes)result); - $_ngcc_current_state = 2; - } - break; } } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java 2013-04-04 15:25:59.336611711 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java 2013-04-04 15:25:59.280611710 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java 2013-04-04 15:25:59.608611715 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java 2013-04-04 15:25:59.560611715 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java 2013-04-04 15:25:59.888611719 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java 2013-04-04 15:25:59.836611718 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java 2013-04-04 15:26:00.136611724 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java 2013-04-04 15:26:00.072611723 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java 2013-04-04 15:26:00.380611727 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java 2013-04-04 15:26:00.320611726 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Schema.java 2013-04-04 15:26:00.624611731 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Schema.java 2013-04-04 15:26:00.572611730 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,23 +67,6 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 6: - { - if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { - $runtime.consumeAttribute($ai); - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); - } - else { - $_ngcc_current_state = 2; - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); - } - } - break; - case 0: - { - revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); - } - break; case 2: { if(($ai = $runtime.getAttributeIndex("","location"))>=0) { @@ -107,37 +90,37 @@ } } break; - default: + case 0: { - unexpectedEnterElement($__qname); + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); } break; - } - } - - public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { - int $ai; - $uri = $__uri; - $localName = $__local; - $qname = $__qname; - switch($_ngcc_current_state) { case 6: { if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { $runtime.consumeAttribute($ai); - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); } else { $_ngcc_current_state = 2; - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); } } break; - case 0: + default: { - revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); + unexpectedEnterElement($__qname); } break; + } + } + + public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { + int $ai; + $uri = $__uri; + $localName = $__local; + $qname = $__qname; + switch($_ngcc_current_state) { case 1: { if(($__uri.equals("") && $__local.equals("schema"))) { @@ -161,6 +144,23 @@ } } break; + case 0: + { + revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); + } + break; + case 6: + { + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + } + else { + $_ngcc_current_state = 2; + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + } + } + break; default: { unexpectedLeaveElement($__qname); @@ -175,13 +175,13 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 6: + case 2: { - if(($__uri.equals("") && $__local.equals("namespace"))) { - $_ngcc_current_state = 8; + if(($__uri.equals("") && $__local.equals("location"))) { + $_ngcc_current_state = 4; } else { - $_ngcc_current_state = 2; + $_ngcc_current_state = 1; $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); } } @@ -191,13 +191,13 @@ revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); } break; - case 2: + case 6: { - if(($__uri.equals("") && $__local.equals("location"))) { - $_ngcc_current_state = 4; + if(($__uri.equals("") && $__local.equals("namespace"))) { + $_ngcc_current_state = 8; } else { - $_ngcc_current_state = 1; + $_ngcc_current_state = 2; $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); } } @@ -216,6 +216,12 @@ $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); + } + break; case 7: { if(($__uri.equals("") && $__local.equals("namespace"))) { @@ -226,10 +232,14 @@ } } break; - case 6: + case 3: { - $_ngcc_current_state = 2; - $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); + if(($__uri.equals("") && $__local.equals("location"))) { + $_ngcc_current_state = 1; + } + else { + unexpectedLeaveAttribute($__qname); + } } break; case 0: @@ -237,22 +247,12 @@ revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); } break; - case 2: + case 6: { - $_ngcc_current_state = 1; + $_ngcc_current_state = 2; $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); } break; - case 3: - { - if(($__uri.equals("") && $__local.equals("location"))) { - $_ngcc_current_state = 1; - } - else { - unexpectedLeaveAttribute($__qname); - } - } - break; default: { unexpectedLeaveAttribute($__qname); @@ -264,14 +264,14 @@ public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { - case 6: + case 2: { - if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { + if(($ai = $runtime.getAttributeIndex("","location"))>=0) { $runtime.consumeAttribute($ai); $runtime.sendText(super._cookie, $value); } else { - $_ngcc_current_state = 2; + $_ngcc_current_state = 1; $runtime.sendText(super._cookie, $value); } } @@ -283,25 +283,25 @@ action0(); } break; - case 0: - { - revertToParentFromText(this, super._cookie, $value); - } - break; case 8: { namespace = $value; $_ngcc_current_state = 7; } break; - case 2: + case 0: { - if(($ai = $runtime.getAttributeIndex("","location"))>=0) { + revertToParentFromText(this, super._cookie, $value); + } + break; + case 6: + { + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { $runtime.consumeAttribute($ai); $runtime.sendText(super._cookie, $value); } else { - $_ngcc_current_state = 1; + $_ngcc_current_state = 2; $runtime.sendText(super._cookie, $value); } } --- old/src/share/jaxws_classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java 2013-04-04 15:26:00.836611734 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java 2013-04-04 15:26:00.788611733 +0200 @@ -31,7 +31,6 @@ import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.runtime.Location; -import java.lang.annotation.Annotation; import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; @@ -53,6 +52,7 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.SimpleTypeVisitor6; import javax.lang.model.util.Types; +import java.lang.annotation.Annotation; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -375,17 +375,17 @@ throw new IllegalStateException(); } - @Override +// @Override public List getAnnotationMirrors() { throw new IllegalStateException(); } - @Override +// @Override public A getAnnotation(Class annotationType) { throw new IllegalStateException(); } - @Override +// @Override public A[] getAnnotationsByType(Class annotationType) { throw new IllegalStateException(); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/Invoker.java 2013-04-04 15:26:01.048611737 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/Invoker.java 2013-04-04 15:26:00.992611737 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -55,6 +55,45 @@ * @author Kohsuke Kawaguchi */ public final class Invoker { + + /** + * The list of package prefixes we want the + * {@link MaskingClassLoader} to prevent the parent + * classLoader from loading + */ + static final String[] maskedPackages = new String[]{ + "com.sun.istack.internal.tools.", + "com.sun.tools.internal.jxc.", + "com.sun.tools.internal.xjc.", + "com.sun.tools.internal.ws.", + "com.sun.codemodel.internal.", + "com.sun.relaxng.", + "com.sun.xml.internal.xsom.", + "com.sun.xml.internal.bind.", + "com.ctc.wstx.", //wsimport, wsgen ant task + "org.codehaus.stax2.", //wsimport, wsgen ant task + "com.sun.xml.internal.messaging.saaj.", //wsgen ant task + "com.sun.xml.internal.ws.", + "com.oracle.webservices.internal.api." //wsgen + }; + + /** + * Escape hatch to work around IBM JDK problem. + * See http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?nav=false&forum=367&thread=164718&cat=10 + */ + public static final boolean noSystemProxies; + + static { + boolean noSysProxiesProperty = false; + try { + noSysProxiesProperty = Boolean.getBoolean(Invoker.class.getName()+".noSystemProxies"); + } catch(SecurityException e) { + // ignore + } finally { + noSystemProxies = noSysProxiesProperty; + } + } + static int invoke(String mainClass, String[] args) throws Throwable { // use the platform default proxy if available. // see sun.net.spi.DefaultProxySelector for details. @@ -107,7 +146,7 @@ // finally load the rest of the RI. The actual class files are loaded from ancestors cl = new ParallelWorldClassLoader(cl,""); - } + } } @@ -194,29 +233,6 @@ } /** - * Creates a classloader for loading JAXB/WS 2.1 jar and tools.jar - */ - private static URL[] findIstack21APIs(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException { - List urls = new ArrayList(); - - if(Service.class.getClassLoader()==null) { - // JAX-WS API is loaded from bootstrap classloader - URL res = cl.getResource("javax/xml/ws/EndpointReference.class"); - if(res==null) - throw new ClassNotFoundException("There's no JAX-WS 2.1 API in the classpath"); - urls.add(ParallelWorldClassLoader.toJarUrl(res)); - - res = cl.getResource("javax/xml/bind/annotation/XmlSeeAlso.class"); - if(res==null) - throw new ClassNotFoundException("There's no JAXB 2.1 API in the classpath"); - urls.add(ParallelWorldClassLoader.toJarUrl(res)); - } - - findToolsJar(cl, urls); - - return urls.toArray(new URL[urls.size()]); - } - /** * Creates a classloader for loading JAXB/WS 2.2 jar and tools.jar */ private static URL[] findIstack22APIs(ClassLoader cl) throws ClassNotFoundException, IOException, ToolsJarNotFoundException { @@ -258,37 +274,4 @@ } } - /** - * The list of package prefixes we want the - * {@link MaskingClassLoader} to prevent the parent - * classLoader from loading - */ - public static String[] maskedPackages = new String[]{ - "com.sun.istack.internal.tools.", - "com.sun.tools.internal.jxc.", - "com.sun.tools.internal.xjc.", - "com.sun.tools.internal.ws.", - "com.sun.codemodel.internal.", - "com.sun.relaxng.", - "com.sun.xml.internal.xsom.", - "com.sun.xml.internal.bind.", - "com.ctc.wstx.", //wsimport, wsgen ant task - "org.codehaus.stax2.", //wsimport, wsgen ant task - "com.sun.xml.internal.messaging.saaj.", //wsgen ant task - "com.sun.xml.internal.ws." - }; - - /** - * Escape hatch to work around IBM JDK problem. - * See http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?nav=false&forum=367&thread=164718&cat=10 - */ - public static boolean noSystemProxies = false; - - static { - try { - noSystemProxies = Boolean.getBoolean(Invoker.class.getName()+".noSystemProxies"); - } catch(SecurityException e) { - // ignore - } - } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/ToolVersion.java 2013-04-04 15:26:01.280611741 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/ToolVersion.java 2013-04-04 15:26:01.220611740 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/WsGen.java 2013-04-04 15:26:01.544611745 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/WsGen.java 2013-04-04 15:26:01.488611745 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/WsImport.java 2013-04-04 15:26:01.800611749 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/WsImport.java 2013-04-04 15:26:01.744611749 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java 2013-04-04 15:26:02.048611753 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java 2013-04-04 15:26:01.996611752 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/WsgenExtension.java 2013-04-04 15:26:02.296611757 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/WsgenExtension.java 2013-04-04 15:26:02.248611756 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/WsgenProtocol.java 2013-04-04 15:26:02.544611761 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/WsgenProtocol.java 2013-04-04 15:26:02.488611760 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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,13 +41,13 @@ public @interface WsgenProtocol { /** * Token for wsgen -wsdl[:protocol] - * @return + * @return Token for wsgen -wsdl[:protocol] */ String token(); /** * The corresponding lexical string used to create BindingID - * @return + * @return lexical string used to create BindingID */ String lexical(); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java 2013-04-04 15:26:02.772611765 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java 2013-04-04 15:26:02.716611763 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java 2013-04-04 15:26:03.016611768 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java 2013-04-04 15:26:02.964611768 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java 2013-04-04 15:26:03.248611772 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java 2013-04-04 15:26:03.196611771 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java 2013-04-04 15:26:03.484611775 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java 2013-04-04 15:26:03.436611775 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java 2013-04-04 15:26:03.708611779 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java 2013-04-04 15:26:03.660611778 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/package-info.java 2013-04-04 15:26:03.940611783 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/package-info.java 2013-04-04 15:26:03.888611781 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/ProcessorException.java 2013-04-04 15:26:04.160611786 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/ProcessorException.java 2013-04-04 15:26:04.112611785 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java 2013-04-04 15:26:04.380611790 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java 2013-04-04 15:26:04.332611789 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java 2013-04-04 15:26:04.624611793 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java 2013-04-04 15:26:04.572611793 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -60,11 +60,11 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import javax.annotation.processing.Filer; +import javax.tools.FileObject; + +import javax.tools.StandardLocation; -/** - * - * @author WS Development Team - */ public abstract class GeneratorBase implements ModelVisitor { private File destDir; private String targetVersion; @@ -96,28 +96,33 @@ } } + @Override public void visit(Model model) throws Exception { for (Service service : model.getServices()) { service.accept(this); } } + @Override public void visit(Service service) throws Exception { for (Port port : service.getPorts()) { port.accept(this); } } + @Override public void visit(Port port) throws Exception { for (Operation operation : port.getOperations()) { operation.accept(this); } } + @Override public void visit(Operation operation) throws Exception { operation.getRequest().accept(this); - if (operation.getResponse() != null) + if (operation.getResponse() != null) { operation.getResponse().accept(this); + } Iterator faults = operation.getFaultsSet().iterator(); if (faults != null) { Fault fault; @@ -128,21 +133,20 @@ } } - public void visit(Parameter param) throws Exception { - } + @Override + public void visit(Parameter param) throws Exception {} - public void visit(Block block) throws Exception { - } + @Override + public void visit(Block block) throws Exception {} - public void visit(Response response) throws Exception { - } + @Override + public void visit(Response response) throws Exception {} + @Override + public void visit(Request request) throws Exception {} - public void visit(Request request) throws Exception { - } - - public void visit(Fault fault) throws Exception { - } + @Override + public void visit(Fault fault) throws Exception {} public List getJAXWSClassComment(){ return getJAXWSClassComment(targetVersion); @@ -162,8 +166,9 @@ cls = cm._class(className, type); } catch (JClassAlreadyExistsException e){ cls = cm._getClass(className); - if(cls == null) + if (cls == null) { throw e; + } } return cls; } @@ -181,8 +186,9 @@ protected void writeHandlerConfig(String className, JDefinedClass cls, WsimportOptions options) { Element e = options.getHandlerChainConfiguration(); - if(e == null) + if (e == null) { return; + } JAnnotationUse handlerChainAnn = cls.annotate(cm.ref(HandlerChain.class)); NodeList nl = e.getElementsByTagNameNS( "http://java.sun.com/xml/ns/javaee", "handler-chain"); @@ -199,17 +205,25 @@ } private void generateHandlerChainFile(Element hChains, String name) { - String hcName = getHandlerConfigFileName(name); - File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir); - File hcFile = new File(packageDir, hcName); - - options.addGeneratedFile(hcFile); + Filer filer = options.filer; try { - IndentingWriter p = - new IndentingWriter( - new OutputStreamWriter(new FileOutputStream(hcFile))); + IndentingWriter p; + FileObject jfo; + if (filer != null) { + jfo = filer.createResource(StandardLocation.SOURCE_OUTPUT, + Names.getPackageName(name), getHandlerConfigFileName(name)); + options.addGeneratedFile(new File(jfo.toUri())); + p = new IndentingWriter(new OutputStreamWriter(jfo.openOutputStream())); + } else { // leave for backw. compatibility now + String hcName = getHandlerConfigFileName(name); + File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir); + File hcFile = new File(packageDir, hcName); + options.addGeneratedFile(hcFile); + p = new IndentingWriter(new OutputStreamWriter(new FileOutputStream(hcFile))); + } + Transformer it = XmlUtil.newTransformer(); it.setOutputProperty(OutputKeys.METHOD, "xml"); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java 2013-04-04 15:26:04.840611797 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java 2013-04-04 15:26:04.792611796 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java 2013-04-04 15:26:05.072611800 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java 2013-04-04 15:26:05.020611800 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorExtension.java 2013-04-04 15:26:05.288611803 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorExtension.java 2013-04-04 15:26:05.236611803 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -62,7 +62,7 @@ /** * Allow additional wsimport options - * @param name, for instance, "-neoption" + * @param name for instance, "-neoption" * @return whether the name specifies an option recognized by the extension */ public boolean validateOption(String name) { --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java 2013-04-04 15:26:05.508611807 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java 2013-04-04 15:26:05.460611806 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java 2013-04-04 15:26:05.736611810 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java 2013-04-04 15:26:05.684611809 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/JwsImplGenerator.java 2013-04-04 15:26:05.936611814 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/JwsImplGenerator.java 2013-04-04 15:26:05.884611813 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -50,6 +50,7 @@ import javax.xml.namespace.QName; import javax.xml.ws.Holder; import java.io.File; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -84,12 +85,12 @@ jwsImplGenerator.init(model, options, receiver); jwsImplGenerator.doGeneration(); // print a warning message while implFiles.size() is zero - if (jwsImplGenerator.implFiles.size() == 0) { - StringBuffer msg = new StringBuffer(); + if (jwsImplGenerator.implFiles.isEmpty()) { + StringBuilder msg = new StringBuilder(); if (options.implServiceName != null) - msg.append("serviceName=[" + options.implServiceName + "] "); + msg.append("serviceName=[").append(options.implServiceName).append("] "); if (options.implPortName != null) - msg.append("portName=[" + options.implPortName + "] "); + msg.append("portName=[").append(options.implPortName).append("] "); if (msg.length() > 0) msg.append(", Not found in wsdl file.\n"); @@ -107,7 +108,7 @@ public static boolean moveToImplDestDir(List gImplFiles, WsimportOptions options, ErrorReceiver receiver) { if (options.implDestDir == null || gImplFiles == null - || gImplFiles.size() == 0) + || gImplFiles.isEmpty()) return true; List generatedImplFiles = ImplFile.toImplFiles(gImplFiles); @@ -335,24 +336,29 @@ webServiceAnn.param("wsdlLocation", wsdlLocation); webServiceAnn.param("endpointInterface", port.getJavaInterface().getName()); } + //CR373098 To transform the java class name as validate. - private String transToValidJavaIdentifier(String s) { - if (s == null) return null; - final int len = s.length(); - StringBuffer retSB = new StringBuffer(); - if (len == 0 || !Character.isJavaIdentifierStart(s.charAt(0))) - retSB.append("J"); //update to a default start char - else - retSB.append(s.charAt(0)); - - for (int i = 1; i < len; i++) { - if (!Character.isJavaIdentifierPart(s.charAt(i))) - ; //delete it if it is illegal //TODO: It might conflict "a-b" vs. "ab" - else - retSB.append(s.charAt(i)); - } - return retSB.toString(); - } + private String transToValidJavaIdentifier(String s) { + if (s == null) { + return null; + } + final int len = s.length(); + StringBuilder retSB = new StringBuilder(); + if (len == 0 || !Character.isJavaIdentifierStart(s.charAt(0))) { + retSB.append("J"); //update to a default start char + } else { + retSB.append(s.charAt(0)); + } + + for (int i = 1; i < len; i++) { + if (!Character.isJavaIdentifierPart(s.charAt(i))) + ; //delete it if it is illegal //TODO: It might conflict "a-b" vs. "ab" + else { + retSB.append(s.charAt(i)); + } + } + return retSB.toString(); + } private String makePackageQualified(String s) { s = transToValidJavaIdentifier(s); @@ -446,21 +452,20 @@ } } - // process the bindings in backup list of model + // process the bindings in whole document if (value == null) { - // TODO: The property "BAKEUP_BINDINGS" is set in WsdlModeler when init - // the model - // make this as a const if needed. - HashMap hm = (HashMap) model.getProperty("BAKEUP_BINDINGS"); - Binding b = (Binding) hm.get(bName); - if (b != null) { + if (model.getEntity() instanceof Definitions) { + Definitions definitions = (Definitions) model.getEntity(); + Binding b = (Binding) definitions.resolveBindings().get(bName); + if (b != null) { List bindextends = (List) b .extensions(); for (TWSDLExtension wsdlext : bindextends) { - value = resolveBindingValue(wsdlext); - if (value != null) - break; + value = resolveBindingValue(wsdlext); + if (value != null) + break; } + } } } @@ -478,14 +483,14 @@ * retrieved from WSDL * @return Standard BindingType URI defined by JAX-WS 2.0 specification. */ - private String translate(String transportURI) - { - String translatedBindingId = TRANSLATION_MAP.get(transportURI); - if (translatedBindingId == null) - translatedBindingId = transportURI; - - return translatedBindingId; - } +// private String translate(String transportURI) +// { +// String translatedBindingId = TRANSLATION_MAP.get(transportURI); +// if (translatedBindingId == null) +// translatedBindingId = transportURI; +// +// return translatedBindingId; +// } /***************************************************************************** * Inner classes definition @@ -529,7 +534,10 @@ ret = options.implDestDir; } - ret.mkdirs(); + boolean created = ret.mkdirs(); + if (options.verbose && !created) { + System.out.println(MessageFormat.format("Directory not created: {0}", ret)); + } return ret; } @@ -549,7 +557,7 @@ private static File findFile(WsimportOptions options, String qualifiedFileName) throws java.io.IOException { - String baseDir = options.destDir.getCanonicalPath(); + String baseDir = options.sourceDir.getCanonicalPath(); String fp = null; for (File f : options.getGeneratedFiles()) { fp = getQualifiedFileName(baseDir, f); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/Names.java 2013-04-04 15:26:06.208611818 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/Names.java 2013-04-04 15:26:06.160611817 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java 2013-04-04 15:26:06.452611822 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java 2013-04-04 15:26:06.400611821 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -36,10 +36,8 @@ import com.sun.tools.internal.ws.wscompile.ErrorReceiver; import com.sun.tools.internal.ws.wscompile.Options; import com.sun.tools.internal.ws.wscompile.WsimportOptions; -import com.sun.tools.internal.ws.wscompile.AbortException; import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle; import com.sun.tools.internal.ws.wsdl.document.PortType; -import com.sun.tools.internal.ws.wsdl.document.Kinds; import com.sun.tools.internal.ws.resources.GeneratorMessages; import javax.jws.WebMethod; @@ -55,7 +53,6 @@ import org.xml.sax.Locator; public class SeiGenerator extends GeneratorBase { - private String serviceNS; private TJavaGeneratorExtension extension; private List extensionHandlers; @@ -76,10 +73,11 @@ register(new W3CAddressingJavaGeneratorExtension()); } - for (TJavaGeneratorExtension j : extensions) + for (TJavaGeneratorExtension j : extensions) { register(j); + } - this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[0])); + this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[extensionHandlers.size()])); } private void write(Port port) { @@ -92,7 +90,7 @@ } - JDefinedClass cls = null; + JDefinedClass cls; try { cls = getClass(className, ClassType.INTERFACE); } catch (JClassAlreadyExistsException e) { @@ -102,16 +100,18 @@ Locator loc = null; if(portTypeName != null){ PortType pt = port.portTypes.get(portTypeName); - if(pt!=null) + if (pt!=null) { loc = pt.getLocator(); + } } receiver.error(loc, GeneratorMessages.GENERATOR_SEI_CLASS_ALREADY_EXIST(intf.getName(), portTypeName)); return; } // If the class has methods it has already been defined // so skip it. - if (!cls.methods().isEmpty()) + if (!cls.methods().isEmpty()) { return; + } //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); @@ -138,8 +138,9 @@ writeSOAPBinding(port, cls); //@XmlSeeAlso - if(options.target.isLaterThan(Options.Target.V2_1)) + if (options.target.isLaterThan(Options.Target.V2_1)) { writeXmlSeeAlso(cls); + } for (Operation operation: port.getOperations()) { JavaMethod method = operation.getJavaMethod(); @@ -159,8 +160,9 @@ JCommentPart ret = methodDoc.addReturn(); ret.add("returns "+retType.getName()); } - if(methodJavaDoc != null) + if (methodJavaDoc != null) { methodDoc.add(methodJavaDoc); + } writeWebMethod(operation, m); JClass holder = cm.ref(Holder.class); @@ -196,8 +198,9 @@ List objectFactories = model.getJAXBModel().getS2JJAXBModel().getAllObjectFactories(); //if there are no object facotires, dont generate @XmlSeeAlso - if(objectFactories.size() == 0) + if (objectFactories.isEmpty()) { return; + } JAnnotationUse xmlSeeAlso = cls.annotate(cm.ref(XmlSeeAlso.class)); JAnnotationArrayMember paramArray = xmlSeeAlso.paramArray("value"); @@ -261,21 +264,24 @@ wr = m.annotate(javax.jws.WebResult.class); wr.param("name", resultName); } - if((nsURI != null) && (!nsURI.equals(serviceNS) || (isDocStyle && operation.isWrapped()))){ - if(wr == null) + if (nsURI != null || (isDocStyle && operation.isWrapped())) { + if(wr == null) { wr = m.annotate(javax.jws.WebResult.class); + } wr.param("targetNamespace", nsURI); } //doclit wrapped could have additional headers if(!(isDocStyle && operation.isWrapped()) || (parameter.getBlock().getLocation() == Block.HEADER)){ - if(wr == null) + if (wr == null) { wr = m.annotate(javax.jws.WebResult.class); + } wr.param("partName", parameter.getName()); } if(parameter.getBlock().getLocation() == Block.HEADER){ - if(wr == null) + if (wr == null) { wr = m.annotate(javax.jws.WebResult.class); + } wr.param("header",true); } } @@ -318,34 +324,43 @@ } private boolean isHeaderParam(Parameter param, Message message) { - if (message.getHeaderBlockCount() == 0) + if (message.getHeaderBlockCount() == 0) { return false; + } - for (Block headerBlock : message.getHeaderBlocksMap().values()) - if (param.getBlock().equals(headerBlock)) + for (Block headerBlock : message.getHeaderBlocksMap().values()) { + if (param.getBlock().equals(headerBlock)) { return true; + } + } return false; } private boolean isAttachmentParam(Parameter param, Message message){ - if (message.getAttachmentBlockCount() == 0) + if (message.getAttachmentBlockCount() == 0) { return false; + } - for (Block attBlock : message.getAttachmentBlocksMap().values()) - if (param.getBlock().equals(attBlock)) + for (Block attBlock : message.getAttachmentBlocksMap().values()) { + if (param.getBlock().equals(attBlock)) { return true; + } + } return false; } private boolean isUnboundParam(Parameter param, Message message){ - if (message.getUnboundBlocksCount() == 0) + if (message.getUnboundBlocksCount() == 0) { return false; + } - for (Block unboundBlock : message.getUnboundBlocksMap().values()) - if (param.getBlock().equals(unboundBlock)) + for (Block unboundBlock : message.getUnboundBlocksMap().values()) { + if (param.getBlock().equals(unboundBlock)) { return true; + } + } return false; } @@ -361,10 +376,11 @@ String name; boolean isWrapped = operation.isWrapped(); - if((param.getBlock().getLocation() == Block.HEADER) || (isDocStyle && !isWrapped)) + if ((param.getBlock().getLocation() == Block.HEADER) || (isDocStyle && !isWrapped)) { name = param.getBlock().getName().getLocalPart(); - else + } else { name = param.getName(); + } paramAnno.param("name", name); @@ -379,8 +395,9 @@ ns = param.getBlock().getName().getNamespaceURI(); } - if((ns != null) && (!ns.equals(serviceNS) || (isDocStyle && isWrapped))) + if (ns != null || (isDocStyle && isWrapped)) { paramAnno.param("targetNamespace", ns); + } if (header) { paramAnno.param("header", true); @@ -394,8 +411,9 @@ } //doclit wrapped could have additional headers - if(!(isDocStyle && isWrapped) || header) + if (!(isDocStyle && isWrapped) || header) { paramAnno.param("partName", javaParameter.getParameter().getName()); + } } private boolean isDocStyle = true; @@ -418,15 +436,18 @@ continue; } sameParamStyle = (isWrapper == operation.isWrapped()); - if(!sameParamStyle) + if (!sameParamStyle) { break; + } } - if(sameParamStyle) + if (sameParamStyle) { port.setWrapped(isWrapper); + } } if(sameParamStyle && !port.isWrapped()){ - if(soapBindingAnn == null) + if (soapBindingAnn == null) { soapBindingAnn = cls.annotate(SOAPBinding.class); + } soapBindingAnn.param("parameterStyle", SOAPBinding.ParameterStyle.BARE); } } @@ -437,15 +458,14 @@ wsa.param("targetNamespace", name.getNamespaceURI()); } - - - + @Override public void visit(Model model) throws Exception { for(Service s:model.getServices()){ s.accept(this); } } + @Override public void visit(Service service) throws Exception { String jd = model.getJavaDoc(); if(jd != null){ --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java 2013-04-04 15:26:06.712611826 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java 2013-04-04 15:26:06.656611825 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -66,6 +66,7 @@ import java.net.URL; import com.sun.xml.internal.ws.util.ServiceFinder; +import java.util.Locale; /** * @author WS Development Team @@ -100,7 +101,7 @@ } cls._extends(javax.xml.ws.Service.class); - String serviceFieldName = BindingHelper.mangleNameToClassName(service.getName().getLocalPart()).toUpperCase(); + String serviceFieldName = BindingHelper.mangleNameToClassName(service.getName().getLocalPart()).toUpperCase(Locale.ENGLISH); String wsdlLocationName = serviceFieldName + "_WSDL_LOCATION"; JFieldVar urlField = cls.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, URL.class, wsdlLocationName); @@ -219,8 +220,9 @@ Locator loc = null; if (portTypeName != null) { PortType pt = port.portTypes.get(portTypeName); - if (pt != null) + if (pt != null) { loc = pt.getLocator(); + } } receiver.error(loc, GeneratorMessages.GENERATOR_SEI_CLASS_ALREADY_EXIST(port.getJavaInterface().getName(), portTypeName)); return; @@ -230,8 +232,9 @@ writeDefaultGetPort(port, retType, cls); //write getXyzPort(WebServicesFeature...) - if (options.target.isLaterThan(Options.Target.V2_1)) + if (options.target.isLaterThan(Options.Target.V2_1)) { writeGetPort(port, retType, cls); + } } writeGetWsdlLocation(cm.ref(URL.class), cls, urlField, exField); @@ -240,8 +243,9 @@ private void writeGetPort(Port port, JType retType, JDefinedClass cls) { JMethod m = cls.method(JMod.PUBLIC, retType, port.getPortGetter()); JDocComment methodDoc = m.javadoc(); - if (port.getJavaDoc() != null) + if (port.getJavaDoc() != null) { methodDoc.add(port.getJavaDoc()); + } JCommentPart ret = methodDoc.addReturn(); JCommentPart paramDoc = methodDoc.addParam("features"); paramDoc.append("A list of "); @@ -250,7 +254,7 @@ ret.add("returns " + retType.name()); m.varParam(WebServiceFeature.class, "features"); JBlock body = m.body(); - StringBuffer statement = new StringBuffer("return "); + StringBuilder statement = new StringBuilder("return "); statement.append("super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), "); statement.append(retType.name()); statement.append(".class, features);"); @@ -389,12 +393,13 @@ String portGetter = port.getPortGetter(); JMethod m = cls.method(JMod.PUBLIC, retType, portGetter); JDocComment methodDoc = m.javadoc(); - if (port.getJavaDoc() != null) + if (port.getJavaDoc() != null) { methodDoc.add(port.getJavaDoc()); + } JCommentPart ret = methodDoc.addReturn(); ret.add("returns " + retType.name()); JBlock body = m.body(); - StringBuffer statement = new StringBuffer("return "); + StringBuilder statement = new StringBuilder("return "); statement.append("super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), "); statement.append(retType.name()); statement.append(".class);"); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java 2013-04-04 15:26:06.948611830 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java 2013-04-04 15:26:06.900611829 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/AbstractType.java 2013-04-04 15:26:07.176611833 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/AbstractType.java 2013-04-04 15:26:07.116611832 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java 2013-04-04 15:26:07.416611837 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java 2013-04-04 15:26:07.368611836 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java 2013-04-04 15:26:07.672611841 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java 2013-04-04 15:26:07.616611840 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Block.java 2013-04-04 15:26:07.928611845 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Block.java 2013-04-04 15:26:07.880611844 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java 2013-04-04 15:26:08.180611849 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java 2013-04-04 15:26:08.120611848 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Fault.java 2013-04-04 15:26:08.404611852 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Fault.java 2013-04-04 15:26:08.348611851 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +26,6 @@ package com.sun.tools.internal.ws.processor.model; import com.sun.codemodel.internal.JClass; -import com.sun.tools.internal.ws.processor.generator.GeneratorUtil; import com.sun.tools.internal.ws.processor.model.java.JavaException; import com.sun.tools.internal.ws.wsdl.framework.Entity; @@ -34,7 +33,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import java.util.TreeSet; /** * @@ -49,7 +47,6 @@ public Fault(String name, Entity entity) { super(entity); this.name = name; - parentFault = null; } public String getName() { @@ -80,12 +77,8 @@ visitor.visit(this); } - public Fault getParentFault() { - return parentFault; - } - public Iterator getSubfaults() { - if (subfaults.size() == 0) { + if (subfaults.isEmpty()) { return null; } return subfaults.iterator(); @@ -103,7 +96,7 @@ public Iterator getAllFaults() { Set allFaults = getAllFaultsSet(); - if (allFaults.size() == 0) { + if (allFaults.isEmpty()) { return null; } return allFaults.iterator(); @@ -160,7 +153,6 @@ private String name; private Block block; private JavaException javaException; - private Fault parentFault; private Set subfaults = new HashSet(); private QName elementName = null; private String javaMemberName = null; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java 2013-04-04 15:26:08.644611856 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java 2013-04-04 15:26:08.576611855 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Message.java 2013-04-04 15:26:08.912611860 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Message.java 2013-04-04 15:26:08.864611859 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Model.java 2013-04-04 15:26:09.136611863 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Model.java 2013-04-04 15:26:09.084611863 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelException.java 2013-04-04 15:26:09.380611867 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelException.java 2013-04-04 15:26:09.328611866 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.tools.internal.ws.processor.model; +import com.sun.istack.internal.localization.Localizable; import com.sun.tools.internal.ws.processor.ProcessorException; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * ModelException represents an exception that occurred while --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelObject.java 2013-04-04 15:26:09.600611871 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelObject.java 2013-04-04 15:26:09.552611870 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java 2013-04-04 15:26:09.828611874 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java 2013-04-04 15:26:09.776611874 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java 2013-04-04 15:26:10.068611878 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java 2013-04-04 15:26:10.008611877 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Operation.java 2013-04-04 15:26:10.308611881 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Operation.java 2013-04-04 15:26:10.256611881 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Parameter.java 2013-04-04 15:26:10.548611886 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Parameter.java 2013-04-04 15:26:10.496611885 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Port.java 2013-04-04 15:26:10.800611890 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Port.java 2013-04-04 15:26:10.756611889 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Request.java 2013-04-04 15:26:11.020611892 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Request.java 2013-04-04 15:26:10.968611892 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Response.java 2013-04-04 15:26:11.268611897 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Response.java 2013-04-04 15:26:11.216611896 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Service.java 2013-04-04 15:26:11.492611900 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Service.java 2013-04-04 15:26:11.440611900 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java 2013-04-04 15:26:11.724611904 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java 2013-04-04 15:26:11.668611903 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java 2013-04-04 15:26:11.976611908 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java 2013-04-04 15:26:11.916611907 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java 2013-04-04 15:26:12.220611911 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java 2013-04-04 15:26:12.168611911 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java 2013-04-04 15:26:12.464611915 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java 2013-04-04 15:26:12.416611914 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java 2013-04-04 15:26:12.716611919 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java 2013-04-04 15:26:12.656611918 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -86,14 +86,14 @@ public void addParameter(JavaParameter param) { // verify that this member does not already exist if (hasParameter(param.getName())) { - if(options.isExtensionMode()){ + if (options.isExtensionMode()) { param.setName(getUniqueName(param.getName())); - }else{ + } else { Parameter duplicParam = getParameter(param.getName()); if(param.getParameter().isEmbedded()){ errorReceiver.error(param.getParameter().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE_WRAPPER(param.getName(), param.getParameter().getEntityName())); errorReceiver.error(duplicParam.getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE_WRAPPER(param.getName(), duplicParam.getEntityName())); - }else{ + } else { errorReceiver.error(param.getParameter().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getParameter().getEntityName())); errorReceiver.error(duplicParam.getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), duplicParam.getEntityName())); } @@ -121,7 +121,7 @@ private String getUniqueName(String param){ int parmNum = 0; - while(hasParameter(param)){ + while (hasParameter(param)) { param = param + Integer.toString(parmNum++); } return param; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java 2013-04-04 15:26:12.952611923 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java 2013-04-04 15:26:12.904611922 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java 2013-04-04 15:26:13.204611926 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java 2013-04-04 15:26:13.152611926 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java 2013-04-04 15:26:13.456611930 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java 2013-04-04 15:26:13.400611930 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java 2013-04-04 15:26:13.704611934 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java 2013-04-04 15:26:13.656611934 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java 2013-04-04 15:26:13.924611938 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java 2013-04-04 15:26:13.872611937 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java 2013-04-04 15:26:14.136611941 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java 2013-04-04 15:26:14.088611940 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java 2013-04-04 15:26:14.364611945 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java 2013-04-04 15:26:14.316611944 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java 2013-04-04 15:26:14.580611948 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java 2013-04-04 15:26:14.528611948 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java 2013-04-04 15:26:14.796611951 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java 2013-04-04 15:26:14.748611951 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java 2013-04-04 15:26:15.048611955 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java 2013-04-04 15:26:14.996611955 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java 2013-04-04 15:26:15.296611960 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java 2013-04-04 15:26:15.248611959 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java 2013-04-04 15:26:15.544611963 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java 2013-04-04 15:26:15.492611963 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java 2013-04-04 15:26:15.788611967 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java 2013-04-04 15:26:15.728611966 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java 2013-04-04 15:26:16.056611971 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java 2013-04-04 15:26:15.992611970 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java 2013-04-04 15:26:16.340611976 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java 2013-04-04 15:26:16.284611974 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java 2013-04-04 15:26:16.604611979 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java 2013-04-04 15:26:16.544611978 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java 2013-04-04 15:26:16.852611983 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java 2013-04-04 15:26:16.804611983 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java 2013-04-04 15:26:17.080611987 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java 2013-04-04 15:26:17.032611987 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java 2013-04-04 15:26:17.316611990 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java 2013-04-04 15:26:17.264611990 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java 2013-04-04 15:26:17.548611995 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java 2013-04-04 15:26:17.496611994 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,8 +25,8 @@ package com.sun.tools.internal.ws.processor.modeler; +import com.sun.istack.internal.localization.Localizable; import com.sun.tools.internal.ws.processor.ProcessorException; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * ModelerException represents an exception that occurred while @@ -38,6 +38,10 @@ */ public class ModelerException extends ProcessorException { + public ModelerException(String key) { + super(key); + } + public ModelerException(String key, Object... args) { super(key, args); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java 2013-04-04 15:26:17.744611997 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java 2013-04-04 15:26:17.692611997 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 SeiContext getSeiContext(Name seiName) { SeiContext context = seiContextMap.get(seiName); if (context == null) { - context = new SeiContext(seiName); + context = new SeiContext(); addSeiContext(seiName, context); } return context; @@ -107,14 +107,17 @@ private Map resOperationWrapperMap = new HashMap(); private Map exceptionBeanMap = new HashMap(); - private Name seiName; private Name seiImplName; private boolean implementsSei; private String namespaceUri; - public SeiContext(Name seiName) { - this.seiName = seiName; - } + public SeiContext() {}; + + /** + * @deprecated use empty constructor, seiName value is ignored + * @param seiName + */ + public SeiContext(Name seiName) {}; public void setImplementsSei(boolean implementsSei) { this.implementsSei = implementsSei; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/FaultInfo.java 2013-04-04 15:26:18.004612001 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/FaultInfo.java 2013-04-04 15:26:17.948612001 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java 2013-04-04 15:26:18.248612005 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java 2013-04-04 15:26:18.196612004 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/MemberInfo.java 2013-04-04 15:26:18.456612008 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/MemberInfo.java 2013-04-04 15:26:18.404612007 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,7 +31,7 @@ import java.util.List; /** - * + * Note: this class has a natural ordering that is inconsistent with equals. * @author WS Development Team */ final class MemberInfo implements Comparable { @@ -57,7 +57,23 @@ return paramName; } + @Override public int compareTo(MemberInfo member) { return paramName.compareTo(member.paramName); } + + @Override + public boolean equals(Object o) { + return super.equals(o); + } + + @Override + public int hashCode() { + int hash = 5; + hash = 47 * hash + (this.paramType != null ? this.paramType.hashCode() : 0); + hash = 47 * hash + (this.paramName != null ? this.paramName.hashCode() : 0); + hash = 47 * hash + (this.jaxbAnnotations != null ? this.jaxbAnnotations.hashCode() : 0); + return hash; + } + } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/ModelBuilder.java 2013-04-04 15:26:18.692612012 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/ModelBuilder.java 2013-04-04 15:26:18.644612011 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeModeler.java 2013-04-04 15:26:18.952612016 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeModeler.java 2013-04-04 15:26:18.904612015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -63,8 +63,9 @@ retClass = getDeclaringClassMethod(superClass, methodName, args); } if (retClass == null) { - for (TypeMirror interfaceType : theClass.getInterfaces()) + for (TypeMirror interfaceType : theClass.getInterfaces()) { retClass = getDeclaringClassMethod(interfaceType, methodName, args); + } } if (retClass == null) { Collection methods = ElementFilter.methodsIn(theClass.getEnclosedElements()); @@ -105,7 +106,7 @@ Collection argTypes = ((DeclaredType) type).getTypeArguments(); if (argTypes.size() == 1) { return argTypes.iterator().next(); - } else if (argTypes.size() == 0) { + } else if (argTypes.isEmpty()) { VariableElement member = getValueMember(typeElement); if (member != null) { return member.asType(); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMoniker.java 2013-04-04 15:26:19.192612020 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMoniker.java 2013-04-04 15:26:19.144612019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMonikerFactory.java 2013-04-04 15:26:19.452612024 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMonikerFactory.java 2013-04-04 15:26:19.400612023 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAp.java 2013-04-04 15:26:19.728612029 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAp.java 2013-04-04 15:26:19.664612028 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -25,6 +25,7 @@ package com.sun.tools.internal.ws.processor.modeler.annotation; +import com.sun.istack.internal.logging.Logger; import com.sun.tools.internal.ws.processor.generator.GeneratorUtil; import com.sun.tools.internal.ws.processor.modeler.ModelerException; import com.sun.tools.internal.ws.resources.WebserviceapMessages; @@ -36,7 +37,6 @@ import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedOptions; -import javax.annotation.processing.SupportedSourceVersion; import javax.jws.WebService; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; @@ -51,12 +51,15 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintStream; +import java.lang.reflect.Method; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; +import java.util.Scanner; import java.util.Set; +import java.util.logging.Level; /** * WebServiceAp is a AnnotationProcessor for processing javax.jws.* and @@ -87,9 +90,10 @@ "javax.xml.ws.WebServiceRef" }) @SupportedOptions({WebServiceAp.DO_NOT_OVERWRITE, WebServiceAp.IGNORE_NO_WEB_SERVICE_FOUND_WARNING}) -@SupportedSourceVersion(SourceVersion.RELEASE_6) public class WebServiceAp extends AbstractProcessor implements ModelBuilder { + private static final Logger LOGGER = Logger.getLogger(WebServiceAp.class); + public static final String DO_NOT_OVERWRITE = "doNotOverWrite"; public static final String IGNORE_NO_WEB_SERVICE_FOUND_WARNING = "ignoreNoWebServiceFoundWarning"; @@ -120,7 +124,7 @@ } @Override - public void init(ProcessingEnvironment processingEnv) { + public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); remoteElement = processingEnv.getElementUtils().getTypeElement(Remote.class.getName()); remoteExceptionElement = processingEnv.getElementUtils().getTypeElement(RemoteException.class.getName()).asType(); @@ -135,18 +139,67 @@ doNotOverWrite = getOption(DO_NOT_OVERWRITE); ignoreNoWebServiceFoundWarning = getOption(IGNORE_NO_WEB_SERVICE_FOUND_WARNING); - String property = System.getProperty("sun.java.command"); // todo: check if property can be null - options.verbose = property != null && property.contains("-verbose"); - // todo: check how to get -s and -d, -classpath options - String classDir = "."; - sourceDir = new File(classDir); - property = System.getProperty("java.class.path"); + String classDir = parseArguments(); + String property = System.getProperty("java.class.path"); options.classpath = classDir + File.pathSeparator + (property != null ? property : ""); isCommandLineInvocation = true; } options.filer = processingEnv.getFiler(); } + private String parseArguments() { + // let's try to parse JavacOptions + + String classDir = null; + try { + ClassLoader cl = WebServiceAp.class.getClassLoader(); + Class javacProcessingEnvironmentClass = Class.forName("com.sun.tools.javac.processing.JavacProcessingEnvironment", false, cl); + if (javacProcessingEnvironmentClass.isInstance(processingEnv)) { + Method getContextMethod = javacProcessingEnvironmentClass.getDeclaredMethod("getContext"); + Object tmpContext = getContextMethod.invoke(processingEnv); + Class optionsClass = Class.forName("com.sun.tools.javac.util.Options", false, cl); + Class contextClass = Class.forName("com.sun.tools.javac.util.Context", false, cl); + Method instanceMethod = optionsClass.getDeclaredMethod("instance", new Class[]{contextClass}); + Object tmpOptions = instanceMethod.invoke(null, tmpContext); + if (tmpOptions != null) { + Method getMethod = optionsClass.getDeclaredMethod("get", new Class[]{String.class}); + Object result = getMethod.invoke(tmpOptions, "-s"); // todo: we have to check for -d also + if (result != null) { + classDir = (String) result; + } + this.options.verbose = getMethod.invoke(tmpOptions, "-verbose") != null; + } + } + } catch (Exception e) { + /// some Error was here - problems with reflection or security + processWarning(WebserviceapMessages.WEBSERVICEAP_PARSING_JAVAC_OPTIONS_ERROR()); + report(e.getMessage()); + } + + if (classDir == null) { // some error within reflection block + String property = System.getProperty("sun.java.command"); + if (property != null) { + Scanner scanner = new Scanner(property); + boolean sourceDirNext = false; + while (scanner.hasNext()) { + String token = scanner.next(); + if (sourceDirNext) { + classDir = token; + sourceDirNext = false; + } else if ("-verbose".equals(token)) { + options.verbose = true; + } else if ("-s".equals(token)) { + sourceDirNext = true; + } + } + } + } + if (classDir != null) { + sourceDir = new File(classDir); + } + return classDir; + } + private boolean getOption(String key) { String value = processingEnv.getOptions().get(key); if (value != null) { @@ -186,8 +239,9 @@ } if (!processedEndpoint) { if (isCommandLineInvocation) { - if (!ignoreNoWebServiceFoundWarning) + if (!ignoreNoWebServiceFoundWarning) { processWarning(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND()); + } } else { processError(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND()); } @@ -214,9 +268,14 @@ } protected void report(String msg) { - PrintStream outStream = out != null ? out : new PrintStream(out, true); - outStream.println(msg); - outStream.flush(); + if (out == null) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "No output set for web service annotation processor reporting."); + } + return; + } + out.println(msg); + out.flush(); } @Override @@ -296,4 +355,9 @@ public String getOperationName(Name messageName) { return messageName != null ? messageName.toString() : null; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java 2013-04-04 15:26:20.008612033 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java 2013-04-04 15:26:19.952612032 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java 2013-04-04 15:26:20.268612037 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java 2013-04-04 15:26:20.220612036 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,6 +31,7 @@ import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle; import com.sun.xml.internal.ws.model.RuntimeModeler; +import javax.annotation.processing.ProcessingEnvironment; import javax.jws.Oneway; import javax.jws.WebMethod; import javax.jws.WebParam; @@ -53,6 +54,7 @@ import javax.lang.model.util.ElementFilter; import javax.lang.model.util.SimpleElementVisitor6; import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.Types; import java.lang.annotation.Annotation; import java.util.Collection; import java.util.HashSet; @@ -139,7 +141,10 @@ serviceImplName = null; postProcessWebService(webService, e); serviceImplName = null; + break; } + default: + break; } return null; } @@ -281,6 +286,8 @@ soapStyle = SOAPStyle.DOCUMENT; wrapped = soapBinding.parameterStyle().equals(ParameterStyle.WRAPPED); } + } else { + pushedSoapBinding = false; } return soapBinding; } @@ -366,6 +373,7 @@ } for (TypeMirror superType : element.getInterfaces()) processMethods((TypeElement) ((DeclaredType) superType).asElement()); + break; } case CLASS: { builder.log("ProcessedMethods Class: " + element); @@ -382,7 +390,10 @@ if (!superclass.getKind().equals(TypeKind.NONE)) { processMethods((TypeElement) ((DeclaredType) superclass).asElement()); } + break; } + default: + break; } } @@ -504,7 +515,7 @@ boolean hasDefaultConstructor = false; for (ExecutableElement constructor : ElementFilter.constructorsIn(classElement.getEnclosedElements())) { if (constructor.getModifiers().contains(Modifier.PUBLIC) && - constructor.getParameters().size() == 0) { + constructor.getParameters().isEmpty()) { hasDefaultConstructor = true; break; } @@ -547,7 +558,7 @@ if (((DeclaredType) interfaceType).asElement().equals(interfaceElement)) return true; } - List classMethods = ElementFilter.methodsIn(classElement.getEnclosedElements()); + List classMethods = getClassMethods(classElement); boolean implementsMethod; for (ExecutableElement interfaceMethod : ElementFilter.methodsIn(interfaceElement.getEnclosedElements())) { implementsMethod = false; @@ -566,17 +577,32 @@ return true; } + private static List getClassMethods(TypeElement classElement) { + if (classElement.getQualifiedName().toString().equals(Object.class.getName())) // we don't need Object's methods + return null; + TypeElement superclassElement = (TypeElement) ((DeclaredType) classElement.getSuperclass()).asElement(); + List superclassesMethods = getClassMethods(superclassElement); + List classMethods = ElementFilter.methodsIn(classElement.getEnclosedElements()); + if (superclassesMethods == null) + return classMethods; + else + superclassesMethods.addAll(classMethods); + return superclassesMethods; + } + protected boolean sameMethod(ExecutableElement method1, ExecutableElement method2) { if (!method1.getSimpleName().equals(method2.getSimpleName())) return false; - if (!method1.getReturnType().equals(method2.getReturnType())) + Types typeUtils = builder.getProcessingEnvironment().getTypeUtils(); + if(!typeUtils.isSameType(method1.getReturnType(), method2.getReturnType()) + && !typeUtils.isSubtype(method2.getReturnType(), method1.getReturnType())) return false; List parameters1 = method1.getParameters(); List parameters2 = method2.getParameters(); if (parameters1.size() != parameters2.size()) return false; for (int i = 0; i < parameters1.size(); i++) { - if (!builder.getProcessingEnvironment().getTypeUtils().isSameType(parameters1.get(i).asType(), parameters2.get(i).asType())) + if (!typeUtils.isSameType(parameters1.get(i).asType(), parameters2.get(i).asType())) return false; } return true; @@ -616,9 +642,9 @@ } DeclaredType superClass = (DeclaredType) element.getSuperclass(); - TypeElement typeElement = (TypeElement) superClass.asElement(); - return typeElement.getQualifiedName().toString().equals(Object.class.getName()) - || methodsAreLegal(typeElement); + TypeElement tE = (TypeElement) superClass.asElement(); + return tE.getQualifiedName().toString().equals(Object.class.getName()) + || methodsAreLegal(tE); } default: { throw new IllegalArgumentException("Class or interface was expecting. But element: " + element); @@ -800,12 +826,12 @@ protected boolean isLegalType(TypeMirror type) { if (!(type != null && type.getKind().equals(TypeKind.DECLARED))) return true; - TypeElement typeElement = (TypeElement) ((DeclaredType) type).asElement(); - if (typeElement == null) { + TypeElement tE = (TypeElement) ((DeclaredType) type).asElement(); + if (tE == null) { // can be null, if this type's declaration is unknown. This may be the result of a processing error, such as a missing class file. builder.processError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(type.toString(), context.getRound())); } - return !builder.isRemote(typeElement); + return !builder.isRemote(tE); } protected VariableElement getOutParameter(ExecutableElement method) { @@ -821,18 +847,22 @@ protected static class MySoapBinding implements SOAPBinding { + @Override public Style style() { return SOAPBinding.Style.DOCUMENT; } + @Override public Use use() { return SOAPBinding.Use.LITERAL; } + @Override public ParameterStyle parameterStyle() { return SOAPBinding.ParameterStyle.WRAPPED; } + @Override public Class annotationType() { return SOAPBinding.class; } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java 2013-04-04 15:26:20.540612041 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java 2013-04-04 15:26:20.484612040 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -124,14 +124,17 @@ super(annReader, nav, beanMemberFactory); } + @Override protected TypeMirror getSafeType(TypeMirror type) { return WebServiceWrapperGenerator.this.getSafeType(type); } + @Override protected TypeMirror getHolderValueType(TypeMirror paramType) { return builder.getHolderValueType(paramType); } + @Override protected boolean isVoidType(TypeMirror type) { return type != null && type.getKind().equals(TypeKind.VOID); } @@ -140,6 +143,7 @@ private static final class FieldFactory implements AbstractWrapperBeanGenerator.BeanMemberFactory { + @Override public MemberInfo createWrapperBeanMember(TypeMirror paramType, String paramName, List jaxb) { return new MemberInfo(paramType, paramName, jaxb); @@ -151,17 +155,20 @@ makeSafeVisitor = new MakeSafeTypeVisitor(builder.getProcessingEnvironment()); } + @Override protected void processWebService(WebService webService, TypeElement d) { cm = new JCodeModel(); wrapperNames = new HashSet(); processedExceptions = new HashSet(); } + @Override protected void postProcessWebService(WebService webService, TypeElement d) { super.postProcessWebService(webService, d); doPostProcessWebService(webService, d); } + @SuppressWarnings("CallToThreadDumpStack") protected void doPostProcessWebService(WebService webService, TypeElement d) { if (cm != null) { File sourceDir = builder.getSourceDir(); @@ -178,6 +185,7 @@ } } + @Override protected void processMethod(ExecutableElement method, WebMethod webMethod) { builder.log("WrapperGen - method: "+method); builder.log("method.getDeclaringType(): " + method.asType()); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WrapperInfo.java 2013-04-04 15:26:20.816612045 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/WrapperInfo.java 2013-04-04 15:26:20.752612044 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/AccessorElement.java 2013-04-04 15:26:21.064612049 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/AccessorElement.java 2013-04-04 15:26:21.012612048 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java 2013-04-04 15:26:21.300612053 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java 2013-04-04 15:26:21.244612052 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java 2013-04-04 15:26:21.540612056 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java 2013-04-04 15:26:21.492612056 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/JAXBModelBuilder.java 2013-04-04 15:26:21.796612060 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/JAXBModelBuilder.java 2013-04-04 15:26:21.748612059 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java 2013-04-04 15:26:22.048612065 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java 2013-04-04 15:26:21.980612064 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +107,7 @@ * @param prop * @param jaxbType * @param block - * @return + * @return unwrapped parameter */ private static Parameter createUnwrappedParameter(JAXBProperty prop, JAXBType jaxbType, Block block, JAXBStructuredType type, --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java 2013-04-04 15:26:22.268612068 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java 2013-04-04 15:26:22.220612067 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -128,13 +128,15 @@ } private void build() { - for(Iterator itr=wsdlDocument.getDefinitions().services(); itr.hasNext(); ) + for(Iterator itr=wsdlDocument.getDefinitions().services(); itr.hasNext(); ) { build(itr.next()); + } } private void build(Service service) { - for( Iterator itr=service.ports(); itr.hasNext(); ) + for( Iterator itr=service.ports(); itr.hasNext(); ) { build(itr.next() ); + } } private void build(Port port) { @@ -193,7 +195,7 @@ outputMessage = operation.getOutput().resolveMessage(wsdlDocument); if(outputMessage != null){ List allParts = new ArrayList(outputMessage.getParts()); - if(options.additionalHeaders) { + if(options != null && options.additionalHeaders) { List addtionalHeaderParts = wsdlModeler.getAdditionHeaderParts(bindingOperation, outputMessage, false); allParts.addAll(addtionalHeaderParts); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java 2013-04-04 15:26:22.496612072 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java 2013-04-04 15:26:22.448612071 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,6 +26,7 @@ package com.sun.tools.internal.ws.processor.modeler.wsdl; import com.sun.codemodel.internal.JType; +import com.sun.istack.internal.NotNull; import com.sun.istack.internal.SAXParseException2; import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible; import com.sun.tools.internal.ws.processor.generator.Names; @@ -54,7 +55,6 @@ import com.sun.tools.internal.xjc.api.S2JJAXBModel; import com.sun.tools.internal.xjc.api.TypeAndAnnotation; import com.sun.tools.internal.xjc.api.XJC; -import com.sun.xml.internal.ws.spi.db.BindingContext; import com.sun.xml.internal.ws.spi.db.BindingHelper; import com.sun.xml.internal.ws.util.xml.XmlUtil; import org.xml.sax.InputSource; @@ -95,10 +95,12 @@ private JAXBModelBuilder jaxbModelBuilder; + @Override public Model buildModel() { try { parser = new WSDLParser(options, errReceiver, forest); parser.addParserListener(new ParserListener() { + @Override public void ignoringExtension(Entity entity, QName name, QName parent) { if (parent.equals(WSDLConstants.QNAME_TYPES)) { // check for a schema element with the wrong namespace URI @@ -110,23 +112,27 @@ } + @Override public void doneParsingEntity(QName element, Entity entity) { } }); document = parser.parse(); - if (document == null || document.getDefinitions() == null) + if (document == null || document.getDefinitions() == null) { return null; + } document.validateLocally(); Model model = internalBuildModel(document); - if(model == null || errReceiver.hadError()) + if (model == null || errReceiver.hadError()) { return null; + } //ClassNameCollector classNameCollector = new ClassNameCollector(); classNameCollector.process(model); if (classNameCollector.getConflictingClassNames().isEmpty()) { - if(errReceiver.hadError()) + if (errReceiver.hadError()) { return null; + } return model; } // do another pass, this time with conflict resolution enabled @@ -135,12 +141,13 @@ classNameCollector.process(model); if (classNameCollector.getConflictingClassNames().isEmpty()) { // we're done - if(errReceiver.hadError()) + if (errReceiver.hadError()) { return null; + } return model; } // give up - StringBuffer conflictList = new StringBuffer(); + StringBuilder conflictList = new StringBuilder(); boolean first = true; for (Iterator iter = classNameCollector.getConflictingClassNames().iterator(); @@ -208,7 +215,6 @@ ) { processService((com.sun.tools.internal.ws.wsdl.document.Service) iter.next(), model, document); - hasServices = true; } } else { // emit a warning if there are no service definitions @@ -276,8 +282,9 @@ return false; } } - if(soapAddress != null) + if (soapAddress != null) { port.setAddress(soapAddress.getLocation()); + } Binding binding = wsdlPort.resolveBinding(document); QName bindingName = getQNameOf(binding); PortType portType = binding.resolvePortType(document); @@ -393,7 +400,7 @@ null; Set operations = portType.getOperationsNamed(bindingOperation.getName()); - if (operations.size() == 0) { + if (operations.isEmpty()) { // the WSDL document is invalid error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(bindingOperation.getName(), binding.getName())); } else if (operations.size() == 1) { @@ -455,9 +462,9 @@ Operation operation; - if(soapBinding != null) + if (soapBinding != null) { operation = processSOAPOperation(); - else{ + } else { operation = processNonSOAPOperation(); } if (operation != null) { @@ -600,19 +607,21 @@ private void setNonSoapStyle(Message inputMessage, Message outputMessage) { SOAPStyle style = SOAPStyle.DOCUMENT; for(MessagePart part:inputMessage.getParts()){ - if(part.getDescriptorKind() == SchemaKinds.XSD_TYPE) + if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) { style = SOAPStyle.RPC; - else + } else { style = SOAPStyle.DOCUMENT; + } } //check the outputMessage parts if(outputMessage != null){ for(MessagePart part:outputMessage.getParts()){ - if(part.getDescriptorKind() == SchemaKinds.XSD_TYPE) + if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) { style = SOAPStyle.RPC; - else + } else { style = SOAPStyle.DOCUMENT; + } } } info.modelPort.setStyle(style); @@ -666,7 +675,6 @@ } info.operation = operation; - info.uniqueOperationName = uniqueOperationName; //attachment SOAPBody soapRequestBody = getSOAPRequestBody(); @@ -692,8 +700,9 @@ protected Operation processLiteralSOAPOperation(StyleAndUse styleAndUse) { //returns false if the operation name is not acceptable - if (!applyOperationNameCustomization()) + if (!applyOperationNameCustomization()) { return null; + } boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE; Message inputMessage = getInputMessage(); @@ -724,9 +733,9 @@ //ignore operation if there are more than one root part if (!validateMimeParts(getMimeParts(info.bindingOperation.getInput())) || - !validateMimeParts(getMimeParts(info.bindingOperation.getOutput()))) + !validateMimeParts(getMimeParts(info.bindingOperation.getOutput()))) { return null; - + } if (!validateBodyParts(info.bindingOperation)) { // BP 1.1 @@ -735,16 +744,18 @@ // R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), // only to wsdNl:part element(s) that have been defined using the type attribute. - if (isOperationDocumentLiteral(styleAndUse)) - if (options.isExtensionMode()) + if (isOperationDocumentLiteral(styleAndUse)) { + if (options.isExtensionMode()) { warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(info.portTypeOperation.getName())); - else + } else { error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_DOCLITOPERATION(info.portTypeOperation.getName())); - else if (isOperationRpcLiteral(styleAndUse)) { - if (options.isExtensionMode()) + } + } else if (isOperationRpcLiteral(styleAndUse)) { + if (options.isExtensionMode()) { warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(info.portTypeOperation.getName())); - else + } else { error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_RPCLITOPERATION(info.portTypeOperation.getName())); + } } return null; } @@ -753,8 +764,9 @@ List parameterList = getParameterOrder(); //binding is invalid in the wsdl, ignore the operation. - if (!setMessagePartsBinding(styleAndUse)) + if (!setMessagePartsBinding(styleAndUse)) { return null; + } List params = null; boolean unwrappable = isUnwrappable(); @@ -902,13 +914,15 @@ private boolean validateParameterName(List params) { - if (options.isExtensionMode()) + if (options.isExtensionMode()) { return true; + } Message msg = getInputMessage(); for (Parameter param : params) { - if (param.isOUT()) + if (param.isOUT()) { continue; + } if (param.getCustomName() != null) { if (Names.isJavaReservedWord(param.getCustomName())) { error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName())); @@ -935,8 +949,9 @@ if (isRequestResponse) { msg = getOutputMessage(); for (Parameter param : params) { - if (param.isIN()) + if (param.isIN()) { continue; + } if (param.getCustomName() != null) { if (Names.isJavaReservedWord(param.getCustomName())) { error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName())); @@ -946,15 +961,17 @@ } //process doclit wrapper style if (param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)) { - if (param.isReturn()) + if (param.isReturn()) { continue; + } if (!param.getName().equals("return") && Names.isJavaReservedWord(param.getName())) { error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(info.operation.getName(), param.getName(), param.getBlock().getName())); return false; } } else { - if (param.isReturn()) + if (param.isReturn()) { continue; + } //non-wrapper style and rpclit if (Names.isJavaReservedWord(param.getName())) { @@ -972,21 +989,24 @@ //first we look at binding operation JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.bindingOperation, JAXWSBinding.class); Boolean mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null; - if (mimeContentMapping != null) + if (mimeContentMapping != null) { return mimeContentMapping; + } //then in wsdl:binding Binding binding = info.port.resolveBinding(info.document); jaxwsCustomization = (JAXWSBinding) getExtensionOfType(binding, JAXWSBinding.class); mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null; - if (mimeContentMapping != null) + if (mimeContentMapping != null) { return mimeContentMapping; + } //at last look in wsdl:definitions jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.document.getDefinitions(), JAXWSBinding.class); mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null; - if (mimeContentMapping != null) + if (mimeContentMapping != null) { return mimeContentMapping; + } return false; } @@ -995,10 +1015,11 @@ String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null; if (operationName != null) { if (Names.isJavaReservedWord(operationName)) { - if (options.isExtensionMode()) + if (options.isExtensionMode()) { warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName)); - else + } else { error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName)); + } return false; } @@ -1006,10 +1027,11 @@ } if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) { - if (options.isExtensionMode()) + if (options.isExtensionMode()) { warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName())); - else + } else { error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName())); + } return false; } return true; @@ -1017,8 +1039,9 @@ protected String getAsyncOperationName(Operation operation) { String name = operation.getCustomizedName(); - if (name == null) + if (name == null) { name = operation.getUniqueName(); + } return name; } @@ -1027,28 +1050,32 @@ */ private void addAsyncOperations(Operation syncOperation, StyleAndUse styleAndUse) { Operation operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.POLLING); - if (operation != null) + if (operation != null) { info.modelPort.addOperation(operation); + } operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.CALLBACK); - if (operation != null) + if (operation != null) { info.modelPort.addOperation(operation); + } } private Operation createAsyncOperation(Operation syncOperation, StyleAndUse styleAndUse, AsyncOperationType asyncType) { boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE; - if (!isRequestResponse) + if (!isRequestResponse) { return null; + } //create async operations AsyncOperation operation = new AsyncOperation(info.operation, info.bindingOperation); //creation the async operation name: operationName+Async or customized name //operation.setName(new QName(operation.getName().getNamespaceURI(), getAsyncOperationName(info.portTypeOperation, operation))); - if (asyncType.equals(AsyncOperationType.CALLBACK)) + if (asyncType.equals(AsyncOperationType.CALLBACK)) { operation.setUniqueName(info.operation.getUniqueName() + "_async_callback"); - else if (asyncType.equals(AsyncOperationType.POLLING)) + } else if (asyncType.equals(AsyncOperationType.POLLING)) { operation.setUniqueName(info.operation.getUniqueName() + "_async_polling"); + } setDocumentationIfPresent( operation, @@ -1149,7 +1176,7 @@ //create response bean String nspace = ""; QName responseBeanName = new QName(nspace, getAsyncOperationName(info.operation) + "Response"); - JAXBType responseBeanType = jaxbModelBuilder.getJAXBType(responseBeanName); + JAXBType responseBeanType = getJAXBModelBuilder().getJAXBType(responseBeanName); if (responseBeanType == null) { error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_RESPONSEBEAN_NOTFOUND(info.operation.getName())); } @@ -1166,20 +1193,19 @@ operation.setProperty(WSDL_RESULT_PARAMETER, respParam.getName()); - List definitiveParameterList = new ArrayList(); int parameterOrderPosition = 0; for (String name : parameterList) { Parameter inParameter = ModelerUtils.getParameter(name, inParameters); if (inParameter == null) { - if (options.isExtensionMode()) + if (options.isExtensionMode()) { warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name)); - else + } else { error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_ERROR_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name)); + } return null; } request.addParameter(inParameter); inParameter.setParameterIndex(parameterOrderPosition); - definitiveParameterList.add(name); parameterOrderPosition++; } @@ -1203,25 +1229,27 @@ JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(wsdlOperation, JAXWSBinding.class); Boolean isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null; - if (isAsync != null) + if (isAsync != null) { return isAsync; + } // then into wsdl:portType - QName portTypeName = new QName(portType.getDefining().getTargetNamespaceURI(), portType.getName()); jaxwsCustomization = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class); isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null; - if (isAsync != null) + if (isAsync != null) { return isAsync; + } //then wsdl:definitions jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class); isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null; - if (isAsync != null) + if (isAsync != null) { return isAsync; + } return false; } - protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, List definitiveParameterList, boolean processRequest) { + protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, @NotNull List definitiveParameterList, boolean processRequest) { QName headerName; Block headerBlock; JAXBType jaxbType; @@ -1248,26 +1276,22 @@ Parameter parameter = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock); parameter.setParameterIndex(parameterOrderPosition); setCustomizedParameterName(info.bindingOperation, headerMessage, part, parameter, false); - if (processRequest && definitiveParameterList != null) { + if (processRequest) { request.addParameter(parameter); definitiveParameterList.add(parameter.getName()); } else { - if (definitiveParameterList != null) { - for (Iterator iterInParams = definitiveParameterList.iterator(); iterInParams.hasNext();) { - String inParamName = - (String) iterInParams.next(); - if (inParamName.equals(parameter.getName())) { - Parameter inParam = request.getParameterByName(inParamName); - parameter.setLinkedParameter(inParam); - inParam.setLinkedParameter(parameter); - //its in/out parameter, input and output parameter have the same order position. - parameter.setParameterIndex(inParam.getParameterIndex()); - } - } - if (!definitiveParameterList.contains(parameter.getName())) { - definitiveParameterList.add(parameter.getName()); + for (String inParamName : definitiveParameterList) { + if (inParamName.equals(parameter.getName())) { + Parameter inParam = request.getParameterByName(inParamName); + parameter.setLinkedParameter(inParam); + inParam.setLinkedParameter(parameter); + //its in/out parameter, input and output parameter have the same order position. + parameter.setParameterIndex(inParam.getParameterIndex()); } } + if (!definitiveParameterList.contains(parameter.getName())) { + definitiveParameterList.add(parameter.getName()); + } response.addParameter(parameter); } parameterOrderPosition++; @@ -1311,7 +1335,6 @@ Fault fault = new Fault(faultName, portTypeFault); fault.setWsdlFaultName(portTypeFault.getName()); setDocumentationIfPresent(fault, portTypeFault.getDocumentation()); - String faultNamespaceURI = null; if (bindingFault != null) { //get the soapbind:fault from wsdl:fault in the binding SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class); @@ -1328,10 +1351,11 @@ //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal" if (!soapFault.isLiteral()) { - if (options.isExtensionMode()) + if (options.isExtensionMode()) { warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName())); - else + } else { error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName())); + } continue; } @@ -1344,10 +1368,6 @@ warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName())); } - faultNamespaceURI = soapFault.getNamespace(); - } - if (faultNamespaceURI == null) { - faultNamespaceURI = portTypeFault.getMessage().getNamespaceURI(); } com.sun.tools.internal.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document); @@ -1371,7 +1391,11 @@ } if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) { - error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName())); + if (options.isExtensionMode()) { + warning(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName())); + } else { + error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName())); + } } JAXBType jaxbType = getJAXBType(faultPart); @@ -1383,8 +1407,9 @@ fault.setBlock(faultBlock); //createParentFault(fault); //createSubfaults(fault); - if (!response.getFaultBlocksMap().containsKey(faultBlock.getName())) + if (!response.getFaultBlocksMap().containsKey(faultBlock.getName())) { response.addFaultBlock(faultBlock); + } info.operation.addFault(fault); } } @@ -1403,21 +1428,22 @@ protected boolean setMessagePartsBinding(StyleAndUse styleAndUse) { SOAPBody inBody = getSOAPRequestBody(); Message inMessage = getInputMessage(); - if (!setMessagePartsBinding(inBody, inMessage, styleAndUse, true)) + if (!setMessagePartsBinding(inBody, inMessage, styleAndUse, true)) { return false; + } if (isRequestResponse()) { SOAPBody outBody = getSOAPResponseBody(); Message outMessage = getOutputMessage(); - if (!setMessagePartsBinding(outBody, outMessage, styleAndUse, false)) + if (!setMessagePartsBinding(outBody, outMessage, styleAndUse, false)) { return false; + } } return true; } //returns false if the wsdl is invalid and operation should be ignored protected boolean setMessagePartsBinding(SOAPBody body, Message message, StyleAndUse styleAndUse, boolean isInput) { - List parts = new ArrayList(); //get Mime parts List mimeParts; @@ -1448,10 +1474,11 @@ if (mimeParts.contains(mPart) || headerParts.contains(mPart) || boundToFault(mPart.getName())) { //throw error that a part cant be bound multiple times, not ignoring operation, if there //is conflict it will fail latter - if (options.isExtensionMode()) + if (options.isExtensionMode()) { warning(mPart, ModelerMessages.WSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName())); - else + } else { error(mPart, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName())); + } } bodyParts.add(mPart); } @@ -1462,23 +1489,21 @@ MessagePart mPart = (MessagePart) iter.next(); if (mimeParts.contains(mPart)) { mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING); - parts.add(mPart); } else if (headerParts.contains(mPart)) { mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING); - parts.add(mPart); } else if (bodyParts.contains(mPart)) { mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING); - parts.add(mPart); } else { mPart.setBindingExtensibilityElementKind(MessagePart.PART_NOT_BOUNDED); } } if (isOperationDocumentLiteral(styleAndUse) && bodyParts.size() > 1) { - if (options.isExtensionMode()) + if (options.isExtensionMode()) { warning(message, ModelerMessages.WSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName())); - else + } else { error(message, ModelerMessages.WSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName())); + } return false; } return true; @@ -1486,8 +1511,9 @@ private boolean boundToFault(String partName) { for (BindingFault bindingFault : info.bindingOperation.faults()) { - if (partName.equals(bindingFault.getName())) + if (partName.equals(bindingFault.getName())) { return true; + } } return false; } @@ -1518,8 +1544,9 @@ List headers = getHeaderParts(bindingOperation, isInput); for(MessagePart part: headers){ - if(parts.contains(part)) + if (parts.contains(part)) { continue; + } headerParts.add(part); } return headerParts; @@ -1542,15 +1569,18 @@ Iterator headers = getHeaderExtensions(ext).iterator(); while (headers.hasNext()) { SOAPHeader header = headers.next(); - if (!header.isLiteral()) + if (!header.isLiteral()) { continue; + } com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(), document); - if (headerMessage == null) + if (headerMessage == null) { continue; + } MessagePart headerPart = headerMessage.getPart(header.getPart()); - if (headerPart == part) + if (headerPart == part) { return headerMessage; + } } return null; } @@ -1584,7 +1614,11 @@ error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName())); } if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) { - error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); + if (options.isExtensionMode()) { + warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); + } else { + error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); + } } part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING); parts.add(part); @@ -1608,7 +1642,7 @@ JAXBType type; QName name = part.getDescriptor(); if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) { - type = jaxbModelBuilder.getJAXBType(name); + type = getJAXBModelBuilder().getJAXBType(name); if(type == null){ error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName())); } @@ -1625,8 +1659,9 @@ } private List getDoclitParameters(Request req, Response res, List parameterList) { - if (parameterList.size() == 0) + if (parameterList.isEmpty()) { return new ArrayList(); + } List params = new ArrayList(); Message inMsg = getInputMessage(); Message outMsg = getOutputMessage(); @@ -1651,15 +1686,14 @@ res.addBodyBlock(block); } } else if (ModelerUtils.isUnbound(part)) { - if (part.isIN()) + if (part.isIN()) { req.addUnboundBlock(block); - else if (part.isOUT()) + } else if (part.isOUT()) { res.addUnboundBlock(block); - else if (part.isINOUT()) { + } else if (part.isINOUT()) { req.addUnboundBlock(block); res.addUnboundBlock(block); } - } if (part.isIN() || part.isINOUT()) { params = ModelerUtils.createUnwrappedParameters(jaxbStructType, block); @@ -1756,10 +1790,11 @@ param.setParameterIndex(pIndex++); } - if (part.isIN()) + if (part.isIN()) { setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, false); - else if (outMsg != null) + } else if (outMsg != null) { setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, false); + } params.add(param); } @@ -1807,8 +1842,9 @@ S2JJAXBModel jaxbModel = ((RpcLitStructure) reqBlock.getType()).getJaxbModel().getS2JJAXBModel(); List inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel, errReceiver); List outParams = null; - if (outMsg != null) + if (outMsg != null) { outParams = ModelerUtils.createRpcLitParameters(outMsg, resBlock, jaxbModel, errReceiver); + } //create parameters for header and mime parts int index = 0; @@ -1835,12 +1871,13 @@ } } else if (ModelerUtils.isBoundToMimeContent(part)) { List mimeContents; - if (part.isIN() || part.isINOUT()) + if (part.isIN() || part.isINOUT()) { mimeContents = getMimeContents(info.bindingOperation.getInput(), getInputMessage(), part.getName()); - else + } else { mimeContents = getMimeContents(info.bindingOperation.getOutput(), getOutputMessage(), part.getName()); + } JAXBType type = getAttachmentType(mimeContents, part); //create Parameters in request or response @@ -1892,10 +1929,11 @@ } } for (Parameter param : params) { - if (param.isIN()) + if (param.isIN()) { setCustomizedParameterName(info.portTypeOperation, inMsg, inMsg.getPart(param.getName()), param, false); - else if (outMsg != null) + } else if (outMsg != null) { setCustomizedParameterName(info.portTypeOperation, outMsg, outMsg.getPart(param.getName()), param, false); + } } return params; } @@ -1903,8 +1941,9 @@ private List getRequestParameters(Request request, List parameterList) { Message inputMessage = getInputMessage(); //there is no input message, return zero parameters - if (inputMessage != null && !inputMessage.parts().hasNext()) + if (inputMessage != null && !inputMessage.parts().hasNext()) { return new ArrayList(); + } List inParameters = null; QName reqBodyName; @@ -1915,8 +1954,9 @@ //setup request parameters for (String inParamName : parameterList) { MessagePart part = inputMessage.getPart(inParamName); - if (part == null) + if (part == null) { continue; + } reqBodyName = part.getDescriptor(); jaxbReqType = getJAXBType(part); if (unwrappable) { @@ -1949,8 +1989,9 @@ } else if (ModelerUtils.isUnbound(part)) { request.addUnboundBlock(reqBlock); } - if (inParameters == null) + if (inParameters == null) { inParameters = new ArrayList(); + } Parameter param = ModelerUtils.createParameter(part.getName(), jaxbReqType, reqBlock); setCustomizedParameterName(info.portTypeOperation, inputMessage, part, param, false); inParameters.add(param); @@ -1966,25 +2007,29 @@ */ private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) { JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class); - if (jaxwsBinding == null) + if (jaxwsBinding == null) { return; + } String paramName = part.getName(); QName elementName = part.getDescriptor(); - if (wrapperStyle) + if (wrapperStyle) { elementName = param.getType().getName(); + } String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle); if (customName != null && !customName.equals("")) { param.setCustomName(customName); } } + @Override protected boolean isConflictingPortClassName(String name) { return false; } protected boolean isUnwrappable() { - if (!getWrapperStyleCustomization()) + if (!getWrapperStyleCustomization()) { return false; + } com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage(); com.sun.tools.internal.ws.wsdl.document.Message outputMessage = getOutputMessage(); @@ -2006,14 +2051,16 @@ // is equal to the operation name // Wrapper style if the output message part refers to a global element declaration if ((inputPart != null && !inputPart.getDescriptor().getLocalPart().equals(operationName)) || - (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT)) + (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT)) { return false; + } //check to see if either input or output message part not bound to soapbing:body //in that case the operation is not wrapper style if (((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) || - ((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING))) + ((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING))) { return false; + } // Wrapper style if the elements referred to by the input and output message parts // (henceforth referred to as wrapper elements) are both complex types defined @@ -2034,8 +2081,9 @@ return inputWrappable; } JAXBType outputType = getJAXBType(outputPart); - if ((inputType != null) && (outputType != null)) + if ((inputType != null) && (outputType != null)) { return inputType.isUnwrappable() && outputType.isUnwrappable(); + } } return false; @@ -2047,8 +2095,9 @@ JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeOperation, JAXWSBinding.class); if (jaxwsBinding != null) { Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle(); - if (isWrappable != null) + if (isWrappable != null) { return isWrappable; + } } //then into wsdl:portType @@ -2056,16 +2105,18 @@ jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class); if (jaxwsBinding != null) { Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle(); - if (isWrappable != null) + if (isWrappable != null) { return isWrappable; + } } //then wsdl:definitions jaxwsBinding = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class); if (jaxwsBinding != null) { Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle(); - if (isWrappable != null) + if (isWrappable != null) { return isWrappable; + } } return true; } @@ -2083,8 +2134,9 @@ Iterator iter = getInputMessage().parts(); while (iter.hasNext()) { MessagePart part = (MessagePart) iter.next(); - if (outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor())) + if (outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor())) { return true; + } } } else if (soapOperation != null && soapOperation.isRPC() || info.soapBinding.isRPC()) { com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage(); @@ -2105,11 +2157,13 @@ //create parameters for header and mime parts for (String paramName : parameterList) { MessagePart part = message.getPart(paramName); - if (part == null) + if (part == null) { continue; + } if (ModelerUtils.isBoundToSOAPHeader(part)) { - if (parameters == null) + if (parameters == null) { parameters = new ArrayList(); + } QName headerName = part.getDescriptor(); JAXBType jaxbType = getJAXBType(part); Block headerBlock = new Block(headerName, jaxbType, part); @@ -2119,8 +2173,9 @@ parameters.add(param); } } else if (ModelerUtils.isBoundToMimeContent(part)) { - if (parameters == null) + if (parameters == null) { parameters = new ArrayList(); + } List mimeContents = getMimeContents(info.bindingOperation.getInput(), getInputMessage(), paramName); @@ -2134,8 +2189,9 @@ parameters.add(param); } } else if (ModelerUtils.isUnbound(part)) { - if (parameters == null) + if (parameters == null) { parameters = new ArrayList(); + } QName name = part.getDescriptor(); JAXBType type = getJAXBType(part); Block unboundBlock = new Block(name, type, part); @@ -2186,10 +2242,8 @@ if(typeAnno == null){ error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(part.getDescriptor(), part.getName())); } - for (Iterator mimeTypeIter = mimeTypes.iterator(); mimeTypeIter.hasNext();) { - String mimeType = (String) mimeTypeIter.next(); - if ((!mimeType.equals("text/xml") && - !mimeType.equals("application/xml"))) { + for (String mimeType : mimeTypes) { + if ((!mimeType.equals("text/xml") && !mimeType.equals("application/xml"))) { //According to AP 1.0, //RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a //global element declaration (via the element attribute of the wsdl:part @@ -2210,13 +2264,13 @@ } protected void buildJAXBModel(WSDLDocument wsdlDocument) { - JAXBModelBuilder jaxbModelBuilder = new JAXBModelBuilder(options, classNameCollector, forest, errReceiver); + JAXBModelBuilder tempJaxbModelBuilder = new JAXBModelBuilder(options, classNameCollector, forest, errReceiver); //set the java package where wsdl artifacts will be generated //if user provided package name using -p switch (or package property on wsimport ant task) //ignore the package customization in the wsdl and schema bidnings //formce the -p option only in the first pass if (explicitDefaultPackage != null) { - jaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(options.defaultPackage); + tempJaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(options.defaultPackage); } else { options.defaultPackage = getJavaPackage(); } @@ -2224,10 +2278,10 @@ //create pseudo schema for async operations(if any) response bean List schemas = PseudoSchemaBuilder.build(this, options, errReceiver); for (InputSource schema : schemas) { - jaxbModelBuilder.getJAXBSchemaCompiler().parseSchema(schema); + tempJaxbModelBuilder.getJAXBSchemaCompiler().parseSchema(schema); } - jaxbModelBuilder.bind(); - this.jaxbModelBuilder = jaxbModelBuilder; + tempJaxbModelBuilder.bind(); + this.jaxbModelBuilder = tempJaxbModelBuilder; } protected String getJavaPackage() { @@ -2270,8 +2324,9 @@ for (JavaParameter jParam : operation.getJavaMethod().getParametersList()) { Parameter param = jParam.getParameter(); - if (param.getCustomName() != null) + if (param.getCustomName() != null) { jParam.setName(param.getCustomName()); + } } } @@ -2283,8 +2338,9 @@ JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(wsdlService, JAXWSBinding.class); if (jaxwsCust != null && jaxwsCust.getClassName() != null) { CustomName name = jaxwsCust.getClassName(); - if (name != null && !name.getName().equals("")) + if (name != null && !name.getName().equals("")) { return makePackageQualified(name.getName()); + } } return makePackageQualified(BindingHelper.mangleNameToClassName(serviceName)); } @@ -2323,28 +2379,13 @@ JavaInterface intf) { String candidateName = getJavaNameForOperation(operation); JavaMethod method = new JavaMethod(candidateName, options, errReceiver); - Request request = operation.getRequest(); - Iterator requestBodyBlocks = request.getBodyBlocks(); - Block requestBlock = - (requestBodyBlocks.hasNext() - ? request.getBodyBlocks().next() - : null); + assert (operation.getRequest() != null); Response response = operation.getResponse(); - Iterator responseBodyBlocks = null; - Block responseBlock; - if (response != null) { - responseBodyBlocks = response.getBodyBlocks(); - responseBlock = - responseBodyBlocks.hasNext() - ? response.getBodyBlocks().next() - : null; - } // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we // detect overloading conflicts in the generated java interface/classes - String signature = candidateName; - for (Iterator iter = request.getParameters(); iter.hasNext();) { + for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) { Parameter parameter = (Parameter) iter.next(); if (parameter.getJavaParameter() != null) { @@ -2364,7 +2405,6 @@ method.addParameter(javaParameter); parameter.setJavaParameter(javaParameter); - signature += "%" + parameterType.getName(); } if (response != null) { @@ -2390,7 +2430,6 @@ } String candidateName = getJavaNameForOperation(operation); JavaMethod method = new JavaMethod(candidateName, options, errReceiver); - Request request = operation.getRequest(); Parameter returnParam = (Parameter) operation.getProperty(WSDL_RESULT_PARAMETER); if (returnParam != null) { JavaType parameterType = returnParam.getType().getJavaType(); @@ -2514,7 +2553,7 @@ protected List getParameterOrder() { List params = new ArrayList(); String parameterOrder = info.portTypeOperation.getParameterOrder(); - java.util.List parameterList = new ArrayList(); + java.util.List parameterList; boolean parameterOrderPresent = false; if ((parameterOrder != null) && !(parameterOrder.trim().equals(""))) { parameterList = XmlUtil.parseTokenList(parameterOrder); @@ -2636,7 +2675,6 @@ } //parameterOrder attribute is not valid, we ignore it warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(info.operation.getName().getLocalPart())); - parameterOrderPresent = false; parameterList.clear(); } @@ -2660,8 +2698,9 @@ //append the out parts to the parameterList for (MessagePart part : outParts) { - if (outParts.size() == 1) + if (outParts.size() == 1) { part.setReturn(true); + } params.add(part); } } @@ -2678,6 +2717,7 @@ return options.defaultPackage + "." + prefix + suffix; } + @Override protected boolean isConflictingServiceClassName(String name) { return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name) || conflictsWithExceptionClass(name); } @@ -2697,6 +2737,7 @@ return exceptionNames != null && exceptionNames.contains(name); } + @Override protected boolean isConflictingExceptionClassName(String name) { return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name); } @@ -2710,15 +2751,17 @@ (SOAPBinding) getExtensionOfType(binding, SOAPBinding.class); //dont process the binding - if (soapBinding == null) - soapBinding = - (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class); - if (soapBinding == null) + if (soapBinding == null) { + soapBinding = (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class); + } + if (soapBinding == null) { return false; + } //if soapbind:binding has no style attribute, the default is DOCUMENT - if (soapBinding.getStyle() == null) + if (soapBinding.getStyle() == null) { soapBinding.setStyle(SOAPStyle.DOCUMENT); + } SOAPStyle opStyle = soapBinding.getStyle(); for (Iterator iter = binding.operations(); iter.hasNext();) { @@ -2730,8 +2773,9 @@ if (soapOperation != null) { SOAPStyle currOpStyle = (soapOperation.getStyle() != null) ? soapOperation.getStyle() : soapBinding.getStyle(); //dont check for the first operation - if (!currOpStyle.equals(opStyle)) + if (!currOpStyle.equals(opStyle)) { return false; + } } } return true; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java 2013-04-04 15:26:22.820612076 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java 2013-04-04 15:26:22.768612076 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,7 +32,6 @@ import com.sun.tools.internal.ws.processor.model.Operation; import com.sun.tools.internal.ws.processor.model.Port; import com.sun.tools.internal.ws.processor.model.java.JavaException; -import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator; import com.sun.tools.internal.ws.processor.modeler.Modeler; import com.sun.tools.internal.ws.resources.ModelerMessages; import com.sun.tools.internal.ws.wscompile.AbortException; @@ -49,10 +48,8 @@ import com.sun.tools.internal.ws.wsdl.framework.Entity; import com.sun.tools.internal.ws.wsdl.framework.GloballyKnown; import com.sun.tools.internal.ws.wsdl.framework.NoSuchEntityException; -import com.sun.tools.internal.ws.wsdl.parser.DOMForest; import com.sun.tools.internal.ws.wsdl.parser.WSDLParser; import com.sun.tools.internal.ws.wsdl.parser.MetadataFinder; -import com.sun.xml.internal.ws.spi.db.BindingContext; import com.sun.xml.internal.ws.spi.db.BindingHelper; import org.xml.sax.helpers.LocatorImpl; @@ -84,8 +81,9 @@ * @param wsdlPort */ protected void applyPortMethodCustomization(Port port, com.sun.tools.internal.ws.wsdl.document.Port wsdlPort) { - if(isProvider(wsdlPort)) + if (isProvider(wsdlPort)) { return; + } JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(wsdlPort, JAXWSBinding.class); String portMethodName = (jaxwsBinding != null)?((jaxwsBinding.getMethodName() != null)?jaxwsBinding.getMethodName().getName():null):null; @@ -108,8 +106,9 @@ JAXWSBinding jaxwsGlobalCustomization = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class); isProvider = (jaxwsGlobalCustomization != null)?jaxwsGlobalCustomization.isProvider():null; - if(isProvider != null) + if (isProvider != null) { return isProvider; + } return false; } @@ -157,8 +156,9 @@ } protected com.sun.tools.internal.ws.wsdl.document.Message getOutputMessage() { - if (info.portTypeOperation.getOutput() == null) + if (info.portTypeOperation.getOutput() == null) { return null; + } return info.portTypeOperation.getOutput().resolveMessage(info.document); } @@ -180,10 +180,11 @@ //get Mime parts List mimeParts; - if(isInput) + if (isInput) { mimeParts = getMimeContentParts(message, info.bindingOperation.getInput()); - else + } else { mimeParts = getMimeContentParts(message, info.bindingOperation.getOutput()); + } if (bodyParts != null) { StringTokenizer in = new StringTokenizer(bodyParts.trim(), " "); @@ -198,17 +199,18 @@ } } else { for (MessagePart mPart : message.getParts()) { - if (!mimeParts.contains(mPart)) + if (!mimeParts.contains(mPart)) { mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING); + } partsList.add(mPart); } } for (MessagePart mPart : message.getParts()) { - if(mimeParts.contains(mPart)) { + if (mimeParts.contains(mPart)) { mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING); parts.add(mPart); - }else if(partsList.contains(mPart)) { + } else if(partsList.contains(mPart)) { mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING); parts.add(mPart); } @@ -226,8 +228,9 @@ for (MIMEPart mimePart : getMimeParts(ext)) { MessagePart part = getMimeContentPart(message, mimePart); - if (part != null) + if (part != null) { mimeContentParts.add(part); + } } return mimeContentParts; } @@ -250,8 +253,9 @@ mimeContents.add((MIMEContent) obj); } } - if(!validateMimeContentPartNames(mimeContents)) + if (!validateMimeContentPartNames(mimeContents)) { return false; + } if(mPart.getName() != null) { warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(info.portTypeOperation.getName())); } @@ -281,8 +285,9 @@ // String mimeType = null; for(MIMEContent mimeContent:mimeContents){ String mimeType = getMimeContentType(mimeContent); - if(!mimeTypes.contains(mimeType)) + if (!mimeTypes.contains(mimeType)) { mimeTypes.add(mimeType); + } } return mimeTypes; } @@ -432,8 +437,9 @@ */ private boolean isRootPart(MIMEPart part) { for (TWSDLExtension twsdlExtension : part.extensions()) { - if (twsdlExtension instanceof SOAPBody) + if (twsdlExtension instanceof SOAPBody) { return true; + } } return false; } @@ -506,13 +512,15 @@ info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE; List inputParts = getMessageParts(getSOAPRequestBody(), getInputMessage(), true); - if(!validateStyleAndPart(operation, inputParts)) + if (!validateStyleAndPart(operation, inputParts)) { return false; + } if(isRequestResponse){ List outputParts = getMessageParts(getSOAPResponseBody(), getOutputMessage(), false); - if(!validateStyleAndPart(operation, outputParts)) + if (!validateStyleAndPart(operation, outputParts)) { return false; + } } return true; } @@ -526,8 +534,9 @@ (SOAPOperation) getExtensionOfType(operation, SOAPOperation.class); for (MessagePart part : parts) { if (part.getBindingExtensibilityElementKind() == MessagePart.SOAP_BODY_BINDING) { - if (!isStyleAndPartMatch(soapOperation, part)) + if (!isStyleAndPartMatch(soapOperation, part)) { return false; + } } } return true; @@ -538,8 +547,9 @@ QName memberName = fault.getElementName(); javaMemberName = fault.getJavaMemberName(); - if (javaMemberName == null) + if (javaMemberName == null) { javaMemberName = memberName.getLocalPart(); + } return javaMemberName; } @@ -553,8 +563,9 @@ for (MIMEPart mimePart : getMimeParts(ext)) { List mimeContents = getMimeContents(mimePart); for (MIMEContent mimeContent : mimeContents) { - if (mimeContent.getPart().equals(name)) + if (mimeContent.getPart().equals(name)) { return mimeContents; + } } } return null; @@ -605,8 +616,9 @@ protected TWSDLExtension getAnyExtensionOfType( TWSDLExtensible extensible, Class type) { - if(extensible == null) + if (extensible == null) { return null; + } for (TWSDLExtension extension:extensible.extensions()) { if(extension.getClass().equals(type)) { return extension; @@ -616,8 +628,9 @@ for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) { //bug fix: 5024001 TWSDLExtension extn = getExtensionOfType(part, type); - if (extn != null) + if (extn != null) { return extn; + } } } } @@ -660,11 +673,11 @@ protected String getUniqueClassName(String className) { int cnt = 2; String uniqueName = className; - while (reqResNames.contains(uniqueName.toLowerCase())) { + while (reqResNames.contains(uniqueName.toLowerCase(Locale.ENGLISH))) { uniqueName = className + cnt; cnt++; } - reqResNames.add(uniqueName.toLowerCase()); + reqResNames.add(uniqueName.toLowerCase(Locale.ENGLISH)); return uniqueName; } @@ -700,19 +713,22 @@ protected void warning(Entity entity, String message){ //avoid duplicate warning for the second pass - if(numPasses > 1) + if (numPasses > 1) { return; - if(entity == null) + } + if (entity == null) { errReceiver.warning(null, message); - else + } else { errReceiver.warning(entity.getLocator(), message); + } } protected void error(Entity entity, String message){ - if(entity == null) + if (entity == null) { errReceiver.error(null, message); - else + } else { errReceiver.error(entity.getLocator(), message); + } throw new AbortException(); } @@ -732,11 +748,10 @@ protected Map _javaExceptions; protected Map _faultTypeToStructureMap; protected Map _bindingNameToPortMap; - protected boolean useWSIBasicProfile = true; private final Set reqResNames = new HashSet(); - public class ProcessSOAPOperationInfo { + public static class ProcessSOAPOperationInfo { public ProcessSOAPOperationInfo( Port modelPort, @@ -768,18 +783,8 @@ // additional data public Operation operation; - public String uniqueOperationName; } - public static class WSDLExceptionInfo { - public String exceptionType; - public QName wsdlMessage; - public String wsdlMessagePartName; - public HashMap constructorOrder; // mapping of element name to - // constructor order (of type Integer) - } - - protected WSDLParser parser; protected WSDLDocument document; protected static final LocatorImpl NULL_LOCATOR = new LocatorImpl(); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java 2013-04-04 15:26:23.132612081 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java 2013-04-04 15:26:23.072612081 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +144,6 @@ _exceptions.add(fault.getJavaException()); addExceptionClassName(fault.getJavaException().getName()); - if (fault.getParentFault() != null) { - preVisit(fault.getParentFault()); - } for (Iterator iter = fault.getSubfaults(); iter != null && iter.hasNext();) { --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java 2013-04-04 15:26:23.376612085 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java 2013-04-04 15:26:23.324612084 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -96,12 +96,10 @@ } - private static void ensureDirectory(File dir) - throws GeneratorException { - + private static void ensureDirectory(File dir) throws GeneratorException { if (!dir.exists()) { - dir.mkdirs(); - if (!dir.exists()) { + boolean created = dir.mkdirs(); + if (!created || !dir.exists()) { throw new GeneratorException("generator.cannot.create.dir", dir.getAbsolutePath()); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/IndentingWriter.java 2013-04-04 15:26:23.612612089 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/IndentingWriter.java 2013-04-04 15:26:23.560612088 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java 2013-04-04 15:26:23.836612092 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java 2013-04-04 15:26:23.784612091 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java 2013-04-04 15:26:24.080612096 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java 2013-04-04 15:26:24.024612095 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java 2013-04-04 15:26:24.292612100 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java 2013-04-04 15:26:24.240612098 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ModelMessages.java 2013-04-04 15:26:24.512612103 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ModelMessages.java 2013-04-04 15:26:24.460612102 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ModelerMessages.java 2013-04-04 15:26:24.748612106 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ModelerMessages.java 2013-04-04 15:26:24.696612106 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** @@ -460,6 +459,18 @@ return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(arg0, arg1)); } + public static Localizable localizableWSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(Object arg0, Object arg1) { + return messageFactory.getMessage("wsdlmodeler.warning.memberSubmissionAddressingUsed", arg0, arg1); + } + + /** + * obsolete addressing version 08-2004:"{0}" used; version "{1}" should be used instead. + * + */ + public static String WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(Object arg0, Object arg1) { + return localizer.localize(localizableWSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(arg0, arg1)); + } + public static Localizable localizableWSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) { return messageFactory.getMessage("wsdlmodeler.warning.bindingOperation.multiplePartBinding", arg0, arg1); } @@ -988,6 +999,18 @@ return localizer.localize(localizableWSDLMODELER_WARNING_R_2716_R_2726(arg0, arg1)); } + public static Localizable localizableWSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(Object arg0, Object arg1) { + return messageFactory.getMessage("wsdlmodeler.invalid.ignoringMemberSubmissionAddressing", arg0, arg1); + } + + /** + * ignoring wsa:Action attribute since obsolete addressing version 08-2004:"{0}" used; expecting addressing version "{1}". To use version 08-2004 anyway run wsimport with -extension switch. + * + */ + public static String WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(Object arg0, Object arg1) { + return localizer.localize(localizableWSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(arg0, arg1)); + } + public static Localizable localizableWSDLMODELER_WARNING_NO_SOAP_ADDRESS(Object arg0) { return messageFactory.getMessage("wsdlmodeler.warning.noSOAPAddress", arg0); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java 2013-04-04 15:26:24.996612111 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java 2013-04-04 15:26:24.948612110 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 +23,10 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/UtilMessages.java 2013-04-04 15:26:25.204612114 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/UtilMessages.java 2013-04-04 15:26:25.156612113 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java 2013-04-04 15:26:25.416612117 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java 2013-04-04 15:26:25.368612116 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** @@ -700,6 +699,18 @@ return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(arg0, arg1, arg2)); } + public static Localizable localizableWEBSERVICEAP_PARSING_JAVAC_OPTIONS_ERROR() { + return messageFactory.getMessage("webserviceap.parsing.javac.options.error"); + } + + /** + * Can't get javac options from processingEnv. + * + */ + public static String WEBSERVICEAP_PARSING_JAVAC_OPTIONS_ERROR() { + return localizer.localize(localizableWEBSERVICEAP_PARSING_JAVAC_OPTIONS_ERROR()); + } + public static Localizable localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) { return messageFactory.getMessage("webservice.encoded.not.supported", arg0, arg1); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WscompileMessages.java 2013-04-04 15:26:25.664612121 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WscompileMessages.java 2013-04-04 15:26:25.612612120 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** @@ -213,7 +212,7 @@ } /** - * You are running on JDK6 which comes with JAX-WS {0} API, but this tool requires JAX-WS {1} API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or use -Xendorsed option. + * You are running on JDK6 which comes with JAX-WS {0} API, but this tool requires JAX-WS {1} API. Use the endorsed standards override mechanism (http://docs.oracle.com/javase/6/docs/technotes/guides/standards/), or use -Xendorsed option. * */ public static String INVOKER_NEED_ENDORSED(Object arg0, Object arg1) { @@ -331,7 +330,8 @@ * result in applications that are not portable or * may not interoperate with other implementations * -help display help - * -httpproxy:: specify a HTTP proxy server (port defaults to 8080) + * -httpproxy: set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort + * (port defaults to 8080) * -keep keep generated files * -p specifies the target package * -quiet suppress wsimport output @@ -568,7 +568,7 @@ } /** - * You are running on JDK6 which comes with JAX-WS {0} API, but this tool requires JAX-WS {1} API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on <{2}>. + * You are running on JDK6 which comes with JAX-WS {0} API, but this tool requires JAX-WS {1} API. Use the endorsed standards override mechanism (http://docs.oracle.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on <{2}>. * */ public static String WRAPPER_TASK_NEED_ENDORSED(Object arg0, Object arg1, Object arg2) { @@ -910,6 +910,18 @@ return localizer.localize(localizableWSIMPORT_ILLEGAL_TARGET_VERSION(arg0)); } + public static Localizable localizableWSIMPORT_ILLEGAL_PROXY(Object arg0) { + return messageFactory.getMessage("wsimport.ILLEGAL_PROXY", arg0); + } + + /** + * "{0}" is not a valid proxy format. The format is [user[:password]@]proxyHost:proxyPort + * + */ + public static String WSIMPORT_ILLEGAL_PROXY(Object arg0) { + return localizer.localize(localizableWSIMPORT_ILLEGAL_PROXY(arg0)); + } + public static Localizable localizableWSGEN_PORTNAME_MISSING_LOCALNAME(Object arg0) { return messageFactory.getMessage("wsgen.portname.missing.localname", arg0); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WsdlMessages.java 2013-04-04 15:26:25.880612124 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WsdlMessages.java 2013-04-04 15:26:25.828612123 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.tools.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** @@ -730,6 +729,18 @@ return localizer.localize(localizablePARSING_WSDL_NOT_DEFAULT_NAMESPACE(arg0)); } + public static Localizable localizablePARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(Object arg0, Object arg1) { + return messageFactory.getMessage("parsing.unknownExtensibilityElementOrAttribute", arg0, arg1); + } + + /** + * unknown extensibility element or attribute "{0}" (in namespace "{1}") + * + */ + public static String PARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(Object arg0, Object arg1) { + return localizer.localize(localizablePARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(arg0, arg1)); + } + public static Localizable localizableVALIDATION_DUPLICATED_ELEMENT(Object arg0) { return messageFactory.getMessage("validation.duplicatedElement", arg0); } @@ -927,7 +938,7 @@ } /** - * failed.noservice=Could not find wsdl:service in the provided WSDL(s): + * Could not find wsdl:service in the provided WSDL(s): * * {0} At least one WSDL with at least one service definition needs to be provided. * --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/configuration.properties 2013-04-04 15:26:26.108612128 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/configuration.properties 2013-04-04 15:26:26.056612127 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/generator.properties 2013-04-04 15:26:26.336612131 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/generator.properties 2013-04-04 15:26:26.284612131 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/javacompiler.properties 2013-04-04 15:26:26.572612135 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/javacompiler.properties 2013-04-04 15:26:26.520612134 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/model.properties 2013-04-04 15:26:26.828612139 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/model.properties 2013-04-04 15:26:26.772612138 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/modeler.properties 2013-04-04 15:26:27.084612143 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/modeler.properties 2013-04-04 15:26:27.032612142 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 @@ -106,6 +106,8 @@ wsdlmodeler.warning.ignoringOperation.cannotHandleElementMessagePart=ignoring operation \"{0}\": message part does not refer to a schema type declaration wsdlmodeler.invalid.rpclitoperation=Invalid wsdl:operation \"{0}\": its a rpc-literal operation, message part must refer to a schema type declaration +wsdlmodeler.invalid.ignoringMemberSubmissionAddressing=ignoring wsa:Action attribute since obsolete addressing version 08-2004:\"{0}\" used; expecting addressing version \"{1}\". To use version 08-2004 anyway run wsimport with -extension switch. +wsdlmodeler.warning.memberSubmissionAddressingUsed=obsolete addressing version 08-2004:\"{0}\" used; version \"{1}\" should be used instead. wsdlmodeler.warning.ignoringOperation.cannotHandleDocumentStyle=ignoring operation \"{0}\": cannot handle document-style operations wsdlmodeler.warning.bindingOperation.multiplePartBinding=Check the abstract operation \"{0}\" binding, part \"{1}\" has multiple binding. Will try to generated artifacts anyway... --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/processor.properties 2013-04-04 15:26:27.308612147 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/processor.properties 2013-04-04 15:26:27.252612145 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/util.properties 2013-04-04 15:26:27.552612150 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/util.properties 2013-04-04 15:26:27.496612149 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/webserviceap.properties 2013-04-04 15:26:27.764612154 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/webserviceap.properties 2013-04-04 15:26:27.712612153 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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,3 +158,5 @@ webserviceap.webservice.and.webserviceprovider=Classes cannot be annotated with both @javax.jws.WebService and @javax.xml.ws.WebServiceProvider. Class\: {0} webserviceap.invalid.soapbinding.parameterstyle= Incorrect usage of Annotation {0} on {1}, ParameterStyle can only be WRAPPED with RPC Style Web service. + +webserviceap.parsing.javac.options.error=Can't get javac options from processingEnv. --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wscompile.properties 2013-04-04 15:26:27.992612157 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wscompile.properties 2013-04-04 15:26:27.940612156 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 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 @@ -40,7 +40,8 @@ \ result in applications that are not portable or\n\ \ may not interoperate with other implementations\n\ \ -help display help\n\ -\ -httpproxy:: specify a HTTP proxy server (port defaults to 8080)\n\ +\ -httpproxy: set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort\n\ +\ (port defaults to 8080)\n\ \ -keep keep generated files\n\ \ -p specifies the target package\n\ \ -quiet suppress wsimport output\n\ @@ -133,7 +134,7 @@ wrapperTask.needEndorsed=\ You are running on JDK6 which comes with JAX-WS {0} API, but this tool requires JAX-WS {1} API. \ -Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), \ +Use the endorsed standards override mechanism (http://docs.oracle.com/javase/6/docs/technotes/guides/standards/), \ or set xendorsed="true" on <{2}>. # {0}, {2} - version (e.g. 2.1), {1} - absolute class location @@ -142,7 +143,7 @@ invoker.needEndorsed=\ You are running on JDK6 which comes with JAX-WS {0} API, but this tool requires JAX-WS {1} API. \ -Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), \ +Use the endorsed standards override mechanism (http://docs.oracle.com/javase/6/docs/technotes/guides/standards/), \ or use -Xendorsed option. @@ -205,6 +206,9 @@ wsimport.ILLEGAL_AUTH_INFO = \ "{0}" is not a valid authorization information format. The format is http[s]://user:password@host:port//. +wsimport.ILLEGAL_PROXY = \ + "{0}" is not a valid proxy format. The format is [user[:password]@]proxyHost:proxyPort + wsimport.readingAuthFile = \ Trying to read authorization file : "{0}"... --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wsdl.properties 2013-04-04 15:26:28.200612160 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wsdl.properties 2013-04-04 15:26:28.152612159 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 @@ parsing.invalidExtensionElement=invalid extension element: \"{0}\" (in namespace \"{1}\") parsing.invalidWsdlElement=invalid WSDL element: \"{0}\" parsing.requiredExtensibilityElement=unknown required extensibility element \"{0}\" (in namespace \"{1}\") +parsing.unknownExtensibilityElementOrAttribute=unknown extensibility element or attribute \"{0}\" (in namespace \"{1}\") parsing.tooManyElements=too many \"{0}\" elements under \"{1}\" element \"{2}\" parsing.invalidOperationStyle=operation \"{0}\" has an invalid style # {0} - "definitions". Not concatenated with any other string. @@ -167,4 +168,4 @@ try.with.mex= {0} \n\nretrying with MEX... file.not.found={0} is unreachable parsing.unableToGetMetadata= {0}\n\n{1} -failed.noservice=failed.noservice=Could not find wsdl:service in the provided WSDL(s): \n\n{0} At least one WSDL with at least one service definition needs to be provided. +failed.noservice=Could not find wsdl:service in the provided WSDL(s): \n\n{0} At least one WSDL with at least one service definition needs to be provided. --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java 2013-04-04 15:26:28.416612163 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java 2013-04-04 15:26:28.368612163 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +67,7 @@ * * @return true if there is no error, otherwise false * - * @see {@link #wsimport(OutputStream, Container, String[])} + * @see #wsimport(OutputStream, Container, String[]) */ public boolean wsimport(OutputStream logStream, String[] args) { return wsimport(logStream, Container.NONE, args); @@ -91,7 +91,7 @@ * artifacts like wrapper, exception bean classes etc. * * @return true if there is no error, otherwise false - * @see {@link #wsgen(OutputStream, Container, String[])} + * @see #wsgen(OutputStream, Container, String[]) */ public boolean wsgen(OutputStream logStream, String[] args) { return wsgen(logStream, Container.NONE, args); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/spi/package-info.java 2013-04-04 15:26:28.664612168 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/spi/package-info.java 2013-04-04 15:26:28.612612167 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/ClassNameInfo.java 2013-04-04 15:26:28.924612171 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/ClassNameInfo.java 2013-04-04 15:26:28.864612170 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/ForkEntityResolver.java 2013-04-04 15:26:29.176612176 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/ForkEntityResolver.java 2013-04-04 15:26:29.120612174 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -49,6 +49,12 @@ InputSource is = lhs.resolveEntity(publicId, systemId); if(is!=null) return is; + + if(publicId == null) { + // WorkAround: Ant's XMLCatalog supports public IDs only, this allows us to treat it as system IDs + publicId = systemId; + } + return rhs.resolveEntity(publicId, systemId); } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSDLFetcher.java 2013-04-04 15:26:29.412612179 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSDLFetcher.java 2013-04-04 15:26:29.360612178 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -70,7 +70,7 @@ /** * Fetches the wsdls in the DOMForest to the options.destDir * @param forest - * @return + * @return location of fetched root WSDL document * @throws IOException * @throws XMLStreamException * @throws FileNotFoundException @@ -100,26 +100,34 @@ } }, docLocator); - //XMLInputFactory readerFactory = XMLInputFactory.newInstance(); - //XMLStreamReader xsr = readerFactory.createXMLStreamReader(new DOMSource(forest.get(rootWsdl))); - - XMLStreamReader xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false); - XMLOutputFactory writerfactory = XMLOutputFactory.newInstance(); - String resolvedRootWsdl = docLocator.getLocationFor(null, doc); - File outFile = new File(destDir, resolvedRootWsdl); - OutputStream os = new FileOutputStream(outFile); - if(options.verbose) { - listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile)); - } - XMLStreamWriter xsw = writerfactory.createXMLStreamWriter(os); - //DOMForest eats away the whitespace loosing all the indentation, so write it through - // indenting writer for better readability of fetched documents - IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw); - wsdlPatcher.bridge(xsr, indentingWriter); - xsr.close(); - xsw.close(); - os.close(); - options.addGeneratedFile(outFile); + XMLStreamReader xsr = null; + XMLStreamWriter xsw = null; + OutputStream os = null; + String resolvedRootWsdl = null; + try { + XMLOutputFactory writerfactory; + xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false); + writerfactory = XMLOutputFactory.newInstance(); + resolvedRootWsdl = docLocator.getLocationFor(null, doc); + File outFile = new File(destDir, resolvedRootWsdl); + os = new FileOutputStream(outFile); + if(options.verbose) { + listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile)); + } + xsw = writerfactory.createXMLStreamWriter(os); + //DOMForest eats away the whitespace loosing all the indentation, so write it through + // indenting writer for better readability of fetched documents + IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw); + wsdlPatcher.bridge(xsr, indentingWriter); + options.addGeneratedFile(outFile); + } finally { + try { + if (xsr != null) {xsr.close();} + if (xsw != null) {xsw.close();} + } finally { + if (os != null) {os.close();} + } + } return resolvedRootWsdl; @@ -136,9 +144,9 @@ if(!rootWsdlFileName.endsWith(WSDL_FILE_EXTENSION)) { Document rootWsdlDoc = forest.get(rootWsdl); NodeList serviceNodes = rootWsdlDoc.getElementsByTagNameNS(WSDLConstants.QNAME_SERVICE.getNamespaceURI(),WSDLConstants.QNAME_SERVICE.getLocalPart()); - if(serviceNodes.getLength() == 0) + if (serviceNodes.getLength() == 0) { rootWsdlName = "Service"; - else { + } else { Node serviceNode = serviceNodes.item(0); String serviceName = ((Element)serviceNode).getAttribute( WSDLConstants.ATTR_NAME); rootWsdlName = serviceName; @@ -177,8 +185,8 @@ } private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map documentMap) { - return new DocumentLocationResolver() { + @Override public String getLocationFor(String namespaceURI, String systemId) { try { URL reference = new URL(new URL(baseWsdl),systemId); @@ -198,7 +206,7 @@ private String sanitize(String fileName) { fileName = fileName.replace('?', '.'); - StringBuffer sb = new StringBuffer(fileName); + StringBuilder sb = new StringBuilder(fileName); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if (Character.isLetterOrDigit(c) || @@ -216,8 +224,11 @@ } private File getWSDLDownloadDir() { - File wsdlDir = new File(options.destDir,WSDL_PATH); - wsdlDir.mkdirs(); + File wsdlDir = new File(options.destDir, WSDL_PATH); + boolean created = wsdlDir.mkdirs(); + if (options.verbose && !created) { + listener.message(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(wsdlDir)); + } return wsdlDir; } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSDLParseException.java 2013-04-04 15:26:29.664612183 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSDLParseException.java 2013-04-04 15:26:29.620612182 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java 2013-04-04 15:26:29.932612187 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java 2013-04-04 15:26:29.876612186 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java 2013-04-04 15:26:30.176612191 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java 2013-04-04 15:26:30.120612190 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties 2013-04-04 15:26:30.420612194 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties 2013-04-04 15:26:30.364612194 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 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,8 +23,7 @@ # questions. # -build-id=b09 - build-version=JAX-WS RI 2.2.7-b09 - major-version=2.2.7 - svn-revision=12895 - svn-url=https://svn.java.net/svn/jax-ws~sources/branches/jaxws22/jaxws-ri +build-id=2.2.9-b13941 +build-version=JAX-WS RI 2.2.9-b13941 +major-version=2.2.9 +svn-revision=unknown --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AbortException.java 2013-04-04 15:26:30.636612198 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AbortException.java 2013-04-04 15:26:30.588612198 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AuthInfo.java 2013-04-04 15:26:30.892612202 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AuthInfo.java 2013-04-04 15:26:30.844612202 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,6 +28,7 @@ import com.sun.istack.internal.NotNull; import java.net.URL; +import java.util.regex.Pattern; /** * Represents authorization information needed by {@link com.sun.tools.internal.ws.wscompile.DefaultAuthenticator} to @@ -39,10 +40,11 @@ public final class AuthInfo { private final String user; private final String password; - private final URL url; + private final Pattern urlPattern; - public AuthInfo(@NotNull URL url, @NotNull String user, @NotNull String password){ - this.url = url; + public AuthInfo(@NotNull URL url, @NotNull String user, @NotNull String password) { + String u = url.toExternalForm().replaceFirst("\\?", "\\\\?"); + this.urlPattern = Pattern.compile(u.replace("*", ".*"), Pattern.CASE_INSENSITIVE); this.user = user; this.password = password; } @@ -59,7 +61,7 @@ * Returns if the requesting host and port are associated with this {@link AuthInfo} */ public boolean matchingHost(@NotNull URL requestingURL) { - return requestingURL.equals(url); + return urlPattern.matcher(requestingURL.toExternalForm()).matches(); } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java 2013-04-04 15:26:31.112612205 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java 2013-04-04 15:26:31.064612204 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,7 +31,7 @@ * @author Vivek Pandey */ public class BadCommandLineException extends Exception { - private Options options; + private transient Options options; public BadCommandLineException(String msg) { super(msg); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java 2013-04-04 15:26:31.332612209 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java 2013-04-04 15:26:31.280612208 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -44,7 +44,7 @@ *

* However, to make the error handling easy (and make it work * with visitor patterns nicely), - * none of the methods on thi class throws {@link org.xml.sax.SAXException}. + * none of the methods on this class throws {@link org.xml.sax.SAXException}. * Instead, when the compilation needs to be aborted, * it throws {@link AbortException}, which is unchecked. * --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java 2013-04-04 15:26:31.576612213 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java 2013-04-04 15:26:31.516612212 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java 2013-04-04 15:26:31.808612217 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java 2013-04-04 15:26:31.760612216 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -51,7 +51,11 @@ public Writer openSource(JPackage pkg, String fileName) throws IOException { String tmp = fileName.substring(0, fileName.length()-5); - w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter(); + if (pkg.name() != null && ! "".equals(pkg.name())) { + w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter(); + } else { + w = filer.createSourceFile(tmp).openWriter(); + } return w; } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java 2013-04-04 15:26:32.052612220 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java 2013-04-04 15:26:31.992612219 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java 2013-04-04 15:26:32.308612224 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java 2013-04-04 15:26:32.252612223 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -36,6 +36,7 @@ import java.net.URLClassLoader; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -92,6 +93,12 @@ */ public boolean nocompile; + /** + * Disable secure xml processing. + * -XdisableSecureXmlProcessing + */ + public boolean disableSecureXmlProcessing = false; + public enum Target { V2_0, V2_1, V2_2; @@ -180,13 +187,6 @@ return compatibilityMode == EXTENSION; } - /** - * Target direcoty when producing files. - */ - public File targetDir = new File("."); - - - public boolean debug = false; /** @@ -213,7 +213,10 @@ public void removeGeneratedFiles(){ for(File file : generatedFiles){ if (file.getName().endsWith(".java")) { - file.delete(); + boolean deleted = file.delete(); + if (verbose && !deleted) { + System.out.println(MessageFormat.format("{0} could not be deleted.", file)); + } } } generatedFiles.clear(); @@ -235,7 +238,10 @@ synchronized (generatedFiles) { for (File file : generatedFiles) { if (file.getName().endsWith(".java")) { - file.delete(); + boolean deleted = file.delete(); + if (verbose && !deleted) { + System.out.println(MessageFormat.format("{0} could not be deleted.", file)); + } } } generatedFiles.clear(); @@ -348,6 +354,9 @@ throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; + } else if (args[i].equals("-XdisableSecureXmlProcessing")) { + disableSecureXmlProcessing= true; + return 1; } return 0; } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Plugin.java 2013-04-04 15:26:32.548612228 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Plugin.java 2013-04-04 15:26:32.496612227 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, 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,7 +73,7 @@ * *

Since options can appear in no particular order, WsImport allows * sub-options of a plugin to show up before the option that activates a - * plugin (one that's returned by {@link #getOptionName().) + * plugin (one that's returned by {@link #getOptionName()}.) * * But nevertheless a {@link Plugin} needs to be activated to participate in * further processing. @@ -120,14 +120,14 @@ * @param options This object allows access to various options used for code * generation as well as access to the generated code. * - * @param errorHandler Errors should be reported to this handler. + * @param errorReceiver Errors should be reported to this handler. * * @return If the add-on executes successfully, return true. If it detects * some errors but those are reported and recovered gracefully, return * false. * - * @throws SAXException After an error is reported to {@link ErrorHandler}, - * the same exception can be thrown to indicate a fatal irrecoverable error. {@link ErrorHandler} + * @throws SAXException After an error is reported to {@link ErrorReceiver}, + * the same exception can be thrown to indicate a fatal irrecoverable error. {@link ErrorReceiver} * itself may throw it, if it chooses not to recover from the error. */ public abstract boolean run( --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java 2013-04-04 15:26:32.748612231 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java 2013-04-04 15:26:32.700612230 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java 2013-04-04 15:26:32.984612235 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java 2013-04-04 15:26:32.936612234 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,17 +25,22 @@ package com.sun.tools.internal.ws.wscompile; -import com.sun.tools.internal.ws.resources.WscompileMessages; import com.sun.tools.internal.ws.api.WsgenExtension; import com.sun.tools.internal.ws.api.WsgenProtocol; +import com.sun.tools.internal.ws.resources.WscompileMessages; import com.sun.xml.internal.ws.api.BindingID; -import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.binding.SOAPBindingImpl; +import com.sun.xml.internal.ws.util.ServiceFinder; import javax.jws.WebService; import javax.xml.namespace.QName; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Vivek Pandey @@ -90,6 +95,12 @@ */ public boolean protocolSet = false; + /** + * -x file1 -x file2 ...
+ * Files to be parsed to get classes' metadata in addition/instead of using annotations and reflection API + */ + public List externalMetadataFiles = new ArrayList(); + private static final String SERVICENAME_OPTION = "-servicename"; private static final String PORTNAME_OPTION = "-portname"; private static final String HTTP = "http"; @@ -163,6 +174,9 @@ } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; + } else if ("-x".equals(args[i])) { + externalMetadataFiles.add(requireArgument("-x", args, ++i)); + return 1; } return j; @@ -180,7 +194,6 @@ private boolean isImplClass; - private boolean noWebServiceEndpoint; public void validate() throws BadCommandLineException { if(nonclassDestDir == null) @@ -233,9 +246,6 @@ if(!isImplClass){ throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(clazz.getName())); } - if(noWebServiceEndpoint){ - throw new BadCommandLineException(WscompileMessages.WSGEN_NO_WEBSERVICES_CLASS(clazz.getName())); - } endpoint = clazz; validateBinding(); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2013-04-04 15:26:33.192612238 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2013-04-04 15:26:33.144612237 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,6 +25,7 @@ package com.sun.tools.internal.ws.wscompile; +import com.oracle.webservices.internal.api.databinding.WSDLResolver; import com.sun.istack.internal.tools.ParallelWorldClassLoader; import com.sun.tools.internal.ws.ToolVersion; import com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAp; @@ -43,9 +44,9 @@ import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension; import com.sun.xml.internal.ws.binding.WebServiceFeatureList; +import com.sun.xml.internal.ws.model.ExternalMetadataReader; import com.sun.xml.internal.ws.model.AbstractSEIModelImpl; import com.sun.xml.internal.ws.util.ServiceFinder; -import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver; import org.xml.sax.SAXParseException; import javax.tools.DiagnosticCollector; @@ -71,6 +72,7 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -86,7 +88,7 @@ public WsgenTool(OutputStream out, Container container) { - this.out = (out instanceof PrintStream)?(PrintStream)out:new PrintStream(out); + this.out = (out instanceof PrintStream) ? (PrintStream) out : new PrintStream(out); this.container = container; } @@ -95,7 +97,7 @@ this(out, null); } - public boolean run(String[] args){ + public boolean run(String[] args) { final Listener listener = new Listener(); for (String arg : args) { if (arg.equals("-version")) { @@ -112,22 +114,22 @@ try { options.parseArguments(args); options.validate(); - if(!buildModel(options.endpoint.getName(), listener)){ + if (!buildModel(options.endpoint.getName(), listener)) { return false; } - }catch (Options.WeAreDone done){ - usage((WsgenOptions)done.getOptions()); - }catch (BadCommandLineException e) { - if(e.getMessage()!=null) { + } catch (Options.WeAreDone done) { + usage(done.getOptions()); + } catch (BadCommandLineException e) { + if (e.getMessage() != null) { System.out.println(e.getMessage()); System.out.println(); } - usage((WsgenOptions)e.getOptions()); + usage(e.getOptions()); return false; - }catch(AbortException e){ + } catch (AbortException e) { //error might have been reported - }finally{ - if(!options.keep){ + } finally { + if (!options.keep) { options.removeGeneratedFiles(); } } @@ -136,21 +138,25 @@ private final Container container; - private int round = 0; - /* * To take care of JDK6-JDK6u3, where 2.1 API classes are not there */ private static boolean useBootClasspath(Class clazz) { try { - ParallelWorldClassLoader.toJarUrl(clazz.getResource('/'+clazz.getName().replace('.','/')+".class")); + ParallelWorldClassLoader.toJarUrl(clazz.getResource('/' + clazz.getName().replace('.', '/') + ".class")); return true; - } catch(Exception e) { + } catch (Exception e) { return false; } } - + /** + * + * @param endpoint + * @param listener + * @return + * @throws BadCommandLineException + */ public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException { final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener); @@ -178,7 +184,7 @@ .append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString()); } - JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create(); DiagnosticCollector diagnostics = new DiagnosticCollector(); StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null); JavaCompiler.CompilationTask task = compiler.getTask( @@ -196,8 +202,15 @@ return false; } if (options.genWsdl) { - DatabindingConfig config = new DatabindingConfig(); - String tmpPath = options.destDir.getAbsolutePath()+ File.pathSeparator+options.classpath; + DatabindingConfig config = new DatabindingConfig(); + + List externalMetadataFileNames = options.externalMetadataFiles; + boolean disableSecureXmlProcessing = options.disableSecureXmlProcessing; + if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) { + config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableSecureXmlProcessing)); + } + + String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath; ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath), this.getClass().getClassLoader()); Class endpointClass; @@ -218,23 +231,26 @@ config.getMappingInfo().setPortName(options.portName);//rtModeler.setPortName(options.portName); // AbstractSEIModelImpl rtModel = rtModeler.buildRuntimeModel(); - DatabindingFactory fac = DatabindingFactory.newInstance(); - config.setEndpointClass(endpointClass); - config.getMappingInfo().setServiceName(options.serviceName); - config.setFeatures(wsfeatures.toArray()); - config.setClassLoader(classLoader); - config.getMappingInfo().setBindingID(bindingID); - com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config); + DatabindingFactory fac = DatabindingFactory.newInstance(); + config.setEndpointClass(endpointClass); + config.getMappingInfo().setServiceName(options.serviceName); + config.setFeatures(wsfeatures.toArray()); + config.setClassLoader(classLoader); + config.getMappingInfo().setBindingID(bindingID); + 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(disableSecureXmlProcessing); + wsdlGenInfo.setWsdlResolver( new WSDLResolver() { private File toFile(String suggestedFilename) { return new File(options.nonclassDestDir, suggestedFilename); } + private Result toResult(File file) { Result result; try { @@ -247,21 +263,27 @@ return result; } + @Override public Result getWSDL(String suggestedFilename) { File f = toFile(suggestedFilename); wsdlFileName[0] = f; return toResult(f); } + public Result getSchemaOutput(String namespace, String suggestedFilename) { if (namespace == null) return null; File f = toFile(suggestedFilename); - schemaFiles.put(namespace,f); + schemaFiles.put(namespace, f); return toResult(f); } + + @Override public Result getAbstractWSDL(Holder filename) { return toResult(toFile(filename.value)); } + + @Override public Result getSchemaOutput(String namespace, Holder filename) { return getSchemaOutput(namespace, filename.value); } @@ -274,20 +296,34 @@ rt.generateWSDL(wsdlGenInfo); - if(options.wsgenReport!=null) - generateWsgenReport(endpointClass,(AbstractSEIModelImpl)rt.getModel(),wsdlFileName[0],schemaFiles); + if (options.wsgenReport != null) + generateWsgenReport(endpointClass, (AbstractSEIModelImpl) rt.getModel(), wsdlFileName[0], schemaFiles); } return true; } + private List getExternalFiles(List exts) { + List files = new ArrayList(); + for (String ext : exts) { + // first try absolute path ... + File file = new File(ext); + if (!file.exists()) { + // then relative path ... + file = new File(options.sourceDir.getAbsolutePath() + File.separator + ext); + } + files.add(file); + } + return files; + } + /** * Generates a small XML file that captures the key activity of wsgen, * so that test harness can pick up artifacts. */ - private void generateWsgenReport(Class endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map schemaFiles) { + private void generateWsgenReport(Class endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map schemaFiles) { try { ReportOutput.Report report = TXW.create(ReportOutput.Report.class, - new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport)))); + new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport)))); report.wsdl(wsdlFile.getAbsolutePath()); ReportOutput.writeQName(rtModel.getServiceQName(), report.service()); @@ -296,7 +332,7 @@ report.implClass(endpointClass.getName()); - for (Map.Entry e : schemaFiles.entrySet()) { + for (Map.Entry e : schemaFiles.entrySet()) { ReportOutput.Schema s = report.schema(); s.ns(e.getKey()); s.location(e.getValue().getAbsolutePath()); @@ -317,10 +353,13 @@ interface Report extends TypedXmlWriter { @XmlElement void wsdl(String file); // location of WSDL + @XmlElement QualifiedName portType(); + @XmlElement QualifiedName service(); + @XmlElement QualifiedName port(); @@ -337,6 +376,7 @@ interface QualifiedName extends TypedXmlWriter { @XmlAttribute void uri(String ns); + @XmlAttribute void localName(String localName); } @@ -344,23 +384,28 @@ interface Schema extends TypedXmlWriter { @XmlAttribute void ns(String ns); + @XmlAttribute void location(String filePath); } - private static void writeQName( QName n, QualifiedName w ) { + private static void writeQName(QName n, QualifiedName w) { w.uri(n.getNamespaceURI()); w.localName(n.getLocalPart()); } } - protected void usage(WsgenOptions options) { + protected void usage(Options options) { // Just don't see any point in passing WsgenOptions // BadCommandLineException also shouldn't have options if (options == null) options = this.options; - System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", options.protocols, options.nonstdProtocols.keySet())); - System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES()); + if (options instanceof WsgenOptions) { + System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", + ((WsgenOptions)options).protocols, + ((WsgenOptions)options).nonstdProtocols.keySet())); + System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES()); + } } class Listener extends WsimportListener { --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java 2013-04-04 15:26:33.460612242 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java 2013-04-04 15:26:33.404612241 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java 2013-04-04 15:26:33.724612246 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java 2013-04-04 15:26:33.668612245 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -62,6 +62,8 @@ import java.util.Arrays; import java.util.List; import java.util.HashMap; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @author Vivek Pandey @@ -139,7 +141,12 @@ /** * Authentication file */ - public File authFile; + public File authFile = null; + + //can user.home value be null? + public static final String defaultAuthfile + = System.getProperty("user.home") + System.getProperty("file.separator") + + ".metro" + System.getProperty("file.separator") + "auth"; /** * Setting disableAuthenticator to true disables the DefaultAuthenticator. @@ -147,6 +154,10 @@ */ public boolean disableAuthenticator; + public String proxyAuth = null; + private String proxyHost = null; + private String proxyPort = null; + /** * Additional arguments */ @@ -240,6 +251,16 @@ } } } + + if (encoding != null && schemaCompiler.getOptions().encoding == null) { + try { + schemaCompiler.getOptions().parseArgument( + new String[] {"-encoding", encoding}, 0); + } catch (com.sun.tools.internal.xjc.BadCommandLineException ex) { + Logger.getLogger(WsimportOptions.class.getName()).log(Level.SEVERE, null, ex); + } + } + if(destDir == null) destDir = new File("."); if(sourceDir == null) @@ -292,15 +313,15 @@ if (value.length() == 0) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_INVALID_OPTION(args[i])); } - int index = value.indexOf(':'); - if (index == -1) { - System.setProperty("proxySet", "true"); - System.setProperty("proxyHost", value); - System.setProperty("proxyPort", "8080"); - } else { + parseProxy(value); + if (proxyHost != null || proxyPort != null) { System.setProperty("proxySet", "true"); - System.setProperty("proxyHost", value.substring(0, index)); - System.setProperty("proxyPort", value.substring(index + 1)); + } + if (proxyHost != null) { + System.setProperty("proxyHost", proxyHost); + } + if (proxyPort != null) { + System.setProperty("proxyPort", proxyPort); } return 1; } else if (args[i].equals("-Xno-addressing-databinding")) { @@ -576,6 +597,37 @@ return extensionOptions.get(argument); } + private void parseProxy(String text) throws BadCommandLineException { + int i = text.lastIndexOf('@'); + int j = text.lastIndexOf(':'); + + if (i > 0) { + proxyAuth = text.substring(0, i); + if (j > i) { + proxyHost = text.substring(i + 1, j); + proxyPort = text.substring(j + 1); + } else { + proxyHost = text.substring(i + 1); + proxyPort = "8080"; + } + } else { + //no auth info + if (j < 0) { + //no port + proxyHost = text; + proxyPort = "8080"; + } else { + proxyHost = text.substring(0, j); + proxyPort = text.substring(j + 1); + } + } + try { + Integer.valueOf(proxyPort); + } catch (NumberFormatException e) { + throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_PROXY(text)); + } + } + /** * Looks for all "META-INF/services/[className]" files and * create one instance for each class name found inside this file. --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2013-04-04 15:26:34.008612251 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2013-04-04 15:26:33.948612250 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,6 +27,7 @@ import com.sun.codemodel.internal.CodeWriter; import com.sun.codemodel.internal.writer.ProgressCodeWriter; +import com.sun.istack.internal.tools.DefaultAuthenticator; import com.sun.tools.internal.ws.ToolVersion; import com.sun.tools.internal.ws.api.TJavaGeneratorExtension; import com.sun.tools.internal.ws.processor.generator.CustomExceptionGenerator; @@ -55,9 +56,10 @@ import javax.xml.ws.EndpointContext; import java.io.*; import java.util.*; -import java.net.Authenticator; +import java.text.MessageFormat; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; +import org.xml.sax.Locator; import org.xml.sax.SAXException; /** @@ -134,11 +136,13 @@ this.listener = listener; } + @Override public void info(SAXParseException exception) { if (options.verbose) super.info(exception); } + @Override public void warning(SAXParseException exception) { if (!options.quiet) super.warning(exception); @@ -179,13 +183,10 @@ } } - Authenticator orig = null; try { parseArguments(args, listener, receiver); try { - orig = DefaultAuthenticator.getCurrentAuthenticator(); - Model wsdlModel = buildWsdlModel(listener, receiver); if (wsdlModel == null) return false; @@ -235,7 +236,7 @@ } finally{ deleteGeneratedFiles(); if (!options.disableAuthenticator) { - Authenticator.setDefault(orig); + DefaultAuthenticator.reset(); } } if(receiver.hadError()) { @@ -253,11 +254,12 @@ synchronized (generatedFiles) { for (File file : generatedFiles) { if (!file.getName().endsWith(".java")) { - file.delete(); + boolean deleted = file.delete(); + if (options.verbose && !deleted) { + System.out.println(MessageFormat.format("{0} could not be deleted.", file)); + } trackedRootPackages.add(file.getParentFile()); - } - } } //remove empty package dirs @@ -265,7 +267,10 @@ while(pkg.list() != null && pkg.list().length ==0 && !pkg.equals(options.destDir)) { File parentPkg = pkg.getParentFile(); - pkg.delete(); + boolean deleted = pkg.delete(); + if (options.verbose && !deleted) { + System.out.println(MessageFormat.format("{0} could not be deleted.", pkg)); + } pkg = parentPkg; } } @@ -273,7 +278,6 @@ if(!options.keep) { options.removeGeneratedFiles(); } - } private void addClassesToGeneratedFiles() throws IOException { @@ -286,7 +290,7 @@ File classDir = new File(options.destDir,relativeDir); if(classDir.exists()) { classDir.listFiles(new FilenameFilter() { - + @Override public boolean accept(File dir, String name) { if(name.equals(className+".class") || (name.startsWith(className+"$") && name.endsWith(".class"))) { trackedClassFiles.add(new File(dir,name)); @@ -309,42 +313,50 @@ zipFile = new File(options.destDir, options.clientjar); } - if (zipFile.exists()) { - //TODO - } - FileOutputStream fos = null; - if( !options.quiet ) + FileOutputStream fos; + if (!options.quiet) { listener.message(WscompileMessages.WSIMPORT_ARCHIVING_ARTIFACTS(zipFile)); + } - + BufferedInputStream bis = null; + FileInputStream fi = null; fos = new FileOutputStream(zipFile); JarOutputStream jos = new JarOutputStream(fos); - - String base = options.destDir.getCanonicalPath(); - for(File f: options.getGeneratedFiles()) { - //exclude packaging the java files in the jar - if(f.getName().endsWith(".java")) { - continue; - } - if(options.verbose) { - listener.message(WscompileMessages.WSIMPORT_ARCHIVE_ARTIFACT(f, options.clientjar)); + try { + String base = options.destDir.getCanonicalPath(); + for(File f: options.getGeneratedFiles()) { + //exclude packaging the java files in the jar + if(f.getName().endsWith(".java")) { + continue; + } + if(options.verbose) { + listener.message(WscompileMessages.WSIMPORT_ARCHIVE_ARTIFACT(f, options.clientjar)); + } + String entry = f.getCanonicalPath().substring(base.length()+1); + fi = new FileInputStream(f); + bis = new BufferedInputStream(fi); + JarEntry jarEntry = new JarEntry(entry); + jos.putNextEntry(jarEntry); + int bytesRead; + byte[] buffer = new byte[1024]; + while ((bytesRead = bis.read(buffer)) != -1) { + jos.write(buffer, 0, bytesRead); + } } - String entry = f.getCanonicalPath().substring(base.length()+1); - BufferedInputStream bis = new BufferedInputStream( - new FileInputStream(f)); - JarEntry jarEntry = new JarEntry(entry); - jos.putNextEntry(jarEntry); - int bytesRead; - byte[] buffer = new byte[1024]; - while ((bytesRead = bis.read(buffer)) != -1) { - jos.write(buffer, 0, bytesRead); + } finally { + try { + if (bis != null) { + bis.close(); + } + } finally { + if (jos != null) { + jos.close(); + } + if (fi != null) { + fi.close(); + } } - bis.close(); - } - - jos.close(); - } protected void parseArguments(String[] args, Listener listener, @@ -356,15 +368,56 @@ options.parseBindings(receiver); } - protected Model buildWsdlModel(Listener listener, - Receiver receiver) throws BadCommandLineException, XMLStreamException, IOException { - if( !options.quiet ) - listener.message(WscompileMessages.WSIMPORT_PARSING_WSDL()); - + protected Model buildWsdlModel(Listener listener, final Receiver receiver) + throws BadCommandLineException, XMLStreamException, IOException { //set auth info //if(options.authFile != null) if (!options.disableAuthenticator) { - Authenticator.setDefault(new DefaultAuthenticator(receiver, options.authFile)); + class AuthListener implements DefaultAuthenticator.Receiver { + + private final boolean isFatal; + + AuthListener(boolean isFatal) { + this.isFatal = isFatal; + } + + @Override + public void onParsingError(String text, Locator loc) { + error(new SAXParseException(WscompileMessages.WSIMPORT_ILLEGAL_AUTH_INFO(text), loc)); + } + + @Override + public void onError(Exception e, Locator loc) { + if (e instanceof FileNotFoundException) { + error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_FILE_NOT_FOUND( + loc.getSystemId(), WsimportOptions.defaultAuthfile), null)); + } else { + error(new SAXParseException(WscompileMessages.WSIMPORT_FAILED_TO_PARSE(loc.getSystemId(),e.getMessage()), loc)); + } + } + + private void error(SAXParseException e) { + if (isFatal) { + receiver.error(e); + } else { + receiver.debug(e); + } + } + } + + DefaultAuthenticator da = DefaultAuthenticator.getAuthenticator(); + if (options.proxyAuth != null) { + da.setProxyAuth(options.proxyAuth); + } + if (options.authFile != null) { + da.setAuth(options.authFile, new AuthListener(true)); + } else { + da.setAuth(new File(WsimportOptions.defaultAuthfile), new AuthListener(false)); + } + } + + if (!options.quiet) { + listener.message(WscompileMessages.WSIMPORT_PARSING_WSDL()); } MetadataFinder forest = new MetadataFinder(new WSDLInternalizationLogic(), options, receiver); @@ -498,7 +551,7 @@ listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE()); if(options.verbose){ - StringBuffer argstr = new StringBuffer(); + StringBuilder argstr = new StringBuilder(); for(String arg:args){ argstr.append(arg).append(" "); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/plugin/at_generated/PluginImpl.java 2013-04-04 15:26:34.252612255 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/plugin/at_generated/PluginImpl.java 2013-04-04 15:26:34.196612253 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Binding.java 2013-04-04 15:26:34.520612259 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Binding.java 2013-04-04 15:26:34.472612258 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java 2013-04-04 15:26:34.780612263 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java 2013-04-04 15:26:34.724612261 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java 2013-04-04 15:26:35.016612266 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java 2013-04-04 15:26:34.968612265 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java 2013-04-04 15:26:35.272612270 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java 2013-04-04 15:26:35.220612269 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -59,7 +59,7 @@ public String getUniqueKey() { if (_uniqueKey == null) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(_name); sb.append(' '); if (_input != null) { @@ -121,6 +121,7 @@ return _faults; } + @Override public QName getElementName() { return WSDLConstants.QNAME_OPERATION; } @@ -133,30 +134,37 @@ _documentation = d; } + @Override public String getNameValue() { return getName(); } + @Override public String getNamespaceURI() { - return parent.getNamespaceURI(); + return (parent == null) ? null : parent.getNamespaceURI(); } + @Override public QName getWSDLElementName() { return getElementName(); } + @Override public void addExtension(TWSDLExtension e) { _helper.addExtension(e); } + @Override public Iterable extensions() { return _helper.extensions(); } + @Override public TWSDLExtensible getParent() { return parent; } + @Override public void withAllSubEntitiesDo(EntityAction action) { if (_input != null) { action.perform(_input); @@ -186,6 +194,7 @@ visitor.postVisit(this); } + @Override public void validateThis() { if (_name == null) { failValidation("validation.missingRequiredAttribute", "name"); @@ -202,7 +211,7 @@ if (_output != null) { failValidation("validation.invalidSubEntity", "output"); } - if (_faults != null && _faults.size() != 0) { + if (_faults != null && !_faults.isEmpty()) { failValidation("validation.invalidSubEntity", "fault"); } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java 2013-04-04 15:26:35.532612275 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java 2013-04-04 15:26:35.484612274 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java 2013-04-04 15:26:35.748612277 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java 2013-04-04 15:26:35.696612277 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,6 +28,7 @@ import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible; import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension; import com.sun.tools.internal.ws.wsdl.framework.*; + import org.xml.sax.Locator; import javax.xml.namespace.QName; @@ -213,6 +214,10 @@ public void validateThis() { } + public Map resolveBindings() { + return _document.getMap(Kinds.BINDING); + } + private AbstractDocument _document; private ExtensibilityHelper _helper; private Documentation _documentation; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java 2013-04-04 15:26:35.984612282 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java 2013-04-04 15:26:35.936612281 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Fault.java 2013-04-04 15:26:36.220612285 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Fault.java 2013-04-04 15:26:36.164612284 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -64,6 +64,7 @@ return (Message) document.find(Kinds.MESSAGE, _message); } + @Override public QName getElementName() { return WSDLConstants.QNAME_FAULT; } @@ -76,12 +77,14 @@ _documentation = d; } + @Override public void withAllQNamesDo(QNameAction action) { if (_message != null) { action.perform(_message); } } + @Override public void withAllEntityReferencesDo(EntityReferenceAction action) { super.withAllEntityReferencesDo(action); if (_message != null) { @@ -94,6 +97,7 @@ visitor.postVisit(this); } + @Override public void validateThis() { if (_name == null) { failValidation("validation.missingRequiredAttribute", "name"); @@ -109,14 +113,17 @@ private String _action; private ExtensibilityHelper _helper; + @Override public String getNameValue() { return getName(); } + @Override public String getNamespaceURI() { - return parent.getNamespaceURI(); + return (parent == null) ? null : parent.getNamespaceURI(); } + @Override public QName getWSDLElementName() { return getElementName(); } @@ -124,6 +131,7 @@ /* (non-Javadoc) * @see TWSDLExtensible#addExtension(ExtensionImpl) */ + @Override public void addExtension(TWSDLExtension e) { _helper.addExtension(e); @@ -132,10 +140,12 @@ /* (non-Javadoc) * @see TWSDLExtensible#extensions() */ + @Override public Iterable extensions() { return _helper.extensions(); } + @Override public TWSDLExtensible getParent() { return parent; } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Import.java 2013-04-04 15:26:36.456612288 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Import.java 2013-04-04 15:26:36.404612288 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Input.java 2013-04-04 15:26:36.712612292 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Input.java 2013-04-04 15:26:36.660612292 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java 2013-04-04 15:26:36.956612296 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java 2013-04-04 15:26:36.904612296 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Message.java 2013-04-04 15:26:37.180612300 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Message.java 2013-04-04 15:26:37.128612299 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java 2013-04-04 15:26:37.396612304 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java 2013-04-04 15:26:37.344612302 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Operation.java 2013-04-04 15:26:37.612612306 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Operation.java 2013-04-04 15:26:37.564612306 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java 2013-04-04 15:26:37.852612310 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java 2013-04-04 15:26:37.796612310 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Output.java 2013-04-04 15:26:38.148612315 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Output.java 2013-04-04 15:26:38.088612314 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Port.java 2013-04-04 15:26:38.412612319 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Port.java 2013-04-04 15:26:38.368612318 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/PortType.java 2013-04-04 15:26:38.652612323 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/PortType.java 2013-04-04 15:26:38.600612322 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Service.java 2013-04-04 15:26:38.932612327 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Service.java 2013-04-04 15:26:38.876612327 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Types.java 2013-04-04 15:26:39.168612331 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Types.java 2013-04-04 15:26:39.120612330 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -47,6 +47,7 @@ _helper = new ExtensibilityHelper(); } + @Override public QName getElementName() { return WSDLConstants.QNAME_TYPES; } @@ -65,32 +66,39 @@ visitor.postVisit(this); } + @Override public void validateThis() { } /** * wsdl:type does not have any name attribute */ + @Override public String getNameValue() { return null; } + @Override public String getNamespaceURI() { - return parent.getNamespaceURI(); + return (parent == null) ? null : parent.getNamespaceURI(); } + @Override public QName getWSDLElementName() { return getElementName(); } + @Override public void addExtension(TWSDLExtension e) { _helper.addExtension(e); } + @Override public Iterable extensions() { return _helper.extensions(); } + @Override public TWSDLExtensible getParent() { return parent; } @@ -99,6 +107,7 @@ this.parent = parent; } + @Override public void withAllSubEntitiesDo(EntityAction action) { _helper.withAllSubEntitiesDo(action); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java 2013-04-04 15:26:39.380612334 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java 2013-04-04 15:26:39.328612334 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,25 +35,24 @@ public interface WSDLConstants { // namespace URIs - public static String NS_XMLNS = "http://www.w3.org/2000/xmlns/"; - public static String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/"; + static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/"; // QNames - public static QName QNAME_BINDING = new QName(NS_WSDL, "binding"); - public static QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions"); - public static QName QNAME_DOCUMENTATION = - new QName(NS_WSDL, "documentation"); - public static QName QNAME_FAULT = new QName(NS_WSDL, "fault"); - public static QName QNAME_IMPORT = new QName(NS_WSDL, "import"); - public static QName QNAME_INPUT = new QName(NS_WSDL, "input"); - public static QName QNAME_MESSAGE = new QName(NS_WSDL, "message"); - public static QName QNAME_OPERATION = new QName(NS_WSDL, "operation"); - public static QName QNAME_OUTPUT = new QName(NS_WSDL, "output"); - public static QName QNAME_PART = new QName(NS_WSDL, "part"); - public static QName QNAME_PORT = new QName(NS_WSDL, "port"); - public static QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType"); - public static QName QNAME_SERVICE = new QName(NS_WSDL, "service"); - public static QName QNAME_TYPES = new QName(NS_WSDL, "types"); + static final QName QNAME_BINDING = new QName(NS_WSDL, "binding"); + static final QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions"); + static final QName QNAME_DOCUMENTATION = new QName(NS_WSDL, "documentation"); + static final QName QNAME_FAULT = new QName(NS_WSDL, "fault"); + static final QName QNAME_IMPORT = new QName(NS_WSDL, "import"); + static final QName QNAME_INPUT = new QName(NS_WSDL, "input"); + static final QName QNAME_MESSAGE = new QName(NS_WSDL, "message"); + static final QName QNAME_OPERATION = new QName(NS_WSDL, "operation"); + static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output"); + static final QName QNAME_PART = new QName(NS_WSDL, "part"); + static final QName QNAME_PORT = new QName(NS_WSDL, "port"); + static final QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType"); + static final QName QNAME_SERVICE = new QName(NS_WSDL, "service"); + static final QName QNAME_TYPES = new QName(NS_WSDL, "types"); - public static QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType"); + static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType"); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java 2013-04-04 15:26:39.608612337 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java 2013-04-04 15:26:39.556612337 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,7 +32,6 @@ import javax.xml.namespace.QName; import java.util.ArrayList; import java.util.Iterator; -import java.util.Set; /** * A WSDL document. @@ -110,6 +109,7 @@ _definitions.accept(visitor); } + @Override public void validate(EntityReferenceValidator validator) { GloballyValidatingAction action = new GloballyValidatingAction(this, validator); @@ -119,14 +119,14 @@ } } + @Override protected Entity getRoot() { return _definitions; } private Definitions _definitions; - private class GloballyValidatingAction - implements EntityAction, EntityReferenceAction { + private static class GloballyValidatingAction implements EntityAction, EntityReferenceAction { public GloballyValidatingAction( AbstractDocument document, EntityReferenceValidator validator) { @@ -134,6 +134,7 @@ _validator = validator; } + @Override public void perform(Entity entity) { try { entity.validateThis(); @@ -146,9 +147,10 @@ } } + @Override public void perform(Kind kind, QName name) { try { - GloballyKnown entity = _document.find(kind, name); + _document.find(kind, name); } catch (NoSuchEntityException e) { // failed to resolve, check with the validator if (_exception == null) { --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java 2013-04-04 15:26:39.832612341 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java 2013-04-04 15:26:39.780612340 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java 2013-04-04 15:26:40.076612345 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java 2013-04-04 15:26:40.020612344 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java 2013-04-04 15:26:40.324612349 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java 2013-04-04 15:26:40.268612348 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java 2013-04-04 15:26:40.576612353 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java 2013-04-04 15:26:40.524612352 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java 2013-04-04 15:26:40.812612356 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java 2013-04-04 15:26:40.760612355 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,14 +35,12 @@ public interface HTTPConstants { // namespace URIs - public static String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"; + static final String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"; // QNames - public static QName QNAME_ADDRESS = new QName(NS_WSDL_HTTP, "address"); - public static QName QNAME_BINDING = new QName(NS_WSDL_HTTP, "binding"); - public static QName QNAME_OPERATION = new QName(NS_WSDL_HTTP, "operation"); - public static QName QNAME_URL_ENCODED = - new QName(NS_WSDL_HTTP, "urlEncoded"); - public static QName QNAME_URL_REPLACEMENT = - new QName(NS_WSDL_HTTP, "urlReplacement"); + static final QName QNAME_ADDRESS = new QName(NS_WSDL_HTTP, "address"); + static final QName QNAME_BINDING = new QName(NS_WSDL_HTTP, "binding"); + static final QName QNAME_OPERATION = new QName(NS_WSDL_HTTP, "operation"); + static final QName QNAME_URL_ENCODED = new QName(NS_WSDL_HTTP, "urlEncoded"); + static final QName QNAME_URL_REPLACEMENT = new QName(NS_WSDL_HTTP, "urlReplacement"); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java 2013-04-04 15:26:41.012612360 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java 2013-04-04 15:26:40.964612359 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java 2013-04-04 15:26:41.272612364 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java 2013-04-04 15:26:41.204612363 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java 2013-04-04 15:26:41.528612368 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java 2013-04-04 15:26:41.476612367 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java 2013-04-04 15:26:41.772612371 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java 2013-04-04 15:26:41.716612371 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java 2013-04-04 15:26:42.016612375 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java 2013-04-04 15:26:41.964612374 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java 2013-04-04 15:26:42.248612379 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java 2013-04-04 15:26:42.196612378 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -291,19 +291,6 @@ this.className = className; } - /** - * @return Returns the exception. - */ - public Exception getException() { - return exception; - } - /** - * @param exception The exception to set. - */ - public void setException(Exception exception) { - this.exception = exception; - } - private String wsdlNamespace; private String wsdlLocation; private String node; @@ -316,7 +303,6 @@ // private Boolean enableAdditionalHeaderMapping; private Boolean enableMimeContentMapping; private Boolean isProvider; - private Exception exception; private Set jaxbBindings; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java 2013-04-04 15:26:42.464612382 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java 2013-04-04 15:26:42.412612382 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,9 +35,9 @@ */ public interface JAXWSBindingsConstants { - public static String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws"; - public static String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb"; - public static String NS_XJC_BINDINGS = "http://java.sun.com/xml/ns/jaxb/xjc"; + static final String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws"; + static final String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb"; + static final String NS_XJC_BINDINGS = "http://java.sun.com/xml/ns/jaxb/xjc"; /** * jaxws:bindings schema component @@ -62,44 +62,44 @@ * elements that don't have any jaxws:bindings ancestors (i.e. on * outermost binding declarations). */ - public static QName JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS, "bindings"); - public static String WSDL_LOCATION_ATTR = "wsdlLocation"; - public static String NODE_ATTR = "node"; - public static String VERSION_ATTR = "version"; + static final QName JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS, "bindings"); + static final String WSDL_LOCATION_ATTR = "wsdlLocation"; + static final String NODE_ATTR = "node"; + static final String VERSION_ATTR = "version"; /* * ? xs:string * */ - public static QName PACKAGE = new QName(NS_JAXWS_BINDINGS, "package"); - public static String NAME_ATTR = "name"; - public static QName JAVADOC = new QName(NS_JAXWS_BINDINGS, "javadoc"); + static final QName PACKAGE = new QName(NS_JAXWS_BINDINGS, "package"); + static final String NAME_ATTR = "name"; + static final QName JAVADOC = new QName(NS_JAXWS_BINDINGS, "javadoc"); /* * xs:boolean ? */ - public static QName ENABLE_WRAPPER_STYLE = new QName(NS_JAXWS_BINDINGS, "enableWrapperStyle"); + static final QName ENABLE_WRAPPER_STYLE = new QName(NS_JAXWS_BINDINGS, "enableWrapperStyle"); /* * xs:boolean * ? */ - public static QName ENABLE_ASYNC_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAsyncMapping"); + static final QName ENABLE_ASYNC_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAsyncMapping"); /* * xs:boolean? */ - public static QName ENABLE_ADDITIONAL_SOAPHEADER_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAdditionalSOAPHeaderMapping"); + static final QName ENABLE_ADDITIONAL_SOAPHEADER_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAdditionalSOAPHeaderMapping"); /* * xs:boolean? */ - public static QName ENABLE_MIME_CONTENT = new QName(NS_JAXWS_BINDINGS, "enableMIMEContent"); + static final QName ENABLE_MIME_CONTENT = new QName(NS_JAXWS_BINDINGS, "enableMIMEContent"); /* * xs:boolean? */ - public static QName PROVIDER = new QName(NS_JAXWS_BINDINGS, "provider"); + static final QName PROVIDER = new QName(NS_JAXWS_BINDINGS, "provider"); /* * PortType @@ -118,7 +118,7 @@ * */ - public static QName CLASS = new QName(NS_JAXWS_BINDINGS, "class"); + static final QName CLASS = new QName(NS_JAXWS_BINDINGS, "class"); /* * PortType WSDLOperation @@ -142,10 +142,10 @@ - public static QName METHOD = new QName(NS_JAXWS_BINDINGS, "method"); - public static QName PARAMETER = new QName(NS_JAXWS_BINDINGS, "parameter"); - public static String PART_ATTR = "part"; - public static String ELEMENT_ATTR = "childElementName"; + static final QName METHOD = new QName(NS_JAXWS_BINDINGS, "method"); + static final QName PARAMETER = new QName(NS_JAXWS_BINDINGS, "parameter"); + static final String PART_ATTR = "part"; + static final String ELEMENT_ATTR = "childElementName"; /* * Binding @@ -181,14 +181,14 @@ * */ - public static QName EXCEPTION = new QName(NS_JAXWS_BINDINGS, "exception"); + static final QName EXCEPTION = new QName(NS_JAXWS_BINDINGS, "exception"); /* * jaxb:bindgs QName */ - public static QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings"); - public static String JAXB_BINDING_VERSION = "2.0"; - public static QName XSD_APPINFO = new QName(Constants.NS_XSD, "appinfo"); - public static QName XSD_ANNOTATION = new QName(Constants.NS_XSD, "annotation"); + static final QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings"); + static final String JAXB_BINDING_VERSION = "2.0"; + static final QName XSD_APPINFO = new QName(Constants.NS_XSD, "appinfo"); + static final QName XSD_ANNOTATION = new QName(Constants.NS_XSD, "annotation"); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java 2013-04-04 15:26:42.720612386 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java 2013-04-04 15:26:42.660612385 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java 2013-04-04 15:26:42.932612389 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java 2013-04-04 15:26:42.880612388 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,12 +35,11 @@ public interface MIMEConstants { // namespace URIs - public static String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"; + static final String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"; // QNames - public static QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content"); - public static QName QNAME_MULTIPART_RELATED = - new QName(NS_WSDL_MIME, "multipartRelated"); - public static QName QNAME_PART = new QName(NS_WSDL_MIME, "part"); - public static QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml"); + static final QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content"); + static final QName QNAME_MULTIPART_RELATED = new QName(NS_WSDL_MIME, "multipartRelated"); + static final QName QNAME_PART = new QName(NS_WSDL_MIME, "part"); + static final QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml"); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java 2013-04-04 15:26:43.148612393 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java 2013-04-04 15:26:43.092612392 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java 2013-04-04 15:26:43.364612396 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java 2013-04-04 15:26:43.312612396 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java 2013-04-04 15:26:43.572612399 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java 2013-04-04 15:26:43.524612399 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java 2013-04-04 15:26:43.788612403 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java 2013-04-04 15:26:43.736612402 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java 2013-04-04 15:26:43.996612406 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java 2013-04-04 15:26:43.948612406 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,118 +34,103 @@ public interface SchemaConstants { // namespace URIs - public static String NS_XMLNS = "http://www.w3.org/2000/xmlns/"; - public static String NS_XSD = "http://www.w3.org/2001/XMLSchema"; - public static String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"; + static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/"; + static final String NS_XSD = "http://www.w3.org/2001/XMLSchema"; + static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"; // QNames - public static QName QNAME_ALL = new QName(NS_XSD, "all"); - public static QName QNAME_ANNOTATION = new QName(NS_XSD, "annotation"); - public static QName QNAME_ANY = new QName(NS_XSD, "any"); - public static QName QNAME_ANY_ATTRIBUTE = new QName(NS_XSD, "anyAttribute"); - public static QName QNAME_ATTRIBUTE = new QName(NS_XSD, "attribute"); - public static QName QNAME_ATTRIBUTE_GROUP = - new QName(NS_XSD, "attributeGroup"); - public static QName QNAME_CHOICE = new QName(NS_XSD, "choice"); - public static QName QNAME_COMPLEX_CONTENT = - new QName(NS_XSD, "complexContent"); - public static QName QNAME_COMPLEX_TYPE = new QName(NS_XSD, "complexType"); - public static QName QNAME_ELEMENT = new QName(NS_XSD, "element"); - public static QName QNAME_ENUMERATION = new QName(NS_XSD, "enumeration"); - public static QName QNAME_EXTENSION = new QName(NS_XSD, "extension"); - public static QName QNAME_FIELD = new QName(NS_XSD, "field"); - public static QName QNAME_FRACTION_DIGITS = - new QName(NS_XSD, "fractionDigits"); - public static QName QNAME_GROUP = new QName(NS_XSD, "group"); - public static QName QNAME_IMPORT = new QName(NS_XSD, "import"); - public static QName QNAME_INCLUDE = new QName(NS_XSD, "include"); - public static QName QNAME_KEY = new QName(NS_XSD, "key"); - public static QName QNAME_KEYREF = new QName(NS_XSD, "keyref"); - public static QName QNAME_LENGTH = new QName(NS_XSD, "length"); - public static QName QNAME_LIST = new QName(NS_XSD, "list"); - public static QName QNAME_MAX_EXCLUSIVE = new QName(NS_XSD, "maxExclusive"); - public static QName QNAME_MAX_INCLUSIVE = new QName(NS_XSD, "maxInclusive"); - public static QName QNAME_MAX_LENGTH = new QName(NS_XSD, "maxLength"); - public static QName QNAME_MIN_EXCLUSIVE = new QName(NS_XSD, "minExclusive"); - public static QName QNAME_MIN_INCLUSIVE = new QName(NS_XSD, "minInclusive"); - public static QName QNAME_MIN_LENGTH = new QName(NS_XSD, "minLength"); - public static QName QNAME_NOTATION = new QName(NS_XSD, "notation"); - public static QName QNAME_RESTRICTION = new QName(NS_XSD, "restriction"); - public static QName QNAME_PATTERN = new QName(NS_XSD, "pattern"); - public static QName QNAME_PRECISION = new QName(NS_XSD, "precision"); - public static QName QNAME_REDEFINE = new QName(NS_XSD, "redefine"); - public static QName QNAME_SCALE = new QName(NS_XSD, "scale"); - public static QName QNAME_SCHEMA = new QName(NS_XSD, "schema"); - public static QName QNAME_SELECTOR = new QName(NS_XSD, "selector"); - public static QName QNAME_SEQUENCE = new QName(NS_XSD, "sequence"); - public static QName QNAME_SIMPLE_CONTENT = + static final QName QNAME_ALL = new QName(NS_XSD, "all"); + static final QName QNAME_ANNOTATION = new QName(NS_XSD, "annotation"); + static final QName QNAME_ANY = new QName(NS_XSD, "any"); + static final QName QNAME_ANY_ATTRIBUTE = new QName(NS_XSD, "anyAttribute"); + static final QName QNAME_ATTRIBUTE = new QName(NS_XSD, "attribute"); + static final QName QNAME_ATTRIBUTE_GROUP = new QName(NS_XSD, "attributeGroup"); + static final QName QNAME_CHOICE = new QName(NS_XSD, "choice"); + static final QName QNAME_COMPLEX_CONTENT = new QName(NS_XSD, "complexContent"); + static final QName QNAME_COMPLEX_TYPE = new QName(NS_XSD, "complexType"); + static final QName QNAME_ELEMENT = new QName(NS_XSD, "element"); + static final QName QNAME_ENUMERATION = new QName(NS_XSD, "enumeration"); + static final QName QNAME_EXTENSION = new QName(NS_XSD, "extension"); + static final QName QNAME_FIELD = new QName(NS_XSD, "field"); + static final QName QNAME_FRACTION_DIGITS = new QName(NS_XSD, "fractionDigits"); + static final QName QNAME_GROUP = new QName(NS_XSD, "group"); + static final QName QNAME_IMPORT = new QName(NS_XSD, "import"); + static final QName QNAME_INCLUDE = new QName(NS_XSD, "include"); + static final QName QNAME_KEY = new QName(NS_XSD, "key"); + static final QName QNAME_KEYREF = new QName(NS_XSD, "keyref"); + static final QName QNAME_LENGTH = new QName(NS_XSD, "length"); + static final QName QNAME_LIST = new QName(NS_XSD, "list"); + static final QName QNAME_MAX_EXCLUSIVE = new QName(NS_XSD, "maxExclusive"); + static final QName QNAME_MAX_INCLUSIVE = new QName(NS_XSD, "maxInclusive"); + static final QName QNAME_MAX_LENGTH = new QName(NS_XSD, "maxLength"); + static final QName QNAME_MIN_EXCLUSIVE = new QName(NS_XSD, "minExclusive"); + static final QName QNAME_MIN_INCLUSIVE = new QName(NS_XSD, "minInclusive"); + static final QName QNAME_MIN_LENGTH = new QName(NS_XSD, "minLength"); + static final QName QNAME_NOTATION = new QName(NS_XSD, "notation"); + static final QName QNAME_RESTRICTION = new QName(NS_XSD, "restriction"); + static final QName QNAME_PATTERN = new QName(NS_XSD, "pattern"); + static final QName QNAME_PRECISION = new QName(NS_XSD, "precision"); + static final QName QNAME_REDEFINE = new QName(NS_XSD, "redefine"); + static final QName QNAME_SCALE = new QName(NS_XSD, "scale"); + static final QName QNAME_SCHEMA = new QName(NS_XSD, "schema"); + static final QName QNAME_SELECTOR = new QName(NS_XSD, "selector"); + static final QName QNAME_SEQUENCE = new QName(NS_XSD, "sequence"); + static final QName QNAME_SIMPLE_CONTENT = new QName(NS_XSD, "simpleContent"); - public static QName QNAME_SIMPLE_TYPE = new QName(NS_XSD, "simpleType"); - public static QName QNAME_TOTAL_DIGITS = new QName(NS_XSD, "totalDigits"); - public static QName QNAME_UNIQUE = new QName(NS_XSD, "unique"); - public static QName QNAME_UNION = new QName(NS_XSD, "union"); - public static QName QNAME_WHITE_SPACE = new QName(NS_XSD, "whiteSpace"); + static final QName QNAME_SIMPLE_TYPE = new QName(NS_XSD, "simpleType"); + static final QName QNAME_TOTAL_DIGITS = new QName(NS_XSD, "totalDigits"); + static final QName QNAME_UNIQUE = new QName(NS_XSD, "unique"); + static final QName QNAME_UNION = new QName(NS_XSD, "union"); + static final QName QNAME_WHITE_SPACE = new QName(NS_XSD, "whiteSpace"); // QNames for built-in XSD types - public static QName QNAME_TYPE_STRING = new QName(NS_XSD, "string"); - public static QName QNAME_TYPE_NORMALIZED_STRING = - new QName(NS_XSD, "normalizedString"); - public static QName QNAME_TYPE_TOKEN = new QName(NS_XSD, "token"); - public static QName QNAME_TYPE_BYTE = new QName(NS_XSD, "byte"); - public static QName QNAME_TYPE_UNSIGNED_BYTE = - new QName(NS_XSD, "unsignedByte"); - public static QName QNAME_TYPE_BASE64_BINARY = - new QName(NS_XSD, "base64Binary"); - public static QName QNAME_TYPE_HEX_BINARY = new QName(NS_XSD, "hexBinary"); - public static QName QNAME_TYPE_INTEGER = new QName(NS_XSD, "integer"); - public static QName QNAME_TYPE_POSITIVE_INTEGER = - new QName(NS_XSD, "positiveInteger"); - public static QName QNAME_TYPE_NEGATIVE_INTEGER = - new QName(NS_XSD, "negativeInteger"); - public static QName QNAME_TYPE_NON_NEGATIVE_INTEGER = - new QName(NS_XSD, "nonNegativeInteger"); - public static QName QNAME_TYPE_NON_POSITIVE_INTEGER = - new QName(NS_XSD, "nonPositiveInteger"); - public static QName QNAME_TYPE_INT = new QName(NS_XSD, "int"); - public static QName QNAME_TYPE_UNSIGNED_INT = - new QName(NS_XSD, "unsignedInt"); - public static QName QNAME_TYPE_LONG = new QName(NS_XSD, "long"); - public static QName QNAME_TYPE_UNSIGNED_LONG = - new QName(NS_XSD, "unsignedLong"); - public static QName QNAME_TYPE_SHORT = new QName(NS_XSD, "short"); - public static QName QNAME_TYPE_UNSIGNED_SHORT = - new QName(NS_XSD, "unsignedShort"); - public static QName QNAME_TYPE_DECIMAL = new QName(NS_XSD, "decimal"); - public static QName QNAME_TYPE_FLOAT = new QName(NS_XSD, "float"); - public static QName QNAME_TYPE_DOUBLE = new QName(NS_XSD, "double"); - public static QName QNAME_TYPE_BOOLEAN = new QName(NS_XSD, "boolean"); - public static QName QNAME_TYPE_TIME = new QName(NS_XSD, "time"); - public static QName QNAME_TYPE_DATE_TIME = new QName(NS_XSD, "dateTime"); - public static QName QNAME_TYPE_DURATION = new QName(NS_XSD, "duration"); - public static QName QNAME_TYPE_DATE = new QName(NS_XSD, "date"); - public static QName QNAME_TYPE_G_MONTH = new QName(NS_XSD, "gMonth"); - public static QName QNAME_TYPE_G_YEAR = new QName(NS_XSD, "gYear"); - public static QName QNAME_TYPE_G_YEAR_MONTH = - new QName(NS_XSD, "gYearMonth"); - public static QName QNAME_TYPE_G_DAY = new QName(NS_XSD, "gDay"); - public static QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_XSD, "gMonthDay"); - public static QName QNAME_TYPE_NAME = new QName(NS_XSD, "Name"); - public static QName QNAME_TYPE_QNAME = new QName(NS_XSD, "QName"); - public static QName QNAME_TYPE_NCNAME = new QName(NS_XSD, "NCName"); - public static QName QNAME_TYPE_ANY_URI = new QName(NS_XSD, "anyURI"); - public static QName QNAME_TYPE_ID = new QName(NS_XSD, "ID"); - public static QName QNAME_TYPE_IDREF = new QName(NS_XSD, "IDREF"); - public static QName QNAME_TYPE_IDREFS = new QName(NS_XSD, "IDREFS"); - public static QName QNAME_TYPE_ENTITY = new QName(NS_XSD, "ENTITY"); - public static QName QNAME_TYPE_ENTITIES = new QName(NS_XSD, "ENTITIES"); - public static QName QNAME_TYPE_NOTATION = new QName(NS_XSD, "NOTATION"); - public static QName QNAME_TYPE_NMTOKEN = new QName(NS_XSD, "NMTOKEN"); - public static QName QNAME_TYPE_NMTOKENS = new QName(NS_XSD, "NMTOKENS"); + static final QName QNAME_TYPE_STRING = new QName(NS_XSD, "string"); + static final QName QNAME_TYPE_NORMALIZED_STRING = new QName(NS_XSD, "normalizedString"); + static final QName QNAME_TYPE_TOKEN = new QName(NS_XSD, "token"); + static final QName QNAME_TYPE_BYTE = new QName(NS_XSD, "byte"); + static final QName QNAME_TYPE_UNSIGNED_BYTE = new QName(NS_XSD, "unsignedByte"); + static final QName QNAME_TYPE_BASE64_BINARY = new QName(NS_XSD, "base64Binary"); + static final QName QNAME_TYPE_HEX_BINARY = new QName(NS_XSD, "hexBinary"); + static final QName QNAME_TYPE_INTEGER = new QName(NS_XSD, "integer"); + static final QName QNAME_TYPE_POSITIVE_INTEGER = new QName(NS_XSD, "positiveInteger"); + static final QName QNAME_TYPE_NEGATIVE_INTEGER = new QName(NS_XSD, "negativeInteger"); + static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER = new QName(NS_XSD, "nonNegativeInteger"); + static final QName QNAME_TYPE_NON_POSITIVE_INTEGER = new QName(NS_XSD, "nonPositiveInteger"); + static final QName QNAME_TYPE_INT = new QName(NS_XSD, "int"); + static final QName QNAME_TYPE_UNSIGNED_INT = new QName(NS_XSD, "unsignedInt"); + static final QName QNAME_TYPE_LONG = new QName(NS_XSD, "long"); + static final QName QNAME_TYPE_UNSIGNED_LONG = new QName(NS_XSD, "unsignedLong"); + static final QName QNAME_TYPE_SHORT = new QName(NS_XSD, "short"); + static final QName QNAME_TYPE_UNSIGNED_SHORT = new QName(NS_XSD, "unsignedShort"); + static final QName QNAME_TYPE_DECIMAL = new QName(NS_XSD, "decimal"); + static final QName QNAME_TYPE_FLOAT = new QName(NS_XSD, "float"); + static final QName QNAME_TYPE_DOUBLE = new QName(NS_XSD, "double"); + static final QName QNAME_TYPE_BOOLEAN = new QName(NS_XSD, "boolean"); + static final QName QNAME_TYPE_TIME = new QName(NS_XSD, "time"); + static final QName QNAME_TYPE_DATE_TIME = new QName(NS_XSD, "dateTime"); + static final QName QNAME_TYPE_DURATION = new QName(NS_XSD, "duration"); + static final QName QNAME_TYPE_DATE = new QName(NS_XSD, "date"); + static final QName QNAME_TYPE_G_MONTH = new QName(NS_XSD, "gMonth"); + static final QName QNAME_TYPE_G_YEAR = new QName(NS_XSD, "gYear"); + static final QName QNAME_TYPE_G_YEAR_MONTH = new QName(NS_XSD, "gYearMonth"); + static final QName QNAME_TYPE_G_DAY = new QName(NS_XSD, "gDay"); + static final QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_XSD, "gMonthDay"); + static final QName QNAME_TYPE_NAME = new QName(NS_XSD, "Name"); + static final QName QNAME_TYPE_QNAME = new QName(NS_XSD, "QName"); + static final QName QNAME_TYPE_NCNAME = new QName(NS_XSD, "NCName"); + static final QName QNAME_TYPE_ANY_URI = new QName(NS_XSD, "anyURI"); + static final QName QNAME_TYPE_ID = new QName(NS_XSD, "ID"); + static final QName QNAME_TYPE_IDREF = new QName(NS_XSD, "IDREF"); + static final QName QNAME_TYPE_IDREFS = new QName(NS_XSD, "IDREFS"); + static final QName QNAME_TYPE_ENTITY = new QName(NS_XSD, "ENTITY"); + static final QName QNAME_TYPE_ENTITIES = new QName(NS_XSD, "ENTITIES"); + static final QName QNAME_TYPE_NOTATION = new QName(NS_XSD, "NOTATION"); + static final QName QNAME_TYPE_NMTOKEN = new QName(NS_XSD, "NMTOKEN"); + static final QName QNAME_TYPE_NMTOKENS = new QName(NS_XSD, "NMTOKENS"); - public static QName QNAME_TYPE_LANGUAGE = new QName(NS_XSD, "language"); + static final QName QNAME_TYPE_LANGUAGE = new QName(NS_XSD, "language"); // QNames for special types - public static QName QNAME_TYPE_URTYPE = new QName(NS_XSD, "anyType"); - public static QName QNAME_TYPE_SIMPLE_URTYPE = - new QName(NS_XSD, "anySimpleType"); + static final QName QNAME_TYPE_URTYPE = new QName(NS_XSD, "anyType"); + static final QName QNAME_TYPE_SIMPLE_URTYPE = new QName(NS_XSD, "anySimpleType"); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java 2013-04-04 15:26:44.204612410 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java 2013-04-04 15:26:44.156612409 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java 2013-04-04 15:26:44.420612413 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java 2013-04-04 15:26:44.368612412 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java 2013-04-04 15:26:44.632612416 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java 2013-04-04 15:26:44.580612415 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,205 +35,122 @@ public interface SOAP12Constants { // namespace URIs - public static String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap12/"; - public static String NS_SOAP_ENCODING = - "http://schemas.xmlsoap.org/soap/encoding/"; + static final String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap12/"; + static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/"; // other URIs - public static String URI_SOAP_TRANSPORT_HTTP = - "http://www.w3.org/2003/05/soap/bindings/HTTP/"; - ; + static final String URI_SOAP_TRANSPORT_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"; // QNames - public static QName QNAME_ADDRESS = new QName(NS_WSDL_SOAP, "address"); - public static QName QNAME_BINDING = new QName(NS_WSDL_SOAP, "binding"); - public static QName QNAME_BODY = new QName(NS_WSDL_SOAP, "body"); - public static QName QNAME_FAULT = new QName(NS_WSDL_SOAP, "fault"); - public static QName QNAME_HEADER = new QName(NS_WSDL_SOAP, "header"); - public static QName QNAME_HEADERFAULT = - new QName(NS_WSDL_SOAP, "headerfault"); - public static QName QNAME_OPERATION = new QName(NS_WSDL_SOAP, "operation"); + static final QName QNAME_ADDRESS = new QName(NS_WSDL_SOAP, "address"); + static final QName QNAME_BINDING = new QName(NS_WSDL_SOAP, "binding"); + static final QName QNAME_BODY = new QName(NS_WSDL_SOAP, "body"); + static final QName QNAME_FAULT = new QName(NS_WSDL_SOAP, "fault"); + static final QName QNAME_HEADER = new QName(NS_WSDL_SOAP, "header"); + static final QName QNAME_HEADERFAULT = new QName(NS_WSDL_SOAP, "headerfault"); + static final QName QNAME_OPERATION = new QName(NS_WSDL_SOAP, "operation"); // SOAP encoding QNames - public static QName QNAME_TYPE_ARRAY = new QName(NS_SOAP_ENCODING, "Array"); - public static QName QNAME_ATTR_GROUP_COMMON_ATTRIBUTES = - new QName(NS_SOAP_ENCODING, "commonAttributes"); - public static QName QNAME_ATTR_ARRAY_TYPE = - new QName(NS_SOAP_ENCODING, "arrayType"); - public static QName QNAME_ATTR_ITEM_TYPE = - new QName(NS_SOAP_ENCODING, "itemType"); - public static QName QNAME_ATTR_ARRAY_SIZE = - new QName(NS_SOAP_ENCODING, "arraySize"); - public static QName QNAME_ATTR_OFFSET = - new QName(NS_SOAP_ENCODING, "offset"); - public static QName QNAME_ATTR_POSITION = - new QName(NS_SOAP_ENCODING, "position"); - - public static QName QNAME_TYPE_BASE64 = - new QName(NS_SOAP_ENCODING, "base64"); - - public static QName QNAME_ELEMENT_STRING = - new QName(NS_SOAP_ENCODING, "string"); - public static QName QNAME_ELEMENT_NORMALIZED_STRING = - new QName(NS_SOAP_ENCODING, "normalizedString"); - public static QName QNAME_ELEMENT_TOKEN = - new QName(NS_SOAP_ENCODING, "token"); - public static QName QNAME_ELEMENT_BYTE = - new QName(NS_SOAP_ENCODING, "byte"); - public static QName QNAME_ELEMENT_UNSIGNED_BYTE = - new QName(NS_SOAP_ENCODING, "unsignedByte"); - public static QName QNAME_ELEMENT_BASE64_BINARY = - new QName(NS_SOAP_ENCODING, "base64Binary"); - public static QName QNAME_ELEMENT_HEX_BINARY = - new QName(NS_SOAP_ENCODING, "hexBinary"); - public static QName QNAME_ELEMENT_INTEGER = - new QName(NS_SOAP_ENCODING, "integer"); - public static QName QNAME_ELEMENT_POSITIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "positiveInteger"); - public static QName QNAME_ELEMENT_NEGATIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "negativeInteger"); - public static QName QNAME_ELEMENT_NON_NEGATIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "nonNegativeInteger"); - public static QName QNAME_ELEMENT_NON_POSITIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "nonPositiveInteger"); - public static QName QNAME_ELEMENT_INT = new QName(NS_SOAP_ENCODING, "int"); - public static QName QNAME_ELEMENT_UNSIGNED_INT = - new QName(NS_SOAP_ENCODING, "unsignedInt"); - public static QName QNAME_ELEMENT_LONG = - new QName(NS_SOAP_ENCODING, "long"); - public static QName QNAME_ELEMENT_UNSIGNED_LONG = - new QName(NS_SOAP_ENCODING, "unsignedLong"); - public static QName QNAME_ELEMENT_SHORT = - new QName(NS_SOAP_ENCODING, "short"); - public static QName QNAME_ELEMENT_UNSIGNED_SHORT = - new QName(NS_SOAP_ENCODING, "unsignedShort"); - public static QName QNAME_ELEMENT_DECIMAL = - new QName(NS_SOAP_ENCODING, "decimal"); - public static QName QNAME_ELEMENT_FLOAT = - new QName(NS_SOAP_ENCODING, "float"); - public static QName QNAME_ELEMENT_DOUBLE = - new QName(NS_SOAP_ENCODING, "double"); - public static QName QNAME_ELEMENT_BOOLEAN = - new QName(NS_SOAP_ENCODING, "boolean"); - public static QName QNAME_ELEMENT_TIME = - new QName(NS_SOAP_ENCODING, "time"); - public static QName QNAME_ELEMENT_DATE_TIME = - new QName(NS_SOAP_ENCODING, "dateTime"); - public static QName QNAME_ELEMENT_DURATION = - new QName(NS_SOAP_ENCODING, "duration"); - public static QName QNAME_ELEMENT_DATE = - new QName(NS_SOAP_ENCODING, "date"); - public static QName QNAME_ELEMENT_G_MONTH = - new QName(NS_SOAP_ENCODING, "gMonth"); - public static QName QNAME_ELEMENT_G_YEAR = - new QName(NS_SOAP_ENCODING, "gYear"); - public static QName QNAME_ELEMENT_G_YEAR_MONTH = - new QName(NS_SOAP_ENCODING, "gYearMonth"); - public static QName QNAME_ELEMENT_G_DAY = - new QName(NS_SOAP_ENCODING, "gDay"); - public static QName QNAME_ELEMENT_G_MONTH_DAY = - new QName(NS_SOAP_ENCODING, "gMonthDay"); - public static QName QNAME_ELEMENT_NAME = - new QName(NS_SOAP_ENCODING, "Name"); - public static QName QNAME_ELEMENT_QNAME = - new QName(NS_SOAP_ENCODING, "QName"); - public static QName QNAME_ELEMENT_NCNAME = - new QName(NS_SOAP_ENCODING, "NCName"); - public static QName QNAME_ELEMENT_ANY_URI = - new QName(NS_SOAP_ENCODING, "anyURI"); - public static QName QNAME_ELEMENT_ID = new QName(NS_SOAP_ENCODING, "ID"); - public static QName QNAME_ELEMENT_IDREF = - new QName(NS_SOAP_ENCODING, "IDREF"); - public static QName QNAME_ELEMENT_IDREFS = - new QName(NS_SOAP_ENCODING, "IDREFS"); - public static QName QNAME_ELEMENT_ENTITY = - new QName(NS_SOAP_ENCODING, "ENTITY"); - public static QName QNAME_ELEMENT_ENTITIES = - new QName(NS_SOAP_ENCODING, "ENTITIES"); - public static QName QNAME_ELEMENT_NOTATION = - new QName(NS_SOAP_ENCODING, "NOTATION"); - public static QName QNAME_ELEMENT_NMTOKEN = - new QName(NS_SOAP_ENCODING, "NMTOKEN"); - public static QName QNAME_ELEMENT_NMTOKENS = - new QName(NS_SOAP_ENCODING, "NMTOKENS"); - - public static QName QNAME_TYPE_STRING = - new QName(NS_SOAP_ENCODING, "string"); - public static QName QNAME_TYPE_NORMALIZED_STRING = - new QName(NS_SOAP_ENCODING, "normalizedString"); - public static QName QNAME_TYPE_TOKEN = new QName(NS_SOAP_ENCODING, "token"); - public static QName QNAME_TYPE_BYTE = new QName(NS_SOAP_ENCODING, "byte"); - public static QName QNAME_TYPE_UNSIGNED_BYTE = - new QName(NS_SOAP_ENCODING, "unsignedByte"); - public static QName QNAME_TYPE_BASE64_BINARY = - new QName(NS_SOAP_ENCODING, "base64Binary"); - public static QName QNAME_TYPE_HEX_BINARY = - new QName(NS_SOAP_ENCODING, "hexBinary"); - public static QName QNAME_TYPE_INTEGER = - new QName(NS_SOAP_ENCODING, "integer"); - public static QName QNAME_TYPE_POSITIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "positiveInteger"); - public static QName QNAME_TYPE_NEGATIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "negativeInteger"); - public static QName QNAME_TYPE_NON_NEGATIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "nonNegativeInteger"); - public static QName QNAME_TYPE_NON_POSITIVE_INTEGER = - new QName(NS_SOAP_ENCODING, "nonPositiveInteger"); - public static QName QNAME_TYPE_INT = new QName(NS_SOAP_ENCODING, "int"); - public static QName QNAME_TYPE_UNSIGNED_INT = - new QName(NS_SOAP_ENCODING, "unsignedInt"); - public static QName QNAME_TYPE_LONG = new QName(NS_SOAP_ENCODING, "long"); - public static QName QNAME_TYPE_UNSIGNED_LONG = - new QName(NS_SOAP_ENCODING, "unsignedLong"); - public static QName QNAME_TYPE_SHORT = new QName(NS_SOAP_ENCODING, "short"); - public static QName QNAME_TYPE_UNSIGNED_SHORT = - new QName(NS_SOAP_ENCODING, "unsignedShort"); - public static QName QNAME_TYPE_DECIMAL = - new QName(NS_SOAP_ENCODING, "decimal"); - public static QName QNAME_TYPE_FLOAT = new QName(NS_SOAP_ENCODING, "float"); - public static QName QNAME_TYPE_DOUBLE = - new QName(NS_SOAP_ENCODING, "double"); - public static QName QNAME_TYPE_BOOLEAN = - new QName(NS_SOAP_ENCODING, "boolean"); - public static QName QNAME_TYPE_TIME = new QName(NS_SOAP_ENCODING, "time"); - public static QName QNAME_TYPE_DATE_TIME = - new QName(NS_SOAP_ENCODING, "dateTime"); - public static QName QNAME_TYPE_DURATION = - new QName(NS_SOAP_ENCODING, "duration"); - public static QName QNAME_TYPE_DATE = new QName(NS_SOAP_ENCODING, "date"); - public static QName QNAME_TYPE_G_MONTH = - new QName(NS_SOAP_ENCODING, "gMonth"); - public static QName QNAME_TYPE_G_YEAR = - new QName(NS_SOAP_ENCODING, "gYear"); - public static QName QNAME_TYPE_G_YEAR_MONTH = - new QName(NS_SOAP_ENCODING, "gYearMonth"); - public static QName QNAME_TYPE_G_DAY = new QName(NS_SOAP_ENCODING, "gDay"); - public static QName QNAME_TYPE_G_MONTH_DAY = - new QName(NS_SOAP_ENCODING, "gMonthDay"); - public static QName QNAME_TYPE_NAME = new QName(NS_SOAP_ENCODING, "Name"); - public static QName QNAME_TYPE_QNAME = new QName(NS_SOAP_ENCODING, "QName"); - public static QName QNAME_TYPE_NCNAME = - new QName(NS_SOAP_ENCODING, "NCName"); - public static QName QNAME_TYPE_ANY_URI = - new QName(NS_SOAP_ENCODING, "anyURI"); - public static QName QNAME_TYPE_ID = new QName(NS_SOAP_ENCODING, "ID"); - public static QName QNAME_TYPE_IDREF = new QName(NS_SOAP_ENCODING, "IDREF"); - public static QName QNAME_TYPE_IDREFS = - new QName(NS_SOAP_ENCODING, "IDREFS"); - public static QName QNAME_TYPE_ENTITY = - new QName(NS_SOAP_ENCODING, "ENTITY"); - public static QName QNAME_TYPE_ENTITIES = - new QName(NS_SOAP_ENCODING, "ENTITIES"); - public static QName QNAME_TYPE_NOTATION = - new QName(NS_SOAP_ENCODING, "NOTATION"); - public static QName QNAME_TYPE_NMTOKEN = - new QName(NS_SOAP_ENCODING, "NMTOKEN"); - public static QName QNAME_TYPE_NMTOKENS = - new QName(NS_SOAP_ENCODING, "NMTOKENS"); - public static QName QNAME_TYPE_LANGUAGE = - new QName(NS_SOAP_ENCODING, "LANGUAGE"); + static final QName QNAME_TYPE_ARRAY = new QName(NS_SOAP_ENCODING, "Array"); + static final QName QNAME_ATTR_GROUP_COMMON_ATTRIBUTES = new QName(NS_SOAP_ENCODING, "commonAttributes"); + static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_SOAP_ENCODING, "arrayType"); + static final QName QNAME_ATTR_ITEM_TYPE = new QName(NS_SOAP_ENCODING, "itemType"); + static final QName QNAME_ATTR_ARRAY_SIZE = new QName(NS_SOAP_ENCODING, "arraySize"); + static final QName QNAME_ATTR_OFFSET = new QName(NS_SOAP_ENCODING, "offset"); + static final QName QNAME_ATTR_POSITION = new QName(NS_SOAP_ENCODING, "position"); + + static final QName QNAME_TYPE_BASE64 = new QName(NS_SOAP_ENCODING, "base64"); + + static final QName QNAME_ELEMENT_STRING = new QName(NS_SOAP_ENCODING, "string"); + static final QName QNAME_ELEMENT_NORMALIZED_STRING = new QName(NS_SOAP_ENCODING, "normalizedString"); + static final QName QNAME_ELEMENT_TOKEN = new QName(NS_SOAP_ENCODING, "token"); + static final QName QNAME_ELEMENT_BYTE = new QName(NS_SOAP_ENCODING, "byte"); + static final QName QNAME_ELEMENT_UNSIGNED_BYTE = new QName(NS_SOAP_ENCODING, "unsignedByte"); + static final QName QNAME_ELEMENT_BASE64_BINARY = new QName(NS_SOAP_ENCODING, "base64Binary"); + static final QName QNAME_ELEMENT_HEX_BINARY = new QName(NS_SOAP_ENCODING, "hexBinary"); + static final QName QNAME_ELEMENT_INTEGER = new QName(NS_SOAP_ENCODING, "integer"); + static final QName QNAME_ELEMENT_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "positiveInteger"); + static final QName QNAME_ELEMENT_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "negativeInteger"); + static final QName QNAME_ELEMENT_NON_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonNegativeInteger"); + static final QName QNAME_ELEMENT_NON_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonPositiveInteger"); + static final QName QNAME_ELEMENT_INT = new QName(NS_SOAP_ENCODING, "int"); + static final QName QNAME_ELEMENT_UNSIGNED_INT = new QName(NS_SOAP_ENCODING, "unsignedInt"); + static final QName QNAME_ELEMENT_LONG = new QName(NS_SOAP_ENCODING, "long"); + static final QName QNAME_ELEMENT_UNSIGNED_LONG = new QName(NS_SOAP_ENCODING, "unsignedLong"); + static final QName QNAME_ELEMENT_SHORT = new QName(NS_SOAP_ENCODING, "short"); + static final QName QNAME_ELEMENT_UNSIGNED_SHORT = new QName(NS_SOAP_ENCODING, "unsignedShort"); + static final QName QNAME_ELEMENT_DECIMAL = new QName(NS_SOAP_ENCODING, "decimal"); + static final QName QNAME_ELEMENT_FLOAT = new QName(NS_SOAP_ENCODING, "float"); + static final QName QNAME_ELEMENT_DOUBLE = new QName(NS_SOAP_ENCODING, "double"); + static final QName QNAME_ELEMENT_BOOLEAN = new QName(NS_SOAP_ENCODING, "boolean"); + static final QName QNAME_ELEMENT_TIME = new QName(NS_SOAP_ENCODING, "time"); + static final QName QNAME_ELEMENT_DATE_TIME = new QName(NS_SOAP_ENCODING, "dateTime"); + static final QName QNAME_ELEMENT_DURATION = new QName(NS_SOAP_ENCODING, "duration"); + static final QName QNAME_ELEMENT_DATE = new QName(NS_SOAP_ENCODING, "date"); + static final QName QNAME_ELEMENT_G_MONTH = new QName(NS_SOAP_ENCODING, "gMonth"); + static final QName QNAME_ELEMENT_G_YEAR = new QName(NS_SOAP_ENCODING, "gYear"); + static final QName QNAME_ELEMENT_G_YEAR_MONTH = new QName(NS_SOAP_ENCODING, "gYearMonth"); + static final QName QNAME_ELEMENT_G_DAY = new QName(NS_SOAP_ENCODING, "gDay"); + static final QName QNAME_ELEMENT_G_MONTH_DAY = new QName(NS_SOAP_ENCODING, "gMonthDay"); + static final QName QNAME_ELEMENT_NAME = new QName(NS_SOAP_ENCODING, "Name"); + static final QName QNAME_ELEMENT_QNAME = new QName(NS_SOAP_ENCODING, "QName"); + static final QName QNAME_ELEMENT_NCNAME = new QName(NS_SOAP_ENCODING, "NCName"); + static final QName QNAME_ELEMENT_ANY_URI = new QName(NS_SOAP_ENCODING, "anyURI"); + static final QName QNAME_ELEMENT_ID = new QName(NS_SOAP_ENCODING, "ID"); + static final QName QNAME_ELEMENT_IDREF = new QName(NS_SOAP_ENCODING, "IDREF"); + static final QName QNAME_ELEMENT_IDREFS = new QName(NS_SOAP_ENCODING, "IDREFS"); + static final QName QNAME_ELEMENT_ENTITY = new QName(NS_SOAP_ENCODING, "ENTITY"); + static final QName QNAME_ELEMENT_ENTITIES = new QName(NS_SOAP_ENCODING, "ENTITIES"); + static final QName QNAME_ELEMENT_NOTATION = new QName(NS_SOAP_ENCODING, "NOTATION"); + static final QName QNAME_ELEMENT_NMTOKEN = new QName(NS_SOAP_ENCODING, "NMTOKEN"); + static final QName QNAME_ELEMENT_NMTOKENS = new QName(NS_SOAP_ENCODING, "NMTOKENS"); + + static final QName QNAME_TYPE_STRING = new QName(NS_SOAP_ENCODING, "string"); + static final QName QNAME_TYPE_NORMALIZED_STRING = new QName(NS_SOAP_ENCODING, "normalizedString"); + static final QName QNAME_TYPE_TOKEN = new QName(NS_SOAP_ENCODING, "token"); + static final QName QNAME_TYPE_BYTE = new QName(NS_SOAP_ENCODING, "byte"); + static final QName QNAME_TYPE_UNSIGNED_BYTE = new QName(NS_SOAP_ENCODING, "unsignedByte"); + static final QName QNAME_TYPE_BASE64_BINARY = new QName(NS_SOAP_ENCODING, "base64Binary"); + static final QName QNAME_TYPE_HEX_BINARY = new QName(NS_SOAP_ENCODING, "hexBinary"); + static final QName QNAME_TYPE_INTEGER = new QName(NS_SOAP_ENCODING, "integer"); + static final QName QNAME_TYPE_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "positiveInteger"); + static final QName QNAME_TYPE_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "negativeInteger"); + static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonNegativeInteger"); + static final QName QNAME_TYPE_NON_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonPositiveInteger"); + static final QName QNAME_TYPE_INT = new QName(NS_SOAP_ENCODING, "int"); + static final QName QNAME_TYPE_UNSIGNED_INT = new QName(NS_SOAP_ENCODING, "unsignedInt"); + static final QName QNAME_TYPE_LONG = new QName(NS_SOAP_ENCODING, "long"); + static final QName QNAME_TYPE_UNSIGNED_LONG = new QName(NS_SOAP_ENCODING, "unsignedLong"); + static final QName QNAME_TYPE_SHORT = new QName(NS_SOAP_ENCODING, "short"); + static final QName QNAME_TYPE_UNSIGNED_SHORT = new QName(NS_SOAP_ENCODING, "unsignedShort"); + static final QName QNAME_TYPE_DECIMAL = new QName(NS_SOAP_ENCODING, "decimal"); + static final QName QNAME_TYPE_FLOAT = new QName(NS_SOAP_ENCODING, "float"); + static final QName QNAME_TYPE_DOUBLE = new QName(NS_SOAP_ENCODING, "double"); + static final QName QNAME_TYPE_BOOLEAN = new QName(NS_SOAP_ENCODING, "boolean"); + static final QName QNAME_TYPE_TIME = new QName(NS_SOAP_ENCODING, "time"); + static final QName QNAME_TYPE_DATE_TIME = new QName(NS_SOAP_ENCODING, "dateTime"); + static final QName QNAME_TYPE_DURATION = new QName(NS_SOAP_ENCODING, "duration"); + static final QName QNAME_TYPE_DATE = new QName(NS_SOAP_ENCODING, "date"); + static final QName QNAME_TYPE_G_MONTH = new QName(NS_SOAP_ENCODING, "gMonth"); + static final QName QNAME_TYPE_G_YEAR = new QName(NS_SOAP_ENCODING, "gYear"); + static final QName QNAME_TYPE_G_YEAR_MONTH = new QName(NS_SOAP_ENCODING, "gYearMonth"); + static final QName QNAME_TYPE_G_DAY = new QName(NS_SOAP_ENCODING, "gDay"); + static final QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_SOAP_ENCODING, "gMonthDay"); + static final QName QNAME_TYPE_NAME = new QName(NS_SOAP_ENCODING, "Name"); + static final QName QNAME_TYPE_QNAME = new QName(NS_SOAP_ENCODING, "QName"); + static final QName QNAME_TYPE_NCNAME = new QName(NS_SOAP_ENCODING, "NCName"); + static final QName QNAME_TYPE_ANY_URI = new QName(NS_SOAP_ENCODING, "anyURI"); + static final QName QNAME_TYPE_ID = new QName(NS_SOAP_ENCODING, "ID"); + static final QName QNAME_TYPE_IDREF = new QName(NS_SOAP_ENCODING, "IDREF"); + static final QName QNAME_TYPE_IDREFS = new QName(NS_SOAP_ENCODING, "IDREFS"); + static final QName QNAME_TYPE_ENTITY = new QName(NS_SOAP_ENCODING, "ENTITY"); + static final QName QNAME_TYPE_ENTITIES = new QName(NS_SOAP_ENCODING, "ENTITIES"); + static final QName QNAME_TYPE_NOTATION = new QName(NS_SOAP_ENCODING, "NOTATION"); + static final QName QNAME_TYPE_NMTOKEN = new QName(NS_SOAP_ENCODING, "NMTOKEN"); + static final QName QNAME_TYPE_NMTOKENS = new QName(NS_SOAP_ENCODING, "NMTOKENS"); + static final QName QNAME_TYPE_LANGUAGE = new QName(NS_SOAP_ENCODING, "LANGUAGE"); // SOAP attributes with non-colonized names - public static QName QNAME_ATTR_ID = new QName("", "id"); - public static QName QNAME_ATTR_HREF = new QName("", "ref"); + static final QName QNAME_ATTR_ID = new QName("", "id"); + static final QName QNAME_ATTR_HREF = new QName("", "ref"); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java 2013-04-04 15:26:44.884612420 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java 2013-04-04 15:26:44.832612419 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java 2013-04-04 15:26:45.136612424 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java 2013-04-04 15:26:45.084612423 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java 2013-04-04 15:26:45.364612428 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java 2013-04-04 15:26:45.308612426 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java 2013-04-04 15:26:45.604612431 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java 2013-04-04 15:26:45.556612431 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java 2013-04-04 15:26:45.864612435 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java 2013-04-04 15:26:45.808612434 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java 2013-04-04 15:26:46.152612440 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java 2013-04-04 15:26:46.084612439 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java 2013-04-04 15:26:46.416612444 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java 2013-04-04 15:26:46.368612443 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java 2013-04-04 15:26:46.648612448 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java 2013-04-04 15:26:46.592612446 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java 2013-04-04 15:26:46.892612451 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java 2013-04-04 15:26:46.836612450 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java 2013-04-04 15:26:47.136612455 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java 2013-04-04 15:26:47.080612454 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java 2013-04-04 15:26:47.380612458 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java 2013-04-04 15:26:47.320612458 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +34,6 @@ import javax.xml.namespace.QName; import java.util.*; -import org.xml.sax.helpers.LocatorImpl; - /** * An abstract class for documents containing entities. * @@ -163,10 +161,11 @@ private final Set includedDocuments; private final List includedEntities; - private class LocallyValidatingAction implements EntityAction { + private static class LocallyValidatingAction implements EntityAction { public LocallyValidatingAction() { } + @Override public void perform(Entity entity) { try { entity.validateThis(); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java 2013-04-04 15:26:47.612612463 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java 2013-04-04 15:26:47.560612461 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java 2013-04-04 15:26:47.844612466 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java 2013-04-04 15:26:47.784612465 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java 2013-04-04 15:26:48.076612470 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java 2013-04-04 15:26:48.020612468 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java 2013-04-04 15:26:48.344612473 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java 2013-04-04 15:26:48.276612472 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java 2013-04-04 15:26:48.564612477 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java 2013-04-04 15:26:48.512612477 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java 2013-04-04 15:26:48.784612481 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java 2013-04-04 15:26:48.732612480 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java 2013-04-04 15:26:49.000612484 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java 2013-04-04 15:26:48.952612483 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java 2013-04-04 15:26:49.212612487 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java 2013-04-04 15:26:49.164612486 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java 2013-04-04 15:26:49.492612492 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java 2013-04-04 15:26:49.436612490 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java 2013-04-04 15:26:49.732612496 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java 2013-04-04 15:26:49.680612494 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java 2013-04-04 15:26:49.948612499 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java 2013-04-04 15:26:49.892612498 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java 2013-04-04 15:26:50.180612503 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java 2013-04-04 15:26:50.132612502 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java 2013-04-04 15:26:50.440612507 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java 2013-04-04 15:26:50.384612505 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java 2013-04-04 15:26:50.740612511 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java 2013-04-04 15:26:50.684612510 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java 2013-04-04 15:26:51.012612515 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java 2013-04-04 15:26:50.960612514 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java 2013-04-04 15:26:51.292612520 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java 2013-04-04 15:26:51.236612518 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java 2013-04-04 15:26:51.544612524 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java 2013-04-04 15:26:51.496612523 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java 2013-04-04 15:26:51.784612527 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java 2013-04-04 15:26:51.732612526 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.tools.internal.ws.wsdl.framework; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * An exception signalling a parsing error. --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java 2013-04-04 15:26:52.016612531 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java 2013-04-04 15:26:51.964612530 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java 2013-04-04 15:26:52.288612535 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java 2013-04-04 15:26:52.232612534 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java 2013-04-04 15:26:52.500612538 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java 2013-04-04 15:26:52.452612537 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java 2013-04-04 15:26:52.780612543 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java 2013-04-04 15:26:52.724612542 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java 2013-04-04 15:26:53.048612547 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java 2013-04-04 15:26:52.984612546 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,17 +43,12 @@ if (idPos >= max) { LocationContext newContexts[] = new LocationContext[max * 2]; System.arraycopy(contexts, 0, newContexts, 0, max); - max *= 2; contexts = newContexts; } currentContext = contexts[idPos]; if (currentContext == null) { contexts[idPos] = currentContext = new LocationContext(); } - if (idPos > 0) { - currentContext.setParent(contexts[idPos - 1]); - } - } public void pop() { @@ -63,7 +58,7 @@ } } - public void reset() { + public final void reset() { contexts = new LocationContext[32]; idPos = 0; contexts[idPos] = currentContext = new LocationContext(); @@ -91,11 +86,6 @@ return location; } - void setParent(LocationContext parent) { - parentLocation = parent; - } - private String location; - private LocationContext parentLocation; } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java 2013-04-04 15:26:53.340612551 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java 2013-04-04 15:26:53.276612550 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java 2013-04-04 15:26:53.580612555 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java 2013-04-04 15:26:53.532612554 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -70,6 +70,7 @@ */ protected abstract String findExternalResource( String nsURI, String localName, Attributes atts); + @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { super.startElement(namespaceURI, localName, qName, atts); @@ -79,16 +80,17 @@ try { // absolutize URL. - String lsi = locator.getSystemId(); - String ref; - if (lsi.startsWith("jar:")) { - int bangIdx = lsi.indexOf('!'); - if (bangIdx > 0) { - ref = new URL(new URL(lsi), relativeRef).toString(); - } else - ref = relativeRef; - } else - ref = new URI(lsi).resolve(new URI(relativeRef)).toString(); + assert locator != null; + String lsi = locator.getSystemId(); + String ref; + if (lsi.startsWith("jar:")) { + int bangIdx = lsi.indexOf('!'); + if (bangIdx > 0) { + ref = new URL(new URL(lsi), relativeRef).toString(); + } else + ref = relativeRef; + } else + ref = new URI(lsi).resolve(new URI(relativeRef)).toString(); // then parse this schema as well, // but don't mark this document as a root. @@ -112,6 +114,7 @@ private Locator locator; + @Override public void setDocumentLocator(Locator locator) { super.setDocumentLocator(locator); this.locator = locator; --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java 2013-04-04 15:26:53.808612559 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java 2013-04-04 15:26:53.760612558 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,114 +32,114 @@ */ public interface Constants { // WSDL element tags - public static String TAG_BINDING = "binding"; - public static String TAG_DEFINITIONS = "definitions"; - public static String TAG_DOCUMENTATION = "documentation"; - public static String TAG_MESSAGE = "message"; - public static String TAG_PART = "part"; - public static String TAG_PORT_TYPE = "portType"; - public static String TAG_TYPES = "types"; - public static String TAG_OPERATION = "operation"; - public static String TAG_INPUT = "input"; - public static String TAG_OUTPUT = "output"; - public static String TAG_FAULT = "fault"; - public static String TAG_SERVICE = "service"; - public static String TAG_PORT = "port"; - public static String TAG_ = ""; + static final String TAG_BINDING = "binding"; + static final String TAG_DEFINITIONS = "definitions"; + static final String TAG_DOCUMENTATION = "documentation"; + static final String TAG_MESSAGE = "message"; + static final String TAG_PART = "part"; + static final String TAG_PORT_TYPE = "portType"; + static final String TAG_TYPES = "types"; + static final String TAG_OPERATION = "operation"; + static final String TAG_INPUT = "input"; + static final String TAG_OUTPUT = "output"; + static final String TAG_FAULT = "fault"; + static final String TAG_SERVICE = "service"; + static final String TAG_PORT = "port"; + static final String TAG_ = ""; // WSDL attribute names - public static String ATTR_ELEMENT = "element"; - public static String ATTR_NAME = "name"; - public static String ATTR_REQUIRED = "required"; - public static String ATTR_TARGET_NAMESPACE = "targetNamespace"; - public static String ATTR_TYPE = "type"; - public static String ATTR_MESSAGE = "message"; - public static String ATTR_BINDING = "binding"; - public static String ATTR_LOCATION = "location"; - public static String ATTR_TRANSPORT = "transport"; - public static String ATTR_STYLE = "style"; - public static String ATTR_USE = "use"; - public static String ATTR_NAMESPACE = "namespace"; - public static String ATTR_ENCODING_STYLE = "encodingStyle"; - public static String ATTR_PART = "part"; - public static String ATTR_PARTS = "parts"; - public static String ATTR_SOAP_ACTION = "soapAction"; - public static String ATTR_PARAMETER_ORDER = "parameterOrder"; - public static String ATTR_VERB = "verb"; + static final String ATTR_ELEMENT = "element"; + static final String ATTR_NAME = "name"; + static final String ATTR_REQUIRED = "required"; + static final String ATTR_TARGET_NAMESPACE = "targetNamespace"; + static final String ATTR_TYPE = "type"; + static final String ATTR_MESSAGE = "message"; + static final String ATTR_BINDING = "binding"; + static final String ATTR_LOCATION = "location"; + static final String ATTR_TRANSPORT = "transport"; + static final String ATTR_STYLE = "style"; + static final String ATTR_USE = "use"; + static final String ATTR_NAMESPACE = "namespace"; + static final String ATTR_ENCODING_STYLE = "encodingStyle"; + static final String ATTR_PART = "part"; + static final String ATTR_PARTS = "parts"; + static final String ATTR_SOAP_ACTION = "soapAction"; + static final String ATTR_PARAMETER_ORDER = "parameterOrder"; + static final String ATTR_VERB = "verb"; // schema attribute names - public static String ATTR_ID = "id"; - public static String ATTR_VERSION = "version"; - public static String ATTR_ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault"; - public static String ATTR_BLOCK_DEFAULT = "blockDefault"; - public static String ATTR_ELEMENT_FORM_DEFAULT = "elementFormDefault"; - public static String ATTR_FINAL_DEFAULT = "finalDefault"; - public static String ATTR_ABSTRACT = "abstract"; - public static String ATTR_NILLABLE = "nillable"; - public static String ATTR_DEFAULT = "default"; - public static String ATTR_FIXED = "fixed"; - public static String ATTR_FORM = "form"; - public static String ATTR_BLOCK = "block"; - public static String ATTR_FINAL = "final"; - public static String ATTR_REF = "ref"; - public static String ATTR_SUBSTITUTION_GROUP = "substitutionGroup"; - public static String ATTR_MIN_OCCURS = "minOccurs"; - public static String ATTR_MAX_OCCURS = "maxOccurs"; - public static String ATTR_PROCESS_CONTENTS = "processContents"; - public static String ATTR_MIXED = "mixed"; - public static String ATTR_BASE = "base"; - public static String ATTR_VALUE = "value"; - public static String ATTR_XPATH = "xpath"; - public static String ATTR_SCHEMA_LOCATION = "schemaLocation"; - public static String ATTR_REFER = "refer"; - public static String ATTR_ITEM_TYPE = "itemType"; - public static String ATTR_PUBLIC = "public"; - public static String ATTR_SYSTEM = "system"; - public static String ATTR_MEMBER_TYPES = "memberTypes"; - public static String ATTR_ = ""; + static final String ATTR_ID = "id"; + static final String ATTR_VERSION = "version"; + static final String ATTR_ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault"; + static final String ATTR_BLOCK_DEFAULT = "blockDefault"; + static final String ATTR_ELEMENT_FORM_DEFAULT = "elementFormDefault"; + static final String ATTR_FINAL_DEFAULT = "finalDefault"; + static final String ATTR_ABSTRACT = "abstract"; + static final String ATTR_NILLABLE = "nillable"; + static final String ATTR_DEFAULT = "default"; + static final String ATTR_FIXED = "fixed"; + static final String ATTR_FORM = "form"; + static final String ATTR_BLOCK = "block"; + static final String ATTR_FINAL = "final"; + static final String ATTR_REF = "ref"; + static final String ATTR_SUBSTITUTION_GROUP = "substitutionGroup"; + static final String ATTR_MIN_OCCURS = "minOccurs"; + static final String ATTR_MAX_OCCURS = "maxOccurs"; + static final String ATTR_PROCESS_CONTENTS = "processContents"; + static final String ATTR_MIXED = "mixed"; + static final String ATTR_BASE = "base"; + static final String ATTR_VALUE = "value"; + static final String ATTR_XPATH = "xpath"; + static final String ATTR_SCHEMA_LOCATION = "schemaLocation"; + static final String ATTR_REFER = "refer"; + static final String ATTR_ITEM_TYPE = "itemType"; + static final String ATTR_PUBLIC = "public"; + static final String ATTR_SYSTEM = "system"; + static final String ATTR_MEMBER_TYPES = "memberTypes"; + static final String ATTR_ = ""; // WSDL attribute values - public static String ATTRVALUE_RPC = "rpc"; - public static String ATTRVALUE_DOCUMENT = "document"; - public static String ATTRVALUE_LITERAL = "literal"; - public static String ATTRVALUE_ENCODED = "encoded"; + static final String ATTRVALUE_RPC = "rpc"; + static final String ATTRVALUE_DOCUMENT = "document"; + static final String ATTRVALUE_LITERAL = "literal"; + static final String ATTRVALUE_ENCODED = "encoded"; // schema attribute values - public static String ATTRVALUE_QUALIFIED = "qualified"; - public static String ATTRVALUE_UNQUALIFIED = "unqualified"; - public static String ATTRVALUE_ALL = "#all"; - public static String ATTRVALUE_SUBSTITUTION = "substitution"; - public static String ATTRVALUE_EXTENSION = "extension"; - public static String ATTRVALUE_RESTRICTION = "restriction"; - public static String ATTRVALUE_LIST = "list"; - public static String ATTRVALUE_UNION = "union"; - public static String ATTRVALUE_UNBOUNDED = "unbounded"; - public static String ATTRVALUE_PROHIBITED = "prohibited"; - public static String ATTRVALUE_OPTIONAL = "optional"; - public static String ATTRVALUE_REQUIRED = "required"; - public static String ATTRVALUE_LAX = "lax"; - public static String ATTRVALUE_SKIP = "skip"; - public static String ATTRVALUE_STRICT = "strict"; - public static String ATTRVALUE_ANY = "##any"; - public static String ATTRVALUE_LOCAL = "##local"; - public static String ATTRVALUE_OTHER = "##other"; - public static String ATTRVALUE_TARGET_NAMESPACE = "##targetNamespace"; - public static String ATTRVALUE_ = ""; + static final String ATTRVALUE_QUALIFIED = "qualified"; + static final String ATTRVALUE_UNQUALIFIED = "unqualified"; + static final String ATTRVALUE_ALL = "#all"; + static final String ATTRVALUE_SUBSTITUTION = "substitution"; + static final String ATTRVALUE_EXTENSION = "extension"; + static final String ATTRVALUE_RESTRICTION = "restriction"; + static final String ATTRVALUE_LIST = "list"; + static final String ATTRVALUE_UNION = "union"; + static final String ATTRVALUE_UNBOUNDED = "unbounded"; + static final String ATTRVALUE_PROHIBITED = "prohibited"; + static final String ATTRVALUE_OPTIONAL = "optional"; + static final String ATTRVALUE_REQUIRED = "required"; + static final String ATTRVALUE_LAX = "lax"; + static final String ATTRVALUE_SKIP = "skip"; + static final String ATTRVALUE_STRICT = "strict"; + static final String ATTRVALUE_ANY = "##any"; + static final String ATTRVALUE_LOCAL = "##local"; + static final String ATTRVALUE_OTHER = "##other"; + static final String ATTRVALUE_TARGET_NAMESPACE = "##targetNamespace"; + static final String ATTRVALUE_ = ""; // namespace URIs - public static String NS_XML = "http://www.w3.org/XML/1998/namespace"; - public static String NS_XMLNS = "http://www.w3.org/2000/xmlns/"; - public static String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/"; - public static String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"; - public static String NS_WSDL_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"; - public static String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"; - public static String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"; - public static String NS_XSD = "http://www.w3.org/2001/XMLSchema"; - public static String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"; - public static String NS_ = ""; + static final String NS_XML = "http://www.w3.org/XML/1998/namespace"; + static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/"; + static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + static final String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"; + static final String NS_WSDL_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"; + static final String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"; + static final String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"; + static final String NS_XSD = "http://www.w3.org/2001/XMLSchema"; + static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"; + static final String NS_ = ""; // other constants - public static String XMLNS = "xmlns"; - public static String TRUE = "true"; - public static String FALSE = "false"; + static final String XMLNS = "xmlns"; + static final String TRUE = "true"; + static final String FALSE = "false"; } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java 2013-04-04 15:26:54.036612563 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java 2013-04-04 15:26:53.984612561 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java 2013-04-04 15:26:54.280612566 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java 2013-04-04 15:26:54.228612566 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,15 +26,12 @@ package com.sun.tools.internal.ws.wsdl.parser; import com.sun.istack.internal.NotNull; -import com.sun.tools.internal.ws.resources.WscompileMessages; -import com.sun.tools.internal.ws.wscompile.AbortException; -import com.sun.tools.internal.ws.wscompile.DefaultAuthenticator; +import com.sun.tools.internal.ws.util.xml.XmlUtil; import com.sun.tools.internal.ws.wscompile.ErrorReceiver; import com.sun.tools.internal.ws.wscompile.WsimportOptions; import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants; import com.sun.tools.internal.xjc.reader.internalizer.LocatorTable; import com.sun.xml.internal.bind.marshaller.DataWriter; -import com.sun.xml.internal.ws.util.JAXWSUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -51,9 +48,6 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXResult; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLSession; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -119,11 +113,13 @@ this.errorReceiver = errReceiver; this.logic = logic; try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + // secure xml processing can be switched off if input requires it + boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; + DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled); dbf.setNamespaceAware(true); this.documentBuilder = dbf.newDocumentBuilder(); - this.parserFactory = SAXParserFactory.newInstance(); + this.parserFactory = XmlUtil.newSAXParserFactory(secureProcessingEnabled); this.parserFactory.setNamespaceAware(true); } catch (ParserConfigurationException e) { throw new AssertionError(e); @@ -368,7 +364,10 @@ public void dump(OutputStream out) throws IOException { try { // create identity transformer - Transformer it = TransformerFactory.newInstance().newTransformer(); + // secure xml processing can be switched off if input requires it + boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; + TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); + Transformer it = tf.newTransformer(); for (Map.Entry e : core.entrySet()) { out.write(("---<< " + e.getKey() + '\n').getBytes()); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestParser.java 2013-04-04 15:26:54.520612570 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestParser.java 2013-04-04 15:26:54.468612569 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java 2013-04-04 15:26:54.768612573 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java 2013-04-04 15:26:54.716612573 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java 2013-04-04 15:26:55.016612578 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java 2013-04-04 15:26:54.964612577 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java 2013-04-04 15:26:55.280612582 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java 2013-04-04 15:26:55.228612581 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java 2013-04-04 15:26:55.528612586 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java 2013-04-04 15:26:55.468612585 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -36,12 +36,8 @@ import com.sun.xml.internal.bind.v2.util.EditDistance; import com.sun.xml.internal.ws.util.DOMUtil; import com.sun.xml.internal.ws.util.JAXWSUtils; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import com.sun.xml.internal.ws.util.xml.XmlUtil; +import org.w3c.dom.*; import org.xml.sax.SAXParseException; import javax.xml.namespace.NamespaceContext; @@ -52,10 +48,8 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.Map; import java.util.Set; @@ -65,16 +59,15 @@ * @author Vivek Pandey */ public class Internalizer { - private static final XPathFactory xpf = XPathFactory.newInstance(); + + private static final XPathFactory xpf = XmlUtil.newXPathFactory(true); private final XPath xpath = xpf.newXPath(); - private final WsimportOptions options; private final DOMForest forest; private final ErrorReceiver errorReceiver; public Internalizer(DOMForest forest, WsimportOptions options, ErrorReceiver errorReceiver) { this.forest = forest; - this.options = options; this.errorReceiver = errorReceiver; } @@ -82,15 +75,6 @@ for (Element jaxwsBinding : forest.outerMostBindings) { internalize(jaxwsBinding, jaxwsBinding); } - /* - Map targetNodes = new HashMap(); - for (Element jaxwsBinding : forest.outerMostBindings) { - buildTargetNodeMap(jaxwsBinding, jaxwsBinding, targetNodes); - } - for (Element jaxwsBinding : forest.outerMostBindings) { - move(jaxwsBinding, targetNodes); - } - */ } /** @@ -100,12 +84,15 @@ NamedNodeMap atts = bindings.getAttributes(); for (int i = 0; i < atts.getLength(); i++) { Attr a = (Attr) atts.item(i); - if (a.getNamespaceURI() != null) + if (a.getNamespaceURI() != null) { continue; // all foreign namespace OK. - if (a.getLocalName().equals("node")) + } + if (a.getLocalName().equals("node")) { continue; - if (a.getLocalName().equals("wsdlLocation")) + } + if (a.getLocalName().equals("wsdlLocation")) { continue; + } // TODO: flag error for this undefined attribute } @@ -181,9 +168,9 @@ //if target is null or empty it means the xpath evaluation has some problem, // just return - if (targetNodes == null && hasNode && !isToplevelBinding) + if (targetNodes == null && hasNode && !isToplevelBinding) { return; - + } if (hasNode) { if (targetNodes != null) { @@ -191,10 +178,11 @@ insertBinding(bindings, targetNodes.item(i)); // look for child and process them recursively Element[] children = getChildElements(bindings); - for (Element child : children) - if("bindings".equals(child.getLocalName())) { + for (Element child : children) { + if ("bindings".equals(child.getLocalName())) { internalize(child, targetNodes.item(i)); } + } } } } @@ -202,8 +190,9 @@ // look for child and process them recursively Element[] children = getChildElements(bindings); - for (Element child : children) + for (Element child : children) { internalize(child, target); + } } } @@ -226,105 +215,20 @@ } } - - /** - * Determines the target node of the "bindings" element - * by using the inherited target node, then put - * the result into the "result" map. - */ - /* TODO Remove this logic if there are no regressions with new internalization logic - private void buildTargetNodeMap(Element bindings, Node inheritedTarget, Map result) { - // start by the inherited target - Node target = inheritedTarget; - - validate(bindings); // validate this node - - // look for @wsdlLocation - if (isTopLevelBinding(bindings)) { - String wsdlLocation; - if (bindings.getAttributeNode("wsdlLocation") != null) { - wsdlLocation = bindings.getAttribute("wsdlLocation"); - - try { - // absolutize this URI. - // TODO: use the URI class - // TODO: honor xml:base - wsdlLocation = new URL(new URL(forest.getSystemId(bindings.getOwnerDocument())), - wsdlLocation).toExternalForm(); - } catch (MalformedURLException e) { - wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); - } - } else { - //the node does not have - wsdlLocation = forest.getFirstRootDocument(); - } - target = forest.get(wsdlLocation); - - if (target == null) { - reportError(bindings, WsdlMessages.INTERNALIZER_INCORRECT_SCHEMA_REFERENCE(wsdlLocation, EditDistance.findNearest(wsdlLocation, forest.listSystemIDs()))); - return; // abort processing this - } - } - - //if the target node is xs:schema, declare the jaxb version on it as latter on it will be - //required by the inlined schema bindings - - Element element = DOMUtil.getFirstElementChild(target); - if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) { - //get all schema elements - Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types"); - if (type != null) { - for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) { - if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) { - schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS); - } - - //add jaxb:bindings version info. Lets put it to 1.0, may need to change latter - if (!schemaElement.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "version")) { - schemaElement.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:version", JAXWSBindingsConstants.JAXB_BINDING_VERSION); - } - } - } - } - - - boolean hasNode = true; - if ((isJAXWSBindings(bindings) || isJAXBBindings(bindings)) && bindings.getAttributeNode("node") != null) { - target = evaluateXPathNode(bindings, target, bindings.getAttribute("node"), new NamespaceContextImpl(bindings)); - } else - if (isJAXWSBindings(bindings) && (bindings.getAttributeNode("node") == null) && !isTopLevelBinding(bindings)) { - hasNode = false; - } else - if (isGlobalBinding(bindings) && !isWSDLDefinition(target) && isTopLevelBinding(bindings.getParentNode())) { - target = getWSDLDefintionNode(bindings, target); - } - - //if target is null it means the xpath evaluation has some problem, - // just return - if (target == null) - return; - - // update the result map - if (hasNode) - result.put(bindings, target); - - // look for child and process them recursively - Element[] children = getChildElements(bindings); - for (Element child : children) - buildTargetNodeMap(child, target, result); - } - */ private NodeList getWSDLDefintionNode(Node bindings, Node target) { return evaluateXPathMultiNode(bindings, target, "wsdl:definitions", new NamespaceContext() { + @Override public String getNamespaceURI(String prefix) { return "http://schemas.xmlsoap.org/wsdl/"; } + @Override public String getPrefix(String nsURI) { throw new UnsupportedOperationException(); } + @Override public Iterator getPrefixes(String namespaceURI) { throw new UnsupportedOperationException(); } @@ -332,8 +236,9 @@ } private boolean isWSDLDefinition(Node target) { - if (target == null) + if (target == null) { return false; + } String localName = target.getLocalName(); String nsURI = target.getNamespaceURI(); return fixNull(localName).equals("definitions") && fixNull(nsURI).equals("http://schemas.xmlsoap.org/wsdl/"); @@ -369,43 +274,17 @@ NodeList children = parent.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node item = children.item(i); - if (!(item instanceof Element)) continue; - + if (!(item instanceof Element)) { + continue; + } if (JAXWSBindingsConstants.NS_JAXWS_BINDINGS.equals(item.getNamespaceURI()) || - JAXWSBindingsConstants.NS_JAXB_BINDINGS.equals(item.getNamespaceURI())) + JAXWSBindingsConstants.NS_JAXB_BINDINGS.equals(item.getNamespaceURI())) { a.add((Element) item); + } } return a.toArray(new Element[a.size()]); } - private Node evaluateXPathNode(Node bindings, Node target, String expression, NamespaceContext namespaceContext) { - NodeList nlst; - try { - xpath.setNamespaceContext(namespaceContext); - nlst = (NodeList) xpath.evaluate(expression, target, XPathConstants.NODESET); - } catch (XPathExpressionException e) { - reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATION_ERROR(e.getMessage()), e); - return null; // abort processing this - } - - if (nlst.getLength() == 0) { - reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(expression)); - return null; // abort - } - - if (nlst.getLength() != 1) { - reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(expression, nlst.getLength())); - return null; // abort - } - - Node rnode = nlst.item(0); - if (!(rnode instanceof Element)) { - reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(expression)); - return null; // abort - } - return rnode; - } - private NodeList evaluateXPathMultiNode(Node bindings, Node target, String expression, NamespaceContext namespaceContext) { NodeList nlst; try { @@ -424,35 +303,6 @@ return nlst; } - /** - * Moves JAXWS customizations under their respective target nodes. - */ - private void move(Element bindings, Map targetNodes) { - Node target = targetNodes.get(bindings); - if (target == null) - // this must be the result of an error on the external binding. - // recover from the error by ignoring this node - return; - - Element[] children = DOMUtils.getChildElements(bindings); - - for (Element item : children) { - if ("bindings".equals(item.getLocalName())) { - // process child recursively - move(item, targetNodes); - } else if (isGlobalBinding(item)) { - target = targetNodes.get(item); - moveUnder(item, (Element) target); - } else { - if (!(target instanceof Element)) { - return; // abort - } - // move this node under the target - moveUnder(item, (Element) target); - } - } - } - private boolean isJAXBBindingElement(Element e) { return fixNull(e.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS); } @@ -536,8 +386,11 @@ Attr a = (Attr) atts.item(i); if (Constants.NS_XMLNS.equals(a.getNamespaceURI())) { String prefix; - if (a.getName().indexOf(':') == -1) prefix = ""; - else prefix = a.getLocalName(); + if (a.getName().indexOf(':') == -1) { + prefix = ""; + } else { + prefix = a.getLocalName(); + } if (inscopes.add(prefix) && p != e) { // if this is the first time we see this namespace bindings, @@ -550,8 +403,9 @@ } } - if (p.getParentNode() instanceof Document) + if (p.getParentNode() instanceof Document) { break; + } p = (Element) p.getParentNode(); } @@ -567,15 +421,17 @@ public Element refineSchemaTarget(Element target) { // look for existing xs:annotation Element annotation = DOMUtils.getFirstChildElement(target, Constants.NS_XSD, "annotation"); - if (annotation == null) + if (annotation == null) { // none exists. need to make one annotation = insertXMLSchemaElement(target, "annotation"); + } // then look for appinfo Element appinfo = DOMUtils.getFirstChildElement(annotation, Constants.NS_XSD, "appinfo"); - if (appinfo == null) + if (appinfo == null) { // none exists. need to make one appinfo = insertXMLSchemaElement(annotation, "appinfo"); + } return appinfo; } @@ -583,9 +439,10 @@ public Element refineWSDLTarget(Element target) { // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); - if (JAXWSBindings == null) + if (JAXWSBindings == null) { // none exists. need to make one JAXWSBindings = insertJAXWSBindingsElement(target, "bindings"); + } return JAXWSBindings; } @@ -600,17 +457,21 @@ // the namespace binding. String qname = parent.getTagName(); int idx = qname.indexOf(':'); - if (idx == -1) qname = localName; - else qname = qname.substring(0, idx + 1) + localName; + if (idx == -1) { + qname = localName; + } else { + qname = qname.substring(0, idx + 1) + localName; + } Element child = parent.getOwnerDocument().createElementNS(Constants.NS_XSD, qname); NodeList children = parent.getChildNodes(); - if (children.getLength() == 0) + if (children.getLength() == 0) { parent.appendChild(child); - else + } else { parent.insertBefore(child, children.item(0)); + } return child; } @@ -622,22 +483,24 @@ NodeList children = parent.getChildNodes(); - if (children.getLength() == 0) + if (children.getLength() == 0) { parent.appendChild(child); - else + } else { parent.insertBefore(child, children.item(0)); + } return child; } - private static @NotNull - String fixNull(@Nullable String s) { - if (s == null) return ""; - else return s; + static String fixNull(@Nullable String s) { + if (s == null) { + return ""; + } else { + return s; + } } - private void reportError(Element errorSource, String formattedMsg) { reportError(errorSource, formattedMsg, null); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java 2013-04-04 15:26:55.800612590 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java 2013-04-04 15:26:55.748612589 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -40,10 +40,7 @@ import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.*; import java.util.Iterator; import java.util.Map; @@ -56,7 +53,8 @@ */ public class JAXWSBindingExtensionHandler extends AbstractExtensionHandler { - private static final XPathFactory xpf = XPathFactory.newInstance(); + // xml security enabled always, xpath used for parsing "part" attribute + private static final XPathFactory xpf = XmlUtil.newXPathFactory(true); private final XPath xpath = xpf.newXPath(); public JAXWSBindingExtensionHandler(Map extensionHandlerMap) { @@ -66,6 +64,7 @@ /* (non-Javadoc) * @see AbstractExtensionHandler#getNamespaceURI() */ + @Override public String getNamespaceURI() { return JAXWSBindingsConstants.NS_JAXWS_BINDINGS; } @@ -80,8 +79,9 @@ context.registerNamespaces(e); JAXWSBinding jaxwsBinding = getJAXWSExtension(parent); - if(jaxwsBinding == null) + if(jaxwsBinding == null) { jaxwsBinding = new JAXWSBinding(context.getLocation(e)); + } String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR); if (attr != null) { jaxwsBinding.setWsdlLocation(attr); @@ -99,29 +99,29 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } - if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)){ + if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)) { parsePackage(context, jaxwsBinding, e2); - if((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)){ - ((Definitions)parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc())); + if ((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)) { + ((Definitions) parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc())); } - }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ + } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) { parseWrapperStyle(context, jaxwsBinding, e2); - }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ + } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) { parseAsynMapping(context, jaxwsBinding, e2); - } -// else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ -// parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); -// } - else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ + } // else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ + // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); + // } + else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)) { parseMimeContent(context, jaxwsBinding, e2); - }else{ + } else { Util.fail( - "parsing.invalidExtensionElement", - e2.getTagName(), - e2.getNamespaceURI()); + "parsing.invalidExtensionElement", + e2.getTagName(), + e2.getNamespaceURI()); return false; } } @@ -150,28 +150,18 @@ */ private void parseProvider(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { String val = e.getTextContent(); - if(val == null) + if (val == null) { return; - if(val.equals("false") || val.equals("0")){ + } + if (val.equals("false") || val.equals("0")) { ((JAXWSBinding)parent).setProvider(Boolean.FALSE); - }else if(val.equals("true") || val.equals("1")){ + } else if(val.equals("true") || val.equals("1")) { ((JAXWSBinding)parent).setProvider(Boolean.TRUE); } } /** - * - * @param context - * @param parent - * @param e - */ - private void parseJAXBBindings(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, TWSDLExtensible parent, Element e) { - JAXWSBinding binding = (JAXWSBinding)parent; - binding.addJaxbBindings(e); - } - - /** * @param context * @param parent * @param e @@ -191,12 +181,13 @@ private void parseWrapperStyle(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { //System.out.println("In handleWrapperStyleExtension: " + e.getNodeName()); String val = e.getTextContent(); - if(val == null) + if (val == null) { return; - if(val.equals("false") || val.equals("0")){ - ((JAXWSBinding)parent).setEnableWrapperStyle(Boolean.FALSE); - }else if(val.equals("true") || val.equals("1")){ - ((JAXWSBinding)parent).setEnableWrapperStyle(Boolean.TRUE); + } + if (val.equals("false") || val.equals("0")) { + ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.FALSE); + } else if (val.equals("true") || val.equals("1")) { + ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.TRUE); } } @@ -225,12 +216,13 @@ private void parseAsynMapping(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { //System.out.println("In handleAsynMappingExtension: " + e.getNodeName()); String val = e.getTextContent(); - if(val == null) + if (val == null) { return; - if(val.equals("false") || val.equals("0")){ - ((JAXWSBinding)parent).setEnableAsyncMapping(Boolean.FALSE); - }else if(val.equals("true") || val.equals("1")){ - ((JAXWSBinding)parent).setEnableAsyncMapping(Boolean.TRUE); + } + if (val.equals("false") || val.equals("0")) { + ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.FALSE); + } else if (val.equals("true") || val.equals("1")) { + ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.TRUE); } } @@ -242,12 +234,13 @@ private void parseMimeContent(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { //System.out.println("In handleMimeContentExtension: " + e.getNodeName()); String val = e.getTextContent(); - if(val == null) + if (val == null) { return; - if(val.equals("false") || val.equals("0")){ - ((JAXWSBinding)parent).setEnableMimeContentMapping(Boolean.FALSE); - }else if(val.equals("true") || val.equals("1")){ - ((JAXWSBinding)parent).setEnableMimeContentMapping(Boolean.TRUE); + } + if (val.equals("false") || val.equals("0")) { + ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.FALSE); + } else if (val.equals("true") || val.equals("1")) { + ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.TRUE); } } @@ -276,10 +269,9 @@ String partName = XmlUtil.getAttributeOrNull(msgPartElm, "name"); String msgName = XmlUtil.getAttributeOrNull((Element)msgElm, "name"); - if((partName == null) || (msgName == null)) + if ((partName == null) || (msgName == null)) { return; - - String val = XmlUtil.getAttributeOrNull(msgPartElm, "element"); + } String element = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.ELEMENT_ATTR); String name = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR); @@ -333,28 +325,12 @@ } - /** - * @param context - * @param jaxwsBinding - * @param e - */ - private void parseException(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) { - for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ - Element e2 = Util.nextElement(iter); - if (e2 == null) - break; - if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ - String className = XmlUtil.getAttributeOrNull(e2, JAXWSBindingsConstants.NAME_ATTR); - String javaDoc = getJavaDoc(e2); - jaxwsBinding.setException(new com.sun.tools.internal.ws.wsdl.document.jaxws.Exception(new CustomName(className, javaDoc))); - } - } - } - + @Override public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { return parseGlobalJAXWSBindings(context, parent, e); } + @Override public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); @@ -363,23 +339,24 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } - if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ + if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) { parseWrapperStyle(context, jaxwsBinding, e2); - }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ + } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) { parseAsynMapping(context, jaxwsBinding, e2); - }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ + } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)) { parseClass(context, jaxwsBinding, e2); - if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ - ((PortType)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); + if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null) && (parent instanceof PortType)) { + ((PortType) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); } - }else{ + } else { Util.fail( - "parsing.invalidExtensionElement", - e2.getTagName(), - e2.getNamespaceURI()); + "parsing.invalidExtensionElement", + e2.getTagName(), + e2.getNamespaceURI()); return false; } } @@ -398,6 +375,7 @@ } } + @Override public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ if(parent instanceof Operation){ @@ -423,8 +401,9 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); @@ -463,8 +442,9 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ parseWrapperStyle(context, jaxwsBinding, e2); @@ -493,6 +473,7 @@ return true; } + @Override public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); @@ -501,8 +482,9 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); @@ -535,6 +517,7 @@ /* (non-Javadoc) * @see ExtensionHandlerBase#handleFaultExtension(TWSDLParserContextImpl, TWSDLExtensible, org.w3c.dom.Element) */ + @Override public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); @@ -543,8 +526,9 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ parseClass(context, jaxwsBinding, e2); if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ @@ -573,6 +557,7 @@ } } + @Override public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); @@ -581,8 +566,9 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ parseClass(context, jaxwsBinding, e2); if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ @@ -611,6 +597,7 @@ } } + @Override public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); @@ -619,8 +606,9 @@ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PROVIDER)){ parseProvider(context, jaxwsBinding, e2); @@ -655,8 +643,9 @@ private String getJavaDoc(Element e){ for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.JAVADOC)){ return XmlUtil.getTextForNode(e2); } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java 2013-04-04 15:26:56.016612593 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java 2013-04-04 15:26:55.972612592 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java 2013-04-04 15:26:56.248612597 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java 2013-04-04 15:26:56.196612596 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,23 +27,35 @@ import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible; import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext; +import com.sun.tools.internal.ws.resources.ModelerMessages; +import com.sun.tools.internal.ws.resources.WsdlMessages; +import com.sun.tools.internal.ws.util.xml.XmlUtil; import com.sun.tools.internal.ws.wscompile.ErrorReceiver; +import com.sun.tools.internal.ws.wsdl.document.Fault; +import com.sun.tools.internal.ws.wsdl.document.Input; +import com.sun.tools.internal.ws.wsdl.document.Output; +import com.sun.xml.internal.ws.addressing.W3CAddressingMetadataConstants; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import org.w3c.dom.Element; +import org.xml.sax.Locator; import javax.xml.namespace.QName; import java.util.Map; +import static com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants.WSA_ACTION_QNAME; + /** * @author Arun Gupta */ public class MemberSubmissionAddressingExtensionHandler extends W3CAddressingExtensionHandler { - public MemberSubmissionAddressingExtensionHandler(Map extensionHandlerMap) { - super(extensionHandlerMap); - } - public MemberSubmissionAddressingExtensionHandler(Map extensionHandlerMap, ErrorReceiver env) { + private ErrorReceiver errReceiver; + private boolean extensionModeOn; + + public MemberSubmissionAddressingExtensionHandler(Map extensionHandlerMap, ErrorReceiver env, boolean extensionModeOn) { super(extensionHandlerMap, env); + this.errReceiver = env; + this.extensionModeOn = extensionModeOn; } @Override @@ -61,4 +73,67 @@ return false; } + @Override + public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { + if (extensionModeOn) { + warn(context.getLocation(e)); + String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME); + if (actionValue == null || actionValue.equals("")) { + return warnEmptyAction(parent, context.getLocation(e)); + } + ((Input) parent).setAction(actionValue); + return true; + } else { + return fail(context.getLocation(e)); + } + } + + private boolean fail(Locator location) { + errReceiver.warning(location, + ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING( + AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME)); + return false; + } + + private void warn(Locator location) { + errReceiver.warning(location, + ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED( + AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME)); + } + + @Override + public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { + if (extensionModeOn) { + warn(context.getLocation(e)); + String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME); + if (actionValue == null || actionValue.equals("")) { + return warnEmptyAction(parent, context.getLocation(e)); + } + ((Output) parent).setAction(actionValue); + return true; + } else { + return fail(context.getLocation(e)); + } + } + + @Override + public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { + if (extensionModeOn) { + warn(context.getLocation(e)); + String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME); + if (actionValue == null || actionValue.equals("")) { + errReceiver.warning(context.getLocation(e), WsdlMessages.WARNING_FAULT_EMPTY_ACTION(parent.getNameValue(), parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue())); + return false; // keep compiler happy + } + ((Fault) parent).setAction(actionValue); + return true; + } else { + return fail(context.getLocation(e)); + } + } + + private boolean warnEmptyAction(TWSDLExtensible parent, Locator pos) { + errReceiver.warning(pos, WsdlMessages.WARNING_INPUT_OUTPUT_EMPTY_ACTION(parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue())); + return false; + } } --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java 2013-04-04 15:26:56.512612601 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java 2013-04-04 15:26:56.456612600 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,6 @@ import com.sun.tools.internal.ws.resources.WscompileMessages; import com.sun.tools.internal.ws.resources.WsdlMessages; import com.sun.tools.internal.ws.wscompile.AbortException; -import com.sun.tools.internal.ws.wscompile.DefaultAuthenticator; import com.sun.tools.internal.ws.wscompile.ErrorReceiver; import com.sun.tools.internal.ws.wscompile.WsimportOptions; import com.sun.tools.internal.ws.wsdl.document.WSDLConstants; @@ -69,28 +68,31 @@ public boolean isMexMetadata; private String rootWSDL; - private Set rootWsdls = new HashSet(); + private final Set rootWsdls = new HashSet(); public MetadataFinder(InternalizationLogic logic, WsimportOptions options, ErrorReceiver errReceiver) { super(logic, new WSEntityResolver(options,errReceiver), options, errReceiver); } + @SuppressWarnings("element-type-mismatch") public void parseWSDL(){ // parse source grammars for (InputSource value : options.getWSDLs()) { String systemID = value.getSystemId(); errorReceiver.pollAbort(); - Document dom ; - Element doc = null; + Document dom; + Element doc; try { - //if there is entity resolver use it - if (options.entityResolver != null) - value = options.entityResolver.resolveEntity(null, systemID); - if (value == null) - value = new InputSource(systemID); + //if there is entity resolver use it + if (options.entityResolver != null) { + value = options.entityResolver.resolveEntity(null, systemID); + } + if (value == null) { + value = new InputSource(systemID); + } dom = parse(value, true); doc = dom.getDocumentElement(); @@ -100,9 +102,9 @@ //if its not a WSDL document, retry with MEX if (doc.getNamespaceURI() == null || !doc.getNamespaceURI().equals(WSDLConstants.NS_WSDL) || !doc.getLocalName().equals("definitions")) { throw new SAXParseException(WsdlMessages.INVALID_WSDL(systemID, - com.sun.xml.internal.ws.wsdl.parser.WSDLConstants.QNAME_DEFINITIONS, doc.getNodeName(), locatorTable.getStartLocation(doc).getLineNumber()), locatorTable.getStartLocation(doc)); + com.sun.xml.internal.ws.wsdl.parser.WSDLConstants.QNAME_DEFINITIONS, doc.getNodeName(), locatorTable.getStartLocation(doc).getLineNumber()), locatorTable.getStartLocation(doc)); } - } catch(FileNotFoundException e){ + } catch (FileNotFoundException e) { errorReceiver.error(WsdlMessages.FILE_NOT_FOUND(systemID), e); return; } catch (IOException e) { @@ -119,24 +121,27 @@ NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema"); for (int i = 0; i < schemas.getLength(); i++) { - if(!inlinedSchemaElements.contains(schemas.item(i))) + if (!inlinedSchemaElements.contains(schemas.item(i))) { inlinedSchemaElements.add((Element) schemas.item(i)); + } } } identifyRootWsdls(); } public static class WSEntityResolver implements EntityResolver { - EntityResolver parentResolver; WsimportOptions options; ErrorReceiver errorReceiver; + private URLConnection c = null; + private boolean doReset = false; + public WSEntityResolver(WsimportOptions options, ErrorReceiver errReceiver) { - this.parentResolver = options.entityResolver; this.options = options; this.errorReceiver = errReceiver; } + @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { InputSource inputSource = null; @@ -161,6 +166,14 @@ ((HttpURLConnection) conn).setInstanceFollowRedirects(false); } + if (conn instanceof JarURLConnection) { + if (conn.getUseCaches()) { + doReset = true; + conn.setDefaultUseCaches(false); + c = conn; + } + } + try { is = conn.getInputStream(); //is = sun.net.www.protocol.http.HttpURLConnection.openConnectionCheckRedirects(conn); @@ -170,7 +183,7 @@ int code = httpConn.getResponseCode(); if (code == 401) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_INFO_NEEDED(e.getMessage(), - systemId, DefaultAuthenticator.defaultAuthfile), null, e)); + systemId, WsimportOptions.defaultAuthfile), null, e)); throw new AbortException(); } //FOR other code we will retry with MEX @@ -211,11 +224,19 @@ return inputSource; } + @Override + protected void finalize() throws Throwable { + //see http://java.net/jira/browse/JAX_WS-1087 + if (doReset) { + c.setDefaultUseCaches(true); + } + } } // overide default SSL HttpClientVerifier to always return true // effectively overiding Hostname client verification when using SSL private static class HttpClientVerifier implements HostnameVerifier { + @Override public boolean verify(String s, SSLSession sslSession) { return true; } @@ -263,7 +284,7 @@ } //no wsdl with wsdl:service found, throw error if(rootWSDL == null){ - StringBuffer strbuf = new StringBuffer(); + StringBuilder strbuf = new StringBuilder(); for(String str : rootWsdls){ strbuf.append(str); strbuf.append('\n'); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java 2013-04-04 15:26:56.732612605 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java 2013-04-04 15:26:56.684612604 +0200 @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy12ExtensionHandler.java 2013-04-04 15:26:56.952612608 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy12ExtensionHandler.java 2013-04-04 15:26:56.900612607 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy15ExtensionHandler.java 2013-04-04 15:26:57.212612612 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy15ExtensionHandler.java 2013-04-04 15:26:57.160612611 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java 2013-04-04 15:26:57.468612615 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java 2013-04-04 15:26:57.416612615 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java 2013-04-04 15:26:57.728612620 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java 2013-04-04 15:26:57.672612619 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java 2013-04-04 15:26:57.968612624 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java 2013-04-04 15:26:57.908612623 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -232,125 +232,108 @@ // context.fireDoneParsingEntity(getBodyQName(), body); return true; } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) { - context.push(); - context.registerNamespaces(e); - - SOAPHeader header = new SOAPHeader(context.getLocation(e)); + return handleHeaderElement(parent, e, context); + } else { + Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); + return false; // keep compiler happy + } + } - String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE); - if (use != null) { - if (use.equals(Constants.ATTRVALUE_LITERAL)) { - header.setUse(SOAPUse.LITERAL); - } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { - header.setUse(SOAPUse.ENCODED); - } else { - Util.fail( - "parsing.invalidAttributeValue", - Constants.ATTR_USE, - use); - } + private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) { + context.push(); + context.registerNamespaces(e); + + SOAPHeader header = new SOAPHeader(context.getLocation(e)); + + String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE); + if (use != null) { + if (use.equals(Constants.ATTRVALUE_LITERAL)) { + header.setUse(SOAPUse.LITERAL); + } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { + header.setUse(SOAPUse.ENCODED); + } else { + Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use); } + } - String namespace = - XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE); - if (namespace != null) { - header.setNamespace(namespace); + String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE); + if (namespace != null) { + header.setNamespace(namespace); + } + + String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE); + if (encodingStyle != null) { + header.setEncodingStyle(encodingStyle); + } + + String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART); + if (part != null) { + header.setPart(part); + } + + String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE); + if (messageAttr != null) { + header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr)); + } + + for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) { + Element e2 = Util.nextElement(iter); + if (e2 == null) + break; + + if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) { + handleHeaderFaultElement(e, context, header, use, e2); + } else { + Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI()); } + } - String encodingStyle = - XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE); - if (encodingStyle != null) { - header.setEncodingStyle(encodingStyle); + parent.addExtension(header); + context.pop(); + context.fireDoneParsingEntity(getHeaderQName(), header); + return true; + } + + private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) { + context.push(); + context.registerNamespaces(e); + + SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e)); + + String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE); + if (use2 != null) { + if (use2.equals(Constants.ATTRVALUE_LITERAL)) { + headerfault.setUse(SOAPUse.LITERAL); + } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { + headerfault.setUse(SOAPUse.ENCODED); + } else { + Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2); } + } - String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART); - if (part != null) { - header.setPart(part); - } - - String messageAttr = - XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE); - if (messageAttr != null) { - header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr)); - } - - for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) { - Element e2 = Util.nextElement(iter); - if (e2 == null) - break; - - if (XmlUtil - .matchesTagNS(e2, getHeaderfaultQName())) { - context.push(); - context.registerNamespaces(e); - - SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e)); - - String use2 = - XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE); - if (use2 != null) { - if (use2.equals(Constants.ATTRVALUE_LITERAL)) { - headerfault.setUse(SOAPUse.LITERAL); - } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { - headerfault.setUse(SOAPUse.ENCODED); - } else { - Util.fail( - "parsing.invalidAttributeValue", - Constants.ATTR_USE, - use2); - } - } - - String namespace2 = - XmlUtil.getAttributeOrNull( - e2, - Constants.ATTR_NAMESPACE); - if (namespace2 != null) { - headerfault.setNamespace(namespace2); - } - - String encodingStyle2 = - XmlUtil.getAttributeOrNull( - e2, - Constants.ATTR_ENCODING_STYLE); - if (encodingStyle2 != null) { - headerfault.setEncodingStyle(encodingStyle2); - } - - String part2 = - XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART); - if (part2 != null) { - headerfault.setPart(part2); - } - - String messageAttr2 = - XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE); - if (messageAttr2 != null) { - headerfault.setMessage( - context.translateQualifiedName(context.getLocation(e2), messageAttr2)); - } + String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE); + if (namespace2 != null) { + headerfault.setNamespace(namespace2); + } - header.add(headerfault); - context.pop(); - } else { - Util.fail( - "parsing.invalidElement", - e2.getTagName(), - e2.getNamespaceURI()); - } - } + String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE); + if (encodingStyle2 != null) { + headerfault.setEncodingStyle(encodingStyle2); + } - parent.addExtension(header); - context.pop(); - context.fireDoneParsingEntity(getHeaderQName(), header); - return true; - } else { - Util.fail( - "parsing.invalidExtensionElement", - e.getTagName(), - e.getNamespaceURI()); - return false; // keep compiler happy + String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART); + if (part2 != null) { + headerfault.setPart(part2); + } + + String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE); + if (messageAttr2 != null) { + headerfault.setMessage( + context.translateQualifiedName(context.getLocation(e2), messageAttr2)); } + + header.add(headerfault); + context.pop(); } public boolean handleFaultExtension( @@ -398,6 +381,10 @@ context.pop(); // context.fireDoneParsingEntity(getFaultQName(), fault); return true; + } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) { + // although SOAP spec doesn't define meaning of this extension; it is allowed + // to be here, so we have to accept it, not fail (bug 13576977) + return handleHeaderElement(parent, e, (TWSDLParserContextImpl) context); } else { Util.fail( "parsing.invalidExtensionElement", --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Util.java 2013-04-04 15:26:58.244612628 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Util.java 2013-04-04 15:26:58.180612627 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java 2013-04-04 15:26:58.476612631 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java 2013-04-04 15:26:58.412612630 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java 2013-04-04 15:26:58.736612635 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java 2013-04-04 15:26:58.676612635 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingMetadataExtensionHandler.java 2013-04-04 15:26:58.976612639 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingMetadataExtensionHandler.java 2013-04-04 15:26:58.928612638 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java 2013-04-04 15:26:59.196612643 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java 2013-04-04 15:26:59.148612642 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,6 @@ package com.sun.tools.internal.ws.wsdl.parser; -import com.sun.tools.internal.ws.wscompile.WsimportOptions; import com.sun.tools.internal.ws.wsdl.document.WSDLConstants; import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants; import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants; @@ -49,11 +48,12 @@ super(parent); } + @Override protected String findExternalResource( String nsURI, String localName, Attributes atts) { if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){ - if(parent.isExtensionMode()){ - //TODO: add support for importing schema using wsdl:import - } +// if(parent.isExtensionMode()){ +// //TODO: add support for importing schema using wsdl:import +// } return atts.getValue("location"); } @@ -67,14 +67,17 @@ return null; } } + @Override public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) { return new ReferenceFinder(parent); } + @Override public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) { return false; } + @Override public Element refineSchemaTarget(Element target) { // look for existing xs:annotation Element annotation = DOMUtils.getFirstChildElement(target, Constants.NS_XSD, "annotation"); @@ -92,6 +95,7 @@ } + @Override public Element refineWSDLTarget(Element target){ // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java 2013-04-04 15:26:59.396612646 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java 2013-04-04 15:26:59.344612645 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -58,11 +58,9 @@ import com.sun.tools.internal.ws.wsdl.framework.ParserListener; import com.sun.tools.internal.ws.wsdl.framework.TWSDLParserContextImpl; import com.sun.xml.internal.ws.util.ServiceFinder; - import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.Locator; @@ -73,6 +71,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import org.w3c.dom.Node; /** * A parser for WSDL documents. This parser is used only at the tool time. @@ -101,9 +100,10 @@ if (forest == null) { forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver); forest.parseWSDL(); - if (forest.isMexMetadata) + if (forest.isMexMetadata) { errReceiver.reset(); } + } this.forest = forest; // register handlers for default extensions register(new SOAPExtensionHandler(extensionHandlers)); @@ -111,7 +111,10 @@ register(new MIMEExtensionHandler(extensionHandlers)); register(new JAXWSBindingExtensionHandler(extensionHandlers)); register(new SOAP12ExtensionHandler(extensionHandlers)); - register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver)); + + // MemberSubmission Addressing not supported by WsImport anymore see JAX_WS-1040 for details + //register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver, options.isExtensionMode())); + register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver)); register(new W3CAddressingMetadataExtensionHandler(extensionHandlers, errReceiver)); register(new Policy12ExtensionHandler()); @@ -144,7 +147,7 @@ Document root = forest.parse(value, false); if(root==null) continue; // error must have been reported Element binding = root.getDocumentElement(); - if (!fixNull(binding.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) + if (!Internalizer.fixNull(binding.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) || !binding.getLocalName().equals("bindings")){ errReceiver.error(forest.locatorTable.getStartLocation(binding), WsdlMessages.PARSER_NOT_A_BINDING_FILE( binding.getNamespaceURI(), @@ -162,11 +165,6 @@ return buildWSDLDocument(); } - private String fixNull(String s) { - if(s==null) return ""; - else return s; - } - public MetadataFinder getDOMForest() { return forest; } @@ -203,13 +201,6 @@ new Internalizer(forest, options, errReceiver).transform(); - //print the wsdl -// try{ -// forest.dump(System.out); -// }catch(IOException e){ -// e.printStackTrace(); -// } - Definitions definitions = parseDefinitionsNoImport(context, root); if(definitions == null){ Locator locator = forest.locatorTable.getStartLocation(root.getDocumentElement()); @@ -221,20 +212,6 @@ return definitions; } - private void processMexDocs(TWSDLParserContextImpl context){ - for(String location : forest.listSystemIDs()){ - if (!context.getDocument().isImportedDocument(location)){ - Document doc = forest.get(location); - if(doc == null) - continue; - Definitions importedDefinitions = parseDefinitionsNoImport(context, doc); - if(importedDefinitions == null) - continue; - context.getDocument().addImportedEntity(importedDefinitions); - context.getDocument().addImportedDocument(location); - } - } - } private void processImports(TWSDLParserContextImpl context) { for(String location : forest.getExternalReferences()){ if (!context.getDocument().isImportedDocument(location)){ @@ -520,10 +497,7 @@ // possible extensibility element -- must live outside the WSDL namespace checkNotWsdlAttribute(e3); - if (!handleExtension(context, input, e3, e2)) { - // ignore the extensiblity attribute - // TODO throw a WARNING - } + handleExtension(context, input, e3, e2); } // verify that there is at most one child element and it is a documentation element @@ -582,10 +556,7 @@ // possible extensibility element -- must live outside the WSDL namespace checkNotWsdlAttribute(e3); - if (!handleExtension(context, output, e3, e2)) { - // ignore the extensiblity attribute - // TODO throw a WARNING - } + handleExtension(context, output, e3, e2); } // verify that there is at most one child element and it is a documentation element @@ -635,10 +606,7 @@ // possible extensibility element -- must live outside the WSDL namespace checkNotWsdlAttribute(e3); - if (!handleExtension(context, fault, e3, e2)) { - // ignore the extensiblity attribute - // TODO throw a WARNING - } + handleExtension(context, fault, e3, e2); } // verify that there is at most one child element and it is a documentation element @@ -780,7 +748,6 @@ } /* Here we check for the use scenario */ - Iterator itere2 = XmlUtil.getAllChildren(e2); context.push(); context.registerNamespaces(e2); BindingInput input = new BindingInput(forest.locatorTable.getStartLocation(e2)); @@ -984,8 +951,9 @@ errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName())); } gotDocumentation = true; - if(service.getDocumentation() == null) + if (service.getDocumentation() == null) { service.setDocumentation(getDocumentationFor(e2)); + } } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PORT)) { Port port = parsePort(context, definitions, e2); service.add(port); @@ -1022,16 +990,18 @@ for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) { Element e2 = Util.nextElement(iter); - if (e2 == null) + if (e2 == null) { break; + } if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) { if (gotDocumentation) { errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName())); } gotDocumentation = true; - if(port.getDocumentation() == null) + if (port.getDocumentation() == null) { port.setDocumentation(getDocumentationFor(e2)); + } } else { // possible extensibility element -- must live outside the WSDL namespace checkNotWsdlElement(e2); @@ -1049,8 +1019,9 @@ private void validateSchemaImports(Element typesElement){ for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) { Element e = Util.nextElement(iter); - if (e == null) + if (e == null) { break; + } if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) { errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003()); }else{ @@ -1072,6 +1043,7 @@ (TWSDLExtensionHandler) extensionHandlers.get(e.getNamespaceURI()); if (h == null) { context.fireIgnoringExtension(e, (Entity) entity); + errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(e.getLocalName(), e.getNamespaceURI())); return false; } else { return h.doHandleExtension(context, entity, e); @@ -1087,6 +1059,7 @@ (TWSDLExtensionHandler) extensionHandlers.get(n.getNamespaceURI()); if (h == null) { context.fireIgnoringExtension(e, (Entity) entity); + errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(n.getLocalName(), n.getNamespaceURI())); return false; } else { return h.doHandleExtension(context, entity, e); @@ -1095,15 +1068,17 @@ private void checkNotWsdlElement(Element e) { // possible extensibility element -- must live outside the WSDL namespace - if (e.getNamespaceURI() != null && e.getNamespaceURI().equals(Constants.NS_WSDL)) + if (e.getNamespaceURI() != null && e.getNamespaceURI().equals(Constants.NS_WSDL)) { errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(e.getTagName())); } + } private void checkNotWsdlAttribute(Attr a) { // possible extensibility element -- must live outside the WSDL namespace - if (a.getNamespaceURI().equals(Constants.NS_WSDL)) + if (Constants.NS_WSDL.equals(a.getNamespaceURI())) { errReceiver.error(forest.locatorTable.getStartLocation(a.getOwnerElement()), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(a.getLocalName())); } + } private void checkNotWsdlRequired(Element e) { // check the wsdl:required attribute, fail if set to "true" --- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java 2013-04-04 15:26:59.628612650 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java 2013-04-04 15:26:59.576612649 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/ClassLoaderBuilder.java 2013-04-04 15:26:59.848612653 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/ClassLoaderBuilder.java 2013-04-04 15:26:59.796612652 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +36,6 @@ import com.sun.istack.internal.tools.MaskingClassLoader; import com.sun.istack.internal.tools.ParallelWorldClassLoader; -import com.sun.tools.internal.xjc.SecureLoader; /** * Creates a class loader configured to run XJC 1.0/2.0 safely without @@ -62,7 +61,7 @@ // JAXB API is loaded from the bootstrap. We need to override one with ours mustang = true; - List mask = new ArrayList(Arrays.asList(maskedPackages)); + List mask = new ArrayList(Arrays.asList(maskedPackages)); mask.add("javax.xml.bind."); cl = new MaskingClassLoader(cl,mask); @@ -80,7 +79,7 @@ // so that the XJC2 classes in the parent class loader // won't interfere with loading XJC1 classes in a child class loader - if (v.equals("1.0")) { + if ("1.0".equals(v)) { if(!mustang) // if we haven't used Masking ClassLoader, do so now. cl = new MaskingClassLoader(cl,toolPackages); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/Driver.java 2013-04-04 15:27:00.056612656 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/Driver.java 2013-04-04 15:26:59.996612655 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -38,6 +38,7 @@ import com.sun.codemodel.internal.writer.ZipCodeWriter; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; +import com.sun.istack.internal.tools.DefaultAuthenticator; import com.sun.tools.internal.xjc.generator.bean.BeanGenerator; import com.sun.tools.internal.xjc.model.Model; import com.sun.tools.internal.xjc.outline.Outline; @@ -222,9 +223,15 @@ opt.setSchemaLanguage(Language.XMLSCHEMA); // disable auto-guessing try { opt.parseArguments(args); - } catch (WeAreDone _) { + } catch (WeAreDone e) { + if (opt.proxyAuth != null) { + DefaultAuthenticator.reset(); + } return -1; } catch(BadCommandLineException e) { + if (opt.proxyAuth != null) { + DefaultAuthenticator.reset(); + } e.initOptions(opt); throw e; } @@ -401,6 +408,10 @@ listener.message(Messages.format(Messages.STACK_OVERFLOW)); return -1; } + } finally { + if (opt.proxyAuth != null) { + DefaultAuthenticator.reset(); + } } } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties 2013-04-04 15:27:00.288612660 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties 2013-04-04 15:27:00.232612659 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 @@ \ \ -target (2.0|2.1) : behave like XJC 2.0 or 2.1 and generate code that doesn't use any 2.2 features.\n\ \ \ -encoding : specify character encoding for generated source files\n\ \ \ -enableIntrospection : enable correct generation of Boolean getters/setters to enable Bean Introspection apis \n\ +\ \ -disableXmlSecurity : disables XML security features when parsing XML documents \n\ \ \ -contentForWildcard : generates content property for types with multiple xs:any derived elements \n\ \ \ -xmlschema : treat input as W3C XML Schema (default)\n\ \ \ -relaxng : treat input as RELAX NG (experimental,unsupported)\n\ @@ -170,31 +171,31 @@ Driver.FailedToGenerateCode = \ Failed to produce code. -# DO NOT localize the 2.2.5-b10 string - it is a token for an ant +# DO NOT localize the 2.2.7-b63 string - it is a token for an ant Driver.FilePrologComment = \ - This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-b10 \n\ + This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7-b63 \n\ See
http://java.sun.com/xml/jaxb \n\ Any modifications to this file will be lost upon recompilation of the source schema. \n\ Generated on: {0} \n Driver.Version = \ - xjc 2.2.5-b10 + xjc 2.2.7-b63 Driver.FullVersion = \ - xjc full version "2.2.5-b10-b14" + xjc full version "2.2.7-b63-b19" -Driver.BuildID = 2.2.5-b10 +Driver.BuildID = 2.2.7-b63 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.5-b10 +jaxb.jdk.version=2.2.7-b63 # see java.text.SimpleDateFormat for format syntax -# Format should not be changed, English locale is used to transform this string into a real date. Letters can be translated but the user should known that java.text.SimpleDateFormat is responsible for formatting (meaning of symbols can be found at http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html). +# DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. Driver.DateFormat = \ yyyy.MM.dd # see java.text.SimpleDateFormat for format syntax -# Format should not be changed, English locale is used to transform this string into a real time. Letters can be translated but the user should known that java.text.SimpleDateFormat is responsible for formatting (meaning of symbols can be found at http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html). +# Format should not be changed, English locale is used to transform this string into a real time. Driver.TimeFormat = \ hh:mm:ss a z --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/Messages.java 2013-04-04 15:27:00.492612663 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/Messages.java 2013-04-04 15:27:00.448612662 +0200 @@ -31,10 +31,10 @@ /** * Formats error messages. */ -class Messages +public class Messages { /** Loads a string resource and formats it with specified arguments. */ - static String format( String property, Object... args ) { + public static String format( String property, Object... args ) { String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property); return MessageFormat.format(text,args); } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/ModelLoader.java 2013-04-04 15:27:00.724612666 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/ModelLoader.java 2013-04-04 15:27:00.664612665 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -47,12 +47,11 @@ import com.sun.tools.internal.xjc.reader.xmlschema.parser.SchemaConstraintChecker; import com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic; import com.sun.tools.internal.xjc.util.ErrorReceiverFilter; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import com.sun.xml.internal.xsom.XSSchemaSet; import com.sun.xml.internal.xsom.parser.JAXPParser; import com.sun.xml.internal.xsom.parser.XMLParser; import com.sun.xml.internal.xsom.parser.XSOMParser; -import java.net.URI; -import java.net.URISyntaxException; import javax.xml.XMLConstants; import com.sun.xml.internal.rngom.ast.builder.SchemaBuilder; @@ -298,7 +297,7 @@ throws SAXException { // parse into DOM forest - DOMForest forest = new DOMForest(logic); + DOMForest forest = new DOMForest(logic, opt); forest.setErrorHandler(errorReceiver); if(opt.entityResolver!=null) @@ -343,7 +342,7 @@ */ public XSSchemaSet loadXMLSchema() throws SAXException { - if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver)) { + if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) { // schema error. error should have been reported return null; } @@ -353,7 +352,7 @@ // which is faster if the speculation succeeds. try { return createXSOMSpeculative(); - } catch( SpeculationFailure _ ) { + } catch( SpeculationFailure e) { // failed. go the slow way } } @@ -411,6 +410,13 @@ return BGMBuilder.build(xs, codeModel, errorReceiver, opt); } + /** + * Potentially problematic - make sure the parser instance passed is initialized + * with proper security feature. + * + * @param parser + * @return + */ public XSOMParser createXSOMParser(XMLParser parser) { // set up other parameters to XSOMParser XSOMParser reader = new XSOMParser(new XMLSchemaParser(parser)); @@ -465,7 +471,7 @@ // check if the schema contains external binding files. If so, speculation is a failure. XMLParser parser = new XMLParser() { - private final JAXPParser base = new JAXPParser(); + private final JAXPParser base = new JAXPParser(XmlFactory.createParserFactory(opt.disableXmlSecurity)); public void parse(InputSource source, ContentHandler handler, ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException { --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/Options.java 2013-04-04 15:27:01.008612671 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/Options.java 2013-04-04 15:27:00.956612670 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -45,13 +45,13 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import com.sun.codemodel.internal.CodeWriter; import com.sun.codemodel.internal.JPackage; +import com.sun.codemodel.internal.JResourceFile; import com.sun.codemodel.internal.writer.FileCodeWriter; import com.sun.codemodel.internal.writer.PrologCodeWriter; +import com.sun.istack.internal.tools.DefaultAuthenticator; import com.sun.org.apache.xml.internal.resolver.CatalogManager; import com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver; import com.sun.tools.internal.xjc.api.ClassNameAllocator; @@ -106,6 +106,15 @@ public String encoding; /** + * If true XML security features when parsing XML documents will be disabled. + * The default value is false. + * + * Boolean + * @since 2.2.6 + */ + public boolean disableXmlSecurity; + + /** * Check the source schemas with extra scrutiny. * The exact meaning depends on the schema language. */ @@ -152,20 +161,12 @@ */ public SpecVersion target = SpecVersion.LATEST; - private boolean is2_2 = true; public Options() { - if (is2_2) { - try { - Class.forName("javax.xml.bind.JAXBPermission"); - } catch (ClassNotFoundException cnfe) { - is2_2 = false; - } - if (!is2_2) { - target = SpecVersion.V2_1; - } else { - target = SpecVersion.LATEST; - } + try { + Class.forName("javax.xml.bind.JAXBPermission"); + } catch (ClassNotFoundException cnfe) { + target = SpecVersion.V2_1; } } @@ -213,8 +214,7 @@ // Proxy setting. private String proxyHost = null; private String proxyPort = null; - private String proxyUser = null; - private String proxyPassword = null; + public String proxyAuth = null; /** * {@link Plugin}s that are enabled in this compilation. @@ -459,7 +459,9 @@ * Gets a classLoader that can load classes specified via the * -classpath option. */ - public URLClassLoader getUserClassLoader( ClassLoader parent ) { + public ClassLoader getUserClassLoader( ClassLoader parent ) { + if (classpaths.isEmpty()) + return parent; return new URLClassLoader( classpaths.toArray(new URL[classpaths.size()]),parent); } @@ -542,6 +544,10 @@ enableIntrospection = true; return 1; } + if (args[i].equals("-disableXmlSecurity")) { + disableXmlSecurity = true; + return 1; + } if (args[i].equals("-contentForWildcard")) { contentForWildcard = true; return 1; @@ -639,16 +645,6 @@ } return 2; } - if (args[i].equals("-source")) { - String version = requireArgument("-source",args,++i); - //For source 1.0 the 1.0 Driver is loaded - //Hence anything other than 2.0 is defaulted to - //2.0 - if( !version.equals("2.0") && !version.equals("2.1") ) - throw new BadCommandLineException( - Messages.format(Messages.DEFAULT_VERSION)); - return 2; - } if( args[i].equals("-Xtest-class-name-allocator") ) { classNameAllocator = new ClassNameAllocator() { public String assignClassName(String packageName, String className) { @@ -703,18 +699,29 @@ } private void parseProxy(String text) throws BadCommandLineException { - // syntax is [user[:password]@]proxyHost:proxyPort - String token = "([^@:]+)"; - Pattern p = Pattern.compile("(?:"+token+"(?:\\:"+token+")?\\@)?"+token+"(?:\\:"+token+")"); - - Matcher matcher = p.matcher(text); - if(!matcher.matches()) - throw new BadCommandLineException(Messages.format(Messages.ILLEGAL_PROXY,text)); + int i = text.lastIndexOf('@'); + int j = text.lastIndexOf(':'); - proxyUser = matcher.group(1); - proxyPassword = matcher.group(2); - proxyHost = matcher.group(3); - proxyPort = matcher.group(4); + if (i > 0) { + proxyAuth = text.substring(0, i); + if (j > i) { + proxyHost = text.substring(i + 1, j); + proxyPort = text.substring(j + 1); + } else { + proxyHost = text.substring(i + 1); + proxyPort = "80"; + } + } else { + //no auth info + if (j < 0) { + //no port + proxyHost = text; + proxyPort = "80"; + } else { + proxyHost = text.substring(0, j); + proxyPort = text.substring(j + 1); + } + } try { Integer.valueOf(proxyPort); } catch (NumberFormatException e) { @@ -811,11 +818,9 @@ throw new BadCommandLineException( Messages.format(Messages.MISSING_PROXYPORT)); } - if(proxyUser!=null) - System.setProperty("http.proxyUser", proxyUser); - if(proxyPassword!=null) - System.setProperty("http.proxyPassword", proxyPassword); - + if (proxyAuth != null) { + DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth); + } } if (grammars.isEmpty()) --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java 2013-04-04 15:27:01.264612675 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java 2013-04-04 15:27:01.212612674 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +31,8 @@ import javax.xml.validation.SchemaFactory; import javax.xml.validation.ValidatorHandler; -import com.sun.xml.internal.bind.v2.WellKnownNamespace; - +import com.sun.xml.internal.bind.v2.util.XmlFactory; +import javax.xml.XMLConstants; import org.xml.sax.SAXException; /** @@ -57,7 +57,9 @@ synchronized(this) { if(schema==null) { try { - schema = SchemaFactory.newInstance(WellKnownNamespace.XML_SCHEMA).newSchema(source); + // do not disable secure processing - these are well-known schemas + SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, false); + schema = sf.newSchema(source); } catch (SAXException e) { // we make sure that the schema is correct before we ship. throw new AssertionError(e); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/SecureLoader.java 2013-04-04 15:27:01.488612679 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/SecureLoader.java 2013-04-04 15:27:01.436612677 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +37,9 @@ 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 java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +50,9 @@ if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +63,9 @@ if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); @@ -77,8 +77,8 @@ Thread.currentThread().setContextClassLoader(cl); } else { java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + new java.security.PrivilegedAction() { + public ClassLoader run() { Thread.currentThread().setContextClassLoader(cl); return null; } @@ -86,4 +86,18 @@ } } + static ClassLoader getParentClassLoader(final ClassLoader cl) { + if (System.getSecurityManager() == null) { + return cl.getParent(); + } else { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { + return cl.getParent(); + } + }); + } + } + + } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/XJCFacade.java 2013-04-04 15:27:01.720612682 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/XJCFacade.java 2013-04-04 15:27:01.664612681 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,56 +25,80 @@ package com.sun.tools.internal.xjc; -import com.sun.tools.internal.xjc.SecureLoader; +import java.io.Closeable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.net.URLClassLoader; /** * A shabby driver to invoke XJC1 or XJC2 depending on the command line switch. * *

- * This class is compiled with -source 1.2 so that we can report a nice user-friendly - * "you require Tiger" error message. + * This class is compiled with -source 1.2 so that we can report a nice + * user-friendly "you require Tiger" error message. * * @author Kohsuke Kawaguchi */ public class XJCFacade { + private static final String JDK6_REQUIRED = "XJC requires JDK 6.0 or later. Please download it from http://www.oracle.com/technetwork/java/javase/downloads"; + public static void main(String[] args) throws Throwable { String v = "2.0"; // by default, we go 2.0 - for( int i=0; i driver = cl.loadClass("com.sun.tools.internal.xjc.Driver"); Method mainMethod = driver.getDeclaredMethod("main", new Class[]{String[].class}); try { - mainMethod.invoke(null,new Object[]{args}); - } catch (IllegalAccessException e) { - throw e; + mainMethod.invoke(null, new Object[]{args}); } catch (InvocationTargetException e) { - if(e.getTargetException()!=null) + if (e.getTargetException() != null) { throw e.getTargetException(); + } } } catch (UnsupportedClassVersionError e) { - System.err.println("XJC requires JDK 5.0 or later. Please download it from http://java.sun.com/j2se/1.5/"); + System.err.println(JDK6_REQUIRED); + } finally { + ClassLoader cl = SecureLoader.getContextClassLoader(); + SecureLoader.setContextClassLoader(oldContextCl); + + //close/cleanup all classLoaders but the one which loaded this class + while (cl != null && !oldContextCl.equals(cl)) { + if (cl instanceof Closeable) { + //JDK7+, ParallelWorldClassLoader + ((Closeable) cl).close(); + } else { + if (cl instanceof URLClassLoader) { + //JDK6 - API jars are loaded by instance of URLClassLoader + //so use proprietary API to release holded resources + try { + Class clUtil = oldContextCl.loadClass("sun.misc.ClassLoaderUtil"); + Method release = clUtil.getDeclaredMethod("releaseLoader", URLClassLoader.class); + release.invoke(null, cl); + } catch (ClassNotFoundException ex) { + //not Sun JDK 6, ignore + System.err.println(JDK6_REQUIRED); + } + } + } + cl = SecureLoader.getParentClassLoader(cl); + } } } - private static String parseVersion(String version) { - if(version.equals("1.0")) - return version; - // if we don't recognize the version number, we'll go to 2.0 RI - // anyway. It's easier to report an error message there, - // than in here. + public static String parseVersion(String version) { + // no other versions supported as of now return "2.0"; } } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/XJC.java 2013-04-04 15:27:01.944612685 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/XJC.java 2013-04-04 15:27:01.888612685 +0200 @@ -25,7 +25,6 @@ package com.sun.tools.internal.xjc.api; -import com.sun.tools.internal.xjc.api.impl.j2s.JavaCompilerImpl; import com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl; import com.sun.xml.internal.bind.api.impl.NameConverter; @@ -37,15 +36,6 @@ * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) */ public final class XJC { - /** - * Gets a fresh {@link JavaCompiler}. - * - * @return - * always return non-null object. - */ - public static JavaCompiler createJavaCompiler() { - return new JavaCompilerImpl(); - } /** * Gets a fresh {@link SchemaCompiler}. --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java 2013-04-04 15:27:02.148612689 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java 2013-04-04 15:27:02.088612687 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -53,6 +53,7 @@ import com.sun.tools.internal.xjc.reader.xmlschema.parser.LSInputSAXWrapper; import com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic; import com.sun.xml.internal.bind.unmarshaller.DOMScanner; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import com.sun.xml.internal.xsom.XSSchemaSet; import org.w3c.dom.Element; @@ -169,7 +170,7 @@ // eventually we need a proper URI class that works for us. try { new URL(systemId); - } catch( MalformedURLException _ ) { + } catch( MalformedURLException mue) { try { new URI(systemId); } catch (URISyntaxException e ) { @@ -196,7 +197,7 @@ } public void resetSchema() { - forest = new DOMForest(new XMLSchemaInternalizationLogic()); + forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts); forest.setErrorHandler(this); forest.setEntityResolver(opts.entityResolver); } @@ -216,7 +217,7 @@ if (!NO_CORRECTNESS_CHECK) { // correctness check - SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, opts.disableXmlSecurity); // fix for https://jaxb.dev.java.net/issues/show_bug.cgi?id=795 // taken from SchemaConstraintChecker, TODO XXX FIXME UGLY --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java 2013-04-04 15:27:02.384612692 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java 2013-04-04 15:27:02.336612691 +0200 @@ -38,7 +38,7 @@ import com.sun.tools.internal.xjc.model.nav.NType; import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED; import com.sun.tools.internal.xjc.outline.Outline; -import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter; +import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker; /** * {@link TypeAndAnnotation} implementation. @@ -81,7 +81,7 @@ CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack - if(adapterUse.getAdapterIfKnown()== SwaRefAdapter.class) { + if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java 2013-04-04 15:27:02.620612696 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java 2013-04-04 15:27:02.564612695 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java 2013-04-04 15:27:02.880612700 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java 2013-04-04 15:27:02.832612699 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java 2013-04-04 15:27:03.100612703 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java 2013-04-04 15:27:03.052612702 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java 2013-04-04 15:27:03.328612707 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java 2013-04-04 15:27:03.276612706 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java 2013-04-04 15:27:03.572612711 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java 2013-04-04 15:27:03.520612710 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java 2013-04-04 15:27:03.792612714 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java 2013-04-04 15:27:03.740612714 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java 2013-04-04 15:27:04.008612718 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java 2013-04-04 15:27:03.960612717 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java 2013-04-04 15:27:04.240612721 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java 2013-04-04 15:27:04.192612720 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java 2013-04-04 15:27:04.472612725 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java 2013-04-04 15:27:04.420612724 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java 2013-04-04 15:27:04.692612728 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java 2013-04-04 15:27:04.644612727 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java 2013-04-04 15:27:04.920612731 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java 2013-04-04 15:27:04.864612731 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java 2013-04-04 15:27:05.152612736 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java 2013-04-04 15:27:05.104612735 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java 2013-04-04 15:27:05.372612739 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java 2013-04-04 15:27:05.316612738 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java 2013-04-04 15:27:05.644612743 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java 2013-04-04 15:27:05.592612742 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java 2013-04-04 15:27:05.884612747 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java 2013-04-04 15:27:05.828612746 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java 2013-04-04 15:27:06.140612750 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java 2013-04-04 15:27:06.080612750 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java 2013-04-04 15:27:06.372612755 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java 2013-04-04 15:27:06.312612753 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java 2013-04-04 15:27:06.736612760 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java 2013-04-04 15:27:06.684612759 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java 2013-04-04 15:27:06.968612764 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java 2013-04-04 15:27:06.916612763 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java 2013-04-04 15:27:07.192612767 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java 2013-04-04 15:27:07.136612766 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java 2013-04-04 15:27:07.452612771 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java 2013-04-04 15:27:07.396612771 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java 2013-04-04 15:27:07.700612775 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java 2013-04-04 15:27:07.648612774 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java 2013-04-04 15:27:07.972612779 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java 2013-04-04 15:27:07.908612778 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java 2013-04-04 15:27:08.256612783 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java 2013-04-04 15:27:08.184612783 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java 2013-04-04 15:27:08.496612787 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java 2013-04-04 15:27:08.444612787 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java 2013-04-04 15:27:08.740612791 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java 2013-04-04 15:27:08.684612791 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java 2013-04-04 15:27:08.996612795 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java 2013-04-04 15:27:08.948612794 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java 2013-04-04 15:27:09.232612799 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java 2013-04-04 15:27:09.180612798 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java 2013-04-04 15:27:09.452612803 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java 2013-04-04 15:27:09.400612801 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java 2013-04-04 15:27:09.680612806 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java 2013-04-04 15:27:09.628612805 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java 2013-04-04 15:27:09.940612810 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java 2013-04-04 15:27:09.880612809 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java 2013-04-04 15:27:10.196612814 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java 2013-04-04 15:27:10.144612813 +0200 @@ -43,6 +43,8 @@ import javax.xml.bind.annotation.XmlAttachmentRef; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlMimeType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; import com.sun.codemodel.internal.ClassType; @@ -96,7 +98,8 @@ import com.sun.tools.internal.xjc.outline.Outline; import com.sun.tools.internal.xjc.outline.PackageOutline; import com.sun.tools.internal.xjc.util.CodeModelClassFactory; -import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter; +import com.sun.xml.internal.bind.v2.model.core.PropertyInfo; +import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker; import com.sun.xml.internal.xsom.XmlString; import com.sun.istack.internal.NotNull; import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; @@ -770,7 +773,7 @@ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { - if (adapter.getAdapterIfKnown() == SwaRefAdapter.class) { + if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java 2013-04-04 15:27:10.424612817 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java 2013-04-04 15:27:10.372612817 +0200 @@ -31,7 +31,6 @@ import com.sun.codemodel.internal.JPackage; import com.sun.tools.internal.xjc.model.CElementInfo; import com.sun.tools.internal.xjc.model.Model; -import com.sun.xml.internal.bind.v2.ContextFactory; /** * {@link ObjectFactoryGenerator} used when we generate @@ -53,7 +52,7 @@ // put the marker so that we can detect missing jaxb.properties publicOFG.getObjectFactory().field(JMod.PRIVATE|JMod.STATIC|JMod.FINAL, - Void.class, ContextFactory.USE_JAXB_PROPERTIES, JExpr._null()); + Void.class, "_useJAXBProperties", JExpr._null()); } void populate(CElementInfo ei) { --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java 2013-04-04 15:27:10.640612821 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java 2013-04-04 15:27:10.588612820 +0200 @@ -32,7 +32,6 @@ import com.sun.codemodel.internal.JMod; import com.sun.codemodel.internal.JType; import com.sun.codemodel.internal.JVar; -import com.sun.tools.internal.xjc.api.SpecVersion; import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; import com.sun.tools.internal.xjc.model.CPropertyInfo; --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CArrayInfo.java 2013-04-04 15:27:10.856612824 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CArrayInfo.java 2013-04-04 15:27:10.804612824 +0200 @@ -28,12 +28,12 @@ import javax.xml.namespace.QName; import com.sun.codemodel.internal.JType; +import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil; import com.sun.tools.internal.xjc.model.nav.NClass; import com.sun.tools.internal.xjc.model.nav.NType; import com.sun.tools.internal.xjc.outline.Aspect; import com.sun.tools.internal.xjc.outline.Outline; import com.sun.xml.internal.bind.v2.model.core.ArrayInfo; -import com.sun.xml.internal.bind.v2.model.impl.ArrayInfoImpl; import com.sun.xml.internal.xsom.XSComponent; import org.xml.sax.Locator; @@ -57,7 +57,7 @@ super(model,source,customizations); this.itemType = itemType; assert itemType.getTypeName()!=null; - this.typeName = ArrayInfoImpl.calcArrayTypeName(itemType.getTypeName()); + this.typeName = ArrayInfoUtil.calcArrayTypeName(itemType.getTypeName()); } public CNonElement getItemType() { --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java 2013-04-04 15:27:11.076612828 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java 2013-04-04 15:27:11.024612827 +0200 @@ -49,16 +49,19 @@ import com.sun.codemodel.internal.JExpression; import com.sun.codemodel.internal.JType; import com.sun.tools.internal.xjc.model.nav.NClass; +import com.sun.xml.internal.bind.v2.model.annotation.Locatable; +import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo; +import com.sun.xml.internal.bind.v2.model.core.Element; +import com.sun.xml.internal.bind.v2.model.core.LeafInfo; +import com.sun.xml.internal.bind.v2.runtime.Location; import com.sun.tools.internal.xjc.model.nav.NType; import com.sun.tools.internal.xjc.model.nav.NavigatorImpl; import com.sun.tools.internal.xjc.outline.Aspect; import com.sun.tools.internal.xjc.outline.Outline; import com.sun.tools.internal.xjc.runtime.ZeroOneBooleanAdapter; import com.sun.tools.internal.xjc.util.NamespaceContextAdapter; -import com.sun.xml.internal.bind.DatatypeConverterImpl; import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.model.core.ID; -import com.sun.xml.internal.bind.v2.model.impl.BuiltinLeafInfoImpl; import com.sun.xml.internal.xsom.XSComponent; import com.sun.xml.internal.xsom.XmlString; @@ -92,13 +95,23 @@ * * @author Kohsuke Kawaguchi */ -public abstract class CBuiltinLeafInfo extends BuiltinLeafInfoImpl implements CNonElement { +public abstract class CBuiltinLeafInfo implements CNonElement, BuiltinLeafInfo, LeafInfo, Location { + + private final NType type; + /** + * Can be null for anonymous types. + */ + private final QName typeName; + + private final QName[] typeNames; private final ID id; // no derived class other than the spec-defined ones. definitely not for enum. - private CBuiltinLeafInfo(NType typeToken, QName typeName, ID id) { - super(typeToken,typeName); + private CBuiltinLeafInfo(NType typeToken, ID id, QName... typeNames) { + this.type = typeToken; + this.typeName = typeNames.length>0?typeNames[0]:null; + this.typeNames = typeNames; this.id = id; } @@ -172,6 +185,73 @@ } /** + * @deprecated always return false at this level. + */ + public final boolean isElement() { + return false; + } + + /** + * @deprecated always return null at this level. + */ + public final QName getElementName() { + return null; + } + + /** + * @deprecated always return null at this level. + */ + public final Element asElement() { + return null; + } + + /** + * A reference to the representation of the type. + */ + public NType getType() { + return type; + } + + /** + * Returns all the type names recognized by this bean info. + * + * @return + * do not modify the returned array. + */ + public final QName[] getTypeNames() { + return typeNames; + } + + /** + * Leaf-type cannot be referenced from IDREF. + * + * @deprecated + * why are you calling a method whose return value is always known? + */ + public final boolean canBeReferencedByIDREF() { + return false; + } + + public QName getTypeName() { + return typeName; + } + + public Locatable getUpstream() { + return null; + } + + public Location getLocation() { + // this isn't very accurate, but it's not too bad + // doing it correctly need leaves to hold navigator. + // otherwise revisit the design so that we take navigator as a parameter + return this; + } + + public boolean isSimpleType() { + return true; + } + + /** * {@link CBuiltinLeafInfo} for Java classes that have * the spec defined built-in binding semantics. */ @@ -180,7 +260,7 @@ this(c,typeName,com.sun.xml.internal.bind.v2.model.core.ID.NONE); } protected Builtin(Class c, String typeName, ID id) { - super(NavigatorImpl.theInstance.ref(c), new QName(WellKnownNamespace.XML_SCHEMA,typeName),id); + super(NavigatorImpl.theInstance.ref(c), id, new QName(WellKnownNamespace.XML_SCHEMA,typeName)); LEAVES.put(getType(),this); } @@ -215,46 +295,46 @@ }; public static final CBuiltinLeafInfo BOOLEAN = new Builtin(Boolean.class,"boolean") { public JExpression createConstant(Outline outline, XmlString lexical) { - return JExpr.lit(DatatypeConverterImpl._parseBoolean(lexical.value)); + return JExpr.lit(DatatypeConverter.parseBoolean(lexical.value)); } }; public static final CBuiltinLeafInfo INT = new Builtin(Integer.class,"int") { public JExpression createConstant(Outline outline, XmlString lexical) { - return JExpr.lit(DatatypeConverterImpl._parseInt(lexical.value)); + return JExpr.lit(DatatypeConverter.parseInt(lexical.value)); } }; public static final CBuiltinLeafInfo LONG = new Builtin(Long.class,"long") { public JExpression createConstant(Outline outline, XmlString lexical) { - return JExpr.lit(DatatypeConverterImpl._parseLong(lexical.value)); + return JExpr.lit(DatatypeConverter.parseLong(lexical.value)); } }; public static final CBuiltinLeafInfo BYTE = new Builtin(Byte.class,"byte") { public JExpression createConstant(Outline outline, XmlString lexical) { return JExpr.cast( outline.getCodeModel().BYTE, - JExpr.lit(DatatypeConverterImpl._parseByte(lexical.value))); + JExpr.lit(DatatypeConverter.parseByte(lexical.value))); } }; public static final CBuiltinLeafInfo SHORT = new Builtin(Short.class,"short") { public JExpression createConstant(Outline outline, XmlString lexical) { return JExpr.cast( outline.getCodeModel().SHORT, - JExpr.lit(DatatypeConverterImpl._parseShort(lexical.value))); + JExpr.lit(DatatypeConverter.parseShort(lexical.value))); } }; public static final CBuiltinLeafInfo FLOAT = new Builtin(Float.class,"float") { public JExpression createConstant(Outline outline, XmlString lexical) { - return JExpr.lit(DatatypeConverterImpl._parseFloat(lexical.value)); + return JExpr.lit(DatatypeConverter.parseFloat(lexical.value)); } }; public static final CBuiltinLeafInfo DOUBLE = new Builtin(Double.class,"double") { public JExpression createConstant(Outline outline, XmlString lexical) { - return JExpr.lit(DatatypeConverterImpl._parseDouble(lexical.value)); + return JExpr.lit(DatatypeConverter.parseDouble(lexical.value)); } }; public static final CBuiltinLeafInfo QNAME = new Builtin(QName.class,"QName") { public JExpression createConstant(Outline outline, XmlString lexical) { - QName qn = DatatypeConverterImpl._parseQName(lexical.value,new NamespaceContextAdapter(lexical)); + QName qn = DatatypeConverter.parseQName(lexical.value,new NamespaceContextAdapter(lexical)); return JExpr._new(outline.getCodeModel().ref(QName.class)) .arg(qn.getNamespaceURI()) .arg(qn.getLocalPart()) --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java 2013-04-04 15:27:11.300612831 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java 2013-04-04 15:27:11.248612830 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +29,6 @@ import java.util.Collection; import java.util.Map; -import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; @@ -37,10 +36,10 @@ import com.sun.codemodel.internal.JClass; import com.sun.codemodel.internal.JJavaName; import com.sun.codemodel.internal.JType; -import com.sun.tools.internal.xjc.Plugin; import com.sun.tools.internal.xjc.generator.bean.field.FieldRenderer; import com.sun.tools.internal.xjc.model.nav.NClass; import com.sun.tools.internal.xjc.model.nav.NType; +import com.sun.tools.internal.xjc.reader.Ring; import com.sun.xml.internal.bind.api.impl.NameConverter; import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.model.core.PropertyInfo; @@ -105,7 +104,15 @@ protected CPropertyInfo(String name, boolean collection, XSComponent source, CCustomizations customizations, Locator locator) { this.publicName = name; - String n = NameConverter.standard.toVariableName(name); + String n = null; + + Model m = Ring.get(Model.class); + if (m != null) { + n = m.getNameConverter().toVariableName(name); + } else { + n = NameConverter.standard.toVariableName(name); + } + if(!JJavaName.isJavaIdentifier(n)) n = '_'+n; // avoid colliding with the reserved names like 'abstract'. this.privateName = n; --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeInfo.java 2013-04-04 15:27:11.528612835 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeInfo.java 2013-04-04 15:27:11.468612833 +0200 @@ -26,15 +26,12 @@ package com.sun.tools.internal.xjc.model; import com.sun.codemodel.internal.JClass; -import com.sun.codemodel.internal.JCodeModel; -import com.sun.codemodel.internal.JExpression; import com.sun.codemodel.internal.JType; import com.sun.tools.internal.xjc.model.nav.NClass; import com.sun.tools.internal.xjc.model.nav.NType; import com.sun.tools.internal.xjc.outline.Aspect; import com.sun.tools.internal.xjc.outline.Outline; import com.sun.xml.internal.bind.v2.model.core.TypeInfo; -import com.sun.xml.internal.xsom.XmlString; /** * {@link TypeInfo} at the compile-time. --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java 2013-04-04 15:27:11.752612838 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java 2013-04-04 15:27:11.700612838 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -207,7 +207,7 @@ return create(primitiveType); } - + @SuppressWarnings("FinalStaticMethod") public static final NType create(Type t) { if(t==null) return null; if(t instanceof Class) @@ -236,17 +236,18 @@ public Location getClassLocation(final NClass c) { // not really needed for XJC but doesn't hurt to have one return new Location() { + @Override public String toString() { return c.fullName(); } }; } - public Location getFieldLocation(Void _) { + public Location getFieldLocation(Void v) { throw new IllegalStateException(); } - public Location getMethodLocation(Void _) { + public Location getMethodLocation(Void v) { throw new IllegalStateException(); } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/TypeUtil.java 2013-04-04 15:27:11.972612841 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/TypeUtil.java 2013-04-04 15:27:11.916612841 +0200 @@ -34,7 +34,6 @@ import java.util.TreeSet; import com.sun.codemodel.internal.JClass; -import com.sun.codemodel.internal.JClassAlreadyExistsException; import com.sun.codemodel.internal.JCodeModel; import com.sun.codemodel.internal.JDefinedClass; import com.sun.codemodel.internal.JType; --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java 2013-04-04 15:27:12.204612845 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java 2013-04-04 15:27:12.148612844 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ import com.sun.tools.internal.xjc.model.TypeUse; import com.sun.tools.internal.xjc.model.TypeUseFactory; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import org.w3c.dom.Element; import org.xml.sax.InputSource; import org.xml.sax.Locator; @@ -86,8 +87,8 @@ private static Element parse(String text) { try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); + //this is parsing well known schemas, do not configure secure processing - always true + DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(false); InputSource is = new InputSource(new StringReader(text)); return dbf.newDocumentBuilder().parse(is).getDocumentElement(); } catch (SAXException x) { @@ -131,7 +132,7 @@ // no package name is specified. try { t = JPrimitiveType.parse(owner.codeModel,type); - } catch( IllegalArgumentException e ) { + } catch( IllegalArgumentException ex ) { // otherwise treat it as a class name in the current package type = owner.getTargetPackage().name()+'.'+type; } @@ -142,8 +143,8 @@ JDefinedClass cls = owner.codeModel._class(type); cls.hide(); t = cls; - } catch( JClassAlreadyExistsException e ) { - t = e.getExistingClass(); + } catch( JClassAlreadyExistsException ex ) { + t = ex.getExistingClass(); } } @@ -168,7 +169,7 @@ try { JPackage pkg = owner.getTargetPackage(); adapter = pkg._class("Adapter"+id); - } catch (JClassAlreadyExistsException e) { + } catch (JClassAlreadyExistsException ex) { // try another name in search for an unique name. // this isn't too efficient, but we expect people to usually use // a very small number of adapters. --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java 2013-04-04 15:27:12.420612848 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java 2013-04-04 15:27:12.364612848 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 @@ import com.sun.tools.internal.xjc.util.ErrorReceiverFilter; import com.sun.tools.internal.xjc.util.ForkContentHandler; +import com.sun.xml.internal.bind.v2.util.XmlFactory; +import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; @@ -301,9 +303,9 @@ // /-> extensionChecker -> validator // parser-> -< // \-> DOM builder - SAXParserFactory pf = SAXParserFactory.newInstance(); - pf.setNamespaceAware(true); - DOMBuilder builder = new DOMBuilder(); + SAXParserFactory pf = XmlFactory.createParserFactory(model.options.disableXmlSecurity); + DocumentBuilderFactory domFactory = XmlFactory.createDocumentBuilderFactory(model.options.disableXmlSecurity); + DOMBuilder builder = new DOMBuilder(domFactory); ErrorReceiverFilter controller = new ErrorReceiverFilter(receiver); validator.setErrorHandler(controller); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java 2013-04-04 15:27:12.624612851 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java 2013-04-04 15:27:12.572612851 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +29,7 @@ import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; +import javax.xml.parsers.DocumentBuilderFactory; import org.xml.sax.Attributes; import org.xml.sax.Locator; @@ -38,14 +39,17 @@ final class DOMBuilder extends SAX2DOMEx { private Locator locator; - public DOMBuilder() throws ParserConfigurationException { + public DOMBuilder(DocumentBuilderFactory f) throws ParserConfigurationException { + super(f); } + @Override public void setDocumentLocator(Locator locator) { super.setDocumentLocator(locator); this.locator = locator; } + @Override public void startElement(String namespace, String localName, String qName, Attributes attrs) { super.startElement(namespace, localName, qName, attrs); DOMLocator.setLocationInfo(getCurrentElement(),locator); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java 2013-04-04 15:27:12.848612855 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java 2013-04-04 15:27:12.788612854 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -77,7 +77,7 @@ String relativeRef = findExternalResource(namespaceURI, localName, atts); if (relativeRef == null) { - return; // non found + return; // not found } try { // absolutize URL. @@ -97,7 +97,9 @@ // then parse this schema as well, // but don't mark this document as a root. - parent.parse(ref, false); + if (parent != null) { // this is there to allow easier testing + parent.parse(ref, false); + } } catch (URISyntaxException e) { String msg = e.getMessage(); if (new File(relativeRef).exists()) { --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java 2013-04-04 15:27:13.068612859 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java 2013-04-04 15:27:13.020612858 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -57,9 +57,9 @@ import com.sun.tools.internal.xjc.ErrorReceiver; import com.sun.tools.internal.xjc.Options; import com.sun.tools.internal.xjc.reader.Const; -import com.sun.tools.internal.xjc.reader.xmlschema.parser.SchemaConstraintChecker; import com.sun.tools.internal.xjc.util.ErrorReceiverFilter; import com.sun.xml.internal.bind.marshaller.DataWriter; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import com.sun.xml.internal.xsom.parser.JAXPParser; import com.sun.xml.internal.xsom.parser.XMLParser; @@ -126,6 +126,7 @@ private final SAXParserFactory parserFactory; private final DocumentBuilder documentBuilder; + private final Options options; public DOMForest( SAXParserFactory parserFactory, DocumentBuilder documentBuilder, @@ -134,16 +135,18 @@ this.parserFactory = parserFactory; this.documentBuilder = documentBuilder; this.logic = logic; + this.options = null; } - public DOMForest( InternalizationLogic logic ) { + public DOMForest( InternalizationLogic logic, Options opt ) { + + if (opt == null) throw new AssertionError("Options object null"); + this.options = opt; + try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); + DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(opt.disableXmlSecurity); this.documentBuilder = dbf.newDocumentBuilder(); - - this.parserFactory = SAXParserFactory.newInstance(); - this.parserFactory.setNamespaceAware(true); + this.parserFactory = XmlFactory.createParserFactory(opt.disableXmlSecurity); } catch( ParserConfigurationException e ) { throw new AssertionError(e); } @@ -188,8 +191,9 @@ */ private String getPath(String key) { key = key.substring(5); // skip 'file:' - while(key.length()>0 && key.charAt(0)=='/') + while(key.length()>0 && key.charAt(0)=='/') { key = key.substring(1); + } return key; } @@ -225,7 +229,11 @@ */ public boolean checkSchemaCorrectness(ErrorReceiver errorHandler) { try { - SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI); + boolean disableXmlSecurity = false; + if (options != null) { + disableXmlSecurity = options.disableXmlSecurity; + } + SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity); ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler); sf.setErrorHandler(filter); Set roots = getRootDocuments(); @@ -424,7 +432,7 @@ * components are built. */ public SCDBasedBindingSet transform(boolean enableSCD) { - return Internalizer.transform(this,enableSCD); + return Internalizer.transform(this, enableSCD, options.disableXmlSecurity); } /** @@ -466,16 +474,16 @@ sf.newSchema(sources.toArray(new SAXSource[0])); } catch (SAXException e) { // error should have been reported. - } catch (RuntimeException e) { + } catch (RuntimeException re) { // JAXP RI isn't very trustworthy when it comes to schema error check, // and we know some cases where it just dies with NPE. So handle it gracefully. // this masks a bug in the JAXP RI, but we need a release that we have to make. try { sf.getErrorHandler().warning( new SAXParseException(Messages.format( - Messages.ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR,e.getMessage()), - null,null,-1,-1,e)); - } catch (SAXException _) { + Messages.ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR,re.getMessage()), + null,null,-1,-1,re)); + } catch (SAXException e) { // ignore } } @@ -489,10 +497,12 @@ ContentHandlerNamespacePrefixAdapter reader = new ContentHandlerNamespacePrefixAdapter(new XMLFilterImpl() { // XMLReader that uses XMLParser to parse. We need to use XMLFilter to indrect // handlers, since SAX allows handlers to be changed while parsing. + @Override public void parse(InputSource input) throws SAXException, IOException { createParser().parse(input, this, this, this); } + @Override public void parse(String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); } @@ -509,11 +519,9 @@ * instead of the original documents. */ public XMLParser createParser() { - return new DOMForestParser(this,new JAXPParser()); + return new DOMForestParser(this, new JAXPParser(XmlFactory.createParserFactory(options.disableXmlSecurity))); } - - public EntityResolver getEntityResolver() { return entityResolver; } @@ -549,10 +557,16 @@ * * This is a debug method. As such, error handling is sloppy. */ + @SuppressWarnings("CallToThreadDumpStack") public void dump( OutputStream out ) throws IOException { try { // create identity transformer - Transformer it = TransformerFactory.newInstance().newTransformer(); + boolean disableXmlSecurity = false; + if (options != null) { + disableXmlSecurity = options.disableXmlSecurity; + } + TransformerFactory tf = XmlFactory.createTransformerFactory(disableXmlSecurity); + Transformer it = tf.newTransformer(); for (Map.Entry e : core.entrySet()) { out.write( ("---<< "+e.getKey()+'\n').getBytes() ); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java 2013-04-04 15:27:13.280612862 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java 2013-04-04 15:27:13.232612861 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +47,7 @@ import com.sun.tools.internal.xjc.reader.Const; import com.sun.tools.internal.xjc.util.DOMUtils; import com.sun.xml.internal.bind.v2.util.EditDistance; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import com.sun.xml.internal.xsom.SCD; import java.io.File; import java.io.IOException; @@ -75,9 +76,9 @@ private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/"; - private static final XPathFactory xpf = XPathFactory.newInstance(); + private static XPathFactory xpf = null; - private final XPath xpath = xpf.newXPath(); + private final XPath xpath; /** * Internalize all <jaxb:bindings> customizations in the given forest. @@ -89,15 +90,21 @@ * SCDs are only for XML Schema, and doesn't make any sense for other * schema languages. */ - static SCDBasedBindingSet transform( DOMForest forest, boolean enableSCD ) { - return new Internalizer( forest, enableSCD ).transform(); + static SCDBasedBindingSet transform( DOMForest forest, boolean enableSCD, boolean disableSecureProcessing ) { + return new Internalizer(forest, enableSCD, disableSecureProcessing).transform(); } - private Internalizer( DOMForest forest, boolean enableSCD ) { + private Internalizer(DOMForest forest, boolean enableSCD, boolean disableSecureProcessing) { this.errorHandler = forest.getErrorHandler(); this.forest = forest; this.enableSCD = enableSCD; + synchronized (this) { + if (xpf == null) { + xpf = XmlFactory.createXPathFactory(disableSecureProcessing); + } + } + xpath = xpf.newXPath(); } /** --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java 2013-04-04 15:27:13.492612865 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java 2013-04-04 15:27:13.440612865 +0200 @@ -31,6 +31,7 @@ import java.util.List; import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; import javax.xml.bind.UnmarshallerHandler; import javax.xml.validation.ValidatorHandler; @@ -45,7 +46,6 @@ import com.sun.xml.internal.xsom.XSAnnotation; import com.sun.xml.internal.xsom.XSComponent; import com.sun.xml.internal.xsom.XSSchemaSet; -import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -217,7 +217,7 @@ public void apply(XSSchemaSet schema, ErrorReceiver errorReceiver) { if(topLevel!=null) { this.errorReceiver = errorReceiver; - UnmarshallerImpl u = BindInfo.getJAXBContext().createUnmarshaller(); + Unmarshaller u = BindInfo.getCustomizationUnmarshaller(); this.unmarshaller = u.getUnmarshallerHandler(); ValidatorHandler v = BindInfo.bindingFileSchema.newValidator(); v.setErrorHandler(errorReceiver); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java 2013-04-04 15:27:13.744612869 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java 2013-04-04 15:27:13.684612868 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +57,7 @@ import com.sun.tools.internal.xjc.util.CodeModelClassFactory; import com.sun.tools.internal.xjc.util.ErrorReceiverFilter; import com.sun.xml.internal.bind.api.impl.NameConverter; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import com.sun.xml.internal.xsom.XSAnnotation; import com.sun.xml.internal.xsom.XSAttributeUse; import com.sun.xml.internal.xsom.XSComponent; @@ -228,7 +229,7 @@ } // obtain the name conversion mode - if(globalBinding.nameConverter!=null) + if (globalBinding.nameConverter!=null) model.setNameConverter(globalBinding.nameConverter); // attach global conversions to the appropriate simple types @@ -498,8 +499,10 @@ */ public Transformer getIdentityTransformer() { try { - if(identityTransformer==null) - identityTransformer = TransformerFactory.newInstance().newTransformer(); + if(identityTransformer==null) { + TransformerFactory tf = XmlFactory.createTransformerFactory(model.options.disableXmlSecurity); + identityTransformer = tf.newTransformer(); + } return identityTransformer; } catch (TransformerConfigurationException e) { throw new Error(e); // impossible --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java 2013-04-04 15:27:14.016612874 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java 2013-04-04 15:27:13.968612873 +0200 @@ -39,9 +39,11 @@ import java.util.Stack; import javax.activation.MimeTypeParseException; +import javax.xml.bind.DatatypeConverter; import com.sun.codemodel.internal.JJavaName; import com.sun.codemodel.internal.util.JavadocEscapeWriter; +import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.tools.internal.xjc.ErrorReceiver; import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo; import com.sun.tools.internal.xjc.model.CClassInfo; @@ -62,10 +64,10 @@ import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BindInfo; import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.EnumMemberMode; import com.sun.tools.internal.xjc.util.MimeTypeRange; -import com.sun.xml.internal.bind.DatatypeConverterImpl; -import com.sun.xml.internal.bind.v2.WellKnownNamespace; + import static com.sun.xml.internal.bind.v2.WellKnownNamespace.XML_MIME_URI; -import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter; + +import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker; import com.sun.xml.internal.xsom.XSAttributeDecl; import com.sun.xml.internal.xsom.XSComplexType; import com.sun.xml.internal.xsom.XSComponent; @@ -393,7 +395,7 @@ if(type.getTargetNamespace().equals(WellKnownNamespace.SWA_URI)) { String name = type.getName(); if(name!=null && name.equals("swaRef")) - return CBuiltinLeafInfo.STRING.makeAdapted(SwaRefAdapter.class,false); + return CBuiltinLeafInfo.STRING.makeAdapted(SwaRefAdapterMarker.class,false); } @@ -668,7 +670,7 @@ if (mem!=null) { name = mem.name; - if (mdoc != null) { + if (mdoc == null) { mdoc = mem.javadoc; } } @@ -846,7 +848,7 @@ XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; - BigInteger bi = DatatypeConverterImpl._parseInteger(me.getValue().value); + BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java 2013-04-04 15:27:14.236612877 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java 2013-04-04 15:27:14.184612876 +0200 @@ -67,7 +67,7 @@ public AnnotationParser create() { return new AnnotationParser() { - private Unmarshaller u = BindInfo.getJAXBContext().createUnmarshaller(); + private Unmarshaller u = BindInfo.getCustomizationUnmarshaller(); private UnmarshallerHandler handler; --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java 2013-04-04 15:27:14.468612881 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java 2013-04-04 15:27:14.416612880 +0200 @@ -35,6 +35,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlMixed; @@ -46,6 +47,7 @@ import javax.xml.transform.stream.StreamResult; import com.sun.codemodel.internal.JDocComment; +import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.tools.internal.xjc.SchemaCache; import com.sun.tools.internal.xjc.model.CCustomizations; import com.sun.tools.internal.xjc.model.CPluginCustomization; @@ -54,8 +56,6 @@ import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder; import com.sun.xml.internal.bind.annotation.XmlLocation; import com.sun.xml.internal.bind.marshaller.MinimumEscapeHandler; -import com.sun.xml.internal.bind.v2.WellKnownNamespace; -import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; import com.sun.xml.internal.xsom.XSComponent; import org.w3c.dom.Element; @@ -69,7 +69,7 @@ * @author * Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com) */ -@XmlRootElement(namespace=WellKnownNamespace.XML_SCHEMA,name="annotation") +@XmlRootElement(namespace= WellKnownNamespace.XML_SCHEMA,name="annotation") @XmlType(namespace=WellKnownNamespace.XML_SCHEMA,name="foobar") public final class BindInfo implements Iterable { @@ -311,33 +311,42 @@ /** * Lazily prepared {@link JAXBContext}. */ - private static JAXBContextImpl customizationContext; + private static volatile JAXBContext customizationContext; - public static JAXBContextImpl getJAXBContext() { - synchronized(AnnotationParserFactoryImpl.class) { - try { - if(customizationContext==null) - customizationContext = new JAXBContextImpl.JAXBContextBuilder().setClasses( - new Class[] { - BindInfo.class, // for xs:annotation - BIClass.class, - BIConversion.User.class, - BIConversion.UserAdapter.class, - BIDom.class, - BIFactoryMethod.class, - BIInlineBinaryData.class, - BIXDom.class, - BIXSubstitutable.class, - BIEnum.class, - BIEnumMember.class, - BIGlobalBinding.class, - BIProperty.class, - BISchemaBinding.class - }).build(); - return customizationContext; - } catch (JAXBException e) { - throw new AssertionError(e); + public static JAXBContext getCustomizationContext() { + try { + if (customizationContext == null) { + synchronized (BindInfo.class) { + if (customizationContext == null) { + customizationContext = JAXBContext.newInstance( + BindInfo.class, // for xs:annotation + BIClass.class, + BIConversion.User.class, + BIConversion.UserAdapter.class, + BIDom.class, + BIFactoryMethod.class, + BIInlineBinaryData.class, + BIXDom.class, + BIXSubstitutable.class, + BIEnum.class, + BIEnumMember.class, + BIGlobalBinding.class, + BIProperty.class, + BISchemaBinding.class); + } + } } + return customizationContext; + } catch (JAXBException e) { + throw new AssertionError(e); + } + } + + public static Unmarshaller getCustomizationUnmarshaller() { + try { + return getCustomizationContext().createUnmarshaller(); + } catch (JAXBException e) { + throw new AssertionError(e); } } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java 2013-04-04 15:27:14.700612884 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java 2013-04-04 15:27:14.652612883 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 @@ import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; +import com.sun.xml.internal.bind.v2.util.XmlFactory; +import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.Locator; @@ -76,12 +78,14 @@ ResultImpl() { try { - s2d = new SAX2DOMEx(); + DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); // safe - only used for BI + s2d = new SAX2DOMEx(factory); } catch (ParserConfigurationException e) { throw new AssertionError(e); // impossible } XMLFilterImpl f = new XMLFilterImpl() { + @Override public void setDocumentLocator(Locator locator) { super.setDocumentLocator(locator); location = new LocatorImpl(locator); --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java 2013-04-04 15:27:14.980612889 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java 2013-04-04 15:27:14.916612888 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.tools.internal.xjc.ErrorReceiver; import com.sun.tools.internal.xjc.util.ErrorReceiverFilter; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import org.w3c.dom.ls.LSInput; import org.w3c.dom.ls.LSResourceResolver; import org.xml.sax.EntityResolver; @@ -60,12 +61,14 @@ * @return true if there was no error, false if there were errors. */ public static boolean check(InputSource[] schemas, - ErrorReceiver errorHandler, final EntityResolver entityResolver) { + ErrorReceiver errorHandler, + final EntityResolver entityResolver, + boolean disableXmlSecurity) { ErrorReceiverFilter errorFilter = new ErrorReceiverFilter(errorHandler); boolean hadErrors = false; - SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI); + SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity); sf.setErrorHandler(errorFilter); if( entityResolver != null ) { sf.setResourceResolver(new LSResourceResolver() { @@ -121,6 +124,6 @@ for (int i = 0; i < args.length; i++) sources[i] = new InputSource(new File(args[i]).toURL().toExternalForm()); - check(sources, new ConsoleErrorReporter(), null); + check(sources, new ConsoleErrorReporter(), null, true); } } --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/DOMUtils.java 2013-04-04 15:27:15.216612892 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/DOMUtils.java 2013-04-04 15:27:15.164612891 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -123,25 +123,6 @@ return null; } -// these implementations look wrong to me, since getElementsByTagName returns -// all the elements in descendants, not just children. -// -// public static Element[] getChildElements(Element parent, QName qname) { -// NodeList children = parent.getElementsByTagNameNS(qname.uri, qname.localpart); -// return getElements(children); -// } -// -// public static Element[] getChildElements(Element parent, String namespaceURI, -// String localName) { -// NodeList children = parent.getElementsByTagNameNS(namespaceURI, localName); -// return getElements(children); -// } -// -// public static Element[] getChildElements(Element parent, String name) { -// NodeList children = parent.getElementsByTagName(name); -// return getElements(children); -// } - public static Element[] getElements(NodeList children) { Element[] elements = null; int len = 0; --- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/Util.java 2013-04-04 15:27:15.448612896 +0200 +++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/Util.java 2013-04-04 15:27:15.388612895 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java 2013-04-04 15:27:15.748612901 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java 2013-04-04 15:27:15.684612900 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 @@ * @deprecated in JAXB 2.2.4 - use javax.xml.bind.DatatypeConverterImpl instead * or let us know why you can't */ -public final class DatatypeConverterImpl { +@Deprecated +public final class DatatypeConverterImpl implements DatatypeConverterInterface { + + @Deprecated + public static final DatatypeConverterInterface theInstance = new DatatypeConverterImpl(); protected DatatypeConverterImpl() { // shall not be used @@ -874,4 +878,239 @@ buf.append(n); } } + + // DEPRECATED METHODS, KEPT FOR JAXB1 GENERATED CLASSES COMPATIBILITY, WILL BE REMOVED IN FUTURE + + @Deprecated + public String parseString(String lexicalXSDString) { + return lexicalXSDString; + } + + @Deprecated + public BigInteger parseInteger(String lexicalXSDInteger) { + return _parseInteger(lexicalXSDInteger); + } + + @Deprecated + public String printInteger(BigInteger val) { + return _printInteger(val); + } + + @Deprecated + public int parseInt(String s) { + return _parseInt(s); + } + + @Deprecated + public long parseLong(String lexicalXSLong) { + return _parseLong(lexicalXSLong); + } + + @Deprecated + public short parseShort(String lexicalXSDShort) { + return _parseShort(lexicalXSDShort); + } + + @Deprecated + public String printShort(short val) { + return _printShort(val); + } + + @Deprecated + public BigDecimal parseDecimal(String content) { + return _parseDecimal(content); + } + + @Deprecated + public float parseFloat(String lexicalXSDFloat) { + return _parseFloat(lexicalXSDFloat); + } + + @Deprecated + public String printFloat(float v) { + return _printFloat(v); + } + + @Deprecated + public double parseDouble(String lexicalXSDDouble) { + return _parseDouble(lexicalXSDDouble); + } + + @Deprecated + public boolean parseBoolean(String lexicalXSDBoolean) { + Boolean b = _parseBoolean(lexicalXSDBoolean); + return (b == null) ? false : b.booleanValue(); + } + + @Deprecated + public String printBoolean(boolean val) { + return val ? "true" : "false"; + } + + @Deprecated + public byte parseByte(String lexicalXSDByte) { + return _parseByte(lexicalXSDByte); + } + + @Deprecated + public String printByte(byte val) { + return _printByte(val); + } + + @Deprecated + public QName parseQName(String lexicalXSDQName, NamespaceContext nsc) { + return _parseQName(lexicalXSDQName, nsc); + } + + @Deprecated + public Calendar parseDateTime(String lexicalXSDDateTime) { + return _parseDateTime(lexicalXSDDateTime); + } + + @Deprecated + public String printDateTime(Calendar val) { + return _printDateTime(val); + } + + @Deprecated + public byte[] parseBase64Binary(String lexicalXSDBase64Binary) { + return _parseBase64Binary(lexicalXSDBase64Binary); + } + + @Deprecated + public byte[] parseHexBinary(String s) { + final int len = s.length(); + + // "111" is not a valid hex encoding. + if (len % 2 != 0) { + throw new IllegalArgumentException("hexBinary needs to be even-length: " + s); + } + + byte[] out = new byte[len / 2]; + + for (int i = 0; i < len; i += 2) { + int h = hexToBin(s.charAt(i)); + int l = hexToBin(s.charAt(i + 1)); + if (h == -1 || l == -1) { + throw new IllegalArgumentException("contains illegal character for hexBinary: " + s); + } + + out[i / 2] = (byte) (h * 16 + l); + } + + return out; + } + + @Deprecated + private static int hexToBin(char ch) { + if ('0' <= ch && ch <= '9') { + return ch - '0'; + } + if ('A' <= ch && ch <= 'F') { + return ch - 'A' + 10; + } + if ('a' <= ch && ch <= 'f') { + return ch - 'a' + 10; + } + return -1; + } + + @Deprecated + private static final char[] hexCode = "0123456789ABCDEF".toCharArray(); + + @Deprecated + public String printHexBinary(byte[] data) { + StringBuilder r = new StringBuilder(data.length * 2); + for (byte b : data) { + r.append(hexCode[(b >> 4) & 0xF]); + r.append(hexCode[(b & 0xF)]); + } + return r.toString(); + } + + @Deprecated + public long parseUnsignedInt(String lexicalXSDUnsignedInt) { + return _parseLong(lexicalXSDUnsignedInt); + } + + @Deprecated + public String printUnsignedInt(long val) { + return _printLong(val); + } + + @Deprecated + public int parseUnsignedShort(String lexicalXSDUnsignedShort) { + return _parseInt(lexicalXSDUnsignedShort); + } + + @Deprecated + public Calendar parseTime(String lexicalXSDTime) { + return datatypeFactory.newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar(); + } + + @Deprecated + public String printTime(Calendar val) { + return CalendarFormatter.doFormat("%h:%m:%s%z", val); + } + + @Deprecated + public Calendar parseDate(String lexicalXSDDate) { + return datatypeFactory.newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar(); + } + + @Deprecated + public String printDate(Calendar val) { + return _printDate(val); + } + + @Deprecated + public String parseAnySimpleType(String lexicalXSDAnySimpleType) { + return lexicalXSDAnySimpleType; + } + + @Deprecated + public String printString(String val) { + return val; + } + + @Deprecated + public String printInt(int val) { + return _printInt(val); + } + + @Deprecated + public String printLong(long val) { + return _printLong(val); + } + + @Deprecated + public String printDecimal(BigDecimal val) { + return _printDecimal(val); + } + + @Deprecated + public String printDouble(double v) { + return _printDouble(v); + } + + @Deprecated + public String printQName(QName val, NamespaceContext nsc) { + return _printQName(val, nsc); + } + + @Deprecated + public String printBase64Binary(byte[] val) { + return _printBase64Binary(val); + } + + @Deprecated + public String printUnsignedShort(int val) { + return String.valueOf(val); + } + + @Deprecated + public String printAnySimpleType(String val) { + return val; + } + } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/InternalAccessorFactory.java 2013-04-04 15:27:15.996612904 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/InternalAccessorFactory.java 2013-04-04 15:27:15.944612904 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ /** * A means to allow the user to provide customized Accessor - * to be used by JAXB. Adds ability to supress warnings. + * to be used by JAXB. Adds ability to suppress warnings. */ public interface InternalAccessorFactory extends AccessorFactory { /** @@ -40,7 +40,7 @@ * @param bean the class to be processed. * @param f the field within the class to be accessed. * @param readOnly the isStatic value of the field's modifier. - * @param supressWarnings supress reflection warnings + * @param supressWarnings suppress reflection warnings * @return Accessor the accessor for this field * * @throws JAXBException reports failures of the method. --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/Util.java 2013-04-04 15:27:16.236612908 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/Util.java 2013-04-04 15:27:16.184612907 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -40,10 +40,9 @@ */ public static Logger getClassLogger() { try { -// StackTraceElement[] trace = Thread.currentThread().getStackTrace(); StackTraceElement[] trace = new Exception().getStackTrace(); return Logger.getLogger(trace[1].getClassName()); - } catch( SecurityException _ ) { + } catch( SecurityException e) { return Logger.getLogger("com.sun.xml.internal.bind"); // use the default } } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java 2013-04-04 15:27:16.464612911 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java 2013-04-04 15:27:16.416612911 +0200 @@ -166,7 +166,7 @@ /** * Returns true if the specified string is all whitespace. */ - public static final boolean isWhiteSpace(CharSequence s) { + public static boolean isWhiteSpace(CharSequence s) { for( int i=s.length()-1; i>=0; i-- ) if(!isWhiteSpace(s.charAt(i))) return false; @@ -174,7 +174,7 @@ } /** returns true if the specified char is a white space character. */ - public static final boolean isWhiteSpace(char ch) { + public static boolean isWhiteSpace(char ch) { // most of the characters are non-control characters. // so check that first to quickly return false for most of the cases. if( ch>0x20 ) return false; @@ -187,7 +187,7 @@ * Returns true if the specified char is a white space character * but not 0x20. */ - protected static final boolean isWhiteSpaceExceptSpace(char ch) { + protected static boolean isWhiteSpaceExceptSpace(char ch) { // most of the characters are non-control characters. // so check that first to quickly return false for most of the cases. if( ch>=0x20 ) return false; --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/api/JAXBRIContext.java 2013-04-04 15:27:16.700612915 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/api/JAXBRIContext.java 2013-04-04 15:27:16.644612914 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +47,7 @@ import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader; import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet; +import java.util.HashMap; /** * {@link JAXBContext} enhanced with JAXB RI specific functionalities. @@ -93,7 +94,7 @@ @Nullable Map subclassReplacements, @Nullable String defaultNamespaceRemap, boolean c14nSupport, @Nullable RuntimeAnnotationReader ar) throws JAXBException { - return ContextFactory.createContext(classes, typeRefs, subclassReplacements, + return newInstance(classes, typeRefs, subclassReplacements, defaultNamespaceRemap, c14nSupport, ar, false, false, false, false); } @@ -135,9 +136,21 @@ @Nullable Map subclassReplacements, @Nullable String defaultNamespaceRemap, boolean c14nSupport, @Nullable RuntimeAnnotationReader ar, - boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean supressAccessorWarnings) throws JAXBException { - return ContextFactory.createContext(classes, typeRefs, subclassReplacements, - defaultNamespaceRemap, c14nSupport, ar, xmlAccessorFactorySupport, allNillable, retainPropertyInfo, supressAccessorWarnings); + boolean xmlAccessorFactorySupport, + boolean allNillable, + boolean retainPropertyInfo, + boolean supressAccessorWarnings) throws JAXBException { + Map properties = new HashMap(); + if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs); + if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements); + if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap); + if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar); + properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport)); + properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport)); + properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable)); + properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo)); + properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings)); + return (JAXBRIContext) ContextFactory.createContext(classes, properties); } /** @@ -407,7 +420,6 @@ return Navigator.REFLECTION.getBaseClass(type,baseType); } - /** * The property that you can specify to {@link JAXBContext#newInstance} * to reassign the default namespace URI to something else at the runtime. @@ -441,6 +453,7 @@ * and {@link Marshaller#setProperty(String, Object)} * to enable the c14n marshalling support in the {@link JAXBContext}. * + * Boolean * @see C14nSupport_ArchitectureDocument * @since 2.0 EA2 */ @@ -451,6 +464,7 @@ * to allow unmarshaller to honor xsi:nil anywhere, even if they are * not specifically allowed by the schema. * + * Boolean * @since 2.1.3 */ public static final String TREAT_EVERYTHING_NILLABLE = "com.sun.xml.internal.bind.treatEverythingNillable"; @@ -492,6 +506,7 @@ /** * Retains references to PropertyInfos. * + * Boolean * @since 2.1.10 */ public static final String RETAIN_REFERENCE_TO_INFO = "retainReferenceToInfo"; @@ -499,6 +514,7 @@ /** * Supress security warnings when trying to access fields through reflection. * + * Boolean * @since 2.1.14, 2.2.2 */ public static final String SUPRESS_ACCESSOR_WARNINGS = "supressAccessorWarnings"; @@ -506,8 +522,17 @@ /** * Improves handling of xsi:type used on leaf properties. * + * Boolean * @since 2.2.3 */ public static final String IMPROVED_XSI_TYPE_HANDLING = "com.sun.xml.internal.bind.improvedXsiTypeHandling"; + /** + * If true XML security features when parsing XML documents will be disabled. + * The default value is false. + * + * Boolean + * @since 2.2.6 + */ + public static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameConverter.java 2013-04-04 15:27:16.932612918 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameConverter.java 2013-04-04 15:27:16.880612918 +0200 @@ -25,6 +25,7 @@ package com.sun.xml.internal.bind.api.impl; +import javax.lang.model.SourceVersion; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -131,11 +132,6 @@ nsUri = nsUri.substring(idx+1); } - // issue 709; s/(.*)#(.*)/\1/ - idx = nsUri.indexOf("#"); - if(idx >= 0) - nsUri = nsUri.substring(0, idx); - // tokenize string ArrayList tokens = tokenize( nsUri, "/: " ); if( tokens.size() == 0 ) { @@ -177,7 +173,7 @@ token = removeIllegalIdentifierChars( token ); // this will check for reserved keywords - if( !NameUtil.isJavaIdentifier( token.toLowerCase() ) ) { + if (SourceVersion.isKeyword(token.toLowerCase())) { token = '_' + token; } @@ -190,19 +186,16 @@ private static String removeIllegalIdentifierChars(String token) { - StringBuffer newToken = new StringBuffer(); + StringBuilder newToken = new StringBuilder(token.length() + 1); // max expected length for( int i = 0; i < token.length(); i++ ) { char c = token.charAt( i ); - - if( i ==0 && !Character.isJavaIdentifierStart( c ) ) { - // prefix an '_' if the first char is illegal - newToken.append('_').append(c); - } else if( !Character.isJavaIdentifierPart( c ) ) { - // replace the char with an '_' if it is illegal - newToken.append( '_' ); + if (i == 0 && !Character.isJavaIdentifierStart(c)) { // c can't be used as FIRST char + newToken.append('_'); + } + if (!Character.isJavaIdentifierPart(c)) { // c can't be used + newToken.append('_'); } else { - // add the legal char - newToken.append( c ); + newToken.append(c); // c is valid } } return newToken.toString(); @@ -267,7 +260,7 @@ public static final NameConverter smart = new Standard() { public String toConstantName( String token ) { String name = super.toConstantName(token); - if( NameUtil.isJavaIdentifier(name) ) + if(!SourceVersion.isKeyword(name)) return name; else return '_'+name; --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameUtil.java 2013-04-04 15:27:17.136612922 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameUtil.java 2013-04-04 15:27:17.084612921 +0200 @@ -26,6 +26,7 @@ package com.sun.xml.internal.bind.api.impl; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Locale; @@ -324,108 +325,4 @@ } return s; } - - - /** - * Checks if a given string is usable as a Java identifier. - */ - public static boolean isJavaIdentifier(String s) { - if(s.length()==0) return false; - if( reservedKeywords.contains(s) ) return false; - - if(!Character.isJavaIdentifierStart(s.charAt(0))) return false; - - for (int i = 1; i < s.length(); i++) - if (!Character.isJavaIdentifierPart(s.charAt(i))) - return false; - - return true; - } - - /** - * Checks if the given string is a valid Java package name. - */ - public static boolean isJavaPackageName(String s) { - while(s.length()!=0) { - int idx = s.indexOf('.'); - if(idx==-1) idx=s.length(); - if( !isJavaIdentifier(s.substring(0,idx)) ) - return false; - - s = s.substring(idx); - if(s.length()!=0) s = s.substring(1); // remove '.' - } - return true; - } - - - /** All reserved keywords of Java. */ - private static HashSet reservedKeywords = new HashSet(); - - static { - // see http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html - String[] words = new String[]{ - "abstract", - "boolean", - "break", - "byte", - "case", - "catch", - "char", - "class", - "const", - "continue", - "default", - "do", - "double", - "else", - "extends", - "final", - "finally", - "float", - "for", - "goto", - "if", - "implements", - "import", - "instanceof", - "int", - "interface", - "long", - "native", - "new", - "package", - "private", - "protected", - "public", - "return", - "short", - "static", - "strictfp", - "super", - "switch", - "synchronized", - "this", - "throw", - "throws", - "transient", - "try", - "void", - "volatile", - "while", - - // technically these are not reserved words but they cannot be used as identifiers. - "true", - "false", - "null", - - // and I believe assert is also a new keyword - "assert", - - // and 5.0 keywords - "enum" - }; - for (String word : words) - reservedKeywords.add(word); - } } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java 2013-04-04 15:27:17.356612926 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java 2013-04-04 15:27:17.300612924 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 +23,6 @@ * questions. */ -/* - * SAX2DOMEx.java - * - * Created on February 22, 2002, 1:55 PM - */ package com.sun.xml.internal.bind.marshaller; import java.util.Stack; @@ -38,6 +33,7 @@ import com.sun.xml.internal.bind.util.Which; import com.sun.istack.internal.FinalArrayList; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -90,9 +86,19 @@ /** * Creates a fresh empty DOM document and adds nodes under this document. */ + public SAX2DOMEx(DocumentBuilderFactory f) throws ParserConfigurationException { + f.setValidating(false); + document = f.newDocumentBuilder().newDocument(); + node = document; + nodeStack.push(document); + } + + /** + * Creates a fresh empty DOM document and adds nodes under this document. + * @deprecated + */ public SAX2DOMEx() throws ParserConfigurationException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); + DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); factory.setValidating(false); document = factory.newDocumentBuilder().newDocument(); @@ -143,7 +149,7 @@ public void startElement(String namespace, String localName, String qName, Attributes attrs) { Node parent = nodeStack.peek(); - // some broken DOM implementatino (we confirmed it with SAXON) + // some broken DOM implementation (we confirmed it with SAXON) // return null from this method. Element element = document.createElementNS(namespace, qName); @@ -158,7 +164,7 @@ // process namespace bindings for (int i = 0; i < unprocessedNamespaces.size(); i += 2) { - String prefix = unprocessedNamespaces.get(i + 0); + String prefix = unprocessedNamespaces.get(i); String uri = unprocessedNamespaces.get(i + 1); namespace(element, prefix, uri); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/util/SecureLoader.java 2013-04-04 15:27:17.600612929 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/util/SecureLoader.java 2013-04-04 15:27:17.544612928 +0200 @@ -37,9 +37,9 @@ 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 java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +50,9 @@ if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +63,9 @@ if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ClassFactory.java 2013-04-04 15:27:17.816612932 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ClassFactory.java 2013-04-04 15:27:17.764612931 +0200 @@ -120,7 +120,7 @@ /** * The same as {@link #create0} but with an error handling to make - * the instanciation error fatal. + * the instantiation error fatal. */ public static T create( Class clazz ) { try { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ContextFactory.java 2013-04-04 15:27:18.056612936 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ContextFactory.java 2013-04-04 15:27:18.004612935 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -60,10 +60,11 @@ * @author Kohsuke Kawaguchi */ public class ContextFactory { + /** * The API will invoke this method via reflection */ - public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException { + public static JAXBContext createContext(Class[] classes, Map properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); @@ -76,6 +77,10 @@ if(c14nSupport==null) c14nSupport = false; + Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); + if (disablesecurityProcessing==null) + disablesecurityProcessing = false; + Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; @@ -89,8 +94,14 @@ supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); - if(improvedXsiTypeHandling == null) - improvedXsiTypeHandling = true; + if (improvedXsiTypeHandling == null) { + String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); + if (improvedXsiSystemProperty == null) { + improvedXsiTypeHandling = true; + } else { + improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); + } + } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); @@ -103,6 +114,11 @@ RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); + Collection tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); + if (tr == null) { + tr = Collections.emptyList(); + } + Map subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( @@ -117,7 +133,7 @@ JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); - builder.setTypeRefs(Collections.emptyList()); + builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); @@ -127,6 +143,7 @@ builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); + builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); } @@ -144,6 +161,22 @@ return type.cast(o); } + /** + * + * @param classes + * @param typeRefs + * @param subclassReplacements + * @param defaultNsUri + * @param c14nSupport + * @param ar + * @param xmlAccessorFactorySupport + * @param allNillable + * @param retainPropertyInfo + * @return + * @throws JAXBException + * @deprecated use createContext(Class[] classes, Map properties) method instead + */ + @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection typeRefs, Map subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, @@ -154,6 +187,23 @@ allNillable, retainPropertyInfo, false); } + /** + * + * @param classes + * @param typeRefs + * @param subclassReplacements + * @param defaultNsUri + * @param c14nSupport + * @param ar + * @param xmlAccessorFactorySupport + * @param allNillable + * @param retainPropertyInfo + * @param improvedXsiTypeHandling + * @return + * @throws JAXBException + * @deprecated use createContext( Class[] classes, Map properties) method instead + */ + @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection typeRefs, Map subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.java 2013-04-04 15:27:18.284612940 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.java 2013-04-04 15:27:18.224612939 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ /** * Formats error messages. */ -enum Messages { +public enum Messages { ILLEGAL_ENTRY, // 1 arg ERROR_LOADING_CLASS, // 2 args INVALID_PROPERTY_VALUE, // 2 args @@ -39,6 +39,7 @@ BROKEN_CONTEXTPATH, // 1 arg NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS, // 1 arg INVALID_TYPE_IN_MAP, // 0args + INVALID_JAXP_IMPLEMENTATION, // 1 arg ; private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName()); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.properties 2013-04-04 15:27:18.532612944 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.properties 2013-04-04 15:27:18.480612943 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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,3 +47,6 @@ INVALID_TYPE_IN_MAP = \ Map contains a wrong type + +INVALID_JAXP_IMPLEMENTATION = \ + You are running with invalid JAXP api or implementation. JAXP api/implementation of version 1.3.1 (included in JDK6) or higher is required. In case you are using ant, make sure ant 1.7.0 or higher is used - older versions of ant contain JAXP api/impl version 1.2 (in xml-apis.jar). If you want to keep using older ant versions, you have to configure it to use higher the JAXP api/impl versions. --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java 2013-04-04 15:27:18.748612947 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java 2013-04-04 15:27:18.700612946 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java 2013-04-04 15:27:18.984612950 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java 2013-04-04 15:27:18.924612949 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java 2013-04-04 15:27:19.204612954 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java 2013-04-04 15:27:19.152612953 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java 2013-04-04 15:27:19.424612957 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java 2013-04-04 15:27:19.372612957 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java 2013-04-04 15:27:19.680612961 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java 2013-04-04 15:27:19.632612961 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java 2013-04-04 15:27:19.936612965 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java 2013-04-04 15:27:19.884612964 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java 2013-04-04 15:27:20.216612970 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java 2013-04-04 15:27:20.156612969 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java 2013-04-04 15:27:20.476612974 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java 2013-04-04 15:27:20.428612973 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java 2013-04-04 15:27:20.696612978 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java 2013-04-04 15:27:20.648612977 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaTypeQuick.java 2013-04-04 15:27:20.984612982 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaTypeQuick.java 2013-04-04 15:27:20.924612981 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java 2013-04-04 15:27:21.220612985 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java 2013-04-04 15:27:21.172612984 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java 2013-04-04 15:27:21.488612990 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java 2013-04-04 15:27:21.436612989 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java 2013-04-04 15:27:21.756612994 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java 2013-04-04 15:27:21.700612993 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java 2013-04-04 15:27:22.000612998 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java 2013-04-04 15:27:21.944612996 +0200 @@ -25,24 +25,23 @@ package com.sun.xml.internal.bind.v2.model.core; -import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder; import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException; /** * listen to static errors found during building a JAXB model from a set of classes. - * Implemented by the client of {@link ModelBuilder}. + * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. * *

* All the static errors have to be reported while constructing a - * model, not when a model is used (IOW, until the {@link ModelBuilder#link} completes. - * Internally, {@link 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.ModelBuilder#link} completes. + * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} 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 ModelBuilder + * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder * @author Kohsuke Kawaguchi */ public interface ErrorHandler { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java 2013-04-04 15:27:22.212613001 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java 2013-04-04 15:27:22.160613000 +0200 @@ -98,7 +98,7 @@ Collection> ref(); /** - * Gets the kind of this proeprty. + * Gets the kind of this property. * * @return * always non-null. --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java 2013-04-04 15:27:22.440613004 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java 2013-04-04 15:27:22.376613003 +0200 @@ -29,9 +29,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlInlineBinaryData; -import com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory; - - /** * An Enum that indicates if the property is * Element, ElementRef, Value, or Attribute. @@ -60,7 +57,7 @@ public final boolean isOrdered; /** - * {@link PropertyFactory} benefits from having index numbers assigned to + * {@link 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/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/Ref.java 2013-04-04 15:27:22.644613008 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/Ref.java 2013-04-04 15:27:22.580613007 +0200 @@ -29,7 +29,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader; -import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder; +import com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI; import com.sun.xml.internal.bind.v2.model.nav.Navigator; /** @@ -68,8 +68,8 @@ this.valueList = valueList; } - public Ref(ModelBuilder builder, T type, XmlJavaTypeAdapter xjta, XmlList xl ) { - this(builder.reader,builder.nav,type,xjta,xl); + public Ref(ModelBuilderI builder, T type, XmlJavaTypeAdapter xjta, XmlList xl ) { + this(builder.getReader(),builder.getNavigator(),type,xjta,xl); } public Ref(AnnotationReader reader, --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java 2013-04-04 15:27:22.852613011 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java 2013-04-04 15:27:22.804613010 +0200 @@ -29,13 +29,11 @@ import javax.xml.bind.annotation.XmlRegistry; -import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder; - /** * Represents the information in a class with {@link XmlRegistry} annotaion. * *

- * This interface is only meant to be used as a return type from {@link ModelBuilder}. + * This interface is only meant to be used as a return type from {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. * * @author Kohsuke Kawaguchi */ --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java 2013-04-04 15:27:23.064613014 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java 2013-04-04 15:27:23.008613014 +0200 @@ -27,11 +27,10 @@ import javax.xml.namespace.QName; -import com.sun.xml.internal.bind.v2.TODO; -import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.model.annotation.Locatable; import com.sun.xml.internal.bind.v2.model.core.ArrayInfo; import com.sun.xml.internal.bind.v2.model.core.NonElement; +import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil; import com.sun.xml.internal.bind.v2.runtime.Location; import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException; @@ -68,20 +67,7 @@ nav().getTypeName(componentType)),this)); n = new QName("#dummy"); // for error recovery } - this.typeName = calcArrayTypeName(n); - } - - /** - * Computes the type name of the array from that of the item type. - */ - public static QName calcArrayTypeName(QName n) { - String uri; - if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) { - TODO.checkSpec("this URI"); - uri = "http://jaxb.dev.java.net/array"; - } else - uri = n.getNamespaceURI(); - return new QName(uri,n.getLocalPart()+"Array"); + this.typeName = ArrayInfoUtil.calcArrayTypeName(n); } public NonElement getItemType() { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java 2013-04-04 15:27:23.268613018 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java 2013-04-04 15:27:23.220613017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +25,14 @@ package com.sun.xml.internal.bind.v2.model.impl; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAttachmentRef; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.bind.annotation.XmlSchema; @@ -50,10 +55,10 @@ import com.sun.xml.internal.bind.v2.model.core.TypeInfo; import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; import com.sun.xml.internal.bind.v2.model.nav.Navigator; +import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException; import com.sun.xml.internal.bind.WhiteSpaceProcessor; - /** * Builds a {@link TypeInfoSet} (a set of JAXB properties) * by using {@link ElementInfoImpl} and {@link ClassInfoImpl}. @@ -66,7 +71,8 @@ * * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) */ -public class ModelBuilder { +public class ModelBuilder implements ModelBuilderI { + private static final Logger logger; /** * {@link TypeInfo}s that are built will go into this set. @@ -183,6 +189,13 @@ } } + /** + * Logger init + */ + static { + logger = Logger.getLogger(ModelBuilder.class.getName()); + } + protected TypeInfoSetImpl createTypeInfoSet() { return new TypeInfoSetImpl(nav,reader,BuiltinLeafInfoImpl.createLeaves(nav)); } @@ -233,12 +246,14 @@ for( PropertyInfo p : ci.getProperties() ) { if(p.kind()== PropertyKind.REFERENCE) { // make sure that we have a registry for this package - String pkg = nav.getPackageName(ci.getClazz()); - if(!registries.containsKey(pkg)) { - // insert the package's object factory - C c = nav.findClass(pkg + ".ObjectFactory",ci.getClazz()); - if(c!=null) - addRegistry(c,(Locatable)p); + addToRegistry(clazz, (Locatable) p); + Class[] prmzdClasses = getParametrizedTypes(p); + if (prmzdClasses != null) { + for (Class prmzdClass : prmzdClasses) { + if (prmzdClass != clazz) { + addToRegistry((C) prmzdClass, (Locatable) p); + } + } } } @@ -266,6 +281,46 @@ } /** + * Adding package's ObjectFactory methods to registry + * @param clazz which package will be used + * @param p location + */ + private void addToRegistry(C clazz, Locatable p) { + String pkg = nav.getPackageName(clazz); + if (!registries.containsKey(pkg)) { + // insert the package's object factory + C c = nav.findClass(pkg + ".ObjectFactory", clazz); + if (c != null) + addRegistry(c, p); + } + } + + /** + * Getting parametrized classes of {@code JAXBElement<...>} property + * @param p property which parametrized types we will try to get + * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case + */ + private Class[] getParametrizedTypes(PropertyInfo p) { + try { + Type pType = ((RuntimePropertyInfo) p).getIndividualType(); + if (pType instanceof ParameterizedType) { + ParameterizedType prmzdType = (ParameterizedType) pType; + if (prmzdType.getRawType() == JAXBElement.class) { + Type[] actualTypes = prmzdType.getActualTypeArguments(); + Class[] result = new Class[actualTypes.length]; + for (int i = 0; i < actualTypes.length; i++) { + result[i] = (Class) actualTypes[i]; + } + return result; + } + } + } catch (Exception e) { + logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage()); + } + return null; + } + + /** * Checks the uniqueness of the type name. */ private void addTypeName(NonElement r) { @@ -417,4 +472,14 @@ public boolean isReplaced(C sc) { return subclassReplacements.containsKey(sc); } + + @Override + public Navigator getNavigator() { + return nav; + } + + @Override + public AnnotationReader getReader() { + return reader; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java 2013-04-04 15:27:23.500613021 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java 2013-04-04 15:27:23.440613020 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +64,7 @@ * @see #getElements() */ private Set> types; - private Set> subTypes = new LinkedHashSet>(); + private Set> subTypes = new LinkedHashSet>(); private final boolean isMixed; @@ -186,10 +186,7 @@ } } - Iterator> i = subTypes.iterator(); - while (i.hasNext()) { - - ReferencePropertyInfoImpl info = (ReferencePropertyInfoImpl) i.next(); + for (ReferencePropertyInfoImpl info : subTypes) { PropertySeed sd = info.seed; refs = sd.readAnnotation(XmlElementRefs.class); ref = sd.readAnnotation(XmlElementRef.class); @@ -377,7 +374,8 @@ } public final void addType(PropertyInfoImpl info) { - subTypes.add(info); + //noinspection unchecked + subTypes.add((ReferencePropertyInfoImpl)info); } public final boolean isMixed() { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java 2013-04-04 15:27:23.740613025 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java 2013-04-04 15:27:23.680613024 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,10 @@ package com.sun.xml.internal.bind.v2.model.impl; -import java.awt.*; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.MediaTracker; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.File; --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java 2013-04-04 15:27:24.004613029 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java 2013-04-04 15:27:23.952613028 +0200 @@ -34,7 +34,6 @@ import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader; import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; -import com.sun.xml.internal.bind.v2.model.core.NonElement; import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement; --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java 2013-04-04 15:27:24.212613032 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java 2013-04-04 15:27:24.160613031 +0200 @@ -59,10 +59,11 @@ if (formals.length != actualTypeArguments.length) { throw new MalformedParameterizedTypeException(); } +/* for (int i = 0; i < actualTypeArguments.length; i++) { // check actuals against formals' bounds } - +*/ } public Type[] getActualTypeArguments() { @@ -96,6 +97,7 @@ Type thatOwner = that.getOwnerType(); Type thatRawType = that.getRawType(); +/* if (false) { // Debugging boolean ownerEquality = (ownerType == null ? thatOwner == null : @@ -114,6 +116,7 @@ ownerEquality, rawEquality, typeArgEquality); return ownerEquality && rawEquality && typeArgEquality; } +*/ return --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java 2013-04-04 15:27:24.448613036 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java 2013-04-04 15:27:24.396613035 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -342,26 +342,26 @@ */ private static final TypeVisitor eraser = new TypeVisitor() { - public Class onClass(Class c, Void _) { + public Class onClass(Class c, Void v) { return c; } - public Class onParameterizdType(ParameterizedType p, Void _) { + public Class onParameterizdType(ParameterizedType p, Void v) { // TODO: why getRawType returns Type? not Class? return visit(p.getRawType(), null); } - public Class onGenericArray(GenericArrayType g, Void _) { + public Class onGenericArray(GenericArrayType g, Void v) { return Array.newInstance( visit(g.getGenericComponentType(), null), 0).getClass(); } - public Class onVariable(TypeVariable v, Void _) { - return visit(v.getBounds()[0], null); + public Class onVariable(TypeVariable tv, Void v) { + return visit(tv.getBounds()[0], null); } - public Class onWildcard(WildcardType w, Void _) { + public Class onWildcard(WildcardType w, Void v) { return visit(w.getUpperBounds()[0], null); } }; --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/SecureLoader.java 2013-04-04 15:27:24.692613039 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/SecureLoader.java 2013-04-04 15:27:24.640613039 +0200 @@ -37,9 +37,9 @@ 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 java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +50,9 @@ if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +63,9 @@ if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java 2013-04-04 15:27:24.932613043 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java 2013-04-04 15:27:24.880613042 +0200 @@ -29,7 +29,6 @@ import com.sun.xml.internal.bind.v2.model.core.NonElement; import com.sun.xml.internal.bind.v2.runtime.Transducer; -import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; /** * @author Kohsuke Kawaguchi --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java 2013-04-04 15:27:25.172613047 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java 2013-04-04 15:27:25.116613046 +0200 @@ -33,7 +33,6 @@ import javax.xml.namespace.QName; import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; -import com.sun.xml.internal.bind.v2.model.core.NonElement; import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java 2013-04-04 15:27:25.436613051 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java 2013-04-04 15:27:25.380613050 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +48,7 @@ import com.sun.xml.internal.bind.v2.ClassFactory; import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.model.core.ID; +import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeClassInfo; import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; import com.sun.xml.internal.bind.v2.runtime.property.AttributeProperty; @@ -190,10 +191,11 @@ Property[] props = bi.properties; if (props == null) break; for (Property superProperty : props) { - if (superProperty == null) break; - String spName = superProperty.getFieldName(); - if ((spName != null) && (spName.equals(p.getFieldName()))) { - superProperty.setHiddenByOverride(true); + if (superProperty != null) { + String spName = superProperty.getFieldName(); + if ((spName != null) && (spName.equals(p.getFieldName()))) { + superProperty.setHiddenByOverride(true); + } } } } @@ -339,8 +341,15 @@ if (retainPropertyInfo) { target.currentProperty.set(p); } - if (!(p.isHiddenByOverride() && !bean.getClass().equals(jaxbType))) { + boolean isThereAnOverridingProperty = p.isHiddenByOverride(); + if (!isThereAnOverridingProperty || bean.getClass().equals(jaxbType)) { p.serializeBody(bean, target, null); + } else if (isThereAnOverridingProperty) { + // need to double check the override - it should be safe to do after the model has been created because it's targeted to override properties only + Class beanClass = bean.getClass(); + if (Navigator.REFLECTION.getDeclaredField(beanClass, p.getFieldName()) == null) { + p.serializeBody(bean, target, null); + } } } } catch (AccessorException e) { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java 2013-04-04 15:27:25.664613055 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java 2013-04-04 15:27:25.612613054 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -71,6 +71,7 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Pool; +import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.api.AccessorException; import com.sun.xml.internal.bind.api.Bridge; import com.sun.xml.internal.bind.api.BridgeContext; @@ -81,7 +82,6 @@ import com.sun.xml.internal.bind.api.TypeReference; import com.sun.xml.internal.bind.unmarshaller.DOMScanner; import com.sun.xml.internal.bind.util.Which; -import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader; import com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader; import com.sun.xml.internal.bind.v2.model.core.Adapter; @@ -110,6 +110,7 @@ import com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator; import com.sun.xml.internal.bind.v2.util.EditDistance; import com.sun.xml.internal.bind.v2.util.QNameMap; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import com.sun.xml.internal.txw2.output.ResultFactory; import org.w3c.dom.Document; @@ -220,7 +221,7 @@ public final boolean retainPropertyInfo; /** - * Supress reflection accessor warnings. + * Suppress reflection accessor warnings. */ public final boolean supressAccessorWarnings; @@ -229,6 +230,11 @@ */ public final boolean improvedXsiTypeHandling; + /** + * Disable security processing. + */ + public final boolean disableSecurityProcessing; + private WeakReference typeInfoSetCache; private @NotNull RuntimeAnnotationReader annotationReader; @@ -237,7 +243,7 @@ private final @NotNull Map subclassReplacements; /** - * If true, we aim for faster {@link JAXBContext} instanciation performance, + * If true, we aim for faster {@link JAXBContext} instantiation performance, * instead of going after efficient sustained unmarshalling/marshalling performance. * * @since 2.0.4 @@ -267,6 +273,7 @@ this.allNillable = builder.allNillable; this.supressAccessorWarnings = builder.supressAccessorWarnings; this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling; + this.disableSecurityProcessing = builder.disableSecurityProcessing; Collection typeRefs = builder.typeRefs; @@ -278,8 +285,6 @@ } this.fastBoot = fastB; - System.arraycopy(classes,0,this.classes,0,classes.length); - RuntimeTypeInfoSet typeSet = getTypeInfoSet(); // at least prepare the empty table so that we don't have to check for null later @@ -701,12 +706,12 @@ /** * Creates a new identity transformer. */ - static Transformer createTransformer() { + static Transformer createTransformer(boolean disableSecureProcessing) { try { if (tf==null) { synchronized(JAXBContextImpl.class) { if (tf==null) { - tf = (SAXTransformerFactory)TransformerFactory.newInstance(); + tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing); } } } @@ -719,12 +724,12 @@ /** * Creates a new identity transformer. */ - public static TransformerHandler createTransformerHandler() { + public static TransformerHandler createTransformerHandler(boolean disableSecureProcessing) { try { if (tf==null) { synchronized(JAXBContextImpl.class) { if (tf==null) { - tf = (SAXTransformerFactory)TransformerFactory.newInstance(); + tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing); } } } @@ -737,12 +742,11 @@ /** * Creates a new DOM document. */ - static Document createDom() { + static Document createDom(boolean disableSecurityProcessing) { synchronized(JAXBContextImpl.class) { if(db==null) { try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); + DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(disableSecurityProcessing); db = dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { // impossible @@ -1055,6 +1059,7 @@ private boolean xmlAccessorFactorySupport = false; private boolean allNillable; private boolean improvedXsiTypeHandling = true; + private boolean disableSecurityProcessing = true; public JAXBContextBuilder() {}; @@ -1069,6 +1074,7 @@ this.typeRefs = baseImpl.bridges.keySet(); this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport; this.allNillable = baseImpl.allNillable; + this.disableSecurityProcessing = baseImpl.disableSecurityProcessing; } public JAXBContextBuilder setRetainPropertyInfo(boolean val) { @@ -1126,6 +1132,11 @@ return this; } + public JAXBContextBuilder setDisableSecurityProcessing(boolean val) { + this.disableSecurityProcessing = val; + return this; + } + public JAXBContextImpl build() throws JAXBException { // fool-proof --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java 2013-04-04 15:27:25.868613058 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java 2013-04-04 15:27:25.816613057 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -79,6 +79,7 @@ tagName = null; } + @Override public QName getTypeName(BeanT instance) { QName tn = xducer.getTypeName(instance); if(tn!=null) return tn; @@ -86,11 +87,11 @@ return super.getTypeName(instance); } - public final String getElementNamespaceURI(BeanT _) { + public final String getElementNamespaceURI(BeanT t) { return tagName.nsUri; } - public final String getElementLocalName(BeanT _) { + public final String getElementLocalName(BeanT t) { return tagName.localName; } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java 2013-04-04 15:27:26.104613061 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java 2013-04-04 15:27:26.048613061 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -183,7 +183,7 @@ final Node node = ((DOMResult) result).getNode(); if (node == null) { - Document doc = JAXBContextImpl.createDom(); + Document doc = JAXBContextImpl.createDom(getContext().disableSecurityProcessing); ((DOMResult) result).setNode(doc); return new SAXOutput(new SAX2DOMEx(doc)); } else { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java 2013-04-04 15:27:26.356613065 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java 2013-04-04 15:27:26.300613065 +0200 @@ -29,16 +29,7 @@ import java.util.HashMap; import java.util.Map; -import javax.xml.bind.ValidationEvent; import javax.xml.bind.annotation.adapters.XmlAdapter; -import javax.xml.bind.helpers.PrintConversionEventImpl; -import javax.xml.bind.helpers.ValidationEventImpl; -import javax.xml.bind.helpers.ValidationEventLocatorImpl; - -import com.sun.xml.internal.bind.util.ValidationEventLocatorExImpl; - -import org.xml.sax.SAXException; - /** * @author Kohsuke Kawaguchi @@ -95,6 +86,7 @@ /** * Reports a print conversion error while marshalling. */ +/* public static void handlePrintConversionException( Object caller, Exception e, XMLSerializer serializer ) throws SAXException { @@ -109,10 +101,12 @@ new ValidationEventLocatorImpl(caller), e ); serializer.reportError(ve); } +*/ /** * Reports that the type of an object in a property is unexpected. */ +/* public static void handleTypeMismatchError( XMLSerializer serializer, Object parentObject, String fieldName, Object childObject ) throws SAXException { @@ -126,6 +120,7 @@ serializer.reportError(ve); } +*/ private static String getTypeName( Object o ) { return o.getClass().getName(); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java 2013-04-04 15:27:26.580613069 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java 2013-04-04 15:27:26.532613068 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -794,8 +794,8 @@ } public Transformer getIdentityTransformer() { - if(identityTransformer==null) - identityTransformer = JAXBContextImpl.createTransformer(); + if (identityTransformer==null) + identityTransformer = JAXBContextImpl.createTransformer(grammar.disableSecurityProcessing); return identityTransformer; } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java 2013-04-04 15:27:26.852613073 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java 2013-04-04 15:27:26.796613072 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -43,7 +43,9 @@ import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader; +import com.sun.xml.internal.bind.v2.runtime.unmarshaller.DefaultValueLoaderDecorator; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.LeafPropertyLoader; +import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader; import org.xml.sax.SAXException; @@ -56,6 +58,8 @@ final class ListElementProperty extends ArrayProperty { private final Name tagName; + private final String defaultValue; + /** * Converts all the values to a list and back. */ @@ -69,6 +73,7 @@ RuntimeTypeRef ref = prop.getTypes().get(0); tagName = grammar.nameBuilder.createElementName(ref.getTagName()); + defaultValue = ref.getDefaultValue(); // transducer for each item Transducer xducer = ref.getTransducer(); @@ -81,7 +86,9 @@ } public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap handlers) { - handlers.put(tagName, new ChildLoader(new LeafPropertyLoader(xacc),null)); + Loader l = new LeafPropertyLoader(xacc); + l = new DefaultValueLoaderDecorator(l, defaultValue); + handlers.put(tagName, new ChildLoader(l,null)); } @Override --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java 2013-04-04 15:27:27.140613078 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java 2013-04-04 15:27:27.084613076 +0200 @@ -26,13 +26,17 @@ package com.sun.xml.internal.bind.v2.runtime.property; import java.io.IOException; +import java.lang.reflect.Modifier; +import javax.xml.bind.JAXBElement; import javax.xml.stream.XMLStreamException; import com.sun.xml.internal.bind.api.AccessorException; +import com.sun.xml.internal.bind.v2.model.core.ID; import com.sun.xml.internal.bind.v2.model.core.PropertyKind; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementPropertyInfo; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeRef; +import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl; import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; import com.sun.xml.internal.bind.v2.runtime.Name; import com.sun.xml.internal.bind.v2.runtime.XMLSerializer; @@ -61,6 +65,7 @@ private final String defaultValue; private final TransducedAccessor xacc; private final boolean improvedXsiTypeHandling; + private final boolean idRef; public SingleElementLeafProperty(JAXBContextImpl context, RuntimeElementPropertyInfo prop) { super(context, prop); @@ -75,6 +80,7 @@ assert xacc != null; improvedXsiTypeHandling = context.improvedXsiTypeHandling; + idRef = ref.getSource().id() == ID.IDREF; } public void reset(BeanT o) throws AccessorException { @@ -100,16 +106,11 @@ Class valueType = acc.getValueType(); // check for different type than expected. If found, add xsi:type declaration - if (improvedXsiTypeHandling && !acc.isAdapted() && - (obj!=null) && ( !obj.getClass().equals(valueType))&& - (!valueType.isPrimitive() && acc.isValueTypeAbstractable() )) { - + if (xsiTypeNeeded(o, w, obj, valueType)) { w.startElement(tagName, outerPeer); - w.childAsXsiType(obj, fieldName, w.grammar.getBeanInfo(valueType), nillable); + w.childAsXsiType(obj, fieldName, w.grammar.getBeanInfo(valueType), false); w.endElement(); - } else { // current type is expected - if (hasValue) { xacc.writeLeafElement(w, tagName, o, fieldName); } else if (nillable) { @@ -120,6 +121,47 @@ } } + /** + * Checks if xsi type needed to be specified + */ + private boolean xsiTypeNeeded(BeanT bean, XMLSerializer w, Object value, Class valueTypeClass) { + if (!improvedXsiTypeHandling) // improved xsi type set + return false; + if (acc.isAdapted()) // accessor is not adapted + return false; + if (value == null) // value is not null + return false; + if (value.getClass().equals(valueTypeClass)) // value represented by different class + return false; + if (idRef) // IDREF + return false; + if (valueTypeClass.isPrimitive()) // is not primitive + return false; + return acc.isValueTypeAbstractable() || isNillableAbstract(bean, w.grammar, value, valueTypeClass); + } + + /** + * Checks if element is nillable and represented by abstract class. + */ + private boolean isNillableAbstract(BeanT bean, JAXBContextImpl context, Object value, Class valueTypeClass) { + if (!nillable) // check if element is nillable + return false; + if (valueTypeClass != Object.class) // required type wasn't recognized + return false; + if (bean.getClass() != JAXBElement.class) // is JAXBElement + return false; + JAXBElement jaxbElement = (JAXBElement) bean; + Class valueClass = value.getClass(); + Class declaredTypeClass = jaxbElement.getDeclaredType(); + if (declaredTypeClass.equals(valueClass)) // JAXBElement is different from unadapted class) + return false; + if (!declaredTypeClass.isAssignableFrom(valueClass)) // and is subclass from it + return false; + if (!Modifier.isAbstract(declaredTypeClass.getModifiers())) // declared class is abstract + return false; + return acc.isAbstractable(declaredTypeClass); // and is not builtin type + } + public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap handlers) { Loader l = new LeafPropertyLoader(xacc); if (defaultValue != null) @@ -128,7 +170,7 @@ l = new XsiNilLoader.Single(l, acc); // LeafPropertyXsiLoader doesn't work well with nillable elements - if (improvedXsiTypeHandling && !nillable) + if (improvedXsiTypeHandling) l = new LeafPropertyXsiLoader(l, xacc, acc); handlers.put(tagName, new ChildLoader(l, null)); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java 2013-04-04 15:27:27.444613083 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java 2013-04-04 15:27:27.384613081 +0200 @@ -142,6 +142,7 @@ private ThreadLocal target = new ThreadLocal(); private ThreadLocal map = new ThreadLocal(); + private int depthCounter = 0; // needed to clean ThreadLocals @Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { @@ -149,6 +150,7 @@ try { target.set((BeanT)state.prev.target); map.set(acc.get(target.get())); + depthCounter++; if(map.get() == null) { map.set(ClassFactory.create(mapImplClass)); } @@ -166,7 +168,10 @@ super.leaveElement(state, ea); try { acc.set(target.get(), map.get()); - target.remove(); + if (--depthCounter == 0) { + target.remove(); + map.remove(); + } } catch (AccessorException ex) { handleGenericException(ex,true); } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java 2013-04-04 15:27:27.720613087 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java 2013-04-04 15:27:27.664613086 +0200 @@ -34,8 +34,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.List; -import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; @@ -54,8 +52,6 @@ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Receiver; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext; -import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; -import com.sun.istack.internal.Nullable; import org.xml.sax.SAXException; @@ -184,6 +180,15 @@ } /** + * Checks if it is not builtin jaxb class + * @param clazz to be checked + * @return true if it is NOT builtin class + */ + public boolean isAbstractable(Class clazz) { + return !nonAbstractableClasses.contains(clazz); + } + + /** * Wraps this {@link Accessor} into another {@link Accessor} * and performs the type adaption as necessary. */ --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java 2013-04-04 15:27:28.004613091 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java 2013-04-04 15:27:27.948613090 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -300,7 +300,9 @@ // invoke set when possible (see Issue 488) try { - acc.set(bean,collection); + if (acc.isAdapted()) { + acc.set(bean,collection); + } } catch (AccessorException ae) { if(acc.isAdapted()) throw ae; } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java 2013-04-04 15:27:28.264613095 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java 2013-04-04 15:27:28.208613094 +0200 @@ -91,7 +91,7 @@ * Customizes a class file by replacing constant pools. * * @param templateClassName - * The resouce that contains the template class file. + * The resource that contains the template class file. * @param replacements * A list of pair of strings that specify the substitution * {@code String[]{search_0, replace_0, search_1, replace_1, ..., search_n, replace_n } --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java 2013-04-04 15:27:28.476613098 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java 2013-04-04 15:27:28.428613097 +0200 @@ -134,7 +134,7 @@ /** - * Gets the optimizd {@link Accessor} that accesses the given field. + * Gets the optimized {@link Accessor} that accesses the given field. * * @return null * if for some reason it fails to create an optimized version. --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java 2013-04-04 15:27:28.680613102 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java 2013-04-04 15:27:28.628613101 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.xml.internal.bind.v2.runtime.unmarshaller; -import com.sun.xml.internal.bind.v2.WellKnownNamespace; import javax.xml.bind.annotation.DomHandler; import javax.xml.transform.Result; import javax.xml.transform.sax.TransformerHandler; @@ -47,8 +46,9 @@ * This instance is created for each unmarshalling episode. */ private final class State { + /** This handler will receive SAX events. */ - private final TransformerHandler handler = JAXBContextImpl.createTransformerHandler(); + private TransformerHandler handler = null; /** {@link #handler} will produce this result. */ private final ResultT result; @@ -57,6 +57,7 @@ int depth = 1; public State( UnmarshallingContext context ) throws SAXException { + handler = JAXBContextImpl.createTransformerHandler(context.getJAXBContext().disableSecurityProcessing); result = dom.createUnmarshaller(context); handler.setResult(result); --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java 2013-04-04 15:27:28.920613106 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java 2013-04-04 15:27:28.856613105 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -60,8 +60,11 @@ import com.sun.xml.internal.bind.v2.runtime.AssociationMap; import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo; +import com.sun.xml.internal.bind.v2.util.XmlFactory; import java.io.Closeable; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -80,7 +83,7 @@ * @author * Kohsuke KAWAGUCHI */ -public final class UnmarshallerImpl extends AbstractUnmarshallerImpl implements ValidationEventHandler, Closeable + public final class UnmarshallerImpl extends AbstractUnmarshallerImpl implements ValidationEventHandler, Closeable { /** Owning {@link JAXBContext} */ protected final JAXBContextImpl context; @@ -116,10 +119,43 @@ return getUnmarshallerHandler(true,null); } + private XMLReader reader = null; + + /** + * Obtains a configured XMLReader. + * + * This method is used when the client-specified + * {@link SAXSource} object doesn't have XMLReader. + * + * {@link Unmarshaller} is not re-entrant, so we will + * only use one instance of XMLReader. + * + * Overriden in order to fix potential security issue. + */ + @Override + protected XMLReader getXMLReader() throws JAXBException { + if (reader == null) { + try { + SAXParserFactory parserFactory = XmlFactory.createParserFactory(context.disableSecurityProcessing); + // there is no point in asking a validation because + // there is no guarantee that the document will come with + // a proper schemaLocation. + parserFactory.setValidating(false); + reader = parserFactory.newSAXParser().getXMLReader(); + } catch (ParserConfigurationException e) { + throw new JAXBException(e); + } catch (SAXException e) { + throw new JAXBException(e); + } + } + return reader; + } + private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) { - XmlVisitor h = createUnmarshallerHandler(null,false,expectedType); - if(intern) + XmlVisitor h = createUnmarshallerHandler(null, false, expectedType); + if (intern) { h = new InterningXmlVisitor(h); + } return new SAXConnector(h,null); } @@ -142,11 +178,13 @@ XmlVisitor unmarshaller = coordinator; // delegate to JAXP 1.3 for validation if the client provided a schema - if (schema != null) + if (schema != null) { unmarshaller = new ValidatingUnmarshaller(schema,unmarshaller); + } - if(attachmentUnmarshaller!=null && attachmentUnmarshaller.isXOPPackage()) + if(attachmentUnmarshaller!=null && attachmentUnmarshaller.isXOPPackage()) { unmarshaller = new MTOMDecorator(this,unmarshaller,attachmentUnmarshaller); + } return unmarshaller; } @@ -162,8 +200,9 @@ } try { - if( reader.getFeature("http://xml.org/sax/features/string-interning") ) + if (reader.getFeature("http://xml.org/sax/features/string-interning")) { return false; // no need for intern + } } catch (SAXException e) { // unrecognized/unsupported } @@ -176,8 +215,9 @@ } protected JAXBElement unmarshal( XMLReader reader, InputSource source, Class expectedType ) throws JAXBException { - if(expectedType==null) + if(expectedType==null) { throw new IllegalArgumentException(); + } return (JAXBElement)unmarshal0(reader,source,getBeanInfo(expectedType)); } @@ -222,40 +262,44 @@ @Override public JAXBElement unmarshal( Source source, Class expectedType ) throws JAXBException { - if(source instanceof SAXSource) { - SAXSource ss = (SAXSource)source; + if (source instanceof SAXSource) { + SAXSource ss = (SAXSource) source; - XMLReader reader = ss.getXMLReader(); - if( reader == null ) - reader = getXMLReader(); + XMLReader locReader = ss.getXMLReader(); + if (locReader == null) { + locReader = getXMLReader(); + } - return unmarshal( reader, ss.getInputSource(), expectedType ); + return unmarshal(locReader, ss.getInputSource(), expectedType); } - if(source instanceof StreamSource) { - return unmarshal( getXMLReader(), streamSourceToInputSource((StreamSource)source), expectedType ); + if (source instanceof StreamSource) { + return unmarshal(getXMLReader(), streamSourceToInputSource((StreamSource) source), expectedType); + } + if (source instanceof DOMSource) { + return unmarshal(((DOMSource) source).getNode(), expectedType); } - if(source instanceof DOMSource) - return unmarshal( ((DOMSource)source).getNode(), expectedType ); // we don't handle other types of Source throw new IllegalArgumentException(); } public Object unmarshal0( Source source, JaxBeanInfo expectedType ) throws JAXBException { - if(source instanceof SAXSource) { - SAXSource ss = (SAXSource)source; + if (source instanceof SAXSource) { + SAXSource ss = (SAXSource) source; - XMLReader reader = ss.getXMLReader(); - if( reader == null ) - reader = getXMLReader(); + XMLReader locReader = ss.getXMLReader(); + if (locReader == null) { + locReader = getXMLReader(); + } - return unmarshal0( reader, ss.getInputSource(), expectedType ); + return unmarshal0(locReader, ss.getInputSource(), expectedType); } - if(source instanceof StreamSource) { - return unmarshal0( getXMLReader(), streamSourceToInputSource((StreamSource)source), expectedType ); + if (source instanceof StreamSource) { + return unmarshal0(getXMLReader(), streamSourceToInputSource((StreamSource) source), expectedType); + } + if (source instanceof DOMSource) { + return unmarshal0(((DOMSource) source).getNode(), expectedType); } - if(source instanceof DOMSource) - return unmarshal0( ((DOMSource)source).getNode(), expectedType ); // we don't handle other types of Source throw new IllegalArgumentException(); @@ -283,8 +327,9 @@ @Override public JAXBElement unmarshal(Node node, Class expectedType) throws JAXBException { - if(expectedType==null) + if (expectedType == null) { throw new IllegalArgumentException(); + } return (JAXBElement)unmarshal0(node,getBeanInfo(expectedType)); } @@ -305,14 +350,13 @@ InterningXmlVisitor handler = new InterningXmlVisitor(createUnmarshallerHandler(null,false,expectedType)); scanner.setContentHandler(new SAXConnector(handler,scanner)); - if(node.getNodeType() == Node.ELEMENT_NODE) + if(node.getNodeType() == Node.ELEMENT_NODE) { scanner.scan((Element)node); - else - if(node.getNodeType() == Node.DOCUMENT_NODE) + } else if(node.getNodeType() == Node.DOCUMENT_NODE) { scanner.scan((Document)node); - else - // no other type of input is supported + } else { throw new IllegalArgumentException("Unexpected node type: "+node); + } Object retVal = handler.getContext().getResult(); handler.getContext().clearResult(); @@ -329,8 +373,9 @@ @Override public JAXBElement unmarshal(XMLStreamReader reader, Class expectedType) throws JAXBException { - if(expectedType==null) + if (expectedType==null) { throw new IllegalArgumentException(); + } return (JAXBElement)unmarshal0(reader,getBeanInfo(expectedType)); } @@ -364,8 +409,9 @@ @Override public JAXBElement unmarshal(XMLEventReader reader, Class expectedType) throws JAXBException { - if(expectedType==null) + if(expectedType==null) { throw new IllegalArgumentException(); + } return (JAXBElement)unmarshal0(reader,getBeanInfo(expectedType)); } @@ -393,8 +439,9 @@ // Quick hack until SJSXP fixes 6270116 boolean isZephyr = reader.getClass().getName().equals("com.sun.xml.internal.stream.XMLReaderImpl"); XmlVisitor h = createUnmarshallerHandler(null,false,expectedType); - if(!isZephyr) + if(!isZephyr) { h = new InterningXmlVisitor(h); + } new StAXEventConnector(reader,h).bridge(); return h.getContext().getResult(); } catch (XMLStreamException e) { @@ -414,10 +461,12 @@ // So we unwrap them here. But we don't want to unwrap too eagerly, because // that could throw away some meaningful exception information. Throwable ne = e.getNestedException(); - if(ne instanceof JAXBException) + if(ne instanceof JAXBException) { return (JAXBException)ne; - if(ne instanceof SAXException) + } + if(ne instanceof SAXException) { return new UnmarshalException(ne); + } return new UnmarshalException(e); } @@ -490,20 +539,22 @@ @Override public void setAdapter(Class type, A adapter) { - if(type==null) + if (type==null) { throw new IllegalArgumentException(); + } coordinator.putAdapter(type,adapter); } @Override public A getAdapter(Class type) { - if(type==null) + if(type==null) { throw new IllegalArgumentException(); - if(coordinator.containsAdapter(type)) - // so as not to create a new instance when this method is called + } + if(coordinator.containsAdapter(type)) { return coordinator.getAdapter(type); - else + } else { return null; + } } // opening up for public use --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java 2013-04-04 15:27:29.236613110 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java 2013-04-04 15:27:29.180613110 +0200 @@ -1068,9 +1068,11 @@ elemName = te.getElementName(); } - Collection refs = propInfo.ref(); - if ((refs != null) && (!refs.isEmpty()) && (elemName != null)) { - ClassInfoImpl cImpl = (ClassInfoImpl)refs.iterator().next(); + Collection refs = propInfo.ref(); + TypeInfo ti; + if ((refs != null) && (!refs.isEmpty()) && (elemName != null) + && ((ti = refs.iterator().next()) == null || ti instanceof ClassInfoImpl)) { + ClassInfoImpl cImpl = (ClassInfoImpl)ti; if ((cImpl != null) && (cImpl.getElementName() != null)) { e.ref(new QName(cImpl.getElementName().getNamespaceURI(), tn.getLocalPart())); } else { --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotated.java 2013-04-04 15:27:29.572613115 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotated.java 2013-04-04 15:27:29.512613115 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotation.java 2013-04-04 15:27:29.856613120 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotation.java 2013-04-04 15:27:29.800613119 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Any.java 2013-04-04 15:27:30.124613124 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Any.java 2013-04-04 15:27:30.064613123 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Appinfo.java 2013-04-04 15:27:30.420613128 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Appinfo.java 2013-04-04 15:27:30.360613127 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttrDecls.java 2013-04-04 15:27:30.712613133 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttrDecls.java 2013-04-04 15:27:30.656613133 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttributeType.java 2013-04-04 15:27:31.008613138 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttributeType.java 2013-04-04 15:27:30.952613137 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexContent.java 2013-04-04 15:27:31.296613143 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexContent.java 2013-04-04 15:27:31.236613142 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexExtension.java 2013-04-04 15:27:31.600613147 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexExtension.java 2013-04-04 15:27:31.540613146 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexRestriction.java 2013-04-04 15:27:31.912613152 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexRestriction.java 2013-04-04 15:27:31.860613151 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexType.java 2013-04-04 15:27:32.152613156 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexType.java 2013-04-04 15:27:32.104613155 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeHost.java 2013-04-04 15:27:32.428613160 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeHost.java 2013-04-04 15:27:32.372613159 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeModel.java 2013-04-04 15:27:32.708613165 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeModel.java 2013-04-04 15:27:32.652613163 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Documentation.java 2013-04-04 15:27:32.988613169 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Documentation.java 2013-04-04 15:27:32.940613168 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java 2013-04-04 15:27:33.208613172 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java 2013-04-04 15:27:33.160613172 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExplicitGroup.java 2013-04-04 15:27:33.460613176 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExplicitGroup.java 2013-04-04 15:27:33.408613175 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExtensionType.java 2013-04-04 15:27:33.720613180 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExtensionType.java 2013-04-04 15:27:33.656613179 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/FixedOrDefault.java 2013-04-04 15:27:33.940613183 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/FixedOrDefault.java 2013-04-04 15:27:33.892613182 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Import.java 2013-04-04 15:27:34.144613187 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Import.java 2013-04-04 15:27:34.096613186 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/List.java 2013-04-04 15:27:34.352613190 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/List.java 2013-04-04 15:27:34.304613189 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalAttribute.java 2013-04-04 15:27:34.680613195 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalAttribute.java 2013-04-04 15:27:34.616613194 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalElement.java 2013-04-04 15:27:34.992613200 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalElement.java 2013-04-04 15:27:34.928613199 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NestedParticle.java 2013-04-04 15:27:35.304613205 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NestedParticle.java 2013-04-04 15:27:35.240613204 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NoFixedFacet.java 2013-04-04 15:27:35.620613210 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NoFixedFacet.java 2013-04-04 15:27:35.564613208 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java 2013-04-04 15:27:35.888613214 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java 2013-04-04 15:27:35.840613213 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Redefinable.java 2013-04-04 15:27:36.168613218 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Redefinable.java 2013-04-04 15:27:36.100613217 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java 2013-04-04 15:27:36.476613223 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java 2013-04-04 15:27:36.416613222 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SchemaTop.java 2013-04-04 15:27:36.728613227 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SchemaTop.java 2013-04-04 15:27:36.676613226 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleContent.java 2013-04-04 15:27:36.996613231 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleContent.java 2013-04-04 15:27:36.940613230 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleDerivation.java 2013-04-04 15:27:37.284613235 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleDerivation.java 2013-04-04 15:27:37.228613235 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleExtension.java 2013-04-04 15:27:37.576613240 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleExtension.java 2013-04-04 15:27:37.516613239 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestriction.java 2013-04-04 15:27:37.872613244 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestriction.java 2013-04-04 15:27:37.808613243 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestrictionModel.java 2013-04-04 15:27:38.180613249 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestrictionModel.java 2013-04-04 15:27:38.124613249 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java 2013-04-04 15:27:38.476613254 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java 2013-04-04 15:27:38.416613253 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleTypeHost.java 2013-04-04 15:27:38.788613259 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleTypeHost.java 2013-04-04 15:27:38.732613258 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelAttribute.java 2013-04-04 15:27:39.036613263 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelAttribute.java 2013-04-04 15:27:38.988613262 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelElement.java 2013-04-04 15:27:39.244613266 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelElement.java 2013-04-04 15:27:39.196613265 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeDefParticle.java 2013-04-04 15:27:39.600613272 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeDefParticle.java 2013-04-04 15:27:39.540613271 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeHost.java 2013-04-04 15:27:39.820613275 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeHost.java 2013-04-04 15:27:39.768613274 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Union.java 2013-04-04 15:27:40.028613278 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Union.java 2013-04-04 15:27:39.980613277 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java 2013-04-04 15:27:40.260613282 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java 2013-04-04 15:27:40.212613281 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java 2013-04-04 15:27:40.504613286 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java 2013-04-04 15:27:40.444613285 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java 2013-04-04 15:27:40.780613290 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java 2013-04-04 15:27:40.736613289 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java 2013-04-04 15:27:40.992613293 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java 2013-04-04 15:27:40.948613293 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -105,7 +105,8 @@ } } catch (ClassNotFoundException ex) { //Do nothing. URLEndpoint is available only when JAXM is there. - log.finest("SAAJ0090.p2p.endpoint.available.only.for.JAXM"); + if (log.isLoggable(Level.FINEST)) + log.finest("SAAJ0090.p2p.endpoint.available.only.for.JAXM"); } if (urlEndpointClass != null) { @@ -152,7 +153,7 @@ } } - SOAPMessage post(SOAPMessage message, URL endPoint) throws SOAPException { + SOAPMessage post(SOAPMessage message, URL endPoint) throws SOAPException, IOException { boolean isFailure = false; URL url = null; @@ -164,8 +165,8 @@ //if(!setHttps) initHttps(); // Process the URL - JaxmURI uri = new JaxmURI(endPoint.toString()); - String userInfo = uri.getUserinfo(); + URI uri = new URI(endPoint.toString()); + String userInfo = uri.getRawUserInfo(); url = endPoint; @@ -224,7 +225,8 @@ if ("Authorization".equals(header.getName())) { hasAuth = true; - log.fine("SAAJ0091.p2p.https.auth.in.POST.true"); + if (log.isLoggable(Level.FINE)) + log.fine("SAAJ0091.p2p.https.auth.in.POST.true"); } } @@ -233,10 +235,12 @@ } OutputStream out = httpConnection.getOutputStream(); - message.writeTo(out); - - out.flush(); - out.close(); + try { + message.writeTo(out); + out.flush(); + } finally { + out.close(); + } httpConnection.connect(); @@ -279,6 +283,7 @@ } SOAPMessage response = null; + InputStream httpIn = null; if (responseCode == HttpURLConnection.HTTP_OK || isFailure) { try { MimeHeaders headers = new MimeHeaders(); @@ -305,7 +310,7 @@ i++; } - InputStream httpIn = + httpIn = (isFailure ? httpConnection.getErrorStream() : httpConnection.getInputStream()); @@ -327,15 +332,16 @@ response = messageFactory.createMessage(headers, in); } - httpIn.close(); - httpConnection.disconnect(); - } catch (SOAPException ex) { throw ex; } catch (Exception ex) { log.log(Level.SEVERE,"SAAJ0010.p2p.cannot.read.resp", ex); throw new SOAPExceptionImpl( "Unable to read response: " + ex.getMessage()); + } finally { + if (httpIn != null) + httpIn.close(); + httpConnection.disconnect(); } } return response; @@ -397,7 +403,7 @@ throw new SOAPExceptionImpl("Bad endPoint type " + endPoint); } - SOAPMessage doGet(URL endPoint) throws SOAPException { + SOAPMessage doGet(URL endPoint) throws SOAPException, IOException { boolean isFailure = false; URL url = null; @@ -409,8 +415,8 @@ if (endPoint.getProtocol().equals("https")) initHttps(); // Process the URL - JaxmURI uri = new JaxmURI(endPoint.toString()); - String userInfo = uri.getUserinfo(); + URI uri = new URI(endPoint.toString()); + String userInfo = uri.getRawUserInfo(); url = endPoint; @@ -475,6 +481,7 @@ } SOAPMessage response = null; + InputStream httpIn = null; if (responseCode == HttpURLConnection.HTTP_OK || isFailure) { try { MimeHeaders headers = new MimeHeaders(); @@ -501,7 +508,7 @@ i++; } - InputStream httpIn = + httpIn = (isFailure ? httpConnection.getErrorStream() : httpConnection.getInputStream()); @@ -520,9 +527,6 @@ response = messageFactory.createMessage(headers, httpIn); } - httpIn.close(); - httpConnection.disconnect(); - } catch (SOAPException ex) { throw ex; } catch (Exception ex) { @@ -531,6 +535,10 @@ ex); throw new SOAPExceptionImpl( "Unable to read response: " + ex.getMessage()); + } finally { + if (httpIn != null) + httpIn.close(); + httpConnection.disconnect(); } } return response; @@ -570,9 +578,8 @@ private void initHttps() { //if(!setHttps) { String pkgs = SAAJUtil.getSystemProperty("java.protocol.handler.pkgs"); - log.log(Level.FINE, - "SAAJ0053.p2p.providers", - new String[] { pkgs }); + if (log.isLoggable(Level.FINE)) + log.log(Level.FINE, "SAAJ0053.p2p.providers", new String[] { pkgs }); if (pkgs == null || pkgs.indexOf(SSL_PKG) < 0) { if (pkgs == null) @@ -580,16 +587,16 @@ else pkgs = pkgs + "|" + SSL_PKG; System.setProperty("java.protocol.handler.pkgs", pkgs); - log.log(Level.FINE, - "SAAJ0054.p2p.set.providers", - new String[] { pkgs }); + if (log.isLoggable(Level.FINE)) + log.log(Level.FINE, "SAAJ0054.p2p.set.providers", + new String[] { pkgs }); try { Class c = Class.forName(SSL_PROVIDER); Provider p = (Provider) c.newInstance(); Security.addProvider(p); - log.log(Level.FINE, - "SAAJ0055.p2p.added.ssl.provider", - new String[] { SSL_PROVIDER }); + if (log.isLoggable(Level.FINE)) + log.log(Level.FINE, "SAAJ0055.p2p.added.ssl.provider", + new String[] { SSL_PROVIDER }); //System.out.println("Added SSL_PROVIDER " + SSL_PROVIDER); //setHttps = true; } catch (Exception ex) { --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java 2013-04-04 15:27:41.332613298 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java 2013-04-04 15:27:41.280613297 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties 2013-04-04 15:27:41.604613303 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties 2013-04-04 15:27:41.540613302 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java 2013-04-04 15:27:41.872613307 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java 2013-04-04 15:27:41.812613306 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java 2013-04-04 15:27:42.080613310 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java 2013-04-04 15:27:42.032613309 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java 2013-04-04 15:27:42.396613315 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java 2013-04-04 15:27:42.336613314 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java 2013-04-04 15:27:42.668613320 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java 2013-04-04 15:27:42.604613319 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java 2013-04-04 15:27:42.928613324 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java 2013-04-04 15:27:42.880613323 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java 2013-04-04 15:27:43.196613328 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java 2013-04-04 15:27:43.148613327 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java 2013-04-04 15:27:43.468613332 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java 2013-04-04 15:27:43.412613331 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java 2013-04-04 15:27:43.780613337 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java 2013-04-04 15:27:43.720613336 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java 2013-04-04 15:27:44.060613341 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java 2013-04-04 15:27:44.012613340 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java 2013-04-04 15:27:44.308613345 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java 2013-04-04 15:27:44.252613344 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -108,11 +108,11 @@ */ protected MimeBodyPart parent; - protected static boolean ignoreMissingEndBoundary = true; - + protected static final boolean ignoreMissingEndBoundary; static { ignoreMissingEndBoundary = SAAJUtil.getSystemBoolean("saaj.mime.multipart.ignoremissingendboundary"); } + /** * Default constructor. An empty MimeMultipart object * is created. Its content type is set to "multipart/mixed". --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java 2013-04-04 15:27:44.544613348 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java 2013-04-04 15:27:44.492613347 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePullMultipart.java 2013-04-04 15:27:44.748613352 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePullMultipart.java 2013-04-04 15:27:44.704613351 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java 2013-04-04 15:27:44.964613355 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java 2013-04-04 15:27:44.916613355 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java 2013-04-04 15:27:45.192613359 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java 2013-04-04 15:27:45.140613358 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -226,6 +226,8 @@ // Quote a parameter value token if required. private String quote(String value) { + if ("".equals(value)) + return "\"\""; return MimeUtility.quote(value, HeaderTokenizer.MIME); } --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java 2013-04-04 15:27:45.392613361 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java 2013-04-04 15:27:45.344613361 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java 2013-04-04 15:27:45.624613366 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java 2013-04-04 15:27:45.568613364 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java 2013-04-04 15:27:45.936613370 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java 2013-04-04 15:27:45.888613369 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java 2013-04-04 15:27:46.260613375 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java 2013-04-04 15:27:46.204613375 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java 2013-04-04 15:27:46.560613380 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java 2013-04-04 15:27:46.504613379 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java 2013-04-04 15:27:46.884613385 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java 2013-04-04 15:27:46.824613384 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java 2013-04-04 15:27:47.180613390 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java 2013-04-04 15:27:47.124613389 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java 2013-04-04 15:27:47.496613394 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java 2013-04-04 15:27:47.440613394 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java 2013-04-04 15:27:47.808613400 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java 2013-04-04 15:27:47.752613398 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java 2013-04-04 15:27:48.068613404 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java 2013-04-04 15:27:48.016613403 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java 2013-04-04 15:27:48.336613408 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java 2013-04-04 15:27:48.288613407 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java 2013-04-04 15:27:48.652613412 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java 2013-04-04 15:27:48.588613411 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java 2013-04-04 15:27:48.944613417 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java 2013-04-04 15:27:48.892613416 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java 2013-04-04 15:27:49.256613422 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java 2013-04-04 15:27:49.196613421 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java 2013-04-04 15:27:49.488613425 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java 2013-04-04 15:27:49.428613425 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java 2013-04-04 15:27:49.744613429 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java 2013-04-04 15:27:49.688613429 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -260,10 +260,9 @@ this.dataHandler = dataHandler; rawContent = null; - log.log( - Level.FINE, - "SAAJ0580.soap.set.Content-Type", - new String[] { dataHandler.getContentType()}); + if (log.isLoggable(Level.FINE)) + log.log(Level.FINE, "SAAJ0580.soap.set.Content-Type", + new String[] { dataHandler.getContentType() }); setMimeHeader("Content-Type", dataHandler.getContentType()); } @@ -604,6 +603,12 @@ return (this == o); } + // In JDK 8 we get a warning if we implement equals() but not hashCode(). + // There is no intuitive value for this, the default one in Object is fine. + public int hashCode() { + return super.hashCode(); + } + public MimeHeaders getMimeHeaders() { return headers; } --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java 2013-04-04 15:27:50.068613434 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java 2013-04-04 15:27:50.008613434 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java 2013-04-04 15:27:50.376613440 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java 2013-04-04 15:27:50.316613439 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java 2013-04-04 15:27:50.692613444 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java 2013-04-04 15:27:50.628613443 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +41,7 @@ * @author Santiago Pericas-Geertsen */ public class FastInfosetDataContentHandler implements DataContentHandler { - public final String STR_SRC = "com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource"; + public static final String STR_SRC = "com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource"; public FastInfosetDataContentHandler() { } --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java 2013-04-04 15:27:50.980613449 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java 2013-04-04 15:27:50.924613448 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java 2013-04-04 15:27:51.300613454 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java 2013-04-04 15:27:51.240613453 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java 2013-04-04 15:27:51.608613458 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java 2013-04-04 15:27:51.560613457 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -44,7 +44,7 @@ public class JpegDataContentHandler extends Component implements DataContentHandler { - public final String STR_SRC = "java.awt.Image"; + public static final String STR_SRC = "java.awt.Image"; /** * return the DataFlavors for this DataContentHandler @@ -125,7 +125,7 @@ + mimeType + "\" for ImageContentHandler"); - if (obj.equals(null)) { + if (obj == null) { throw new IOException("Null object for ImageContentHandler"); } --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties 2013-04-04 15:27:51.900613463 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties 2013-04-04 15:27:51.844613462 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java 2013-04-04 15:27:52.212613468 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java 2013-04-04 15:27:52.156613467 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java 2013-04-04 15:27:52.488613472 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java 2013-04-04 15:27:52.428613471 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java 2013-04-04 15:27:52.792613477 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java 2013-04-04 15:27:52.732613476 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java 2013-04-04 15:27:53.104613482 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java 2013-04-04 15:27:53.048613481 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java 2013-04-04 15:27:53.416613487 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java 2013-04-04 15:27:53.360613486 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java 2013-04-04 15:27:53.728613491 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java 2013-04-04 15:27:53.672613491 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java 2013-04-04 15:27:54.044613497 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java 2013-04-04 15:27:53.984613495 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java 2013-04-04 15:27:54.376613502 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java 2013-04-04 15:27:54.316613501 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java 2013-04-04 15:27:54.664613506 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java 2013-04-04 15:27:54.608613505 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java 2013-04-04 15:27:54.984613511 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java 2013-04-04 15:27:54.928613510 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java 2013-04-04 15:27:55.296613516 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java 2013-04-04 15:27:55.236613515 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java 2013-04-04 15:27:55.540613520 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java 2013-04-04 15:27:55.492613519 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java 2013-04-04 15:27:55.748613523 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java 2013-04-04 15:27:55.696613522 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +43,7 @@ * @author Anil Vijendran */ public class XmlDataContentHandler implements DataContentHandler { - public final String STR_SRC = "javax.xml.transform.stream.StreamSource"; + public static final String STR_SRC = "javax.xml.transform.stream.StreamSource"; private static Class streamSourceClass = null; public XmlDataContentHandler() throws ClassNotFoundException { --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java 2013-04-04 15:27:55.964613527 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java 2013-04-04 15:27:55.908613525 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java 2013-04-04 15:27:56.196613530 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java 2013-04-04 15:27:56.140613529 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java 2013-04-04 15:27:56.420613534 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java 2013-04-04 15:27:56.372613533 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java 2013-04-04 15:27:56.636613537 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java 2013-04-04 15:27:56.580613536 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java 2013-04-04 15:27:56.876613540 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java 2013-04-04 15:27:56.820613540 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java 2013-04-04 15:27:57.172613545 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java 2013-04-04 15:27:57.116613544 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java 2013-04-04 15:27:57.472613550 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java 2013-04-04 15:27:57.420613549 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java 2013-04-04 15:27:57.756613554 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java 2013-04-04 15:27:57.700613554 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java 2013-04-04 15:27:58.068613559 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java 2013-04-04 15:27:58.008613558 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java 2013-04-04 15:27:58.376613564 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java 2013-04-04 15:27:58.320613563 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 @@ package com.sun.xml.internal.messaging.saaj.soap.impl; +import java.net.URI; +import java.net.URISyntaxException; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; @@ -109,12 +111,11 @@ } public Document getOwnerDocument() { - SOAPDocument ownerSOAPDocument = - ((SOAPDocument) super.getOwnerDocument()); - if (ownerSOAPDocument == null) { - return null; - } - return ownerSOAPDocument.getDocument(); + Document doc = super.getOwnerDocument(); + if (doc instanceof SOAPDocument) + return ((SOAPDocument) doc).getDocument(); + else + return doc; } public SOAPElement addChildElement(Name name) throws SOAPException { @@ -799,8 +800,8 @@ public void setEncodingStyle(String encodingStyle) throws SOAPException { if (!"".equals(encodingStyle)) { try { - JaxmURI uri = new JaxmURI(encodingStyle); - } catch (JaxmURI.MalformedURIException m) { + new URI(encodingStyle); + } catch (URISyntaxException m) { log.log( Level.SEVERE, "SAAJ0105.impl.encoding.style.mustbe.valid.URI", @@ -1226,15 +1227,11 @@ public void setAttributeNS( String namespaceURI,String qualifiedName, String value) { int index = qualifiedName.indexOf(':'); - String prefix, localName; - if (index < 0) { - prefix = null; + String localName; + if (index < 0) localName = qualifiedName; - } - else { - prefix = qualifiedName.substring(0, index); + else localName = qualifiedName.substring(index + 1); - } // Workaround for bug 6467808 - This needs to be fixed in JAXP --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java 2013-04-04 15:27:58.696613569 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java 2013-04-04 15:27:58.640613568 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -278,15 +278,12 @@ result = new StreamResult(writer); } - - log.log( - Level.FINE, - "SAAJ0190.impl.set.xml.declaration", - new String[] { omitXmlDecl }); - log.log( - Level.FINE, - "SAAJ0191.impl.set.encoding", - new String[] { charset }); + if (log.isLoggable(Level.FINE)) { + log.log(Level.FINE, "SAAJ0190.impl.set.xml.declaration", + new String[] { omitXmlDecl }); + log.log(Level.FINE, "SAAJ0191.impl.set.encoding", + new String[] { charset }); + } //StreamResult result = new StreamResult(out); transformer.transform(getContent(), result); --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java 2013-04-04 15:27:58.976613573 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java 2013-04-04 15:27:58.924613573 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java 2013-04-04 15:27:59.292613578 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java 2013-04-04 15:27:59.232613577 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java 2013-04-04 15:27:59.620613583 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java 2013-04-04 15:27:59.564613583 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java 2013-04-04 15:27:59.916613588 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java 2013-04-04 15:27:59.856613587 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties 2013-04-04 15:28:00.188613592 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties 2013-04-04 15:28:00.132613591 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java 2013-04-04 15:28:00.516613597 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java 2013-04-04 15:28:00.452613596 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java 2013-04-04 15:28:00.836613602 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java 2013-04-04 15:28:00.768613601 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties 2013-04-04 15:28:01.144613607 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties 2013-04-04 15:28:01.088613606 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java 2013-04-04 15:28:01.436613611 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java 2013-04-04 15:28:01.376613611 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -236,6 +236,10 @@ return true; } + public int hashCode() { + return localName.hashCode(); + } + /** * Get the local name part of this XML Name. * --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java 2013-04-04 15:28:01.716613616 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java 2013-04-04 15:28:01.668613615 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java 2013-04-04 15:28:01.996613620 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java 2013-04-04 15:28:01.948613619 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java 2013-04-04 15:28:02.284613624 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java 2013-04-04 15:28:02.232613624 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java 2013-04-04 15:28:02.596613629 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java 2013-04-04 15:28:02.540613629 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java 2013-04-04 15:28:02.916613634 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java 2013-04-04 15:28:02.856613634 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java 2013-04-04 15:28:03.208613639 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java 2013-04-04 15:28:03.152613638 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java 2013-04-04 15:28:03.528613644 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java 2013-04-04 15:28:03.464613643 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java 2013-04-04 15:28:03.844613649 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java 2013-04-04 15:28:03.784613648 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java 2013-04-04 15:28:04.176613654 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java 2013-04-04 15:28:04.116613653 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties 2013-04-04 15:28:04.480613659 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties 2013-04-04 15:28:04.428613658 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java 2013-04-04 15:28:04.792613664 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java 2013-04-04 15:28:04.736613663 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java 2013-04-04 15:28:05.108613669 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java 2013-04-04 15:28:05.060613668 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java 2013-04-04 15:28:05.408613674 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java 2013-04-04 15:28:05.360613673 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +50,16 @@ return new Message1_1Impl(isFastInfoset, acceptFastInfoset); } - public SOAPMessage createMessage(MimeHeaders headers, InputStream in) - throws IOException, SOAPExceptionImpl { - if ((headers == null) || (getContentType(headers) == null)) { + public SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws IOException, SOAPExceptionImpl { + + if (headers == null) { headers = new MimeHeaders(); + } + + if (getContentType(headers) == null) { headers.setHeader("Content-Type", SOAPConstants.SOAP_1_1_CONTENT_TYPE); } + MessageImpl msg = new Message1_1Impl(headers, in); msg.setLazyAttachments(lazyAttachments); return msg; --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java 2013-04-04 15:28:05.728613678 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java 2013-04-04 15:28:05.668613678 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java 2013-04-04 15:28:06.040613683 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java 2013-04-04 15:28:05.984613682 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java 2013-04-04 15:28:06.352613688 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java 2013-04-04 15:28:06.292613687 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java 2013-04-04 15:28:06.644613693 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java 2013-04-04 15:28:06.592613691 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java 2013-04-04 15:28:06.856613696 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java 2013-04-04 15:28:06.804613695 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java 2013-04-04 15:28:07.056613699 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java 2013-04-04 15:28:07.008613698 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java 2013-04-04 15:28:07.272613703 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java 2013-04-04 15:28:07.216613701 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java 2013-04-04 15:28:07.520613706 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java 2013-04-04 15:28:07.464613706 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java 2013-04-04 15:28:07.736613710 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java 2013-04-04 15:28:07.688613709 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java 2013-04-04 15:28:08.064613715 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java 2013-04-04 15:28:08.008613714 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties 2013-04-04 15:28:08.364613720 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties 2013-04-04 15:28:08.312613718 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java 2013-04-04 15:28:08.664613724 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java 2013-04-04 15:28:08.608613723 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java 2013-04-04 15:28:08.928613728 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java 2013-04-04 15:28:08.880613728 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java 2013-04-04 15:28:09.220613733 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java 2013-04-04 15:28:09.160613732 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +50,16 @@ return new Message1_2Impl(isFastInfoset, acceptFastInfoset); } - public SOAPMessage createMessage(MimeHeaders headers, InputStream in) - throws IOException, SOAPExceptionImpl { - if ((headers == null) || (getContentType(headers) == null)) { + public SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws IOException, SOAPExceptionImpl { + + if (headers == null) { headers = new MimeHeaders(); + } + + if (getContentType(headers) == null) { headers.setHeader("Content-Type", SOAPConstants.SOAP_1_2_CONTENT_TYPE); } + MessageImpl msg = new Message1_2Impl(headers, in); msg.setLazyAttachments(lazyAttachments); return msg; --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java 2013-04-04 15:28:09.520613738 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java 2013-04-04 15:28:09.468613736 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/Base64.java 2013-04-04 15:28:09.844613743 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/Base64.java 2013-04-04 15:28:09.784613741 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java 2013-04-04 15:28:10.152613747 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java 2013-04-04 15:28:10.088613746 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java 2013-04-04 15:28:10.460613752 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java 2013-04-04 15:28:10.400613751 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java 2013-04-04 15:28:10.760613757 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java 2013-04-04 15:28:10.712613756 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java 2013-04-04 15:28:11.056613761 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java 2013-04-04 15:28:10.996613760 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java 2013-04-04 15:28:11.356613766 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java 2013-04-04 15:28:11.296613765 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java 2013-04-04 15:28:11.668613770 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java 2013-04-04 15:28:11.612613770 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java 2013-04-04 15:28:11.968613776 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java 2013-04-04 15:28:11.908613774 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java 2013-04-04 15:28:12.272613780 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java 2013-04-04 15:28:12.212613779 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -450,7 +450,7 @@ // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 - String path = new String(); + String path = ""; String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path @@ -1137,6 +1137,11 @@ return false; } + public int hashCode() { + // No members safe to use, just default to a constant. + return 153214; + } + /** * Get the URI as a string specification. See RFC 2396 Section 5.2. * --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties 2013-04-04 15:28:12.600613785 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties 2013-04-04 15:28:12.552613784 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java 2013-04-04 15:28:12.900613790 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java 2013-04-04 15:28:12.840613789 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java 2013-04-04 15:28:13.212613795 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java 2013-04-04 15:28:13.160613794 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java 2013-04-04 15:28:13.524613800 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java 2013-04-04 15:28:13.468613799 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java 2013-04-04 15:28:13.828613805 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java 2013-04-04 15:28:13.772613803 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java 2013-04-04 15:28:14.136613809 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java 2013-04-04 15:28:14.076613808 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java 2013-04-04 15:28:14.440613814 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java 2013-04-04 15:28:14.384613813 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -176,7 +176,7 @@ } super.startElement(namespaceURI,localName, qName,attrImpl); }else{ - super.startElement(namespaceURI,localName, qName, atts); + super.startElement(namespaceURI,localName, qName, null); } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java 2013-04-04 15:28:14.736613818 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java 2013-04-04 15:28:14.672613817 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java 2013-04-04 15:28:15.008613822 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java 2013-04-04 15:28:14.948613822 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java 2013-04-04 15:28:15.324613828 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java 2013-04-04 15:28:15.264613827 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java 2013-04-04 15:28:15.588613832 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java 2013-04-04 15:28:15.528613831 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/Chunk.java 2013-04-04 15:28:15.872613836 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/Chunk.java 2013-04-04 15:28:15.812613835 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/ChunkInputStream.java 2013-04-04 15:28:16.116613840 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/ChunkInputStream.java 2013-04-04 15:28:16.068613839 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +52,9 @@ @Override public int read(byte b[], int off, int sz) throws IOException { - if(!fetch()) return -1; + if (!fetch()) { + return -1; + } sz = Math.min(sz, len-offset); System.arraycopy(buf,offset,b,off,sz); @@ -60,7 +62,9 @@ } public int read() throws IOException { - if(!fetch()) return -1; + if (!fetch()) { + return -1; + } return (buf[offset++] & 0xff); } @@ -88,6 +92,7 @@ return true; } + @Override public void close() throws IOException { super.close(); current = null; --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/CleanUpExecutorFactory.java 2013-04-04 15:28:16.368613844 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/CleanUpExecutorFactory.java 2013-04-04 15:28:16.316613843 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/Data.java 2013-04-04 15:28:16.672613849 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/Data.java 2013-04-04 15:28:16.624613848 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/DataFile.java 2013-04-04 15:28:16.924613853 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/DataFile.java 2013-04-04 15:28:16.868613851 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/DataHead.java 2013-04-04 15:28:17.224613857 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/DataHead.java 2013-04-04 15:28:17.168613857 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ * lazily using a pull parser, so the part may not have all the data. {@link #read} * and {@link #readOnce} may trigger the actual parsing the message. In fact, * parsing of an attachment part may be triggered by calling {@link #read} methods - * on some other attachemnt parts. All this happens behind the scenes so the + * on some other attachment parts. All this happens behind the scenes so the * application developer need not worry about these details. * * @author Jitendra Kotamraju @@ -84,13 +84,18 @@ } else { try { OutputStream os = new FileOutputStream(f); - InputStream in = readOnce(); - byte[] buf = new byte[8192]; - int len; - while((len=in.read(buf)) != -1) { - os.write(buf, 0, len); + try { + InputStream in = readOnce(); + byte[] buf = new byte[8192]; + int len; + while((len=in.read(buf)) != -1) { + os.write(buf, 0, len); + } + } finally { + if (os != null) { + os.close(); + } } - os.close(); } catch(IOException ioe) { throw new MIMEParsingException(ioe); } @@ -141,6 +146,7 @@ * * @return true if readOnce() is not called before */ + @SuppressWarnings("ThrowableInitCause") private boolean unconsumed() { if (consumedAt != null) { AssertionError error = new AssertionError("readOnce() is already called before. See the nested exception from where it's called."); @@ -195,7 +201,9 @@ @Override public int read(byte b[], int off, int sz) throws IOException { - if(!fetch()) return -1; + if (!fetch()) { + return -1; + } sz = Math.min(sz, len-offset); System.arraycopy(buf,offset,b,off,sz); @@ -203,6 +211,7 @@ return sz; } + @Override public int read() throws IOException { if (!fetch()) { return -1; @@ -244,6 +253,7 @@ return true; } + @Override public void close() throws IOException { super.close(); current = null; --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/FactoryFinder.java 2013-04-04 15:28:17.512613862 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/FactoryFinder.java 2013-04-04 15:28:17.456613861 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +29,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.logging.Level; +import java.util.logging.Logger; class FactoryFinder { @@ -58,26 +60,34 @@ private static String findJarServiceProviderName(String factoryId) { String serviceId = "META-INF/services/" + factoryId; - InputStream is = null; + InputStream is; is = cl.getResourceAsStream(serviceId); if (is == null) { return null; } - BufferedReader rd; + String factoryClassName; + BufferedReader rd = null; try { - rd = new BufferedReader(new InputStreamReader(is, "UTF-8")); - } catch (java.io.UnsupportedEncodingException e) { - rd = new BufferedReader(new InputStreamReader(is)); - } - - String factoryClassName = null; - try { - factoryClassName = rd.readLine(); - rd.close(); - } catch (IOException x) { - return null; + try { + rd = new BufferedReader(new InputStreamReader(is, "UTF-8")); + } catch (java.io.UnsupportedEncodingException e) { + rd = new BufferedReader(new InputStreamReader(is)); + } + try { + factoryClassName = rd.readLine(); + } catch (IOException x) { + return null; + } + } finally { + if (rd != null) { + try { + rd.close(); + } catch (IOException ex) { + Logger.getLogger(FactoryFinder.class.getName()).log(Level.INFO, null, ex); + } + } } return factoryClassName; --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/FileData.java 2013-04-04 15:28:17.796613866 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/FileData.java 2013-04-04 15:28:17.744613866 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +48,7 @@ this.length = length; } + @Override public byte[] read() { byte[] buf = new byte[length]; file.read(pointer, buf, 0, length); @@ -57,10 +58,12 @@ /* * This shouldn't be called */ + @Override public long writeTo(DataFile file) { throw new IllegalStateException(); } + @Override public int size() { return length; } @@ -68,6 +71,7 @@ /* * Always create FileData */ + @Override public Data createNext(DataHead dataHead, ByteBuffer buf) { return new FileData(file, buf); } --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/FinalArrayList.java 2013-04-04 15:28:18.044613870 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/FinalArrayList.java 2013-04-04 15:28:17.992613869 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/Header.java 2013-04-04 15:28:18.256613874 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/Header.java 2013-04-04 15:28:18.204613872 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/InternetHeaders.java 2013-04-04 15:28:18.472613877 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/InternetHeaders.java 2013-04-04 15:28:18.412613876 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +59,7 @@ */ final class InternetHeaders { - private final FinalArrayList headers = new FinalArrayList(); + private final FinalArrayList headers = new FinalArrayList(); /** * Read and parse the given RFC822 message stream till the @@ -78,7 +78,7 @@ String line; String prevline = null; // the previous header line, as a string // a buffer to accumulate the header in, when we know it's needed - StringBuffer lineBuffer = new StringBuffer(); + StringBuilder lineBuffer = new StringBuilder(); try { //while ((line = lis.readLine()) != null) { @@ -95,9 +95,9 @@ lineBuffer.append(line); } else { // new header - if (prevline != null) + if (prevline != null) { addHeaderLine(prevline); - else if (lineBuffer.length() > 0) { + } else if (lineBuffer.length() > 0) { // store previous header first addHeaderLine(lineBuffer.toString()); lineBuffer.setLength(0); @@ -124,7 +124,7 @@ int len = headers.size(); for( int i=0; i cids = ih.getHeader("content-id"); @@ -219,20 +220,20 @@ break; case CONTENT : - LOGGER.finer("MIMEEvent="+MIMEEvent.EVENT_TYPE.CONTENT); + LOGGER.log(Level.FINER, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.CONTENT); MIMEEvent.Content content = (MIMEEvent.Content)event; ByteBuffer buf = content.getData(); currentPart.addBody(buf); break; case END_PART : - LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.END_PART); + LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.END_PART); currentPart.doneParsing(); ++currentIndex; break; case END_MESSAGE : - LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.END_MESSAGE); + LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.END_MESSAGE); parsed = true; try { in.close(); --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParser.java 2013-04-04 15:28:19.316613890 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParser.java 2013-04-04 15:28:19.268613889 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +30,7 @@ import java.util.*; import java.util.logging.Logger; import java.nio.ByteBuffer; +import java.util.logging.Level; /** * Pull parser for the MIME messages. Applications can use pull API to continue @@ -53,6 +54,8 @@ private static final Logger LOGGER = Logger.getLogger(MIMEParser.class.getName()); + private static final String HEADER_ENCODING = "ISO8859-1"; + // Actually, the grammar doesn't support whitespace characters // after boundary. But the mail implementation checks for it. // We will only check for these many whitespace characters after boundary @@ -106,47 +109,50 @@ * * @return iterator for parsing events */ + @Override public Iterator iterator() { return new MIMEEventIterator(); } class MIMEEventIterator implements Iterator { + @Override public boolean hasNext() { return !parsed; } + @Override public MIMEEvent next() { switch(state) { case START_MESSAGE : - LOGGER.finer("MIMEParser state="+STATE.START_MESSAGE); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.START_MESSAGE);} state = STATE.SKIP_PREAMBLE; return MIMEEvent.START_MESSAGE; case SKIP_PREAMBLE : - LOGGER.finer("MIMEParser state="+STATE.SKIP_PREAMBLE); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.SKIP_PREAMBLE);} skipPreamble(); // fall through case START_PART : - LOGGER.finer("MIMEParser state="+STATE.START_PART); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.START_PART);} state = STATE.HEADERS; return MIMEEvent.START_PART; case HEADERS : - LOGGER.finer("MIMEParser state="+STATE.HEADERS); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.HEADERS);} InternetHeaders ih = readHeaders(); state = STATE.BODY; bol = true; return new MIMEEvent.Headers(ih); case BODY : - LOGGER.finer("MIMEParser state="+STATE.BODY); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.BODY);} ByteBuffer buf = readBody(); bol = false; return new MIMEEvent.Content(buf); case END_PART : - LOGGER.finer("MIMEParser state="+STATE.END_PART); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.END_PART);} if (done) { state = STATE.END_MESSAGE; } else { @@ -155,7 +161,7 @@ return MIMEEvent.END_PART; case END_MESSAGE : - LOGGER.finer("MIMEParser state="+STATE.END_MESSAGE); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.END_MESSAGE);} parsed = true; return MIMEEvent.END_MESSAGE; @@ -164,6 +170,7 @@ } } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -316,7 +323,7 @@ } adjustBuf(start+1, len-start-1); } - LOGGER.fine("Skipped the preamble. buffer len="+len); + if (LOGGER.isLoggable(Level.FINE)) {LOGGER.log(Level.FINE, "Skipped the preamble. buffer len={0}", len);} } private static byte[] getBytes(String s) { @@ -324,8 +331,9 @@ int size = chars.length; byte[] bytes = new byte[size]; - for (int i = 0; i < size;) + for (int i = 0; i < size;) { bytes[i] = (byte) chars[i++]; + } return bytes; } @@ -409,7 +417,7 @@ * Fills the remaining buf to the full capacity */ private void fillBuf() { - LOGGER.finer("Before fillBuf() buffer len="+len); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "Before fillBuf() buffer len={0}", len);} assert !eof; while(len < buf.length) { int read; @@ -421,7 +429,7 @@ if (read == -1) { eof = true; try { - LOGGER.fine("Closing the input stream."); + if (LOGGER.isLoggable(Level.FINE)) {LOGGER.fine("Closing the input stream.");} in.close(); } catch(IOException ioe) { throw new MIMEParsingException(ioe); @@ -431,7 +439,7 @@ len += read; } } - LOGGER.finer("After fillBuf() buffer len="+len); + if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "After fillBuf() buffer len={0}", len);} } private void doubleBuf() { @@ -484,7 +492,7 @@ return null; } - String hdr = new String(buf, offset, hdrLen); + String hdr = new String(buf, offset, hdrLen, HEADER_ENCODING); offset += hdrLen+lwsp; return hdr; } --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParsingException.java 2013-04-04 15:28:19.560613894 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParsingException.java 2013-04-04 15:28:19.500613893 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java 2013-04-04 15:28:19.828613898 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java 2013-04-04 15:28:19.772613897 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,22 +29,28 @@ import java.io.InputStream; import java.nio.ByteBuffer; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Represents an attachment part in a MIME message. MIME message parsing is done * lazily using a pull parser, so the part may not have all the data. {@link #read} * and {@link #readOnce} may trigger the actual parsing the message. In fact, * parsing of an attachment part may be triggered by calling {@link #read} methods - * on some other attachemnt parts. All this happens behind the scenes so the + * on some other attachment parts. All this happens behind the scenes so the * application developer need not worry about these details. * - * @author Jitendra Kotamraju + * @author Jitendra Kotamraju, Martin Grebac */ public class MIMEPart { + private static final Logger LOGGER = Logger.getLogger(MIMEPart.class.getName()); + private volatile InternetHeaders headers; private volatile String contentId; private String contentType; + private String contentTransferEncoding; + volatile boolean parsed; // part is parsed or not final MIMEMessage msg; private final DataHead dataHead; @@ -69,7 +75,15 @@ * @return data for the part's content */ public InputStream read() { - return dataHead.read(); + InputStream is = null; + try { + is = MimeUtility.decode(dataHead.read(), contentTransferEncoding); + } catch (DecodingException ex) { //ignore + if (LOGGER.isLoggable(Level.WARNING)) { + LOGGER.log(Level.WARNING, null, ex); + } + } + return is; } /** @@ -81,7 +95,6 @@ dataHead.close(); } - /** * Can get the attachment part's content only once. The content * will be lost after the method. Content data is not be stored @@ -95,7 +108,15 @@ * @return data for the part's content */ public InputStream readOnce() { - return dataHead.readOnce(); + InputStream is = null; + try { + is = MimeUtility.decode(dataHead.readOnce(), contentTransferEncoding); + } catch (DecodingException ex) { //ignore + if (LOGGER.isLoggable(Level.WARNING)) { + LOGGER.log(Level.WARNING, null, ex); + } + } + return is; } public void moveTo(File f) { @@ -115,6 +136,18 @@ } /** + * Returns Content-Transfer-Encoding MIME header for this attachment part + * + * @return Content-Transfer-Encoding of the part + */ + public String getContentTransferEncoding() { + if (contentTransferEncoding == null) { + getHeaders(); + } + return contentTransferEncoding; + } + + /** * Returns Content-Type MIME header for this attachment part * * @return Content-Type of the part @@ -171,6 +204,8 @@ this.headers = headers; List ct = getHeader("Content-Type"); this.contentType = (ct == null) ? "application/octet-stream" : ct.get(0); + List cte = getHeader("Content-Transfer-Encoding"); + this.contentTransferEncoding = (cte == null) ? "binary" : cte.get(0); } /** @@ -199,9 +234,17 @@ this.contentId = cid; } + /** + * Callback to set Content-Transfer-Encoding for this part + * @param cte Content-Transfer-Encoding of the part + */ + void setContentTransferEncoding(String cte) { + this.contentTransferEncoding = cte; + } + @Override public String toString() { - return "Part="+contentId; + return "Part="+contentId+":"+contentTransferEncoding; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MemoryData.java 2013-04-04 15:28:20.140613903 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/MemoryData.java 2013-04-04 15:28:20.080613901 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,6 +28,7 @@ import java.nio.ByteBuffer; import java.io.File; import java.io.IOException; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -50,14 +51,17 @@ } // size of the chunk given by the parser + @Override public int size() { return len; } + @Override public byte[] read() { return data; } + @Override public long writeTo(DataFile file) { return file.writeTo(data, 0, len); } @@ -68,6 +72,7 @@ * @param buf * @return */ + @Override public Data createNext(DataHead dataHead, ByteBuffer buf) { if (!config.isOnlyMemory() && dataHead.inMemory >= config.memoryThreshold) { try { @@ -79,7 +84,7 @@ : File.createTempFile(prefix, suffix, dir); // delete the temp file when VM exits as a last resort for file clean up tempFile.deleteOnExit(); - LOGGER.fine("Created temp file = "+tempFile); + if (LOGGER.isLoggable(Level.FINE)) {LOGGER.log(Level.FINE, "Created temp file = {0}", tempFile);} dataHead.dataFile = new DataFile(tempFile); } catch(IOException ioe) { throw new MIMEParsingException(ioe); --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/WeakDataFile.java 2013-04-04 15:28:20.408613907 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/WeakDataFile.java 2013-04-04 15:28:20.348613906 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.util.ArrayList; import java.util.List; import java.util.concurrent.Executor; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -53,16 +54,20 @@ static { CleanUpExecutorFactory executorFactory = CleanUpExecutorFactory.newInstance(); if (executorFactory!=null) { - LOGGER.fine("Initializing clean up executor for MIMEPULL: " - + executorFactory.getClass().getName()); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Initializing clean up executor for MIMEPULL: {0}", executorFactory.getClass().getName()); + } Executor executor = executorFactory.getExecutor(); executor.execute(new Runnable() { + @Override public void run() { - WeakDataFile weak = null; + WeakDataFile weak; while (true) { try { weak = (WeakDataFile) refQueue.remove(); - LOGGER.fine("Cleaning file = "+weak.file+" from reference queue."); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Cleaning file = {0} from reference queue.", weak.file); + } weak.close(); } catch (InterruptedException e) { } @@ -107,22 +112,36 @@ } void close() { - LOGGER.fine("Deleting file = "+file.getName()); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Deleting file = {0}", file.getName()); + } refList.remove(this); try { raf.close(); - file.delete(); + boolean deleted = file.delete(); + if (!deleted) { + if (LOGGER.isLoggable(Level.INFO)) { + LOGGER.log(Level.INFO, "File {0} was not deleted", file.getAbsolutePath()); + } + } } catch(IOException ioe) { throw new MIMEParsingException(ioe); } } void renameTo(File f) { - LOGGER.fine("Moving file="+file+" to="+f); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Moving file={0} to={1}", new Object[]{file, f}); + } refList.remove(this); try { raf.close(); - file.renameTo(f); + boolean renamed = file.renameTo(f); + if (!renamed) { + if (LOGGER.isLoggable(Level.INFO)) { + LOGGER.log(Level.INFO, "File {0} was not moved to {1}", new Object[] {file.getAbsolutePath(), f.getAbsolutePath()}); + } + } } catch(IOException ioe) { throw new MIMEParsingException(ioe); } @@ -130,9 +149,11 @@ } static void drainRefQueueBounded() { - WeakDataFile weak = null; + WeakDataFile weak; while (( weak = (WeakDataFile) refQueue.poll()) != null ) { - LOGGER.fine("Cleaning file = "+weak.file+" from reference queue."); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Cleaning file = {0} from reference queue.", weak.file); + } weak.close(); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java 2013-04-04 15:28:20.724613912 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java 2013-04-04 15:28:20.660613911 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 +36,13 @@ import java.io.OutputStream; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; +import java.util.logging.Level; +import java.util.logging.Logger; // for testing method //import com.sun.xml.internal.stream.writers.XMLStreamWriterImpl; //import java.io.FileNotFoundException; -//import java.io.StringWriter; +//import java.io.FileWriter; //import javax.activation.FileDataSource; /** @@ -59,8 +61,8 @@ // (note that having both is allowed) private DataHandler dataHandler; - private byte[] data; + /** * Length of the valid data in {@link #data}. */ @@ -84,6 +86,8 @@ public Base64Data() { } + private static final Logger logger = Logger.getLogger(Base64Data.class.getName()); + /** * Clone constructor * @param that needs to be cloned @@ -429,15 +433,30 @@ Base64Encoder.print(data, 0, dataLen, buf, start); } + private static final int CHUNK_SIZE; + static { + int bufSize = 1024; + try { + String bufSizeStr = getProperty("com.sun.xml.internal.org.jvnet.staxex.Base64DataStreamWriteBufferSize"); + if (bufSizeStr != null) { + bufSize = Integer.parseInt(bufSizeStr); + } + } catch (Exception e) { + logger.log(Level.INFO, "Error reading com.sun.xml.internal.org.jvnet.staxex.Base64DataStreamWriteBufferSize property", e); + } + CHUNK_SIZE = bufSize; + } + public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException { if (data==null) { try { InputStream is = dataHandler.getDataSource().getInputStream(); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); // dev-null stream Base64EncoderStream encWriter = new Base64EncoderStream(output, outStream); - int b = -1; - while ((b = is.read()) != -1) { - encWriter.write(b); + int b; + byte[] buffer = new byte[CHUNK_SIZE]; + while ((b = is.read(buffer)) != -1) { + encWriter.write(buffer, 0, b); } outStream.close(); encWriter.close(); @@ -457,17 +476,33 @@ return new Base64Data(this); } + static String getProperty(final String propName) { + if (System.getSecurityManager() == null) { + return System.getProperty(propName); + } else { + return (String) java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public java.lang.Object run() { + return System.getProperty(propName); + } + }); + } + } + // public static void main(String[] args) throws FileNotFoundException, IOException, XMLStreamException { // Base64Data data = new Base64Data(); // -// data.set(new DataHandler(new FileDataSource(new File("/home/snajper/Desktop/a.txt")))); +// File f = new File("/Users/snajper/work/builds/weblogic/wls1211_dev.zip"); +// FileDataSource fds = new FileDataSource(f); +// DataHandler dh = new DataHandler(fds); +// data.set(dh); // -// StringWriter sw = new StringWriter(); -// XMLStreamWriterImpl wi = new XMLStreamWriterImpl(sw, null); +// FileWriter fw = new FileWriter(new File("/Users/snajper/Desktop/b.txt")); +// XMLStreamWriterImpl wi = new XMLStreamWriterImpl(fw, null); // // data.writeTo(wi); -// wi.flush();sw.flush(); -// System.out.println("SW: " + sw.toString()); +// wi.flush();fw.flush(); +// //System.out.println("SW: " + sw.toString()); // // } --- old/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java 2013-04-04 15:28:21.028613916 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java 2013-04-04 15:28:20.972613916 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ * *

* Some producer of infoset (in particular, such as FastInfoset, - * XOP deecoder), usees a native format that enables efficient + * XOP decoder), uses a native format that enables efficient * treatment of binary data. For ordinary infoset consumer * (that just uses {@link XMLStreamReader}, those binary data * will just look like base64-encoded string, but this interface --- old/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java 2013-04-04 15:28:21.324613921 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java 2013-04-04 15:28:21.276613921 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, 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,7 +131,7 @@ } if (length < CHAR_ARRAY_LENGTH_SMALL_SIZE) { - storeStructure(type | CHAR_ARRAY_LENGTH_SMALL); + storeStructure(type); storeStructure(length); System.arraycopy(ch, start, _contentCharactersBuffer, _contentCharactersBufferPtr, length); _contentCharactersBufferPtr += length; --- old/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java 2013-04-04 15:28:21.564613925 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java 2013-04-04 15:28:21.520613924 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, 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 @@ -88,6 +88,7 @@ protected String[] _namespacePrefixes = new String[16]; protected int _namespacePrefixesIndex; + protected int[] _namespaceAttributesStartingStack = new int[16]; protected int[] _namespaceAttributesStack = new int[16]; protected int _namespaceAttributesStackIndex; @@ -436,6 +437,7 @@ int item = peekStructure(); Set prefixSet = inscope ? new HashSet() : Collections.emptySet(); if ((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE) { + cacheNamespacePrefixStartingIndex(); hasNamespaceAttributes = true; item = processNamespaceAttributes(item, inscope, prefixSet); } @@ -570,7 +572,8 @@ private void processEndPrefixMapping() throws SAXException { final int end = _namespaceAttributesStack[--_namespaceAttributesStackIndex]; - final int start = (_namespaceAttributesStackIndex > 0) ? _namespaceAttributesStack[_namespaceAttributesStackIndex] : 0; +// final int start = (_namespaceAttributesStackIndex > 0) ? _namespaceAttributesStack[_namespaceAttributesStackIndex] : 0; + final int start = (_namespaceAttributesStackIndex >= 0) ? _namespaceAttributesStartingStack[_namespaceAttributesStackIndex] : 0; for (int i = end - 1; i >= start; i--) { _contentHandler.endPrefixMapping(_namespacePrefixes[i]); @@ -699,6 +702,15 @@ _namespaceAttributesStack[_namespaceAttributesStackIndex++] = _namespacePrefixesIndex; } + private void cacheNamespacePrefixStartingIndex() { + if (_namespaceAttributesStackIndex == _namespaceAttributesStartingStack.length) { + final int[] namespaceAttributesStart = new int[_namespaceAttributesStackIndex * 3 /2 + 1]; + System.arraycopy(_namespaceAttributesStartingStack, 0, namespaceAttributesStart, 0, _namespaceAttributesStackIndex); + _namespaceAttributesStartingStack = namespaceAttributesStart; + } + _namespaceAttributesStartingStack[_namespaceAttributesStackIndex] = _namespacePrefixesIndex; + } + private void processComment(String s) throws SAXException { processComment(s.toCharArray(), 0, s.length()); } --- old/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java 2013-04-04 15:28:21.896613930 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java 2013-04-04 15:28:21.836613929 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, 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 @@ -74,9 +74,6 @@ // Current position to store the next namespace context private int contextPosition; - // The current namespace context - private int currentContext; - /** * Create a new NamespaceContexHelper. * @@ -88,7 +85,7 @@ prefixes[1] = "xmlns"; namespaceURIs[1] = "http://www.w3.org/2000/xmlns/"; - currentContext = namespacePosition = 2; + namespacePosition = 2; } @@ -257,7 +254,7 @@ if (contextPosition == contexts.length) resizeContexts(); - contexts[contextPosition++] = currentContext = namespacePosition; + contexts[contextPosition++] = namespacePosition; } private void resizeContexts() { @@ -274,7 +271,7 @@ */ public void popContext() { if (contextPosition > 0) { - namespacePosition = currentContext = contexts[--contextPosition]; + namespacePosition = contexts[--contextPosition]; } } @@ -284,6 +281,6 @@ * Pop all namespace contexts and reset the root context. */ public void resetContexts() { - currentContext = namespacePosition = 2; + namespacePosition = 2; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java 2013-04-04 15:28:22.196613935 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java 2013-04-04 15:28:22.148613934 +0200 @@ -354,7 +354,7 @@ } int eventType = getEventType(); - StringBuffer content = new StringBuffer(); + StringBuilder content = new StringBuilder(); while(eventType != END_ELEMENT ) { if(eventType == CHARACTERS || eventType == CDATA @@ -642,6 +642,7 @@ return new CharSequenceImpl(_offset + start, length); } + @Override public String toString() { return new String(_characters, _offset, _length); } --- old/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java 2013-04-04 15:28:22.516613940 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java 2013-04-04 15:28:22.460613938 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, 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 @@ -28,11 +28,13 @@ import com.sun.xml.internal.stream.buffer.AbstractProcessor; import com.sun.xml.internal.stream.buffer.XMLStreamBuffer; +import java.io.IOException; import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; +import com.sun.xml.internal.org.jvnet.staxex.Base64Data; import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx; import javax.xml.stream.XMLStreamException; @@ -359,7 +361,16 @@ } case STATE_TEXT_AS_OBJECT: { final CharSequence c = (CharSequence)readContentObject(); - writer.writeCharacters(c.toString()); + if (c instanceof Base64Data) { + try { + Base64Data bd = (Base64Data)c; + bd.writeTo(writer); + } catch (IOException e) { + throw new XMLStreamException(e); + } + } else { + writer.writeCharacters(c.toString()); + } break; } case STATE_COMMENT_AS_CHAR_ARRAY_SMALL: { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/Closeable.java 2013-04-04 15:28:22.828613944 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/Closeable.java 2013-04-04 15:28:22.772613944 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java 2013-04-04 15:28:23.112613949 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java 2013-04-04 15:28:23.064613948 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +43,6 @@ import java.io.IOException; import java.util.List; import java.util.Collection; -import java.util.ArrayList; import java.util.Collections; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java 2013-04-04 15:28:23.416613954 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java 2013-04-04 15:28:23.360613952 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -162,8 +162,9 @@ e.getLocalName().equals(MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart())) { NodeList nl = e.getElementsByTagNameNS(WSDLConstants.NS_WSDL, WSDLConstants.QNAME_DEFINITIONS.getLocalPart()); - if(nl != null) + if(nl != null) { wsdlElement = (Element) nl.item(0); + } } } } @@ -172,8 +173,9 @@ DOMUtil.serializeNode(wsdlElement, writer); } - if (w3cMetadataWritten) + if (w3cMetadataWritten) { writer.writeEndElement(); + } //TODO revisit this //write extension elements if ((msEpr.elements != null) && (msEpr.elements.size() > 0)) { @@ -200,20 +202,21 @@ private static boolean w3cMetadataWritten = false; - private static void writeW3CMetadata(StreamWriterBufferCreator writer) throws XMLStreamException { - if (!w3cMetadataWritten) { - writer.writeStartElement(AddressingVersion.W3C.getPrefix(), AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri); - w3cMetadataWritten = true; - } - } - +// private static void writeW3CMetadata(StreamWriterBufferCreator writer) throws XMLStreamException { +// if (!w3cMetadataWritten) { +// writer.writeStartElement(AddressingVersion.W3C.getPrefix(), AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri); +// w3cMetadataWritten = true; +// } +// } +// private static MemberSubmissionEndpointReference toMSEpr(W3CEndpointReference w3cEpr) { DOMResult result = new DOMResult(); w3cEpr.writeTo(result); Node eprNode = result.getNode(); Element e = DOMUtil.getFirstElementChild(eprNode); - if (e == null) + if (e == null) { return null; + } MemberSubmissionEndpointReference msEpr = new MemberSubmissionEndpointReference(); @@ -223,12 +226,11 @@ Element child = (Element) nodes.item(i); if (child.getNamespaceURI().equals(AddressingVersion.W3C.nsUri) && child.getLocalName().equals(AddressingVersion.W3C.eprType.address)) { - if (msEpr.addr == null) + if (msEpr.addr == null) { msEpr.addr = new MemberSubmissionEndpointReference.Address(); + } msEpr.addr.uri = XmlUtil.getTextForNode(child); - //now add the attribute extensions - msEpr.addr.attributes = getAttributes(child); } else if (child.getNamespaceURI().equals(AddressingVersion.W3C.nsUri) && child.getLocalName().equals("ReferenceParameters")) { NodeList refParams = child.getChildNodes(); @@ -249,8 +251,9 @@ Element wsdlDefinitions = null; for (int j = 0; j < metadata.getLength(); j++) { Node node = metadata.item(j); - if (node.getNodeType() != Node.ELEMENT_NODE) + if (node.getNodeType() != Node.ELEMENT_NODE) { continue; + } Element elm = (Element) node; if ((elm.getNamespaceURI().equals(AddressingVersion.W3C.wsdlNsUri) || @@ -264,13 +267,15 @@ String name = XmlUtil.getLocalPart(service); //if there is no service name then its not a valid EPR but lets continue as its optional anyway - if (name == null) + if (name == null) { continue; + } if (prefix != null) { String ns = elm.lookupNamespaceURI(prefix); - if (ns != null) + if (ns != null) { msEpr.serviceName.name = new QName(ns, name, prefix); + } } else { msEpr.serviceName.name = new QName(null, name); } @@ -285,13 +290,15 @@ String name = XmlUtil.getLocalPart(portType); //if there is no portType name then its not a valid EPR but lets continue as its optional anyway - if (name == null) + if (name == null) { continue; + } if (prefix != null) { String ns = elm.lookupNamespaceURI(prefix); - if (ns != null) + if (ns != null) { msEpr.portTypeName.name = new QName(ns, name, prefix); + } } else { msEpr.portTypeName.name = new QName(null, name); } @@ -372,18 +379,21 @@ NamedNodeMap nm = node.getAttributes(); for (int i = 0; i < nm.getLength(); i++) { - if (attribs == null) + if (attribs == null) { attribs = new HashMap(); + } Node n = nm.item(i); String prefix = fixNull(n.getPrefix()); String ns = fixNull(n.getNamespaceURI()); String localName = n.getLocalName(); - if (prefix.equals("xmlns") || prefix.length() == 0 && localName.equals("xmlns")) + if (prefix.equals("xmlns") || prefix.length() == 0 && localName.equals("xmlns")) { continue; + } //exclude some attributes - if (!localName.equals(AddressingVersion.W3C.eprType.portName)) + if (!localName.equals(AddressingVersion.W3C.eprType.portName)) { attribs.put(new QName(ns, localName, prefix), n.getNodeValue()); + } } return attribs; } @@ -391,8 +401,11 @@ private static @NotNull String fixNull(@Nullable String s) { - if (s == null) return ""; - else return s; + if (s == null) { + return ""; + } else { + return s; + } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/ProblemAction.java 2013-04-04 15:28:23.736613959 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/ProblemAction.java 2013-04-04 15:28:23.676613958 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/ProblemHeaderQName.java 2013-04-04 15:28:24.052613963 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/ProblemHeaderQName.java 2013-04-04 15:28:23.992613963 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CAddressingConstants.java 2013-04-04 15:28:24.360613969 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CAddressingConstants.java 2013-04-04 15:28:24.296613968 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CAddressingMetadataConstants.java 2013-04-04 15:28:24.672613973 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CAddressingMetadataConstants.java 2013-04-04 15:28:24.616613973 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CWsaClientTube.java 2013-04-04 15:28:24.964613978 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CWsaClientTube.java 2013-04-04 15:28:24.912613977 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,6 +27,7 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.TubeCloner; @@ -58,7 +59,7 @@ // RelatesTo required as per // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse if (expectReply && (packet.getMessage() != null) && !foundRelatesTo) { - String action = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String action = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion); // Don't check for AddressingFaults as // Faults for requests with duplicate MessageId will have no wsa:RelatesTo if (!packet.getMessage().isFault() || !action.equals(addressingVersion.getDefaultFaultAction())) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CWsaServerTube.java 2013-04-04 15:28:25.240613982 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/W3CWsaServerTube.java 2013-04-04 15:28:25.184613981 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +37,10 @@ import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED; import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.ONLY_ANONYMOUS_ADDRESS_SUPPORTED; -import com.sun.xml.internal.ws.resources.AddressingMessages; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import javax.xml.ws.soap.AddressingFeature; -import javax.xml.ws.WebServiceException; /** * @author Rama Pulavarthi @@ -135,57 +133,4 @@ } } - /* - @Override - protected boolean isAnonymousRequired(@Nullable WSDLBoundOperation wbo) { - return getResponseRequirement(wbo) == AddressingFeature.Responses.ANONYMOUS; - } - - private AddressingFeature.Responses getResponseRequirement(@Nullable WSDLBoundOperation wbo) { - if (af.getResponses() == AddressingFeature.Responses.ALL && wbo != null) { - //wsaw wsdl binding case will have some value set on wbo - WSDLBoundOperation.ANONYMOUS anon = wbo.getAnonymous(); - if (wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.required) - return AddressingFeature.Responses.ANONYMOUS; - else if (wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited) - return AddressingFeature.Responses.NON_ANONYMOUS; - else - return AddressingFeature.Responses.ALL; - - } else - return af.getResponses(); - } - - @Override - protected void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) { - String replyToValue = null; - String faultToValue = null; - - if (replyTo != null) - replyToValue = replyTo.getAddress(); - - if (faultTo != null) - faultToValue = faultTo.getAddress(); - AddressingFeature.Responses responseRequirement = getResponseRequirement(wbo); - - switch (responseRequirement) { - case NON_ANONYMOUS: - if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri)) - throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED); - - if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri)) - throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED); - break; - case ANONYMOUS: - if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri)) - throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED); - - if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri)) - throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED); - break; - default: - // ALL: no check - } - } - */ } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WSEPRExtension.java 2013-04-04 15:28:25.552613987 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WSEPRExtension.java 2013-04-04 15:28:25.496613986 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaActionUtil.java 2013-04-04 15:28:25.864613992 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaActionUtil.java 2013-04-04 15:28:25.808613991 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,27 +36,28 @@ * @author Rama Pulavarthi */ public class WsaActionUtil { + + @SuppressWarnings("FinalStaticMethod") public static final String getDefaultFaultAction(JavaMethod method, CheckedException ce) { String tns = method.getOwner().getTargetNamespace(); String delim = getDelimiter(tns); - if (tns.endsWith(delim)) + if (tns.endsWith(delim)) { tns = tns.substring(0, tns.length() - 1); - - //this assumes that fromjava case there won't be a standard fault name. - String name = method.getOperationName() + delim + "Fault" + delim + ce.getExceptionClass(); + } return new StringBuilder(tns).append(delim).append( method.getOwner().getPortTypeName().getLocalPart()).append( delim).append(method.getOperationName()).append(delim).append("Fault").append(delim).append(ce.getExceptionClass().getSimpleName()).toString(); } - private static final String getDelimiter(String tns) { + private static String getDelimiter(String tns) { String delim = "/"; // TODO: is this the correct way to find the separator ? try { URI uri = new URI(tns); - if ((uri.getScheme() != null) && uri.getScheme().equalsIgnoreCase("urn")) + if ((uri.getScheme() != null) && uri.getScheme().equalsIgnoreCase("urn")) { delim = ":"; + } } catch (URISyntaxException e) { LOGGER.warning("TargetNamespace of WebService is not a valid URI"); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java 2013-04-04 15:28:26.152613996 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java 2013-04-04 15:28:26.096613996 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,6 +28,7 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.addressing.model.ActionNotSupportedException; import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; @@ -73,8 +74,9 @@ if (response.getMessage() != null) { response = validateInboundHeaders(response); response.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,response)); - String msgId = response.getMessage().getHeaders(). - getMessageID(addressingVersion, soapVersion); + String msgId = AddressingUtils. + getMessageID(response.getMessage().getHeaders(), + addressingVersion, soapVersion); response.put(WsaPropertyBag.WSA_MSGID_FROM_REQUEST, msgId); } @@ -90,7 +92,9 @@ if (wbo == null) return; - String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String gotA = AddressingUtils.getAction( + packet.getMessage().getHeaders(), + addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION()); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaPropertyBag.java 2013-04-04 15:28:26.452614001 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaPropertyBag.java 2013-04-04 15:28:26.396614000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,12 @@ package com.sun.xml.internal.ws.addressing; +import com.oracle.webservices.internal.api.message.BasePropertySet; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; @@ -38,6 +39,7 @@ import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; + /** * Provides access to the Addressing headers. * @@ -45,7 +47,7 @@ * @author Rama Pulavarthi * @since 2.1.3 */ -public class WsaPropertyBag extends PropertySet { +public class WsaPropertyBag extends BasePropertySet { public static final String WSA_REPLYTO_FROM_REQUEST = "com.sun.xml.internal.ws.addressing.WsaPropertyBag.ReplyToFromRequest"; public static final String WSA_FAULTTO_FROM_REQUEST = "com.sun.xml.internal.ws.addressing.WsaPropertyBag.FaultToFromRequest"; @@ -137,7 +139,7 @@ if (packet.getMessage() == null) { return null; } - return packet.getMessage().getHeaders().getMessageID(addressingVersion,soapVersion); + return AddressingUtils.getMessageID(packet.getMessage().getHeaders(), addressingVersion,soapVersion); } private WSEndpointReference getEPR(QName tag) throws XMLStreamException { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java 2013-04-04 15:28:26.764614005 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java 2013-04-04 15:28:26.704614005 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,13 +32,12 @@ import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.WSService; -import com.sun.xml.internal.ws.api.client.WSPortInfo; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.NonAnonymousResponseProcessor; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; -import com.sun.xml.internal.ws.api.message.HeaderList; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.message.Messages; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; @@ -47,19 +46,13 @@ import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.client.Stub; import com.sun.xml.internal.ws.developer.JAXWSProperties; -import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import com.sun.xml.internal.ws.message.FaultDetailHeader; import com.sun.xml.internal.ws.resources.AddressingMessages; -import com.sun.xml.internal.ws.binding.BindingImpl; import javax.xml.soap.SOAPFault; -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Dispatch; -import javax.xml.ws.Response; import javax.xml.ws.WebServiceException; import java.net.URI; -import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; @@ -97,6 +90,7 @@ endpoint = that.endpoint; } + @Override public WsaServerTube copy(TubeCloner cloner) { return new WsaServerTube(this, cloner); } @@ -104,7 +98,9 @@ @Override public @NotNull NextAction processRequest(Packet request) { Message msg = request.getMessage(); - if(msg==null) return doInvoke(next,request); // hmm? + if (msg == null) { + return doInvoke(next,request); + } // hmm? // expose bunch of addressing related properties for advanced applications request.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,request)); @@ -113,12 +109,12 @@ // so that they can be used after responsePacket is received. // These properties are used if a fault is thrown from the subsequent Pipe/Tubes. - HeaderList hl = request.getMessage().getHeaders(); + MessageHeaders hl = request.getMessage().getHeaders(); String msgId; try { - replyTo = hl.getReplyTo(addressingVersion, soapVersion); - faultTo = hl.getFaultTo(addressingVersion, soapVersion); - msgId = hl.getMessageID(addressingVersion, soapVersion); + replyTo = AddressingUtils.getReplyTo(hl, addressingVersion, soapVersion); + faultTo = AddressingUtils.getFaultTo(hl, addressingVersion, soapVersion); + msgId = AddressingUtils.getMessageID(hl, addressingVersion, soapVersion); } catch (InvalidAddressingHeaderException e) { LOGGER.log(Level.WARNING, addressingVersion.getInvalidMapText()+", Problem header:" + e.getProblemHeader()+ ", Reason: "+ e.getSubsubcode(),e); @@ -144,8 +140,12 @@ } // defaulting - if (replyTo == null) replyTo = addressingVersion.anonymousEpr; - if (faultTo == null) faultTo = replyTo; + if (replyTo == null) { + replyTo = addressingVersion.anonymousEpr; + } + if (faultTo == null) { + faultTo = replyTo; + } // Save a copy into the packet such that we can save it with that // packet if we're going to deliver the response at a later time @@ -160,9 +160,9 @@ Packet p = validateInboundHeaders(request); // if one-way message and WS-A header processing fault has occurred, // then do no further processing - if (p.getMessage() == null) - // request message is invalid, exception is logged by now and response is sent back with null message + if (p.getMessage() == null) { return doReturnWith(p); + } // if we find an error in addressing header, just turn around the direction here if (p.getMessage().isFault()) { @@ -197,19 +197,30 @@ @Override public @NotNull NextAction processException(Throwable t) { - Packet response = Fiber.current().getPacket(); - return processResponse(response.createServerResponse( - SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, t), - wsdlPort, response.endpoint.getSEIModel(), binding)); + final Packet response = Fiber.current().getPacket(); + ThrowableContainerPropertySet tc = response.getSatellite(ThrowableContainerPropertySet.class); + if (tc == null) { + tc = new ThrowableContainerPropertySet(t); + response.addSatellite(tc); + } else if (t != tc.getThrowable()) { + // This is a pathological case where an exception happens after a previous exception. + // Make sure you report the latest one. + tc.setThrowable(t); + } + return processResponse(response.endpoint.createServiceResponseForException(tc, response, soapVersion, wsdlPort, + response.endpoint.getSEIModel(), + binding)); } @Override public @NotNull NextAction processResponse(Packet response) { Message msg = response.getMessage(); - if (msg ==null) - return doReturnWith(response); // one way message. Nothing to see here. Move on. + if (msg ==null) { + return doReturnWith(response); + } // one way message. Nothing to see here. Move on. - String to = msg.getHeaders().getTo(addressingVersion, soapVersion); + String to = AddressingUtils.getTo(msg.getHeaders(), + addressingVersion, soapVersion); if (to != null) { replyTo = faultTo = new WSEndpointReference(to, addressingVersion); } @@ -234,17 +245,14 @@ get(WsaPropertyBag.WSA_FAULTTO_FROM_REQUEST); } - WSEndpointReference target = msg.isFault()?faultTo:replyTo; - + WSEndpointReference target = msg.isFault() ? faultTo : replyTo; if (target == null && response.proxy instanceof Stub) { target = ((Stub) response.proxy).getWSEndpointReference(); } - - if(target.isAnonymous() || isAnonymousRequired ) - // the response will go back the back channel. most common case + if (target == null || target.isAnonymous() || isAnonymousRequired) { return doReturnWith(response); - - if(target.isNone()) { + } + if (target.isNone()) { // the caller doesn't want to hear about it, so proceed like one-way response.setMessage(null); return doReturnWith(response); @@ -297,18 +305,23 @@ //For instance this may be a RM CreateSequence message. WSDLBoundOperation wsdlBoundOperation = getWSDLBoundOperation(packet); - if (wsdlBoundOperation == null) + if (wsdlBoundOperation == null) { return; + } - String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String gotA = AddressingUtils.getAction( + packet.getMessage().getHeaders(), + addressingVersion, soapVersion); - if (gotA == null) + if (gotA == null) { throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); + } String expected = helper.getInputAction(packet); String soapAction = helper.getSOAPAction(packet); - if (helper.isInputActionDefault(packet) && (soapAction != null && !soapAction.equals(""))) + if (helper.isInputActionDefault(packet) && (soapAction != null && !soapAction.equals(""))) { expected = soapAction; + } if (expected != null && !gotA.equals(expected)) { throw new ActionNotSupportedException(gotA); @@ -326,6 +339,7 @@ checkNonAnonymousAddresses(replyTo,faultTo); } + @SuppressWarnings("ResultOfObjectAllocationIgnored") private void checkNonAnonymousAddresses(WSEndpointReference replyTo, WSEndpointReference faultTo) { if (!replyTo.isAnonymous()) { try { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTube.java 2013-04-04 15:28:27.096614011 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTube.java 2013-04-04 15:28:27.036614010 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,8 +30,8 @@ import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Messages; @@ -43,21 +43,16 @@ import com.sun.xml.internal.ws.api.pipe.TubeCloner; import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl; import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature; -import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.message.FaultDetailHeader; import com.sun.xml.internal.ws.resources.AddressingMessages; -import com.sun.xml.internal.ws.binding.BindingImpl; import javax.xml.namespace.QName; import javax.xml.soap.SOAPFault; import javax.xml.stream.XMLStreamException; import javax.xml.ws.WebServiceException; -import javax.xml.ws.Binding; import javax.xml.ws.soap.AddressingFeature; import javax.xml.ws.soap.SOAPBinding; import java.util.Iterator; -import java.util.Set; -import java.util.Arrays; import java.util.logging.Logger; import java.util.logging.Level; @@ -107,16 +102,15 @@ } private void addKnownHeadersToBinding(WSBinding binding) { - Set headerQNames = binding.getKnownHeaders(); for (AddressingVersion addrVersion: AddressingVersion.values()) { - headerQNames.add(addrVersion.actionTag); - headerQNames.add(addrVersion.faultDetailTag); - headerQNames.add(addrVersion.faultToTag); - headerQNames.add(addrVersion.fromTag); - headerQNames.add(addrVersion.messageIDTag); - headerQNames.add(addrVersion.relatesToTag); - headerQNames.add(addrVersion.replyToTag); - headerQNames.add(addrVersion.toTag); + binding.addKnownHeader(addrVersion.actionTag); + binding.addKnownHeader(addrVersion.faultDetailTag); + binding.addKnownHeader(addrVersion.faultToTag); + binding.addKnownHeader(addrVersion.fromTag); + binding.addKnownHeader(addrVersion.messageIDTag); + binding.addKnownHeader(addrVersion.relatesToTag); + binding.addKnownHeader(addrVersion.replyToTag); + binding.addKnownHeader(addrVersion.toTag); } } @@ -206,7 +200,9 @@ if (packet.getMessage().getHeaders() != null) return false; - String action = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String action = AddressingUtils.getAction( + packet.getMessage().getHeaders(), + addressingVersion, soapVersion); if (action == null) return true; @@ -370,7 +366,9 @@ } protected void validateSOAPAction(Packet packet) { - String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String gotA = AddressingUtils.getAction( + packet.getMessage().getHeaders(), + addressingVersion, soapVersion); if (gotA == null) throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION()); if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java 2013-04-04 15:28:27.412614016 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java 2013-04-04 15:28:27.356614015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,7 @@ import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; -import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; @@ -39,6 +39,7 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.JavaMethod; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl; import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.CheckedExceptionImpl; @@ -53,7 +54,6 @@ import javax.xml.soap.SOAPFault; import javax.xml.soap.SOAPMessage; import javax.xml.ws.WebServiceException; -import java.util.Map; /** * @author Rama Pulavarthi @@ -75,14 +75,15 @@ if(seiModel != null) { action = getFaultActionFromSEIModel(requestPacket,responsePacket); } - if(action != null) + if (action != null) { return action; - else + } else { action = addVer.getDefaultFaultAction(); + } if (wsdlPort != null) { - QName wsdlOp = requestPacket.getWSDLOperation(); + WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping(); if (wsdlOp != null) { - WSDLBoundOperation wbo = wsdlPort.getBinding().get(wsdlOp); + WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); return getFaultAction(wbo, responsePacket); } } @@ -91,29 +92,34 @@ String getFaultActionFromSEIModel(Packet requestPacket, Packet responsePacket) { String action = null; - if (seiModel == null || wsdlPort == null) + if (seiModel == null || wsdlPort == null) { return action; + } try { SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage(); - if (sm == null) + if (sm == null) { return action; + } - if (sm.getSOAPBody() == null) + if (sm.getSOAPBody() == null) { return action; + } - if (sm.getSOAPBody().getFault() == null) + if (sm.getSOAPBody().getFault() == null) { return action; + } Detail detail = sm.getSOAPBody().getFault().getDetail(); - if (detail == null) + if (detail == null) { return action; + } String ns = detail.getFirstChild().getNamespaceURI(); String name = detail.getFirstChild().getLocalName(); - QName wsdlOp = requestPacket.getWSDLOperation(); - JavaMethodImpl jm = (JavaMethodImpl) seiModel.getJavaMethodForWsdlOperation(wsdlOp); + WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping(); + JavaMethodImpl jm = (wsdlOp != null) ? (JavaMethodImpl)wsdlOp.getJavaMethod() : null; if (jm != null) { for (CheckedExceptionImpl ce : jm.getCheckedExceptions()) { if (ce.getDetailType().tagName.getLocalPart().equals(name) && @@ -129,28 +135,34 @@ } String getFaultAction(@Nullable WSDLBoundOperation wbo, Packet responsePacket) { - String action = responsePacket.getMessage().getHeaders().getAction(addVer, soapVer); - if (action != null) - return action; + String action = AddressingUtils.getAction(responsePacket.getMessage().getHeaders(), addVer, soapVer); + if (action != null) { + return action; + } action = addVer.getDefaultFaultAction(); - if (wbo == null) + if (wbo == null) { return action; + } try { SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage(); - if (sm == null) + if (sm == null) { return action; + } - if (sm.getSOAPBody() == null) + if (sm.getSOAPBody() == null) { return action; + } - if (sm.getSOAPBody().getFault() == null) + if (sm.getSOAPBody().getFault() == null) { return action; + } Detail detail = sm.getSOAPBody().getFault().getDetail(); - if (detail == null) + if (detail == null) { return action; + } String ns = detail.getFirstChild().getNamespaceURI(); String name = detail.getFirstChild().getLocalName(); @@ -158,10 +170,10 @@ WSDLOperation o = wbo.getOperation(); WSDLFault fault = o.getFault(new QName(ns, name)); - if (fault == null) + if (fault == null) { return action; + } - WSDLOperationImpl impl = (WSDLOperationImpl)o; action = fault.getAction(); return action; @@ -174,9 +186,9 @@ String action = null; if (wsdlPort != null) { - QName wsdlOp = packet.getWSDLOperation(); + WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping(); if (wsdlOp != null) { - WSDLBoundOperation wbo = wsdlPort.getBinding().get(wsdlOp); + WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); WSDLOperation op = wbo.getOperation(); action = op.getInput().getAction(); } @@ -194,18 +206,20 @@ */ public String getEffectiveInputAction(Packet packet) { //non-default SOAPAction beomes wsa:action - if(packet.soapAction != null && !packet.soapAction.equals("")) - return packet.soapAction; - String action = null; + if(packet.soapAction != null && !packet.soapAction.equals("")) { + return packet.soapAction; + } + String action; if (wsdlPort != null) { - QName wsdlOp = packet.getWSDLOperation(); + WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping(); if (wsdlOp != null) { - WSDLBoundOperation wbo = wsdlPort.getBinding().get(wsdlOp); + WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); WSDLOperation op = wbo.getOperation(); action = op.getInput().getAction(); - } else + } else { action = packet.soapAction; + } } else { action = packet.soapAction; } @@ -213,12 +227,14 @@ } public boolean isInputActionDefault(Packet packet) { - if (wsdlPort == null) + if (wsdlPort == null) { return false; - QName wsdlOp = packet.getWSDLOperation(); - if(wsdlOp == null) + } + WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping(); + if(wsdlOp == null) { return false; - WSDLBoundOperation wbo = wsdlPort.getBinding().get(wsdlOp); + } + WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); WSDLOperation op = wbo.getOperation(); return ((WSDLOperationImpl) op).getInput().isDefaultAction(); @@ -227,17 +243,20 @@ public String getSOAPAction(Packet packet) { String action = ""; - if (packet == null || packet.getMessage() == null) + if (packet == null || packet.getMessage() == null) { return action; + } - if (wsdlPort == null) + if (wsdlPort == null) { return action; + } - QName opName = packet.getWSDLOperation(); - if(opName == null) + WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping(); + if (wsdlOp == null) { return action; + } - WSDLBoundOperation op = wsdlPort.getBinding().get(opName); + WSDLBoundOperation op = wsdlOp.getWSDLBoundOperation(); action = op.getSOAPAction(); return action; } @@ -245,18 +264,17 @@ public String getOutputAction(Packet packet) { //String action = AddressingVersion.UNSET_OUTPUT_ACTION; String action = null; - QName wsdlOp = packet.getWSDLOperation(); + WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping(); if (wsdlOp != null) { - if (seiModel != null) { - JavaMethodImpl jm = (JavaMethodImpl) seiModel.getJavaMethodForWsdlOperation(wsdlOp); + JavaMethod javaMethod = wsdlOp.getJavaMethod(); + if (javaMethod != null) { + JavaMethodImpl jm = (JavaMethodImpl) javaMethod; if (jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) { return jm.getOutputAction(); } } - if (wsdlPort != null) { - WSDLBoundOperation wbo = wsdlPort.getBinding().get(wsdlOp); - return getOutputAction(wbo); - } + WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); + if (wbo != null) return getOutputAction(wbo); } return action; } @@ -265,8 +283,9 @@ String action = AddressingVersion.UNSET_OUTPUT_ACTION; if (wbo != null) { WSDLOutput op = wbo.getOperation().getOutput(); - if (op != null) + if (op != null) { action = op.getAction(); + } } return action; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java 2013-04-04 15:28:27.728614020 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java 2013-04-04 15:28:27.676614020 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java 2013-04-04 15:28:28.020614025 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java 2013-04-04 15:28:27.968614024 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/model/InvalidAddressingHeaderException.java 2013-04-04 15:28:28.316614030 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/model/InvalidAddressingHeaderException.java 2013-04-04 15:28:28.252614029 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/model/MissingAddressingHeaderException.java 2013-04-04 15:28:28.564614033 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/model/MissingAddressingHeaderException.java 2013-04-04 15:28:28.508614033 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingFeatureConfigurator.java 2013-04-04 15:28:28.880614038 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingFeatureConfigurator.java 2013-04-04 15:28:28.820614037 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingPolicyMapConfigurator.java 2013-04-04 15:28:29.184614044 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingPolicyMapConfigurator.java 2013-04-04 15:28:29.136614043 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingPolicyValidator.java 2013-04-04 15:28:29.440614048 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingPolicyValidator.java 2013-04-04 15:28:29.392614047 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingPrefixMapper.java 2013-04-04 15:28:29.648614051 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/policy/AddressingPrefixMapper.java 2013-04-04 15:28:29.600614050 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionAddressingConstants.java 2013-04-04 15:28:29.844614053 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionAddressingConstants.java 2013-04-04 15:28:29.796614053 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +37,8 @@ public static final String WSA_NAMESPACE_WSDL_NAME = WSA_NAMESPACE_NAME; public static final String WSA_NAMESPACE_POLICY_NAME = "http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"; + public static final QName WSA_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME,"Action"); + public static final String WSA_SERVICENAME_NAME = "ServiceName"; public static final String WSA_PORTTYPE_NAME = "PortType"; public static final String WSA_PORTNAME_NAME = "PortName"; @@ -44,6 +46,9 @@ public static final String WSA_ADDRESS_NAME = "Address"; public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME); + public static final String WSA_EPR_NAME = "EndpointReference"; + public static final QName WSA_EPR_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_EPR_NAME); + public static final String WSA_ANONYMOUS_ADDRESS = WSA_NAMESPACE_NAME + "/role/anonymous"; public static final String WSA_NONE_ADDRESS = ""; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionWsaClientTube.java 2013-04-04 15:28:30.052614057 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionWsaClientTube.java 2013-04-04 15:28:30.000614056 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,6 +29,7 @@ import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.TubeCloner; @@ -72,7 +73,7 @@ // RelatesTo required as per // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse if (expectReply && (packet.getMessage() != null) && !foundRelatesTo) { - String action = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String action = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion); // Don't check for AddressingFaults as // Faults for requests with duplicate MessageId will have no wsa:RelatesTo if (!packet.getMessage().isFault() || !action.equals(addressingVersion.getDefaultFaultAction())) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionWsaServerTube.java 2013-04-04 15:28:30.252614060 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionWsaServerTube.java 2013-04-04 15:28:30.204614059 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/ProblemAction.java 2013-04-04 15:28:30.456614063 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/ProblemAction.java 2013-04-04 15:28:30.408614062 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/ProblemHeaderQName.java 2013-04-04 15:28:30.656614067 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/ProblemHeaderQName.java 2013-04-04 15:28:30.608614066 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java 2013-04-04 15:28:30.868614070 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java 2013-04-04 15:28:30.816614069 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/BindingID.java 2013-04-04 15:28:31.192614075 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/BindingID.java 2013-04-04 15:28:31.136614074 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,10 +35,8 @@ import com.sun.xml.internal.ws.encoding.SOAPBindingCodec; import com.sun.xml.internal.ws.encoding.XMLHTTPBindingCodec; import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants; -import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.developer.JAXWSProperties; -import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.toFeatureArray; import javax.xml.ws.BindingType; import javax.xml.ws.WebServiceException; @@ -157,6 +155,7 @@ * @return * Always non-null same value. */ + @Override public abstract String toString(); /** @@ -218,12 +217,14 @@ /** * Compares the equality based on {@link #toString()}. */ + @Override public boolean equals(Object obj) { if(!(obj instanceof BindingID)) return false; return toString().equals(obj.toString()); } + @Override public int hashCode() { return toString().hashCode(); } @@ -353,6 +354,7 @@ * Constant that represents REST. */ public static final BindingID XML_HTTP = new Impl(SOAPVersion.SOAP_11, HTTPBinding.HTTP_BINDING,false) { + @Override public Codec createEncoder(WSBinding binding) { return new XMLHTTPBindingCodec(binding.getFeatures()); } @@ -362,6 +364,7 @@ * Constant that represents REST. */ private static final BindingID REST_HTTP = new Impl(SOAPVersion.SOAP_11, JAXWSProperties.REST_BINDING,true) { + @Override public Codec createEncoder(WSBinding binding) { return new XMLHTTPBindingCodec(binding.getFeatures()); } @@ -378,15 +381,18 @@ this.canGenerateWSDL = canGenerateWSDL; } + @Override public SOAPVersion getSOAPVersion() { return version; } + @Override public String toString() { return lexical; } @Deprecated + @Override public boolean canGenerateWSDL() { return canGenerateWSDL; } @@ -399,7 +405,6 @@ /*final*/ Map parameters = new HashMap(); static final String MTOM_PARAM = "mtom"; - Boolean mtomSetting = null; public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL) { super(version, lexical, canGenerateWSDL); @@ -410,10 +415,9 @@ this(version, lexical, canGenerateWSDL); String mtomStr = mtomEnabled ? "true" : "false"; parameters.put(MTOM_PARAM, mtomStr); - mtomSetting = mtomEnabled; } - public @NotNull Codec createEncoder(WSBinding binding) { + public @NotNull @Override Codec createEncoder(WSBinding binding) { return new SOAPBindingCodec(binding.getFeatures()); } @@ -422,6 +426,7 @@ return mtom==null?null:Boolean.valueOf(mtom); } + @Override public WebServiceFeatureList createBuiltinFeatureList() { WebServiceFeatureList r=super.createBuiltinFeatureList(); Boolean mtom = isMTOMEnabled(); @@ -430,10 +435,16 @@ return r; } + @Override public String getParameter(String parameterName, String defaultValue) { if (parameters.get(parameterName) == null) return super.getParameter(parameterName, defaultValue); return parameters.get(parameterName); } + + @Override + public SOAPHTTPImpl clone() throws CloneNotSupportedException { + return (SOAPHTTPImpl) super.clone(); + } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/BindingIDFactory.java 2013-04-04 15:28:31.480614079 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/BindingIDFactory.java 2013-04-04 15:28:31.424614078 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,4 +63,27 @@ * {@link BindingID#parse(String)} will throw the exception. */ public abstract @Nullable BindingID parse(@NotNull String lexical) throws WebServiceException; + + /** + * Creates a {@link BindingID} for given transport and SOAPVersion. + * + * @return + * a non-null return value would cause the JAX-WS RI to consider + * the creation to be successful. No furhter {@link BindingIDFactory} + * will be consulted. + * + *

+ * Retruning a null value indicates that this factory doesn't understand + * the transport, in which case the JAX-WS RI will keep asking next + * {@link BindingIDFactory}. + * + * @throws WebServiceException + * if the implementation understood the transport but it is not correct, + * this exception can be thrown to abort the creation with error. + * No further {@link BindingIDFactory} will be consulted, and + * {@link BindingID#create(String, SOAPVersion)} will throw the exception. + */ + public @Nullable BindingID create(@NotNull String transport, @NotNull SOAPVersion soapVersion) throws WebServiceException { + return null; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/Cancelable.java 2013-04-04 15:28:31.780614084 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/Cancelable.java 2013-04-04 15:28:31.724614083 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/Component.java 2013-04-04 15:28:32.064614088 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/Component.java 2013-04-04 15:28:32.008614088 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +27,7 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.server.WSEndpoint; /** * Interface that allows components to hook up with each other. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ComponentEx.java 2013-04-04 15:28:32.356614093 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ComponentEx.java 2013-04-04 15:28:32.300614092 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +40,7 @@ *

* This method works as a kind of directory service * for SPIs, allowing various components to define private contract - * and talk to each other. However unlike {@link Component.getSPI}, this + * and talk to each other. However unlike {@link Component#getSPI(java.lang.Class)}, this * method can support cases where there is an ordered collection (defined * by {@link Iterable} of implementations. The SPI contract should define * whether lookups are for the first appropriate implementation or whether --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ComponentFeature.java 2013-04-04 15:28:32.664614098 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ComponentFeature.java 2013-04-04 15:28:32.604614097 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.xml.internal.ws.api; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.WSEndpoint; +import com.sun.xml.internal.ws.client.Stub; import javax.xml.ws.WebServiceFeature; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ComponentRegistry.java 2013-04-04 15:28:32.956614102 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ComponentRegistry.java 2013-04-04 15:28:32.900614101 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ /** * Registry for component delegates. It is expected that implementations of * ComponentRegistry will delegate to registered {@link Component}s in its own - * implementation of {@link Component.getSPI}, either before or after it + * implementation of {@link Component#getSPI(java.lang.Class)}, either before or after it * considers its own SPI implementations. * * @since 2.2.6 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java 2013-04-04 15:28:33.264614107 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java 2013-04-04 15:28:33.200614106 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,163 +26,40 @@ package com.sun.xml.internal.ws.api; import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.message.Packet; -import com.sun.xml.internal.ws.client.RequestContext; -import com.sun.xml.internal.ws.client.ResponseContext; - -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; -import javax.xml.ws.WebServiceContext; -import java.util.Map.Entry; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.Set; /** - * {@link PropertySet} that combines properties exposed from multiple - * {@link PropertySet}s into one. - * - *

- * This implementation allows one {@link PropertySet} to assemble - * all properties exposed from other "satellite" {@link PropertySet}s. - * (A satellite may itself be a {@link DistributedPropertySet}, so - * in general this can form a tree.) - * - *

- * This is useful for JAX-WS because the properties we expose to the application - * are contributed by different pieces, and therefore we'd like each of them - * to have a separate {@link PropertySet} implementation that backs up - * the properties. For example, this allows FastInfoset to expose its - * set of properties to {@link RequestContext} by using a strongly-typed fields. - * - *

- * This is also useful for a client-side transport to expose a bunch of properties - * into {@link ResponseContext}. It simply needs to create a {@link PropertySet} - * object with methods for each property it wants to expose, and then add that - * {@link PropertySet} to {@link Packet}. This allows property values to be - * lazily computed (when actually asked by users), thus improving the performance - * of the typical case where property values are not asked. - * - *

- * A similar benefit applies on the server-side, for a transport to expose - * a bunch of properties to {@link WebServiceContext}. - * - *

- * To achieve these benefits, access to {@link DistributedPropertySet} is slower - * compared to {@link PropertySet} (such as get/set), while adding a satellite - * object is relatively fast. + * Placeholder for backwards compatibility. * + * @deprecated Use com.oracle.webservices.internal.api.message.DistributedPropertySet instead. * @author Kohsuke Kawaguchi */ -public abstract class DistributedPropertySet - extends PropertySet - implements com.sun.xml.internal.org.jvnet.ws.message.DistributedPropertySet -{ +public abstract class DistributedPropertySet extends com.oracle.webservices.internal.api.message.BaseDistributedPropertySet { + /** - * All {@link PropertySet}s that are bundled into this {@link PropertySet}. + * @deprecated */ - private final Map satellites = new IdentityHashMap(); - public void addSatellite(@NotNull PropertySet satellite) { - addSatellite(satellite.getClass(), satellite); + super.addSatellite(satellite); } + /** + * @deprecated + */ public void addSatellite(@NotNull Class keyClass, @NotNull PropertySet satellite) { - satellites.put(keyClass, satellite); + super.addSatellite(keyClass, satellite); } + /** + * @deprecated + */ public void copySatelliteInto(@NotNull DistributedPropertySet r) { - r.satellites.putAll(this.satellites); + super.copySatelliteInto(r); } - public @Nullable T getSatellite(Class satelliteClass) { - T satellite = (T) satellites.get(satelliteClass); - if (satellite != null) - return satellite; - - for (PropertySet child : satellites.values()) { - if (satelliteClass.isInstance(child)) { - return satelliteClass.cast(child); - } - - if (DistributedPropertySet.class.isInstance(child)) { - satellite = DistributedPropertySet.class.cast(child).getSatellite(satelliteClass); - if (satellite != null) { - return satellite; - } - } - } - return null; - } - - @Override - public Object get(Object key) { - // check satellites - for (PropertySet child : satellites.values()) { - if(child.supports(key)) - return child.get(key); - } - - // otherwise it must be the master - return super.get(key); - } - - @Override - public Object put(String key, Object value) { - // check satellites - for (PropertySet child : satellites.values()) { - if(child.supports(key)) - return child.put(key,value); - } - - // otherwise it must be the master - return super.put(key,value); - } - - @Override - public boolean supports(Object key) { - // check satellites - for (PropertySet child : satellites.values()) { - if(child.supports(key)) - return true; - } - - return super.supports(key); - } - - @Override - public Object remove(Object key) { - // check satellites - for (PropertySet child : satellites.values()) { - if(child.supports(key)) - return child.remove(key); - } - - return super.remove(key); - } - - @Override - /*package*/ void createEntrySet(Set> core) { - super.createEntrySet(core); - for (PropertySet child : satellites.values()) { - child.createEntrySet(core); - } - } - - public void addSatellite(com.sun.xml.internal.org.jvnet.ws.message.PropertySet satellite) { - addSatellite((PropertySet)satellite); - } - - public void addSatellite(@NotNull Class keyClass, @NotNull com.sun.xml.internal.org.jvnet.ws.message.PropertySet satellite) { - addSatellite(keyClass, (PropertySet)satellite); - } - - public void removeSatellite(com.sun.xml.internal.org.jvnet.ws.message.PropertySet satellite) { - removeSatellite((PropertySet)satellite); - } - - public void copySatelliteInto(com.sun.xml.internal.org.jvnet.ws.message.MessageContext r) { - copySatelliteInto((DistributedPropertySet)r); + /** + * @deprecated + */ + public void removeSatellite(PropertySet satellite) { + super.removeSatellite(satellite); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/EndpointAddress.java 2013-04-04 15:28:33.572614112 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/EndpointAddress.java 2013-04-04 15:28:33.520614111 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.xml.internal.ws.api; - import com.sun.istack.internal.Nullable; import javax.xml.ws.WebServiceException; @@ -155,6 +154,7 @@ ProxySelector sel = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public ProxySelector run() { return ProxySelector.getDefault(); } @@ -209,7 +209,6 @@ * if the code is written correctly this shall never happen. */ public URLConnection openConnection() throws IOException { - assert url!=null : uri+" doesn't have the corresponding URL"; if (url == null) { throw new WebServiceException("URI="+uri+" doesn't have the corresponding URL"); } @@ -226,6 +225,7 @@ return url.openConnection(); } + @Override public String toString() { return stringForm; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/FeatureConstructor.java 2013-04-04 15:28:33.896614116 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/FeatureConstructor.java 2013-04-04 15:28:33.828614115 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ImpliesWebServiceFeature.java 2013-04-04 15:28:34.208614122 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ImpliesWebServiceFeature.java 2013-04-04 15:28:34.148614120 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +38,7 @@ * user had already specified a different addressing version. * * @since 2.2.6 + * @deprecated use {@link FeatureListValidatorAnnotation} */ public interface ImpliesWebServiceFeature { /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/PropertySet.java 2013-04-04 15:28:34.492614126 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/PropertySet.java 2013-04-04 15:28:34.440614125 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,256 +25,35 @@ package com.sun.xml.internal.ws.api; -import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.util.ReadOnlyPropertyException; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.AbstractMap; -import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import java.util.Map.Entry; /** - * A set of "properties" that can be accessed via strongly-typed fields - * as well as reflexibly through the property name. + * Placeholder for backwards compatibility. * - * @author Kohsuke Kawaguchi + * @deprecated Use com.oracle.webservices.internal.api.message.PropertySet instead. + * @author snajper */ -@SuppressWarnings("SuspiciousMethodCalls") -public abstract class PropertySet implements com.sun.xml.internal.org.jvnet.ws.message.PropertySet { - - /** - * Creates a new instance of TypedMap. - */ - protected PropertySet() {} - +public abstract class PropertySet extends com.oracle.webservices.internal.api.message.BasePropertySet { /** - * Represents the list of strongly-typed known propertyies + * Represents the list of strongly-typed known properties * (keyed by property names.) * *

* Just giving it an alias to make the use of this class more fool-proof. + * @deprecated */ - protected static final class PropertyMap extends HashMap {} - - /** - * Map representing the Fields and Methods annotated with {@link Property}. - * Model of {@link PropertySet} class. - * - *

- * At the end of the derivation chain this method just needs to be implemented - * as: - * - *

-     * private static final PropertyMap model;
-     * static {
-     *   model = parse(MyDerivedClass.class);
-     * }
-     * protected PropertyMap getPropertyMap() {
-     *   return model;
-     * }
-     * 
- */ - protected abstract PropertyMap getPropertyMap(); - - // maybe we can use this some time - ///** - // * If all the properties defined on this {@link PropertySet} has a certain prefix - // * (such as, say, "javax.xml.ws.http."), then return it. - // * - // *

- // * Returning a non-null name from this method allows methods like - // * {@link #get(Object)} and {@link #put(String, Object)} to work faster. - // * This is especially so with {@link DistributedPropertySet}, so implementations - // * are encouraged to set a common prefix, as much as possible. - // * - // *

- // * Currently, this is used only by {@link DistributedPropertySet}. - // * - // * @return - // * Null if no such common prefix exists. Otherwise string like - // * "javax.xml.ws.http." (the dot at the last is usually preferrable, - // * so that properties like "javax.xml.ws.https.something" won't match. - // */ - //protected abstract String getPropertyPrefix(); + protected static class PropertyMap extends com.oracle.webservices.internal.api.message.BasePropertySet.PropertyMap {} /** - * This method parses a class for fields and methods with {@link Property}. + * @deprecated */ protected static PropertyMap parse(final Class clazz) { - // make all relevant fields and methods accessible. - // this allows runtime to skip the security check, so they runs faster. - return AccessController.doPrivileged(new PrivilegedAction() { - public PropertyMap run() { - PropertyMap props = new PropertyMap(); - for( Class c=clazz; c!=null; c=c.getSuperclass()) { - for (Field f : c.getDeclaredFields()) { - Property cp = f.getAnnotation(Property.class); - if(cp!=null) { - for(String value : cp.value()) { - props.put(value, new FieldAccessor(f, value)); - } - } - } - for (Method m : c.getDeclaredMethods()) { - Property cp = m.getAnnotation(Property.class); - if(cp!=null) { - String name = m.getName(); - assert name.startsWith("get") || name.startsWith("is"); - - String setName = name.startsWith("is") ? "set"+name.substring(3) : // isFoo -> setFoo - 's'+name.substring(1); // getFoo -> setFoo - Method setter; - try { - setter = clazz.getMethod(setName,m.getReturnType()); - } catch (NoSuchMethodException e) { - setter = null; // no setter - } - for(String value : cp.value()) { - props.put(value, new MethodAccessor(m, setter, value)); - } - } - } - } - - return props; - } - }); - } - - /** - * Represents a typed property defined on a {@link PropertySet}. - */ - protected interface Accessor { - String getName(); - boolean hasValue(PropertySet props); - Object get(PropertySet props); - void set(PropertySet props, Object value); - } - - static final class FieldAccessor implements Accessor { - /** - * Field with the annotation. - */ - private final Field f; - - /** - * One of the values in {@link Property} annotation on {@link #f}. - */ - private final String name; - - protected FieldAccessor(Field f, String name) { - this.f = f; - f.setAccessible(true); - this.name = name; - } - - public String getName() { - return name; - } - - public boolean hasValue(PropertySet props) { - return get(props)!=null; - } - - public Object get(PropertySet props) { - try { - return f.get(props); - } catch (IllegalAccessException e) { - throw new AssertionError(); - } - } - - public void set(PropertySet props, Object value) { - try { - f.set(props,value); - } catch (IllegalAccessException e) { - throw new AssertionError(); - } - } - } - - static final class MethodAccessor implements Accessor { - /** - * Getter method. - */ - private final @NotNull Method getter; - /** - * Setter method. - * Some property is read-only. - */ - private final @Nullable Method setter; - - /** - * One of the values in {@link Property} annotation on {@link #getter}. - */ - private final String name; - - protected MethodAccessor(Method getter, Method setter, String value) { - this.getter = getter; - this.setter = setter; - this.name = value; - getter.setAccessible(true); - if(setter!=null) - setter.setAccessible(true); - } - - public String getName() { - return name; - } - - public boolean hasValue(PropertySet props) { - return get(props)!=null; - } - - public Object get(PropertySet props) { - try { - return getter.invoke(props); - } catch (IllegalAccessException e) { - throw new AssertionError(); - } catch (InvocationTargetException e) { - handle(e); - return 0; // never reach here - } - } - - public void set(PropertySet props, Object value) { - if(setter==null) - throw new ReadOnlyPropertyException(getName()); - try { - setter.invoke(props,value); - } catch (IllegalAccessException e) { - throw new AssertionError(); - } catch (InvocationTargetException e) { - handle(e); - } - } - - /** - * Since we don't expect the getter/setter to throw a checked exception, - * it should be possible to make the exception propagation transparent. - * That's what we are trying to do here. - */ - private Exception handle(InvocationTargetException e) { - Throwable t = e.getTargetException(); - if(t instanceof Error) - throw (Error)t; - if(t instanceof RuntimeException) - throw (RuntimeException)t; - throw new Error(e); - } - } - - - public final boolean containsKey(Object key) { - return get(key)!=null; + com.oracle.webservices.internal.api.message.BasePropertySet.PropertyMap pm = com.oracle.webservices.internal.api.message.BasePropertySet.parse(clazz); + PropertyMap map = new PropertyMap(); + map.putAll(pm); + return map; } /** @@ -316,9 +95,6 @@ } } - /** - * Checks if this {@link PropertySet} supports a property of the given name. - */ public boolean supports(Object key) { return getPropertyMap().containsKey(key); } @@ -334,39 +110,7 @@ } } - - /** - * Lazily created view of {@link Property}s that - * forms the core of {@link #createMapView()}. - */ - /*package*/ Set> mapViewCore; - - /** - * Creates a {@link Map} view of this {@link PropertySet}. - * - *

- * This map is partially live, in the sense that values you set to it - * will be reflected to {@link PropertySet}. - * - *

- * However, this map may not pick up changes made - * to {@link PropertySet} after the view is created. - * - * @return - * always non-null valid instance. - */ - public final Map createMapView() { - final Set> core = new HashSet>(); - createEntrySet(core); - - return new AbstractMap() { - public Set> entrySet() { - return core; - } - }; - } - - /*package*/ void createEntrySet(Set> core) { + protected void createEntrySet(Set> core) { for (final Entry e : getPropertyMap().entrySet()) { core.add(new Entry() { public String getKey() { @@ -386,4 +130,6 @@ }); } } + + protected abstract PropertyMap getPropertyMap(); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ResourceLoader.java 2013-04-04 15:28:34.824614131 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ResourceLoader.java 2013-04-04 15:28:34.764614130 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/SOAPVersion.java 2013-04-04 15:28:35.128614136 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/SOAPVersion.java 2013-04-04 15:28:35.072614135 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -36,8 +36,8 @@ import javax.xml.soap.SOAPFactory; import javax.xml.ws.soap.SOAPBinding; -import com.sun.xml.internal.org.jvnet.ws.EnvelopeStyle; -import com.sun.xml.internal.org.jvnet.ws.EnvelopeStyleFeature; +import com.oracle.webservices.internal.api.EnvelopeStyle; +import com.oracle.webservices.internal.api.EnvelopeStyleFeature; import java.util.Arrays; import java.util.Collections; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ServiceSharedFeatureMarker.java 2013-04-04 15:28:35.428614141 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ServiceSharedFeatureMarker.java 2013-04-04 15:28:35.376614140 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSBinding.java 2013-04-04 15:28:35.696614145 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSBinding.java 2013-04-04 15:28:35.636614144 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -39,6 +39,7 @@ import java.util.List; import java.util.Set; + /** * JAX-WS implementation of {@link Binding}. * @@ -97,7 +98,8 @@ */ @NotNull BindingID getBindingId(); - @NotNull List getHandlerChain(); + @NotNull@Override + List getHandlerChain(); /** * Checks if a particular {@link WebServiceFeature} is enabled. @@ -188,10 +190,20 @@ @NotNull final QName messageName); /** - * Returns set of header QNames known to be supported by this binding. Tubes should use this - * Set to add QNames for headers they process so that must-understand processing can validate - * headers on inbound messages + * Returns set of header QNames known to be supported by this binding. * @return Set of known QNames */ @NotNull Set getKnownHeaders(); + + /** + * Adds header QName to set known to be supported by this binding + * @param knownHeader Known header QName + * @return true, if new entry was added; false, if known header QName was already known + */ + boolean addKnownHeader(QName knownHeader); + + /** + * @return A MessageContextFactory configured according to the binding's features. + */ + @NotNull com.oracle.webservices.internal.api.message.MessageContextFactory getMessageContextFactory(); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSDLLocator.java 2013-04-04 15:28:35.980614149 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSDLLocator.java 2013-04-04 15:28:35.920614148 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSFeatureList.java 2013-04-04 15:28:36.240614153 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSFeatureList.java 2013-04-04 15:28:36.184614153 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSService.java 2013-04-04 15:28:36.492614157 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSService.java 2013-04-04 15:28:36.436614156 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -82,13 +82,13 @@ public abstract T getPort(WSEndpointReference epr, Class portInterface, WebServiceFeature... features); /** - * Works like {@link #createDispatch(EndpointReference, Class, Mode, WebServiceFeature[])} + * Works like {@link #createDispatch(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])} * but it takes the port name separately, so that EPR without embedded metadata can be used. */ public abstract Dispatch createDispatch(QName portName, WSEndpointReference wsepr, Class aClass, Service.Mode mode, WebServiceFeature... features); /** - * Works like {@link #createDispatch(EndpointReference, JAXBContext, Mode, WebServiceFeature[])} + * Works like {@link #createDispatch(javax.xml.ws.EndpointReference, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])} * but it takes the port name separately, so that EPR without embedded metadata can be used. */ public abstract Dispatch createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features); @@ -113,7 +113,7 @@ return s; } - return null; + return getContainer().getSPI(spiType); } public @NotNull Set getComponents() { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WebServiceFeatureFactory.java 2013-04-04 15:28:36.748614161 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WebServiceFeatureFactory.java 2013-04-04 15:28:36.700614161 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java 2013-04-04 15:28:37.000614165 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java 2013-04-04 15:28:36.944614164 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java 2013-04-04 15:28:37.300614169 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java 2013-04-04 15:28:37.240614169 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,18 +25,27 @@ package com.sun.xml.internal.ws.api.addressing; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.Writer; + import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.message.AbstractHeaderImpl; import com.sun.xml.internal.ws.util.xml.XmlUtil; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPHeader; +import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; @@ -102,7 +111,19 @@ SOAPHeader header = saaj.getSOAPHeader(); if (header == null) header = saaj.getSOAPPart().getEnvelope().addHeader(); - t.transform(epr.asSource(localName), new DOMResult(header)); +// TODO workaround for oracle xdk bug 16555545, when this bug is fixed the line below can be +// uncommented and all lines below, except the catch block, can be removed. +// t.transform(epr.asSource(localName), new DOMResult(header)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + XMLStreamWriter w = XMLOutputFactory.newFactory().createXMLStreamWriter(baos); + epr.writeTo(localName, w); + w.flush(); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance(); + fac.setNamespaceAware(true); + Node eprNode = fac.newDocumentBuilder().parse(bais).getDocumentElement(); + Node eprNodeToAdd = header.getOwnerDocument().importNode(eprNode, true); + header.appendChild(eprNodeToAdd); } catch (Exception e) { throw new SOAPException(e); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/NonAnonymousResponseProcessor.java 2013-04-04 15:28:37.576614174 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/NonAnonymousResponseProcessor.java 2013-04-04 15:28:37.516614173 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java 2013-04-04 15:28:37.880614178 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java 2013-04-04 15:28:37.820614178 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,6 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.FeatureConstructor; -import com.sun.xml.internal.ws.api.message.HeaderList; import javax.xml.ws.WebServiceFeature; @@ -63,6 +62,7 @@ */ public static final String ID = "http://java.sun.com/xml/ns/jaxws/addressing/oneway"; + private String messageId; private WSEndpointReference replyTo; private WSEndpointReference sslReplyTo; private WSEndpointReference from; @@ -115,6 +115,23 @@ this.relatesToID = relatesTo; } + public OneWayFeature(final AddressingPropertySet a, AddressingVersion v) { + this.enabled = true; + this.messageId = a.getMessageId(); + this.relatesToID = a.getRelatesTo(); + this.replyTo = makeEPR(a.getReplyTo(), v); + this.faultTo = makeEPR(a.getFaultTo(), v); + } + + private WSEndpointReference makeEPR(final String x, final AddressingVersion v) { + if (x == null) { return null; } + return new WSEndpointReference(x, v); + } + + public String getMessageId() { + return messageId; + } + /** * {@inheritDoc} */ --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java 2013-04-04 15:28:38.116614182 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java 2013-04-04 15:28:38.060614182 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,21 +80,26 @@ this.localName = localName; } + @Override public @NotNull String getNamespaceURI() { return nsUri; } + @Override public @NotNull String getLocalPart() { return localName; } + @Override public String getAttribute(String nsUri, String localName) { - if(attributes==null) + if(attributes==null) { parseAttributes(); + } for(int i=attributes.size()-1; i>=0; i-- ) { Attribute a = attributes.get(i); - if(a.localName.equals(localName) && a.nsUri.equals(nsUri)) + if (a.localName.equals(localName) && a.nsUri.equals(nsUri)) { return a.value; + } } return null; } @@ -113,105 +118,135 @@ attributes = new FinalArrayList(); boolean refParamAttrWritten = false; for (int i = 0; i < reader.getAttributeCount(); i++) { - final String localName = reader.getAttributeLocalName(i); + final String attrLocalName = reader.getAttributeLocalName(i); final String namespaceURI = reader.getAttributeNamespace(i); final String value = reader.getAttributeValue(i); - if(namespaceURI.equals(AddressingVersion.W3C.nsUri)&& localName.equals("IS_REFERENCE_PARAMETER")) + if (namespaceURI.equals(AddressingVersion.W3C.nsUri)&& attrLocalName.equals("IS_REFERENCE_PARAMETER")) { refParamAttrWritten = true; - attributes.add(new Attribute(namespaceURI,localName,value)); + } + attributes.add(new Attribute(namespaceURI,attrLocalName,value)); } // we are adding one more attribute "wsa:IsReferenceParameter", if its not alrady there - if(!refParamAttrWritten) + if (!refParamAttrWritten) { attributes.add(new Attribute(AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER,TRUE_VALUE)); + } } catch (XMLStreamException e) { throw new WebServiceException("Unable to read the attributes for {"+nsUri+"}"+localName+" header",e); } } + @Override public XMLStreamReader readHeader() throws XMLStreamException { return new StreamReaderDelegate(infoset.readAsXMLStreamReader()) { int state=0; /* 0:expecting root, 1:in root, 2:past root */ + @Override public int next() throws XMLStreamException { return check(super.next()); } + @Override public int nextTag() throws XMLStreamException { return check(super.nextTag()); } private int check(int type) { - switch(state) { - case 0: - if(type==START_ELEMENT) - state=1; - break; - case 1: - state=2; + switch (state) { + case 0: + if (type == START_ELEMENT) { + state = 1; + } + break; + case 1: + state = 2; + break; + default: + break; } return type; } + @Override public int getAttributeCount() { - if(state==1) return super.getAttributeCount()+1; - else return super.getAttributeCount(); + if (state == 1) { + return super.getAttributeCount()+1; + } else { + return super.getAttributeCount(); + } } + @Override public String getAttributeLocalName(int index) { - if(state==1 && index==super.getAttributeCount()) + if (state == 1 && index == super.getAttributeCount()) { return IS_REFERENCE_PARAMETER; - else + } else { return super.getAttributeLocalName(index); + } } + @Override public String getAttributeNamespace(int index) { - if(state==1 && index==super.getAttributeCount()) + if (state == 1 && index==super.getAttributeCount()) { return AddressingVersion.W3C.nsUri; - else + } + else { return super.getAttributeNamespace(index); + } } + @Override public String getAttributePrefix(int index) { - if(state==1 && index==super.getAttributeCount()) + if(state==1 && index==super.getAttributeCount()) { return "wsa"; - else + } else { return super.getAttributePrefix(index); + } } + @Override public String getAttributeType(int index) { - if(state==1 && index==super.getAttributeCount()) + if(state==1 && index==super.getAttributeCount()) { return "CDATA"; - else + } else { return super.getAttributeType(index); + } } + @Override public String getAttributeValue(int index) { - if(state==1 && index==super.getAttributeCount()) + if(state==1 && index==super.getAttributeCount()) { return TRUE_VALUE; - else + } else { return super.getAttributeValue(index); + } } + @Override public QName getAttributeName(int index) { - if(state==1 && index==super.getAttributeCount()) + if(state==1 && index==super.getAttributeCount()) { return new QName(AddressingVersion.W3C.nsUri, IS_REFERENCE_PARAMETER, "wsa"); - else + } else { return super.getAttributeName(index); + } } + @Override public String getAttributeValue(String namespaceUri, String localName) { - if(state==1 && localName.equals(IS_REFERENCE_PARAMETER) && namespaceUri.equals(AddressingVersion.W3C.nsUri)) + if(state==1 && localName.equals(IS_REFERENCE_PARAMETER) && namespaceUri.equals(AddressingVersion.W3C.nsUri)) { return TRUE_VALUE; - else + } else { return super.getAttributeValue(namespaceUri, localName); + } } }; } + @Override public void writeTo(XMLStreamWriter w) throws XMLStreamException { infoset.writeToXMLStreamWriter(new XMLStreamWriterFilter(w) { private boolean root=true; private boolean onRootEl = true; + @Override public void writeStartElement(String localName) throws XMLStreamException { super.writeStartElement(localName); writeAddedAttribute(); @@ -227,40 +262,42 @@ super.writeAttribute("wsa",AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER,TRUE_VALUE); } + @Override public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException { super.writeStartElement(namespaceURI, localName); writeAddedAttribute(); } + @Override public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { //TODO: Verify with KK later //check if prefix is declared before writing start element. boolean prefixDeclared = isPrefixDeclared(prefix,namespaceURI); super.writeStartElement(prefix, localName, namespaceURI); - if(!prefixDeclared && !prefix.equals("")) + if (!prefixDeclared && !prefix.equals("")) { super.writeNamespace(prefix,namespaceURI); + } writeAddedAttribute(); } + @Override public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException{ - //TODO: Verify with KK later - if(isPrefixDeclared(prefix, namespaceURI)) { - //Dont write it again , as its already in NamespaceContext - return; - } else + if (!isPrefixDeclared(prefix, namespaceURI)) { super.writeNamespace(prefix,namespaceURI); + } } + @Override public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException { //skip if its on root element and attribute is wsa;IsReferenceParameter, as we write it. if(onRootEl && namespaceURI.equals(AddressingVersion.W3C.nsUri) - && localName.equals(IS_REFERENCE_PARAMETER)) + && localName.equals(IS_REFERENCE_PARAMETER)) { return; - + } writer.writeAttribute(prefix, namespaceURI, localName, value); } - public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { - + @Override + public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { writer.writeAttribute(namespaceURI, localName, value); } private boolean isPrefixDeclared(String prefix, String namespaceURI ) { @@ -269,14 +306,16 @@ },true); } + @Override public void writeTo(SOAPMessage saaj) throws SOAPException { //TODO: SAAJ returns null instead of throwing SOAPException, // when there is no SOAPHeader in the message, // which leads to NPE. try { SOAPHeader header = saaj.getSOAPHeader(); - if (header == null) + if (header == null) { header = saaj.getSOAPPart().getEnvelope().addHeader(); + } Element node = (Element)infoset.writeTo(header); node.setAttributeNS(AddressingVersion.W3C.nsUri,AddressingVersion.W3C.getPrefix()+":"+IS_REFERENCE_PARAMETER,TRUE_VALUE); } catch (XMLStreamBufferException e) { @@ -284,10 +323,12 @@ } } + @Override public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException { class Filter extends XMLFilterImpl { Filter(ContentHandler ch) { setContentHandler(ch); } private int depth=0; + @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if(depth++==0) { // add one more attribute @@ -309,10 +350,12 @@ super.startElement(uri, localName, qName, atts); } + @Override public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); - if(--depth==0) + if (--depth == 0) { super.endPrefixMapping("wsa"); + } } } @@ -341,8 +384,7 @@ * Convert null to "". */ private static String fixNull(String s) { - if(s==null) return ""; - else return s; + return s == null ? "" : s; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java 2013-04-04 15:28:38.432614188 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java 2013-04-04 15:28:38.372614186 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension; import com.sun.xml.internal.ws.resources.AddressingMessages; @@ -289,8 +290,9 @@ //write extensibility elements in the EPR element if (elements != null) { - for (Element e : elements) + for (Element e : elements) { DOMUtil.serializeNode(e, writer); + } } writer.writeEndElement(); @@ -352,8 +354,9 @@ //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written. if(referenceParameters != null && referenceParameters.size() > 0) { writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri); - for (Element e : referenceParameters) + for (Element e : referenceParameters) { DOMUtil.serializeNode(e, writer); + } writer.writeEndElement(); } @@ -386,6 +389,9 @@ } } + private static boolean isEmty(QName qname) { + return qname == null || qname.toString().trim().length()== 0; + } private static void writeW3CMetaData(StreamWriterBufferCreator writer, QName service, @@ -395,15 +401,18 @@ //.NET treate empty metaData element as bad request. - if (service == null && port == null && portType == null && metadata == null && wsdlAddress == null) - return; + if (isEmty(service) && isEmty(port) && isEmty(portType) && metadata == null/* && wsdlAddress == null*/) { + return; + } + writer.writeStartElement(AddressingVersion.W3C.getPrefix(), AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri); writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(), AddressingVersion.W3C.wsdlNsUri); //write wsdliLication as defined in WS-Addressing 1.0 Metadata spec - if(wsdlAddress != null) - writeWsdliLocation(writer, service, wsdlAddress,wsdlTargetNamespace); + if(wsdlAddress != null) { + writeWsdliLocation(writer, service, wsdlAddress, wsdlTargetNamespace); + } //Write Interface info if (portType != null) { @@ -449,10 +458,11 @@ } */ //Add the extra metadata Elements - if (metadata != null) + if (metadata != null) { for (Element e : metadata) { DOMUtil.serializeNode(e, writer); } + } writer.writeEndElement(); } @@ -552,10 +562,11 @@ */ public static @Nullable WSEndpointReference create(@Nullable EndpointReference epr) { - if (epr != null) + if (epr != null) { return new WSEndpointReference(epr); - else + } else { return null; + } } /** @@ -592,21 +603,26 @@ MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer(); XMLFilterImpl filter = new XMLFilterImpl() { private boolean inAddress = false; + @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { - if(localName.equals("Address") && uri.equals(version.nsUri)) + if (localName.equals("Address") && uri.equals(version.nsUri)) { inAddress = true; + } super.startElement(uri,localName,qName,atts); } + @Override public void characters(char ch[], int start, int length) throws SAXException { - if(!inAddress) + if (!inAddress) { super.characters(ch, start, length); + } } - + @Override public void endElement(String uri, String localName, String qName) throws SAXException { - if(inAddress) + if (inAddress) { super.characters(newAddress.toCharArray(),0,newAddress.length()); + } inAddress = false; super.endElement(uri, localName, qName); } @@ -737,14 +753,16 @@ StreamReaderBufferProcessor xsr = infoset.readAsXMLStreamReader(); // parser should be either at the start element or the start document - if(xsr.getEventType()==XMLStreamReader.START_DOCUMENT) + if (xsr.getEventType()==XMLStreamReader.START_DOCUMENT) { xsr.nextTag(); + } assert xsr.getEventType()==XMLStreamReader.START_ELEMENT; String rootLocalName = xsr.getLocalName(); - if(!xsr.getNamespaceURI().equals(version.nsUri)) + if(!xsr.getNamespaceURI().equals(version.nsUri)) { throw new WebServiceException(AddressingMessages.WRONG_ADDRESSING_VERSION( version.nsUri, xsr.getNamespaceURI())); + } this.rootElement = new QName(xsr.getNamespaceURI(), rootLocalName); @@ -756,8 +774,9 @@ if(version.isReferenceParameter(localName)) { XMLStreamBuffer mark; while((mark = xsr.nextTagAndMark())!=null) { - if(marks==null) + if (marks==null) { marks = new ArrayList
(); + } // TODO: need a different header for member submission version marks.add(version.createReferenceParameterHeader( @@ -766,8 +785,9 @@ } } else if(localName.equals("Address")) { - if(address!=null) // double
. That's an error. + if (address!=null) { throw new InvalidAddressingHeaderException(new QName(version.nsUri,rootLocalName),AddressingVersion.fault_duplicateAddressInEpr); + } address = xsr.getElementText().trim(); } else { XMLStreamReaderUtil.skipElement(xsr); @@ -776,14 +796,15 @@ // hit to by now - if(marks==null) { + if (marks==null) { this.referenceParameters = EMPTY_ARRAY; } else { this.referenceParameters = marks.toArray(new Header[marks.size()]); } - if(address==null) + if (address==null) { throw new InvalidAddressingHeaderException(new QName(version.nsUri,rootLocalName),version.fault_missingAddressInEpr); + } } @@ -797,9 +818,11 @@ */ public XMLStreamReader read(final @NotNull String localName) throws XMLStreamException { return new StreamReaderBufferProcessor(infoset) { - protected void processElement(String prefix, String uri, String _localName) { - if (_depth == 0) + @Override + protected void processElement(String prefix, String uri, String _localName, boolean inScope) { + if (_depth == 0) { _localName = localName; + } super.processElement(prefix, uri, _localName, isInscope(infoset,_depth)); } }; @@ -874,14 +897,17 @@ return ln; } + @Override public void writeStartElement(String localName) throws XMLStreamException { super.writeStartElement(override(localName)); } + @Override public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException { super.writeStartElement(namespaceURI, override(localName)); } + @Override public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { super.writeStartElement(prefix, override(localName), namespaceURI); } @@ -908,14 +934,27 @@ /** * Copies all the reference parameters in this EPR as headers * to the given {@link HeaderList}. + * @deprecated - use addReferenceParametersToList(MessageHeaders) */ + @SuppressWarnings("ManualArrayToCollectionCopy") public void addReferenceParametersToList(HeaderList outbound) { + // implemented through iteration because of unsupportedoperation exception thrown from addAll method on headerlist + // do not change for (Header header : referenceParameters) { outbound.add(header); } } /** + * Copies all the reference parameters in this EPR as headers + * to the given {@link MessageHeaders}. + */ + public void addReferenceParametersToList(MessageHeaders outbound) { + for (Header header : referenceParameters) { + outbound.add(header); + } + } + /** * Copies all the reference parameters from the given {@link HeaderList} * to this EPR */ @@ -950,6 +989,7 @@ * Gets the QName of the EndpointReference element. * @return */ + @Override public QName getName() { return rootElement; } @@ -966,6 +1006,7 @@ this.rootLocalName = rootLocalName; } + @Override protected void processElement(String uri, String localName, String qName, boolean inscope) throws SAXException { if(root) { root = false; @@ -1000,14 +1041,16 @@ */ public @Nullable EPRExtension getEPRExtension(final QName extnQName) throws XMLStreamException { - if (rootEprExtensions == null) + if (rootEprExtensions == null) { parseEPRExtensions(); + } return rootEprExtensions.get(extnQName); } public @NotNull Collection getEPRExtensions() throws XMLStreamException { - if (rootEprExtensions == null) + if (rootEprExtensions == null) { parseEPRExtensions(); + } return rootEprExtensions.values(); } @@ -1019,14 +1062,15 @@ StreamReaderBufferProcessor xsr = infoset.readAsXMLStreamReader(); // parser should be either at the start element or the start document - if (xsr.getEventType() == XMLStreamReader.START_DOCUMENT) + if (xsr.getEventType() == XMLStreamReader.START_DOCUMENT) { xsr.nextTag(); + } assert xsr.getEventType() == XMLStreamReader.START_ELEMENT; - String rootLocalName = xsr.getLocalName(); - if (!xsr.getNamespaceURI().equals(version.nsUri)) + if (!xsr.getNamespaceURI().equals(version.nsUri)) { throw new WebServiceException(AddressingMessages.WRONG_ADDRESSING_VERSION( version.nsUri, xsr.getNamespaceURI())); + } // since often EPR doesn't have extensions, create array lazily XMLStreamBuffer mark; @@ -1101,13 +1145,15 @@ StreamReaderBufferProcessor xsr = infoset.readAsXMLStreamReader(); // parser should be either at the start element or the start document - if (xsr.getEventType() == XMLStreamReader.START_DOCUMENT) - xsr.nextTag(); + if (xsr.getEventType() == XMLStreamReader.START_DOCUMENT) { + xsr.nextTag(); + } assert xsr.getEventType() == XMLStreamReader.START_ELEMENT; String rootElement = xsr.getLocalName(); - if (!xsr.getNamespaceURI().equals(version.nsUri)) - throw new WebServiceException(AddressingMessages.WRONG_ADDRESSING_VERSION( - version.nsUri, xsr.getNamespaceURI())); + if (!xsr.getNamespaceURI().equals(version.nsUri)) { + throw new WebServiceException(AddressingMessages.WRONG_ADDRESSING_VERSION( + version.nsUri, xsr.getNamespaceURI())); + } String localName; String ns; if (version == AddressingVersion.W3C) { @@ -1115,22 +1161,26 @@ //If the current element is metadata enclosure, look inside if (xsr.getLocalName().equals(version.eprType.wsdlMetadata.getLocalPart())) { String wsdlLoc = xsr.getAttributeValue("http://www.w3.org/ns/wsdl-instance","wsdlLocation"); - if (wsdlLoc != null) + if (wsdlLoc != null) { wsdliLocation = wsdlLoc.trim(); + } XMLStreamBuffer mark; while ((mark = xsr.nextTagAndMark()) != null) { localName = xsr.getLocalName(); ns = xsr.getNamespaceURI(); if (localName.equals(version.eprType.serviceName)) { String portStr = xsr.getAttributeValue(null, version.eprType.portName); - if(serviceName != null) + if (serviceName != null) { throw new RuntimeException("More than one "+ version.eprType.serviceName +" element in EPR Metadata"); + } serviceName = getElementTextAsQName(xsr); - if (serviceName != null && portStr != null) + if (serviceName != null && portStr != null) { portName = new QName(serviceName.getNamespaceURI(), portStr); + } } else if (localName.equals(version.eprType.portTypeName)) { - if(portTypeName != null) + if (portTypeName != null) { throw new RuntimeException("More than one "+ version.eprType.portTypeName +" element in EPR Metadata"); + } portTypeName = getElementTextAsQName(xsr); } else if (ns.equals(WSDLConstants.NS_WSDL) && localName.equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) { @@ -1141,8 +1191,9 @@ } } else { //Skip is it is not root element - if (!xsr.getLocalName().equals(rootElement)) + if (!xsr.getLocalName().equals(rootElement)) { XMLStreamReaderUtil.skipElement(xsr); + } } } while (XMLStreamReaderUtil.nextElementContent(xsr) == XMLStreamReader.START_ELEMENT); @@ -1174,14 +1225,16 @@ } else if (localName.equals(version.eprType.serviceName)) { String portStr = xsr.getAttributeValue(null, version.eprType.portName); serviceName = getElementTextAsQName(xsr); - if (serviceName != null && portStr != null) + if (serviceName != null && portStr != null) { portName = new QName(serviceName.getNamespaceURI(), portStr); + } } else if (localName.equals(version.eprType.portTypeName)) { portTypeName = getElementTextAsQName(xsr); } else { //Skip is it is not root element - if (!xsr.getLocalName().equals(rootElement)) + if (!xsr.getLocalName().equals(rootElement)) { XMLStreamReaderUtil.skipElement(xsr); + } } } while (XMLStreamReaderUtil.nextElementContent(xsr) == XMLStreamReader.START_ELEMENT); } @@ -1194,8 +1247,9 @@ if (name != null) { if (prefix != null) { String ns = xsr.getNamespaceURI(prefix); - if (ns != null) + if (ns != null) { return new QName(ns, name, prefix); + } } else { return new QName(null, name); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/package-info.java 2013-04-04 15:28:38.740614192 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/addressing/package-info.java 2013-04-04 15:28:38.680614191 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/ClientPipelineHook.java 2013-04-04 15:28:39.052614197 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/ClientPipelineHook.java 2013-04-04 15:28:38.992614196 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java 2013-04-04 15:28:39.340614201 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java 2013-04-04 15:28:39.284614201 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -49,7 +49,7 @@ * is equivalent to this feature being present and disabled. *

* If this feature is enabled by the client and the Service supports the - * Fast Infoset encoding, as specified by the {@link FastInfosetFeature}, + * Fast Infoset encoding, as specified by the {@link com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature}, * and Fast Infoset is determined to be the most optimal encoding, then the * Fast Infoset encoding will be automatically selected by the client. *

--- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/ServiceInterceptor.java 2013-04-04 15:28:39.652614207 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/ServiceInterceptor.java 2013-04-04 15:28:39.592614206 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/ServiceInterceptorFactory.java 2013-04-04 15:28:39.964614211 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/ServiceInterceptorFactory.java 2013-04-04 15:28:39.904614210 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java 2013-04-04 15:28:40.284614216 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java 2013-04-04 15:28:40.224614215 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/EndpointCreationAttributes.java 2013-04-04 15:28:40.596614221 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/EndpointCreationAttributes.java 2013-04-04 15:28:40.536614220 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/ManagedEndpointFactory.java 2013-04-04 15:28:40.836614225 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/ManagedEndpointFactory.java 2013-04-04 15:28:40.784614224 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/Reconfigurable.java 2013-04-04 15:28:41.048614228 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/Reconfigurable.java 2013-04-04 15:28:40.996614227 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/policy/ManagedClientAssertion.java 2013-04-04 15:28:41.256614232 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/policy/ManagedClientAssertion.java 2013-04-04 15:28:41.204614230 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/policy/ManagedServiceAssertion.java 2013-04-04 15:28:41.500614235 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/policy/ManagedServiceAssertion.java 2013-04-04 15:28:41.440614234 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/policy/ManagementAssertion.java 2013-04-04 15:28:41.712614239 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/config/management/policy/ManagementAssertion.java 2013-04-04 15:28:41.660614238 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/ClientCallBridge.java 2013-04-04 15:28:41.904614242 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/ClientCallBridge.java 2013-04-04 15:28:41.860614241 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.api.databinding; import java.lang.reflect.Method; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.JavaMethod; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/Databinding.java 2013-04-04 15:28:42.208614246 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/Databinding.java 2013-04-04 15:28:42.148614245 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 java.io.OutputStream; import java.lang.reflect.Method; -import javax.xml.ws.WebServiceFeature; +import com.sun.xml.internal.ws.api.message.MessageContextFactory; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.ContentType; import com.sun.xml.internal.ws.wsdl.DispatchException; @@ -61,7 +61,7 @@ * * @author shih-chang.chen@oracle.com */ -public interface Databinding extends com.sun.xml.internal.org.jvnet.ws.databinding.Databinding { +public interface Databinding extends com.oracle.webservices.internal.api.databinding.Databinding { /** * Gets the MessageFactory instance associated with this WsRuntime @@ -141,7 +141,15 @@ void generateWSDL(WSDLGenInfo info); + /** + * @deprecated use MessageContextFactory + */ public ContentType encode( Packet packet, OutputStream out ) throws IOException ; + /** + * @deprecated use MessageContextFactory + */ public void decode( InputStream in, String ct, Packet packet ) throws IOException; + + public MessageContextFactory getMessageContextFactory(); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingConfig.java 2013-04-04 15:28:42.516614251 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingConfig.java 2013-04-04 15:28:42.456614250 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingFactory.java 2013-04-04 15:28:42.820614256 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingFactory.java 2013-04-04 15:28:42.768614255 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +56,7 @@ * * @author shih-chang.chen@oracle.com */ -public abstract class DatabindingFactory extends com.sun.xml.internal.org.jvnet.ws.databinding.DatabindingFactory { +public abstract class DatabindingFactory extends com.oracle.webservices.internal.api.databinding.DatabindingFactory { /** * Creates a new instance of a WsTool. @@ -73,7 +73,7 @@ * the EndpointRuntimeConfig to init this WsRuntime * @return New instance of a WsRuntime */ - abstract public com.sun.xml.internal.org.jvnet.ws.databinding.Databinding createRuntime(DatabindingConfig config); + abstract public com.oracle.webservices.internal.api.databinding.Databinding createRuntime(DatabindingConfig config); /** * Creates a new instance of a XsTool. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/EndpointCallBridge.java 2013-04-04 15:28:43.120614261 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/EndpointCallBridge.java 2013-04-04 15:28:43.064614259 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.api.databinding; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.JavaMethod; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/JavaCallInfo.java 2013-04-04 15:28:43.424614265 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/JavaCallInfo.java 2013-04-04 15:28:43.364614264 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +45,7 @@ * * @author shih-chang.chen@oracle.com */ -public class JavaCallInfo implements com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo { +public class JavaCallInfo implements com.oracle.webservices.internal.api.databinding.JavaCallInfo { private Method method; private Object[] parameters; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/MappingInfo.java 2013-04-04 15:28:43.740614270 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/MappingInfo.java 2013-04-04 15:28:43.680614269 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 @@ protected BindingID bindingID; protected QName serviceName; protected QName portName; + protected String defaultSchemaNamespaceSuffix; - public String getTargetNamespace() { + public String getTargetNamespace() { return targetNamespace; } public void setTargetNamespace(String targetNamespace) { @@ -82,4 +83,10 @@ public void setPortName(QName portName) { this.portName = portName; } + public String getDefaultSchemaNamespaceSuffix() { + return defaultSchemaNamespaceSuffix; + } + public void setDefaultSchemaNamespaceSuffix(String defaultSchemaNamespaceSuffix) { + this.defaultSchemaNamespaceSuffix = defaultSchemaNamespaceSuffix; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/MetadataReader.java 2013-04-04 15:28:44.044614275 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/MetadataReader.java 2013-04-04 15:28:43.980614274 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/SoapBodyStyle.java 2013-04-04 15:28:44.356614280 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/SoapBodyStyle.java 2013-04-04 15:28:44.300614278 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/WSDLGenInfo.java 2013-04-04 15:28:44.676614285 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/WSDLGenInfo.java 2013-04-04 15:28:44.616614284 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,9 +25,9 @@ package com.sun.xml.internal.ws.api.databinding; +import com.oracle.webservices.internal.api.databinding.WSDLResolver; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension; -import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver; /** * WSDLGenInfo provides the WSDL generation options @@ -38,6 +38,7 @@ WSDLResolver wsdlResolver; Container container; boolean inlineSchemas; + boolean secureXmlProcessingDisabled; WSDLGeneratorExtension[] extensions; public WSDLResolver getWsdlResolver() { @@ -59,9 +60,18 @@ this.inlineSchemas = inlineSchemas; } public WSDLGeneratorExtension[] getExtensions() { + if (extensions == null) return new WSDLGeneratorExtension[0]; return extensions; } public void setExtensions(WSDLGeneratorExtension[] extensions) { this.extensions = extensions; } + + public void setSecureXmlProcessingDisabled(boolean secureXmlProcessingDisabled) { + this.secureXmlProcessingDisabled = secureXmlProcessingDisabled; + } + + public boolean isSecureXmlProcessingDisabled() { + return secureXmlProcessingDisabled; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java 2013-04-04 15:28:44.980614289 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java 2013-04-04 15:28:44.920614289 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ha/HaInfo.java 2013-04-04 15:28:45.292614294 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ha/HaInfo.java 2013-04-04 15:28:45.236614293 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ha/StickyFeature.java 2013-04-04 15:28:45.616614299 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/ha/StickyFeature.java 2013-04-04 15:28:45.556614298 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/handler/MessageHandler.java 2013-04-04 15:28:45.928614304 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/handler/MessageHandler.java 2013-04-04 15:28:45.868614303 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/handler/MessageHandlerContext.java 2013-04-04 15:28:46.228614309 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/handler/MessageHandlerContext.java 2013-04-04 15:28:46.172614308 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Attachment.java 2013-04-04 15:28:46.524614314 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Attachment.java 2013-04-04 15:28:46.460614313 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,19 @@ /** * Content ID of the attachment. Uniquely identifies an attachment. * + * http://www.ietf.org/rfc/rfc2392.txt (which is referred by the ws-i attachment profile + * http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html) + * + * content-id = url-addr-spec + * url-addr-spec = addr-spec ; URL encoding of RFC 822 addr-spec + * cid-url = "cid" ":" content-id + * + * A "cid" URL is converted to the corresponding Content-ID message header [MIME] by + * removing the "cid:" prefix, converting the % encoded character to their equivalent + * US-ASCII characters, and enclosing the remaining parts with an angle bracket pair, + * "<" and ">". For example, "cid:foo4%25foo1@bar.net" corresponds to + * Content-ID: + * * @return * The content ID like "foo-bar-zot@abc.com", without * surrounding '<' and '>' used as the transfer syntax. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/AttachmentEx.java 2013-04-04 15:28:46.816614318 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/AttachmentEx.java 2013-04-04 15:28:46.768614317 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/AttachmentSet.java 2013-04-04 15:28:47.104614323 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/AttachmentSet.java 2013-04-04 15:28:47.048614321 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/ExceptionHasMessage.java 2013-04-04 15:28:47.412614327 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/ExceptionHasMessage.java 2013-04-04 15:28:47.352614326 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ * with a specific protocol wire format. For example, the SOAP's * VersionMismatchFault needs to be written with a correct fault code. * In that case, decoder could throw {@link VersionMismatchException}, - * and the correspoinding fault {@link Message} from {@link ExceptionHasMessage::getFaultMessage} + * and the corresponding fault {@link Message} from {@link ExceptionHasMessage#getFaultMessage()} * is sent on the wire. * * @author Jitendra Kotamraju --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/FilterMessageImpl.java 2013-04-04 15:28:47.712614332 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/FilterMessageImpl.java 2013-04-04 15:28:47.648614331 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -73,7 +73,7 @@ return delegate.hasHeaders(); } - public @NotNull HeaderList getHeaders() { + public @NotNull MessageHeaders getHeaders() { return delegate.getHeaders(); } @@ -168,4 +168,8 @@ public @NotNull String getID(AddressingVersion av, SOAPVersion sv) { return delegate.getID(av, sv); } + + public SOAPVersion getSOAPVersion() { + return delegate.getSOAPVersion(); + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Header.java 2013-04-04 15:28:48.024614337 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Header.java 2013-04-04 15:28:47.960614336 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/HeaderList.java 2013-04-04 15:28:48.328614342 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/HeaderList.java 2013-04-04 15:28:48.272614340 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,33 +25,30 @@ package com.sun.xml.internal.ws.api.message; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; + +import javax.xml.namespace.QName; +import javax.xml.ws.WebServiceException; + import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.addressing.WsaTubeHelper; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; -import com.sun.xml.internal.ws.api.addressing.OneWayFeature; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.pipe.Codec; import com.sun.xml.internal.ws.api.pipe.Pipe; -import com.sun.xml.internal.ws.message.RelatesToHeader; -import com.sun.xml.internal.ws.message.StringHeader; +import com.sun.xml.internal.ws.binding.SOAPBindingImpl; import com.sun.xml.internal.ws.protocol.soap.ClientMUTube; import com.sun.xml.internal.ws.protocol.soap.ServerMUTube; -import com.sun.xml.internal.ws.resources.AddressingMessages; -import com.sun.xml.internal.ws.resources.ClientMessages; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.ws.WebServiceException; -import javax.xml.ws.soap.SOAPBinding; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.Iterator; -import java.util.NoSuchElementException; +import java.util.Arrays; /** * A list of {@link Header}s on a {@link Message}. @@ -113,7 +110,7 @@ * * @see Message#getHeaders() */ -public class HeaderList extends ArrayList

{ +public class HeaderList extends ArrayList
implements MessageHeaders { private static final long serialVersionUID = -6358045781349627237L; /** @@ -132,13 +129,26 @@ */ private BitSet moreUnderstoodBits = null; + private SOAPVersion soapVersion; + /** + * This method is deprecated - instead use this one: + * public HeaderList(SOAPVersion) * Creates an empty {@link HeaderList}. */ + @Deprecated public HeaderList() { } /** + * Creates an empty {@link HeaderList} with the given soap version + * @param soapVersion + */ + public HeaderList(SOAPVersion soapVersion) { + this.soapVersion = soapVersion; + } + + /** * Copy constructor. */ public HeaderList(HeaderList that) { @@ -149,6 +159,24 @@ } } + public HeaderList(MessageHeaders that) { + super(that.asList()); + if (that instanceof HeaderList) { + HeaderList hThat = (HeaderList) that; + this.understoodBits = hThat.understoodBits; + if (hThat.moreUnderstoodBits != null) { + this.moreUnderstoodBits = (BitSet) hThat.moreUnderstoodBits.clone(); + } + } else { + Set understood = that.getUnderstoodHeaders(); + if (understood != null) { + for (QName qname : understood) { + understood(qname); + } + } + } + } + /** * The total number of headers. */ @@ -157,13 +185,18 @@ return super.size(); } + @Override + public boolean hasHeaders() { + return !isEmpty(); + } + /** * Adds all the headers. + * @deprecated throws UnsupportedOperationException from some HeaderList implementations - better iterate over items one by one */ + @Deprecated public void addAll(Header... headers) { - for (Header header : headers) { - add(header); - } + addAll(Arrays.asList(headers)); } /** @@ -233,6 +266,7 @@ * if the given header is not {@link #contains(Object) contained} * in this header. */ + @Override public void understood(@NotNull Header header) { int sz = size(); for (int i = 0; i < sz; i++) { @@ -252,9 +286,8 @@ * be marked as "understood". * @return null if not found. */ - public - @Nullable - Header get(@NotNull String nsUri, @NotNull String localName, boolean markAsUnderstood) { + @Override + public @Nullable Header get(@NotNull String nsUri, @NotNull String localName, boolean markAsUnderstood) { int len = size(); for (int i = 0; i < len; i++) { Header h = get(i); @@ -285,9 +318,8 @@ * @return null * if not found. */ - public - @Nullable - Header get(@NotNull QName name, boolean markAsUnderstood) { + @Override + public @Nullable Header get(@NotNull QName name, boolean markAsUnderstood) { return get(name.getNamespaceURI(), name.getLocalPart(), markAsUnderstood); } @@ -321,12 +353,14 @@ */ public @NotNull + @Override Iterator
getHeaders(@NotNull final String nsUri, @NotNull final String localName, final boolean markAsUnderstood) { return new Iterator
() { int idx = 0; Header next; + @Override public boolean hasNext() { if (next == null) { fetch(); @@ -334,6 +368,7 @@ return next != null; } + @Override public Header next() { if (next == null) { fetch(); @@ -362,6 +397,7 @@ } } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -373,6 +409,7 @@ */ public @NotNull + @Override Iterator
getHeaders(@NotNull QName headerName, final boolean markAsUnderstood) { return getHeaders(headerName.getNamespaceURI(), headerName.getLocalPart(), markAsUnderstood); } @@ -400,12 +437,14 @@ */ public @NotNull + @Override Iterator
getHeaders(@NotNull final String nsUri, final boolean markAsUnderstood) { return new Iterator
() { int idx = 0; Header next; + @Override public boolean hasNext() { if (next == null) { fetch(); @@ -413,6 +452,7 @@ return next != null; } + @Override public Header next() { if (next == null) { fetch(); @@ -441,6 +481,7 @@ } } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -448,33 +489,6 @@ } /** - * Gets the first {@link Header} of the specified name targeted at the - * current implicit role. - * - * @param name name of the header - * @param markUnderstood - * If this parameter is true, the returned headers will - * be marked as "understood" when they are returned - * from {@link Iterator#next()}. - * @return null if header not found - */ - private Header getFirstHeader(QName name, boolean markUnderstood, SOAPVersion sv) { - if (sv == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION()); - } - - Iterator
iter = getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood); - while (iter.hasNext()) { - Header h = iter.next(); - if (h.getRole(sv).equals(sv.implicitRole)) { - return h; - } - } - - return null; - } - - /** * Returns the value of WS-Addressing To header. The version * identifies the WS-Addressing version and the header returned is targeted at * the current implicit role. Caches the value for subsequent invocation. @@ -486,19 +500,7 @@ * @return Value of WS-Addressing To header, anonymous URI if no header is present */ public String getTo(AddressingVersion av, SOAPVersion sv) { - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - Header h = getFirstHeader(av.toTag, true, sv); - String to; - if (h != null) { - to = h.getStringContent(); - } else { - to = av.anonymousUri; - } - - return to; + return AddressingUtils.getTo(this, av, sv); } /** @@ -513,17 +515,7 @@ * @return Value of WS-Addressing Action header, null if no header is present */ public String getAction(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - String action = null; - Header h = getFirstHeader(av.actionTag, true, sv); - if (h != null) { - action = h.getStringContent(); - } - - return action; + return AddressingUtils.getAction(this, av, sv); } /** @@ -538,23 +530,7 @@ * @return Value of WS-Addressing ReplyTo header, null if no header is present */ public WSEndpointReference getReplyTo(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - Header h = getFirstHeader(av.replyToTag, true, sv); - WSEndpointReference replyTo; - if (h != null) { - try { - replyTo = h.readAsEPR(av); - } catch (XMLStreamException e) { - throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e); - } - } else { - replyTo = av.anonymousEpr; - } - - return replyTo; + return AddressingUtils.getReplyTo(this, av, sv); } /** @@ -569,21 +545,7 @@ * @return Value of WS-Addressing FaultTo header, null if no header is present */ public WSEndpointReference getFaultTo(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - Header h = getFirstHeader(av.faultToTag, true, sv); - WSEndpointReference faultTo = null; - if (h != null) { - try { - faultTo = h.readAsEPR(av); - } catch (XMLStreamException e) { - throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e); - } - } - - return faultTo; + return AddressingUtils.getFaultTo(this, av, sv); } /** @@ -598,17 +560,7 @@ * @return Value of WS-Addressing MessageID header, null if no header is present */ public String getMessageID(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - Header h = getFirstHeader(av.messageIDTag, true, sv); - String messageId = null; - if (h != null) { - messageId = h.getStringContent(); - } - - return messageId; + return AddressingUtils.getMessageID(this, av, sv); } /** @@ -623,17 +575,7 @@ * @return Value of WS-Addressing RelatesTo header, null if no header is present */ public String getRelatesTo(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) { - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - Header h = getFirstHeader(av.relatesToTag, true, sv); - String relatesTo = null; - if (h != null) { - relatesTo = h.getStringContent(); - } - - return relatesTo; + return AddressingUtils.getRelatesTo(this, av, sv); } /** @@ -654,33 +596,11 @@ * @param mustUnderstand to indicate if the addressing headers are set with mustUnderstand attribute */ public void fillRequestAddressingHeaders(Packet packet, AddressingVersion av, SOAPVersion sv, boolean oneway, String action, boolean mustUnderstand) { - fillCommonAddressingHeaders(packet, av, sv, action, mustUnderstand); - - // wsa:ReplyTo - // null or "true" is equivalent to request/response MEP - if (!oneway) { - WSEndpointReference epr = av.anonymousEpr; - if (get(av.replyToTag, false) == null) { - add(epr.createHeader(av.replyToTag)); - } - - // wsa:FaultTo - if (get(av.faultToTag, false) == null) { - add(epr.createHeader(av.faultToTag)); - } - - // wsa:MessageID - if (packet.getMessage().getHeaders().get(av.messageIDTag, false) == null) { - if (get(av.messageIDTag, false) == null) { - Header h = new StringHeader(av.messageIDTag, Message.generateMessageID()); - add(h); - } - } - } + AddressingUtils.fillRequestAddressingHeaders(this, packet, av, sv, oneway, action, mustUnderstand); } public void fillRequestAddressingHeaders(Packet packet, AddressingVersion av, SOAPVersion sv, boolean oneway, String action) { - fillRequestAddressingHeaders(packet, av, sv, oneway, action, false); + AddressingUtils.fillRequestAddressingHeaders(this, packet, av, sv, oneway, action); } /** @@ -703,141 +623,7 @@ * @param packet request packet */ public void fillRequestAddressingHeaders(WSDLPort wsdlPort, @NotNull WSBinding binding, Packet packet) { - if (binding == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_BINDING()); - } - - if (binding.isFeatureEnabled(SuppressAutomaticWSARequestHeadersFeature.class)) - return; - - //See if WSA headers are already set by the user. - HeaderList hl = packet.getMessage().getHeaders(); - String action = hl.getAction(binding.getAddressingVersion(), binding.getSOAPVersion()); - if (action != null) { - //assume that all the WSA headers are set by the user - return; - } - AddressingVersion addressingVersion = binding.getAddressingVersion(); - //seiModel is passed as null as it is not needed. - WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, null, binding); - - // wsa:Action - String effectiveInputAction = wsaHelper.getEffectiveInputAction(packet); - if (effectiveInputAction == null || effectiveInputAction.equals("") && binding.getSOAPVersion() == SOAPVersion.SOAP_11) { - throw new WebServiceException(ClientMessages.INVALID_SOAP_ACTION()); - } - boolean oneway = !packet.expectReply; - if (wsdlPort != null) { - // if WSDL has prohibited, then throw an error - // as anonymous ReplyTo MUST NOT be added in that case. BindingProvider need to - // disable AddressingFeature and MemberSubmissionAddressingFeature and hand-craft - // the SOAP message with non-anonymous ReplyTo/FaultTo. - if (!oneway && packet.getMessage() != null && packet.getWSDLOperation() != null) { - WSDLBoundOperation wbo = wsdlPort.getBinding().get(packet.getWSDLOperation()); - if (wbo != null && wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited) { - throw new WebServiceException(AddressingMessages.WSAW_ANONYMOUS_PROHIBITED()); - } - } - } - if (!binding.isFeatureEnabled(OneWayFeature.class)) { - // standard oneway - fillRequestAddressingHeaders(packet, addressingVersion, binding.getSOAPVersion(), oneway, effectiveInputAction, addressingVersion.isRequired(binding)); - } else { - // custom oneway - fillRequestAddressingHeaders(packet, addressingVersion, binding.getSOAPVersion(), binding.getFeature(OneWayFeature.class), oneway, effectiveInputAction); - } - } - - private void fillRequestAddressingHeaders(@NotNull Packet packet, @NotNull AddressingVersion av, @NotNull SOAPVersion sv, @NotNull OneWayFeature of, boolean oneway, @NotNull String action) { - if (!oneway&&!of.isUseAsyncWithSyncInvoke() && Boolean.TRUE.equals(packet.isSynchronousMEP)) - fillRequestAddressingHeaders(packet, av, sv, oneway, action); - else { - fillCommonAddressingHeaders(packet, av, sv, action, false); - - // wsa:ReplyTo - // wsa:ReplyTo (add it if it doesn't already exist and OnewayFeature - // requests a specific ReplyTo) - if (get(av.replyToTag, false) == null) { - WSEndpointReference replyToEpr = of.getReplyTo(); - if (replyToEpr != null) { - add(replyToEpr.createHeader(av.replyToTag)); - // add wsa:MessageID only for non-null ReplyTo - if (packet.getMessage().getHeaders().get(av.messageIDTag, false) == null) { - // if header doesn't exist, method getID creates a new random id - String newID = Message.generateMessageID(); - add(new StringHeader(av.messageIDTag, newID)); - } - } - } - - // wsa:FaultTo - // wsa:FaultTo (add it if it doesn't already exist and OnewayFeature - // requests a specific FaultTo) - if (get(av.faultToTag, false) == null) { - WSEndpointReference faultToEpr = of.getFaultTo(); - if (faultToEpr != null) { - add(faultToEpr.createHeader(av.faultToTag)); - // add wsa:MessageID only for non-null FaultTo - if (get(av.messageIDTag, false) == null) { - add(new StringHeader(av.messageIDTag, Message.generateMessageID())); - } - } - } - - // wsa:From - if (of.getFrom() != null) { - addOrReplace(of.getFrom().createHeader(av.fromTag)); - } - - // wsa:RelatesTo - if (of.getRelatesToID() != null) { - addOrReplace(new RelatesToHeader(av.relatesToTag, of.getRelatesToID())); - } - } - } - - /** - * Creates wsa:To, wsa:Action and wsa:MessageID header on the client - * - * @param packet request packet - * @param av WS-Addressing version - * @param sv SOAP version - * @param action Action Message Addressing Property value - * @throws IllegalArgumentException if any of the parameters is null. - */ - private void fillCommonAddressingHeaders(Packet packet, @NotNull AddressingVersion av, @NotNull SOAPVersion sv, @NotNull String action, boolean mustUnderstand) { - if (packet == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_PACKET()); - } - - if (av == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION()); - } - - if (sv == null) { - throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION()); - } - - if (action == null && !sv.httpBindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)) { - throw new IllegalArgumentException(AddressingMessages.NULL_ACTION()); - } - - // wsa:To - if (get(av.toTag, false) == null) { - StringHeader h = new StringHeader(av.toTag, packet.endpointAddress.toString()); - add(h); - } - - // wsa:Action - if (action != null) { - packet.soapAction = action; - if (get(av.actionTag, false) == null) { - //As per WS-I BP 1.2/2.0, if one of the WSA headers is MU, then all WSA headers should be treated as MU., - // so just set MU on action header - StringHeader h = new StringHeader(av.actionTag, action, sv, mustUnderstand); - add(h); - } - } + AddressingUtils.fillRequestAddressingHeaders(this, wsdlPort, binding, packet); } /** @@ -865,6 +651,7 @@ */ public @Nullable + @Override Header remove(@NotNull String nsUri, @NotNull String localName) { int len = size(); for (int i = 0; i < len; i++) { @@ -887,6 +674,7 @@ * @return * always true. Don't use the return value. */ + @Override public boolean addOrReplace(Header header) { for (int i=0; i < size(); i++) { Header hdr = get(i); @@ -902,6 +690,23 @@ return add(header); } + @Override + public void replace(Header old, Header header) { + for (int i=0; i < size(); i++) { + Header hdr = get(i); + if (hdr.getNamespaceURI().equals(header.getNamespaceURI()) && + hdr.getLocalPart().equals(header.getLocalPart())) { + // Put the new header in the old position. Call super versions + // internally to avoid UnsupportedOperationException + removeInternal(i); + addInternal(i, header); + return; + } + } + + throw new IllegalArgumentException(); + } + protected void addInternal(int index, Header header) { super.add(index, header); } @@ -919,6 +724,7 @@ */ public @Nullable + @Override Header remove(@NotNull QName name) { return remove(name.getNamespaceURI(), name.getLocalPart()); } @@ -1010,16 +816,25 @@ @Override public boolean remove(Object o) { if (o != null) { - for (int index = 0; index < this.size(); index++) + for (int index = 0; index < this.size(); index++) { if (o.equals(this.get(index))) { remove(index); return true; } + } } return false; } + public Header remove(Header h) { + if (remove((Object) h)) { + return h; + } else { + return null; + } + } + /** * Creates a copy. * @@ -1028,7 +843,7 @@ * @param original * Can be null, in which case null will be returned. */ - public static HeaderList copy(HeaderList original) { + public static HeaderList copy(MessageHeaders original) { if (original == null) { return null; } else { @@ -1036,9 +851,126 @@ } } + /** + * Creates a copy. + * + * This handles null {@link HeaderList} correctly. + * + * @param original + * Can be null, in which case null will be returned. + */ + public static HeaderList copy(HeaderList original) { + return copy((MessageHeaders) original); + } + public void readResponseAddressingHeaders(WSDLPort wsdlPort, WSBinding binding) { // read Action - String wsaAction = getAction(binding.getAddressingVersion(), binding.getSOAPVersion()); +// String wsaAction = getAction(binding.getAddressingVersion(), binding.getSOAPVersion()); // TODO: validate client-inbound Action } + + @Override + public void understood(QName name) { + get(name, true); + } + + @Override + public void understood(String nsUri, String localName) { + get(nsUri, localName, true); + } + + @Override + public Set getUnderstoodHeaders() { + Set understoodHdrs = new HashSet(); + for (int i = 0; i < size(); i++) { + if (isUnderstood(i)) { + Header header = get(i); + understoodHdrs.add(new QName(header.getNamespaceURI(), header.getLocalPart())); + } + } + return understoodHdrs; +// throw new UnsupportedOperationException("getUnderstoodHeaders() is not implemented by HeaderList"); + } + + @Override + public boolean isUnderstood(Header header) { + return isUnderstood(header.getNamespaceURI(), header.getLocalPart()); + } + + @Override + public boolean isUnderstood(String nsUri, String localName) { + for (int i = 0; i < size(); i++) { + Header h = get(i); + if (h.getLocalPart().equals(localName) && h.getNamespaceURI().equals(nsUri)) { + return isUnderstood(i); + } + } + return false; + } + + @Override + public boolean isUnderstood(QName name) { + return isUnderstood(name.getNamespaceURI(), name.getLocalPart()); + } + + @Override + public Set getNotUnderstoodHeaders(Set roles, Set knownHeaders, WSBinding binding) { + Set notUnderstoodHeaders = null; + if (roles == null) { + roles = new HashSet(); + } + SOAPVersion effectiveSoapVersion = getEffectiveSOAPVersion(binding); + roles.add(effectiveSoapVersion.implicitRole); + for (int i = 0; i < size(); i++) { + if (!isUnderstood(i)) { + Header header = get(i); + if (!header.isIgnorable(effectiveSoapVersion, roles)) { + QName qName = new QName(header.getNamespaceURI(), header.getLocalPart()); + if (binding == null) { + //if binding is null, no further checks needed...we already + //know this header is not understood from the isUnderstood + //check above + if (notUnderstoodHeaders == null) { + notUnderstoodHeaders = new HashSet(); + } + notUnderstoodHeaders.add(qName); + } else { + // if the binding is not null, see if the binding can understand it + if (binding instanceof SOAPBindingImpl && !((SOAPBindingImpl) binding).understandsHeader(qName)) { + if (!knownHeaders.contains(qName)) { + //logger.info("Element not understood=" + qName); + if (notUnderstoodHeaders == null) { + notUnderstoodHeaders = new HashSet(); + } + notUnderstoodHeaders.add(qName); + } + } + } + } + } + } + return notUnderstoodHeaders; + } + + private SOAPVersion getEffectiveSOAPVersion(WSBinding binding) { + SOAPVersion mySOAPVersion = (soapVersion != null) ? soapVersion : binding.getSOAPVersion(); + if (mySOAPVersion == null) { + mySOAPVersion = SOAPVersion.SOAP_11; + } + return mySOAPVersion; + } + + public void setSoapVersion(SOAPVersion soapVersion) { + this.soapVersion = soapVersion; + } + + @Override + public Iterator
getHeaders() { + return iterator(); + } + + @Override + public List
asList() { + return this; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Headers.java 2013-04-04 15:28:48.632614346 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Headers.java 2013-04-04 15:28:48.576614345 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Message.java 2013-04-04 15:28:48.928614350 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Message.java 2013-04-04 15:28:48.880614350 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -34,6 +34,7 @@ import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; @@ -56,6 +57,7 @@ import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.namespace.QName; +import javax.xml.soap.MimeHeaders; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPMessage; import javax.xml.stream.XMLStreamException; @@ -67,6 +69,8 @@ import java.io.InputStream; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.util.List; +import java.util.Map; import java.util.UUID; /** @@ -206,14 +210,14 @@ *

Implementation Note

*

* {@link Message} implementation is allowed to defer - * the construction of {@link HeaderList} object. So + * the construction of {@link MessageHeaders} object. So * if you only want to check for the existence of any header * element, use {@link #hasHeaders()}. * * @return * always return the same non-null object. */ - public abstract @NotNull HeaderList getHeaders(); + public abstract @NotNull MessageHeaders getHeaders(); /** * Gets the attachments of this message @@ -238,6 +242,15 @@ private WSDLBoundOperation operation = null; + private WSDLOperationMapping wsdlOperationMapping = null; + + private MessageMetadata messageMetadata = null; + + public void setMessageMedadata(MessageMetadata metadata) { + messageMetadata = metadata; + } + + /** * Returns the operation of which this message is an instance of. * @@ -267,6 +280,10 @@ */ @Deprecated public final @Nullable WSDLBoundOperation getOperation(@NotNull WSDLBoundPortType boundPortType) { + if (operation == null && messageMetadata != null) { + if (wsdlOperationMapping == null) wsdlOperationMapping = messageMetadata.getWSDLOperationMapping(); + if (wsdlOperationMapping != null) operation = wsdlOperationMapping.getWSDLBoundOperation(); + } if(operation==null) operation = boundPortType.getOperation(getPayloadNamespaceURI(),getPayloadLocalPart()); return operation; @@ -312,6 +329,13 @@ */ @Deprecated public final @Nullable JavaMethod getMethod(@NotNull SEIModel seiModel) { + if (wsdlOperationMapping == null && messageMetadata != null) { + wsdlOperationMapping = messageMetadata.getWSDLOperationMapping(); + } + if (wsdlOperationMapping != null) { + return wsdlOperationMapping.getJavaMethod(); + } + //fall back to the original logic which could be incorrect ... String localPart = getPayloadLocalPart(); String nsUri; if (localPart == null) { @@ -509,6 +533,28 @@ return readAsSOAPMessage(); } + public static Map> getTransportHeaders(Packet packet) { + return getTransportHeaders(packet, packet.getState().isInbound()); + } + + public static Map> getTransportHeaders(Packet packet, boolean inbound) { + Map> headers = null; + String key = inbound ? Packet.INBOUND_TRANSPORT_HEADERS : Packet.OUTBOUND_TRANSPORT_HEADERS; + if (packet.supports(key)) { + headers = (Map>)packet.get(key); + } + return headers; + } + + public static void addSOAPMimeHeaders(MimeHeaders mh, Map> headers) { + for(Map.Entry> e : headers.entrySet()) { + if (!e.getKey().equalsIgnoreCase("Content-Type")) { + for(String value : e.getValue()) { + mh.addHeader(e.getKey(), value); + } + } + } + } /** * Reads the payload as a JAXB object by using the given unmarshaller. * @@ -720,7 +766,7 @@ public @NotNull String getID(AddressingVersion av, SOAPVersion sv) { String uuid = null; if (av != null) { - uuid = getHeaders().getMessageID(av, sv); + uuid = AddressingUtils.getMessageID(getHeaders(), av, sv); } if (uuid == null) { uuid = generateMessageID(); @@ -736,4 +782,8 @@ public static String generateMessageID() { return "uuid:" + UUID.randomUUID().toString(); } + + public SOAPVersion getSOAPVersion() { + return null; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/MessageContextFactory.java 2013-04-04 15:28:49.264614356 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/MessageContextFactory.java 2013-04-04 15:28:49.200614355 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,27 +27,35 @@ import java.io.IOException; import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import javax.xml.soap.MimeHeader; +import javax.xml.soap.MimeHeaders; import javax.xml.soap.SOAPMessage; import javax.xml.transform.Source; import javax.xml.ws.WebServiceFeature; +import javax.xml.ws.soap.MTOMFeature; -import com.sun.xml.internal.org.jvnet.ws.EnvelopeStyle; -import com.sun.xml.internal.org.jvnet.ws.EnvelopeStyleFeature; -import com.sun.xml.internal.org.jvnet.ws.message.MessageContext; - +import com.oracle.webservices.internal.api.EnvelopeStyle; +import com.oracle.webservices.internal.api.EnvelopeStyleFeature; +import com.oracle.webservices.internal.api.message.MessageContext; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSFeatureList; import com.sun.xml.internal.ws.api.pipe.Codec; import com.sun.xml.internal.ws.api.pipe.Codecs; +import static com.sun.xml.internal.ws.transport.http.HttpAdapter.fixQuotesAroundSoapAction; /** - * The MessageContextFactory implements com.sun.xml.internal.org.jvnet.ws.message.MessageContextFactory as + * The MessageContextFactory implements com.oracle.webservices.internal.api.message.MessageContextFactory as * a factory of Packet and public facade of Codec(s). * * @author shih-chang.chen@oracle.com */ -public class MessageContextFactory extends com.sun.xml.internal.org.jvnet.ws.message.MessageContextFactory { +public class MessageContextFactory extends com.oracle.webservices.internal.api.message.MessageContextFactory { private WSFeatureList features; private Codec soapCodec; @@ -76,46 +84,105 @@ } } - protected com.sun.xml.internal.org.jvnet.ws.message.MessageContextFactory newFactory(WebServiceFeature... f) { + protected com.oracle.webservices.internal.api.message.MessageContextFactory newFactory(WebServiceFeature... f) { return new com.sun.xml.internal.ws.api.message.MessageContextFactory(f); } - public MessageContext createContext(SOAPMessage soap) { + + public com.oracle.webservices.internal.api.message.MessageContext createContext() { + return packet(null); + } + + public com.oracle.webservices.internal.api.message.MessageContext createContext(SOAPMessage soap) { + throwIfIllegalMessageArgument(soap); return packet(Messages.create(soap)); } - public MessageContext createContext(Source m, EnvelopeStyle.Style envelopeStyle) { + public MessageContext createContext(Source m, com.oracle.webservices.internal.api.EnvelopeStyle.Style envelopeStyle) { + throwIfIllegalMessageArgument(m); return packet(Messages.create(m, SOAPVersion.from(envelopeStyle))); } - public MessageContext createContext(Source m) { + public com.oracle.webservices.internal.api.message.MessageContext createContext(Source m) { + throwIfIllegalMessageArgument(m); return packet(Messages.create(m, SOAPVersion.from(singleSoapStyle))); } - public MessageContext createContext(InputStream in, String contentType) throws IOException { + public com.oracle.webservices.internal.api.message.MessageContext createContext(InputStream in, String contentType) throws IOException { + throwIfIllegalMessageArgument(in); //TODO when do we use xmlCodec? Packet p = packet(null); soapCodec.decode(in, contentType, p); return p; } + /** + * @deprecated http://java.net/jira/browse/JAX_WS-1077 + */ + @Deprecated + public com.oracle.webservices.internal.api.message.MessageContext createContext(InputStream in, MimeHeaders headers) throws IOException { + String contentType = getHeader(headers, "Content-Type"); + Packet packet = (Packet) createContext(in, contentType); + packet.acceptableMimeTypes = getHeader(headers, "Accept"); + packet.soapAction = fixQuotesAroundSoapAction(getHeader(headers, "SOAPAction")); +// packet.put(Packet.INBOUND_TRANSPORT_HEADERS, toMap(headers)); + return packet; + } + + static String getHeader(MimeHeaders headers, String name) { + String[] values = headers.getHeader(name); + return (values != null && values.length > 0) ? values[0] : null; + } + + static Map> toMap(MimeHeaders headers) { + HashMap> map = new HashMap>(); + for (Iterator i = headers.getAllHeaders(); i.hasNext();) { + MimeHeader mh = i.next(); + List values = map.get(mh.getName()); + if (values == null) { + values = new ArrayList(); + map.put(mh.getName(), values); + } + values.add(mh.getValue()); + } + return map; + } + + public MessageContext createContext(Message m) { + throwIfIllegalMessageArgument(m); + return packet(m); + } + private Packet packet(Message m) { final Packet p = new Packet(); //TODO when do we use xmlCodec? p.codec = soapCodec; if (m != null) p.setMessage(m); + MTOMFeature mf = features.get(MTOMFeature.class); + if (mf != null) { + p.setMtomFeature(mf); + } return p; } + private void throwIfIllegalMessageArgument(Object message) + throws IllegalArgumentException + { + if (message == null) { + throw new IllegalArgumentException("null messages are not allowed. Consider using MessageContextFactory.createContext()"); + } + } - - public MessageContext doCreate() { + @Deprecated + public com.oracle.webservices.internal.api.message.MessageContext doCreate() { return packet(null); } - public MessageContext doCreate(SOAPMessage m) { + @Deprecated + public com.oracle.webservices.internal.api.message.MessageContext doCreate(SOAPMessage m) { return createContext(m); } - public MessageContext doCreate(Source x, SOAPVersion soapVersion) { + @Deprecated + public com.oracle.webservices.internal.api.message.MessageContext doCreate(Source x, SOAPVersion soapVersion) { return packet(Messages.create(x, soapVersion)); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Messages.java 2013-04-04 15:28:49.488614359 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Messages.java 2013-04-04 15:28:49.436614359 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -41,7 +41,6 @@ import com.sun.xml.internal.ws.message.ProblemActionHeader; import com.sun.xml.internal.ws.message.stream.PayloadStreamReaderMessage; import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; -import com.sun.xml.internal.ws.message.saaj.SAAJMessage; import com.sun.xml.internal.ws.message.source.PayloadSourceMessage; import com.sun.xml.internal.ws.message.source.ProtocolSourceMessage; import com.sun.xml.internal.ws.spi.db.BindingContextFactory; @@ -222,7 +221,7 @@ for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) { if(n.getNodeType()==Node.ELEMENT_NODE) { if(headers==null) - headers = new HeaderList(); + headers = new HeaderList(ver); headers.add(Headers.create((Element)n)); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Packet.java 2013-04-04 15:28:49.792614364 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Packet.java 2013-04-04 15:28:49.736614364 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,18 +25,23 @@ package com.sun.xml.internal.ws.api.message; +import com.oracle.webservices.internal.api.message.ContentType; +import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; import com.sun.xml.internal.ws.addressing.WsaPropertyBag; +import com.sun.xml.internal.ws.addressing.WsaServerTube; import com.sun.xml.internal.ws.addressing.WsaTubeHelper; -import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; -import com.sun.xml.internal.ws.api.*; +import com.sun.xml.internal.ws.api.Component; +import com.sun.xml.internal.ws.api.EndpointAddress; +import com.sun.xml.internal.ws.api.SOAPVersion; +import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; -import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.pipe.Codec; @@ -48,17 +53,16 @@ import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory; import com.sun.xml.internal.ws.client.*; import com.sun.xml.internal.ws.developer.JAXWSProperties; +import com.sun.xml.internal.ws.encoding.MtomCodec; import com.sun.xml.internal.ws.message.RelatesToHeader; import com.sun.xml.internal.ws.message.StringHeader; -import com.sun.xml.internal.ws.transport.http.WSHTTPConnection; -import com.sun.xml.internal.ws.message.saaj.SAAJMessage; -import com.sun.xml.internal.ws.server.WSEndpointImpl; import com.sun.xml.internal.ws.util.DOMUtil; import com.sun.xml.internal.ws.util.xml.XmlUtil; import com.sun.xml.internal.ws.wsdl.DispatchException; import com.sun.xml.internal.ws.wsdl.OperationDispatcher; +import com.sun.xml.internal.ws.resources.AddressingMessages; + -import com.sun.xml.internal.org.jvnet.ws.message.ContentType; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -67,6 +71,7 @@ import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPMessage; import javax.xml.stream.XMLStreamWriter; +import javax.xml.stream.XMLStreamException; import javax.xml.ws.BindingProvider; import javax.xml.ws.Dispatch; import javax.xml.ws.WebServiceContext; @@ -74,12 +79,13 @@ import javax.xml.ws.handler.LogicalMessageContext; import javax.xml.ws.handler.MessageContext; import javax.xml.ws.handler.soap.SOAPMessageContext; +import javax.xml.ws.soap.MTOMFeature; + import java.util.*; import java.util.logging.Logger; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; -import java.nio.ByteBuffer; import java.nio.channels.WritableByteChannel; /** @@ -142,7 +148,7 @@ *

  • this class needs to be cloneable since Message is copiable. *
  • The three live views aren't implemented correctly. It will be * more work to do so, although I'm sure it's possible. - *
  • {@link Property} annotation is to make it easy + *
  • {@link PropertySet.Property} annotation is to make it easy * for {@link MessageContext} to export properties on this object, * but it probably needs some clean up. * @@ -150,9 +156,10 @@ * @author Kohsuke Kawaguchi */ public final class Packet - extends DistributedPropertySet - implements com.sun.xml.internal.org.jvnet.ws.message.MessageContext -{ + // Packet must continue to extend/implement deprecated interfaces until downstream + // usage is updated. + extends com.oracle.webservices.internal.api.message.BaseDistributedPropertySet + implements com.oracle.webservices.internal.api.message.MessageContext, MessageMetadata { /** * Creates a {@link Packet} that wraps a given {@link Message}. @@ -167,6 +174,7 @@ public Packet(Message request) { this(); this.message = request; + if (message != null) message.setMessageMedadata(this); } /** @@ -180,24 +188,8 @@ * Used by {@link #createResponse(Message)} and {@link #copy(boolean)}. */ private Packet(Packet that) { - that.copySatelliteInto((DistributedPropertySet) this); - this.handlerConfig = that.handlerConfig; + relatePackets(that, true); this.invocationProperties = that.invocationProperties; - this.handlerScopePropertyNames = that.handlerScopePropertyNames; - this.contentNegotiation = that.contentNegotiation; - this.wasTransportSecure = that.wasTransportSecure; - this.transportBackChannel = that.transportBackChannel; - this.endpointAddress = that.endpointAddress; - this.isAdapterDeliversNonAnonymousResponse = that.isAdapterDeliversNonAnonymousResponse; - this.wsdlOperation = that.wsdlOperation; - this.acceptableMimeTypes = that.acceptableMimeTypes; - this.endpoint = that.endpoint; - this.proxy = that.proxy; - this.webServiceContextDelegate = that.webServiceContextDelegate; - this.soapAction = that.soapAction; - this.expectReply = that.expectReply; - this.component = that.component; - // copy other properties that need to be copied. is there any? } /** @@ -215,7 +207,7 @@ if (copyMessage && this.message != null) { copy.message = this.message.copy(); } - + if (copy.message != null) copy.message.setMessageMedadata(copy); return copy; } @@ -227,14 +219,23 @@ * @return may null. See the class javadoc for when it's null. */ public Message getMessage() { - return message; + if (message != null && !(message instanceof MessageWrapper)) { + message = new MessageWrapper(this, message); + } + return message; + } + + public Message getInternalMessage() { + return (message instanceof MessageWrapper)? ((MessageWrapper)message).delegate : message; } public WSBinding getBinding() { - if (endpoint != null) - return endpoint.getBinding(); - if (proxy != null) - return (WSBinding) proxy.getBinding(); + if (endpoint != null) { + return endpoint.getBinding(); + } + if (proxy != null) { + return (WSBinding) proxy.getBinding(); + } return null; } /** @@ -244,8 +245,11 @@ */ public void setMessage(Message message) { this.message = message; + if (message != null) this.message.setMessageMedadata(this); } + private WSDLOperationMapping wsdlOperationMapping = null; + private QName wsdlOperation; /** @@ -257,29 +261,34 @@ * @return null if there is no WSDL model or * runtime cannot uniquely identify the wsdl operation from the information in the packet. */ - @com.sun.xml.internal.ws.api.PropertySet.Property(MessageContext.WSDL_OPERATION) + @Property(MessageContext.WSDL_OPERATION) public final @Nullable QName getWSDLOperation() { - if (wsdlOperation != null) - return wsdlOperation; + if (wsdlOperation != null) return wsdlOperation; + if ( wsdlOperationMapping == null) wsdlOperationMapping = getWSDLOperationMapping(); + if ( wsdlOperationMapping != null ) wsdlOperation = wsdlOperationMapping.getOperationName(); + return wsdlOperation; + } + public WSDLOperationMapping getWSDLOperationMapping() { + if (wsdlOperationMapping != null) return wsdlOperationMapping; OperationDispatcher opDispatcher = null; if (endpoint != null) { - opDispatcher = ((WSEndpointImpl) endpoint).getOperationDispatcher(); + opDispatcher = endpoint.getOperationDispatcher(); } else if (proxy != null) { opDispatcher = ((Stub) proxy).getOperationDispatcher(); } //OpDispatcher is null when there is no WSDLModel if (opDispatcher != null) { try { - wsdlOperation = opDispatcher.getWSDLOperationQName(this); + wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this); } catch (DispatchException e) { //Ignore, this might be a protocol message which may not have a wsdl operation //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for."); } } - return wsdlOperation; + return wsdlOperationMapping; } /** @@ -333,7 +342,7 @@ * at the time of invocation. * This property is used by MUPipe and HandlerPipe implementations. */ - @com.sun.xml.internal.ws.api.PropertySet.Property(BindingProviderProperties.JAXWS_HANDLER_CONFIG) + @Property(BindingProviderProperties.JAXWS_HANDLER_CONFIG) public HandlerConfiguration handlerConfig; /** @@ -342,17 +351,29 @@ * * TODO: who's using this property? */ - @com.sun.xml.internal.ws.api.PropertySet.Property(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY) + @Property(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY) public BindingProvider proxy; /** - * Determines if the governing {@link Adapter} or {@link Fiber.CompletionCallback} will handle delivering - * response messages targeted at non-anonymous endpoint addresses. Prior to the introduction of this - * flag the {@link WsaServerTube} would deliver non-anonymous responses. + * Determines if the governing {@link Adapter} or {@link com.sun.xml.internal.ws.api.pipe.Fiber.CompletionCallback} + * will handle delivering response messages targeted at non-anonymous endpoint + * addresses. Prior to the introduction of this flag + * the {@link WsaServerTube} would deliver non-anonymous responses. */ public boolean isAdapterDeliversNonAnonymousResponse; /** + * During invocation of a client Stub or Dispatch a Packet is + * created then the Stub's RequestContext is copied into the + * Packet. On certain internal cases the Packet is created + * *before* the invocation. In those cases we want the contents + * of the Packet to take precedence when ever any key/value pairs + * collide : if the Packet contains a value for a key use it, + * otherwise copy as usual from Stub. + */ + public boolean packetTakesPriorityOverRequestContext = false; + + /** * The endpoint address to which this message is sent to. * *

    @@ -371,19 +392,21 @@ * {@link #endpointAddress}. This is for JAX-WS client applications * that access this property via {@link BindingProvider#ENDPOINT_ADDRESS_PROPERTY}. */ - @com.sun.xml.internal.ws.api.PropertySet.Property(BindingProvider.ENDPOINT_ADDRESS_PROPERTY) + @Property(BindingProvider.ENDPOINT_ADDRESS_PROPERTY) public String getEndPointAddressString() { - if (endpointAddress == null) + if (endpointAddress == null) { return null; - else + } else { return endpointAddress.toString(); + } } public void setEndPointAddressString(String s) { - if (s == null) + if (s == null) { this.endpointAddress = null; - else + } else { this.endpointAddress = EndpointAddress.create(s); + } } /** @@ -394,15 +417,15 @@ */ public ContentNegotiation contentNegotiation; - @com.sun.xml.internal.ws.api.PropertySet.Property(ContentNegotiation.PROPERTY) + @Property(ContentNegotiation.PROPERTY) public String getContentNegotiationString() { return (contentNegotiation != null) ? contentNegotiation.toString() : null; } public void setContentNegotiationString(String s) { - if (s == null) + if (s == null) { contentNegotiation = null; - else { + } else { try { contentNegotiation = ContentNegotiation.valueOf(s); } catch (IllegalArgumentException e) { @@ -419,16 +442,17 @@ * This is not cached as one may reset the Message. *

    */ - @com.sun.xml.internal.ws.api.PropertySet.Property(MessageContext.REFERENCE_PARAMETERS) + @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List getReferenceParameters() { + Message msg = getMessage(); List refParams = new ArrayList(); - if (message == null) { + if (msg == null) { return refParams; } - HeaderList hl = message.getHeaders(); - for (Header h : hl) { + MessageHeaders hl = msg.getHeaders(); + for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); @@ -455,14 +479,16 @@ } /** - * @deprecated * This method is for exposing header list through {@link PropertySet#get(Object)}, * for user applications, and should never be invoked directly from within the JAX-WS RI. */ - @com.sun.xml.internal.ws.api.PropertySet.Property(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY) - /*package*/ HeaderList getHeaderList() { - if (message == null) return null; - return message.getHeaders(); + @Property(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY) + /*package*/ MessageHeaders getHeaderList() { + Message msg = getMessage(); + if (msg == null) { + return null; + } + return msg.getHeaders(); } /** @@ -534,7 +560,7 @@ *

    * This property is set if and only if this is on the server side. */ - @com.sun.xml.internal.ws.api.PropertySet.Property(JAXWSProperties.WSENDPOINT) + @Property(JAXWSProperties.WSENDPOINT) public WSEndpoint endpoint; /** @@ -561,7 +587,7 @@ * header is present (See {@BP R2744} and {@BP R2745}.) For SOAP 1.2, * this is moved to the parameter of the "application/soap+xml". */ - @com.sun.xml.internal.ws.api.PropertySet.Property(BindingProvider.SOAPACTION_URI_PROPERTY) + @Property(BindingProvider.SOAPACTION_URI_PROPERTY) public String soapAction; /** @@ -622,7 +648,7 @@ * In all other situations, this property is null. * */ - @com.sun.xml.internal.ws.api.PropertySet.Property(BindingProviderProperties.ONE_WAY_OPERATION) + @Property(BindingProviderProperties.ONE_WAY_OPERATION) public Boolean expectReply; @@ -656,6 +682,20 @@ public Boolean nonNullAsyncHandlerGiven; /** + * USE-CASE: + * WS-AT is enabled, but there is no WSDL available. + * If Packet.isRequestReplyMEP() is Boolean.TRUE then WS-AT should + * add the TX context. + * + * This value is exposed to users via facades at higher abstraction layers. + * The user should NEVER use Packet directly. + * This value should ONLY be set by users. + */ + private Boolean isRequestReplyMEP; + public Boolean isRequestReplyMEP() { return isRequestReplyMEP; } + public void setRequestReplyMEP(final Boolean x) { isRequestReplyMEP = x; } + + /** * Lazily created set of handler-scope property names. * *

    @@ -701,8 +741,9 @@ public final Set getHandlerScopePropertyNames(boolean readOnly) { Set o = this.handlerScopePropertyNames; if (o == null) { - if (readOnly) + if (readOnly) { return Collections.emptySet(); + } o = new HashSet(); this.handlerScopePropertyNames = o; } @@ -755,11 +796,25 @@ */ public Packet createClientResponse(Message msg) { Packet response = new Packet(this); - response.soapAction = null; // de-initializing response.setMessage(msg); + finishCreateRelateClientResponse(response); + return response; + } + + /** + * For use cases that start with an existing Packet. + */ + public Packet relateClientResponse(final Packet response) { + response.relatePackets(this, true); + finishCreateRelateClientResponse(response); return response; } + private void finishCreateRelateClientResponse(final Packet response) { + response.soapAction = null; // de-initializing + response.setState(State.ClientResponse); + } + /** * Creates a server-side response {@link Packet} from a request * packet ({@code this}). If WS-Addressing is enabled, a default Action @@ -778,55 +833,93 @@ */ public Packet createServerResponse(@Nullable Message responseMessage, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding) { Packet r = createClientResponse(responseMessage); + return relateServerResponse(r, wsdlPort, seiModel, binding); + } - AddressingVersion av = binding.getAddressingVersion(); - // populate WS-A headers only if WS-A is enabled - if (av == null) - return r; - //populate WS-A headers only if the request has addressing headers - String inputAction = this.getMessage().getHeaders().getAction(av, binding.getSOAPVersion()); - if (inputAction == null) { - return r; + /** + * Copy all properties from ({@code this}) packet into a input {@link Packet} + * @param response packet + */ + public void copyPropertiesTo(@Nullable Packet response){ + relatePackets(response, false); + } + + + /** + * A common method to make members related between input packet and this packet + * + * @param packet + * @param isCopy 'true' means copying all properties from input packet; + * 'false' means copying all properties from this packet to input packet. + */ + private void relatePackets(@Nullable Packet packet, boolean isCopy) + { + Packet request; + Packet response; + + if (!isCopy) { //is relate + request = this; + response = packet; + + // processing specific properties + response.soapAction = null; + response.invocationProperties.putAll(request.invocationProperties); + if (this.getState().equals(State.ServerRequest)) { + response.setState(State.ServerResponse); + } + } else { //is copy constructor + request = packet; + response = this; + + // processing specific properties + response.soapAction = request.soapAction; + response.setState(request.getState()); } - // if one-way, then dont populate any WS-A headers - if (responseMessage == null || (wsdlPort != null && message.isOneWay(wsdlPort))) - return r; - // otherwise populate WS-Addressing headers - populateAddressingHeaders(binding, r, wsdlPort, seiModel); - return r; + request.copySatelliteInto(response); + response.isAdapterDeliversNonAnonymousResponse = request.isAdapterDeliversNonAnonymousResponse; + response.handlerConfig = request.handlerConfig; + response.handlerScopePropertyNames = request.handlerScopePropertyNames; + response.contentNegotiation = request.contentNegotiation; + response.wasTransportSecure = request.wasTransportSecure; + response.transportBackChannel = request.transportBackChannel; + response.endpointAddress = request.endpointAddress; + response.wsdlOperation = request.wsdlOperation; + response.wsdlOperationMapping = request.wsdlOperationMapping; + response.acceptableMimeTypes = request.acceptableMimeTypes; + response.endpoint = request.endpoint; + response.proxy = request.proxy; + response.webServiceContextDelegate = request.webServiceContextDelegate; + response.expectReply = request.expectReply; + response.component = request.component; + response.mtomAcceptable = request.mtomAcceptable; + response.mtomRequest = request.mtomRequest; + // copy other properties that need to be copied. is there any? } public Packet relateServerResponse(@Nullable Packet r, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding) { - copySatelliteInto((DistributedPropertySet) r); - r.soapAction = null; - r.handlerConfig = this.handlerConfig; - r.invocationProperties.putAll(this.invocationProperties); - r.handlerScopePropertyNames = this.handlerScopePropertyNames; - r.contentNegotiation = this.contentNegotiation; - r.wasTransportSecure = this.wasTransportSecure; - r.endpointAddress = this.endpointAddress; - r.wsdlOperation = this.wsdlOperation; - - r.acceptableMimeTypes = this.acceptableMimeTypes; - r.endpoint = this.endpoint; - r.proxy = this.proxy; - r.webServiceContextDelegate = this.webServiceContextDelegate; - r.expectReply = this.expectReply; - + relatePackets(r, false); + r.setState(State.ServerResponse); AddressingVersion av = binding.getAddressingVersion(); // populate WS-A headers only if WS-A is enabled - if (av == null) + if (av == null) { return r; + } + + if (getMessage() == null) { + return r; + } + //populate WS-A headers only if the request has addressing headers - String inputAction = this.getMessage().getHeaders().getAction(av, binding.getSOAPVersion()); + String inputAction = AddressingUtils.getAction(getMessage().getHeaders(), av, binding.getSOAPVersion()); if (inputAction == null) { return r; } // if one-way, then dont populate any WS-A headers - if (r.getMessage() == null || (wsdlPort != null && message.isOneWay(wsdlPort))) + if (r.getMessage() == null || (wsdlPort != null && getMessage().isOneWay(wsdlPort))) { return r; + } // otherwise populate WS-Addressing headers populateAddressingHeaders(binding, r, wsdlPort, seiModel); @@ -851,12 +944,13 @@ */ public Packet createServerResponse(@Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) { Packet responsePacket = createClientResponse(responseMessage); - + responsePacket.setState(State.ServerResponse); // populate WS-A headers only if WS-A is enabled - if (addressingVersion == null) + if (addressingVersion == null) { return responsePacket; + } //populate WS-A headers only if the request has addressing headers - String inputAction = this.getMessage().getHeaders().getAction(addressingVersion, soapVersion); + String inputAction = AddressingUtils.getAction(this.getMessage().getHeaders(), addressingVersion, soapVersion); if (inputAction == null) { return responsePacket; } @@ -888,21 +982,33 @@ if (responsePacket.getMessage() == null) return; - HeaderList hl = responsePacket.getMessage().getHeaders(); + MessageHeaders hl = responsePacket.getMessage().getHeaders(); WsaPropertyBag wpb = getSatellite(WsaPropertyBag.class); - + Message msg = getMessage(); // wsa:To WSEndpointReference replyTo = null; - if (wpb != null) - replyTo = wpb.getReplyToFromRequest(); - if (replyTo == null) - replyTo = message.getHeaders().getReplyTo(av, sv); + Header replyToFromRequestMsg = AddressingUtils.getFirstHeader(msg.getHeaders(), av.replyToTag, true, sv); + Header replyToFromResponseMsg = hl.get(av.toTag, false); + boolean replaceToTag = true; + try{ + if (replyToFromRequestMsg != null){ + replyTo = replyToFromRequestMsg.readAsEPR(av); + } + if (replyToFromResponseMsg != null && replyTo == null) { + replaceToTag = false; + } + } catch (XMLStreamException e) { + throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e); + } + if (replyTo == null) { + replyTo = AddressingUtils.getReplyTo(msg.getHeaders(), av, sv); + } // wsa:Action, add if the message doesn't already contain it, // generally true for SEI case where there is SEIModel or WSDLModel // false for Provider with no wsdl, Expects User to set the coresponding header on the Message. - if (responsePacket.getMessage().getHeaders().getAction(av, sv) == null) { + if (AddressingUtils.getAction(responsePacket.getMessage().getHeaders(), av, sv) == null) { //wsa:Action header is not set in the message, so use the wsa:Action passed as the parameter. hl.add(new StringHeader(av.actionTag, action, sv, mustUnderstand)); } @@ -916,31 +1022,37 @@ // wsa:RelatesTo String mid = null; - if (wpb != null) - mid = wpb.getMessageID(); - if (mid == null) - mid = message.getHeaders().getMessageID(av, sv); - if (mid != null) - hl.add(new RelatesToHeader(av.relatesToTag, mid)); + if (wpb != null) { + mid = wpb.getMessageID(); + } + if (mid == null) { + mid = AddressingUtils.getMessageID(msg.getHeaders(), av, sv); + } + if (mid != null) { + hl.addOrReplace(new RelatesToHeader(av.relatesToTag, mid)); + } // populate reference parameters WSEndpointReference refpEPR = null; if (responsePacket.getMessage().isFault()) { // choose FaultTo - if (wpb != null) - refpEPR = wpb.getFaultToFromRequest(); - if (refpEPR == null) - refpEPR = message.getHeaders().getFaultTo(av, sv); + if (wpb != null) { + refpEPR = wpb.getFaultToFromRequest(); + } + if (refpEPR == null) { + refpEPR = AddressingUtils.getFaultTo(msg.getHeaders(), av, sv); + } // if FaultTo is null, then use ReplyTo - if (refpEPR == null) + if (refpEPR == null) { refpEPR = replyTo; + } } else { // choose ReplyTo refpEPR = replyTo; } - if (refpEPR != null) { - hl.add(new StringHeader(av.toTag, refpEPR.getAddress())); + if (replaceToTag && refpEPR != null) { + hl.addOrReplace(new StringHeader(av.toTag, refpEPR.getAddress())); refpEPR.addReferenceParametersToList(hl); } } @@ -948,17 +1060,19 @@ private void populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) { AddressingVersion addressingVersion = binding.getAddressingVersion(); - if (addressingVersion == null) return; + if (addressingVersion == null) { + return; + } WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, seiModel, binding); - String action = responsePacket.message.isFault() ? + String action = responsePacket.getMessage().isFault() ? wsaHelper.getFaultAction(this, responsePacket) : wsaHelper.getOutputAction(this); if (action == null) { LOGGER.info("WSA headers are not added as value for wsa:Action cannot be resolved for this message"); return; } - populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action, addressingVersion.isRequired(binding)); + populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action, AddressingVersion.isRequired(binding)); } public String toShortString() { @@ -966,15 +1080,17 @@ } // For use only in a debugger + @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append(super.toString()); String content; try { - if (message != null) { + Message msg = getMessage(); + if (msg != null) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLStreamWriter xmlWriter = XMLStreamWriterFactory.create(baos, "UTF-8"); - message.copy().writeTo(xmlWriter); + msg.copy().writeTo(xmlWriter); xmlWriter.flush(); xmlWriter.close(); baos.flush(); @@ -1000,19 +1116,121 @@ model = parse(Packet.class); } + @Override protected PropertyMap getPropertyMap() { return model; } + public Map asMapIncludingInvocationProperties() { + final Map asMap = asMap(); + return new AbstractMap() { + @Override + public Object get(Object key) { + Object o = asMap.get(key); + if (o != null) + return o; + + return invocationProperties.get(key); + } + + @Override + public int size() { + return asMap.size() + invocationProperties.size(); + } + + @Override + public boolean containsKey(Object key) { + if (asMap.containsKey(key)) + return true; + return invocationProperties.containsKey(key); + } + + @Override + public Set> entrySet() { + final Set> asMapEntries = asMap.entrySet(); + final Set> ipEntries = invocationProperties.entrySet(); + + return new AbstractSet>() { + @Override + public Iterator> iterator() { + final Iterator> asMapIt = asMapEntries.iterator(); + final Iterator> ipIt = ipEntries.iterator(); + + return new Iterator>() { + @Override + public boolean hasNext() { + return asMapIt.hasNext() || ipIt.hasNext(); + } + + @Override + public java.util.Map.Entry next() { + if (asMapIt.hasNext()) + return asMapIt.next(); + return ipIt.next(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + + @Override + public int size() { + return asMap.size() + invocationProperties.size(); + } + }; + } + + @Override + public Object put(String key, Object value) { + if (supports(key)) + return asMap.put(key, value); + + return invocationProperties.put(key, value); + } + + @Override + public void clear() { + asMap.clear(); + invocationProperties.clear(); + } + + @Override + public Object remove(Object key) { + if (supports(key)) + return asMap.remove(key); + + return invocationProperties.remove(key); + } + }; + } + private static final Logger LOGGER = Logger.getLogger(Packet.class.getName()); + @Override public SOAPMessage getSOAPMessage() throws SOAPException { - return (message != null) ? message.readAsSOAPMessage() : null; + return getAsSOAPMessage(); } + //TODO replace the message to a SAAJMEssage issue - JRFSAAJMessage or SAAJMessage? + @Override + public SOAPMessage getAsSOAPMessage() throws SOAPException { + Message msg = this.getMessage(); + if (msg == null) + return null; + if (msg instanceof MessageWritable) + ((MessageWritable) msg).setMTOMConfiguration(mtomFeature); + return msg.readAsSOAPMessage(this, this.getState().isInbound()); + } + + public Codec codec = null; - Codec getCodec() { - if (codec != null) return codec; + public Codec getCodec() { + if (codec != null) { + return codec; + } if (endpoint != null) { codec = endpoint.createCodec(); } @@ -1023,12 +1241,232 @@ return codec; } - - public ContentType writeTo( OutputStream out ) throws IOException { + @Override + public com.oracle.webservices.internal.api.message.ContentType writeTo( OutputStream out ) throws IOException { + Message msg = getInternalMessage(); + if (msg instanceof MessageWritable) { + ((MessageWritable) msg).setMTOMConfiguration(mtomFeature); + return ((MessageWritable)msg).writeTo(out); + } return getCodec().encode(this, out); } - public ContentType writeTo( WritableByteChannel buffer ) { + public com.oracle.webservices.internal.api.message.ContentType writeTo( WritableByteChannel buffer ) { return getCodec().encode(this, buffer); } + + private ContentType contentType; + + /** + * If the request's Content-Type is multipart/related; type=application/xop+xml, then this set to to true + * + * Used on server-side, for encoding the repsonse. + */ + private Boolean mtomRequest; + + /** + * Based on request's Accept header this is set. + * Currently only set if MTOMFeature is enabled. + * + * Should be used on server-side, for encoding the response. + */ + private Boolean mtomAcceptable; + + private MTOMFeature mtomFeature; + + public Boolean getMtomRequest() { + return mtomRequest; + } + + public void setMtomRequest(Boolean mtomRequest) { + this.mtomRequest = mtomRequest; + } + + public Boolean getMtomAcceptable() { + return mtomAcceptable; + } + + Boolean checkMtomAcceptable; + public void checkMtomAcceptable() { + if (checkMtomAcceptable == null) { + if (acceptableMimeTypes == null || isFastInfosetDisabled) { + checkMtomAcceptable = false; + } else { + checkMtomAcceptable = (acceptableMimeTypes.indexOf(MtomCodec.XOP_XML_MIME_TYPE) != -1); +// StringTokenizer st = new StringTokenizer(acceptableMimeTypes, ","); +// while (st.hasMoreTokens()) { +// final String token = st.nextToken().trim(); +// if (token.toLowerCase().contains(MtomCodec.XOP_XML_MIME_TYPE)) { +// mtomAcceptable = true; +// } +// } +// if (mtomAcceptable == null) mtomAcceptable = false; + } + } + mtomAcceptable = checkMtomAcceptable; + } + + private Boolean fastInfosetAcceptable; + + public Boolean getFastInfosetAcceptable(String fiMimeType) { + if (fastInfosetAcceptable == null) { + if (acceptableMimeTypes == null || isFastInfosetDisabled) { + fastInfosetAcceptable = false; + } else { + fastInfosetAcceptable = (acceptableMimeTypes.indexOf(fiMimeType) != -1); + } +// if (accept == null || isFastInfosetDisabled) return false; +// +// StringTokenizer st = new StringTokenizer(accept, ","); +// while (st.hasMoreTokens()) { +// final String token = st.nextToken().trim(); +// if (token.equalsIgnoreCase(fiMimeType)) { +// return true; +// } +// } +// return false; + } + return fastInfosetAcceptable; + } + + + public void setMtomFeature(MTOMFeature mtomFeature) { + this.mtomFeature = mtomFeature; + } + + public MTOMFeature getMtomFeature() { + //If we have a binding, use that in preference to an explicitly + //set MTOMFeature + WSBinding binding = getBinding(); + if (binding != null) { + return binding.getFeature(MTOMFeature.class); + } + return mtomFeature; + } + + @Override + public com.oracle.webservices.internal.api.message.ContentType getContentType() { + if (contentType == null) { + contentType = getInternalContentType(); + } + if (contentType == null) { + contentType = getCodec().getStaticContentType(this); + } + if (contentType == null) { + //TODO write to buffer + } + return contentType; + } + + public ContentType getInternalContentType() { + Message msg = getInternalMessage(); + if (msg instanceof MessageWritable) { + return ((MessageWritable)msg).getContentType(); + } + return contentType; + } + + public void setContentType(ContentType contentType) { + this.contentType = contentType; + } + + public enum Status { + Request, Response, Unknown; + public boolean isRequest() { return Request.equals(this); } + public boolean isResponse() { return Response.equals(this); } + } + + public enum State { + ServerRequest(true), ClientRequest(false), ServerResponse(false), ClientResponse(true); + private boolean inbound; + State(boolean inbound) { + this.inbound = inbound; + } + public boolean isInbound() { + return inbound; + } + } + +// private Status status = Status.Unknown; + + //Default state is ServerRequest - some custom adapters may not set the value of state + //upon server request - all other code paths should set it + private State state = State.ServerRequest; + +// public Status getStatus() { return status; } + + public State getState() { return state; } + public void setState(State state) { this.state = state; } + + public boolean shouldUseMtom() { + if (getState().isInbound()) { + return isMtomContentType(); + } else { + return shouldUseMtomOutbound(); + } + } + + private boolean shouldUseMtomOutbound() { + //Use the getter to make sure all the logic is executed correctly + MTOMFeature myMtomFeature = getMtomFeature(); + if(myMtomFeature != null && myMtomFeature.isEnabled()) { + //On client, always use XOP encoding if MTOM is enabled + //On Server, mtomAcceptable and mtomRequest will be set - use XOP encoding + //if either request is XOP encoded (mtomRequest) or + //client accepts XOP encoding (mtomAcceptable) + if (getMtomAcceptable() == null && getMtomRequest() == null) { + return true; + } else { + if (getMtomAcceptable() != null && getMtomAcceptable() && getState().equals(State.ServerResponse)) { + return true; + } + if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ServerResponse)) { + return true; + } + } + } + return false; + } + + private boolean isMtomContentType() { + return (getInternalContentType() != null) && + (getInternalContentType().getContentType().contains("application/xop+xml")); + } + + /** + * @deprecated + */ + public void addSatellite(@NotNull com.sun.xml.internal.ws.api.PropertySet satellite) { + super.addSatellite(satellite); + } + + /** + * @deprecated + */ + public void addSatellite(@NotNull Class keyClass, @NotNull com.sun.xml.internal.ws.api.PropertySet satellite) { + super.addSatellite(keyClass, satellite); + } + + /** + * @deprecated + */ + public void copySatelliteInto(@NotNull com.sun.xml.internal.ws.api.DistributedPropertySet r) { + super.copySatelliteInto(r); + } + + /** + * @deprecated + */ + public void removeSatellite(com.sun.xml.internal.ws.api.PropertySet satellite) { + super.removeSatellite(satellite); + } + + /** + * This is propogated from SOAPBindingCodec and will affect isMtomAcceptable and isFastInfosetAcceptable + */ + private boolean isFastInfosetDisabled; + + public void setFastInfosetDisabled(boolean b) { + isFastInfosetDisabled = b; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/SuppressAutomaticWSARequestHeadersFeature.java 2013-04-04 15:28:50.168614370 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/SuppressAutomaticWSARequestHeadersFeature.java 2013-04-04 15:28:50.100614369 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/package-info.java 2013-04-04 15:28:50.488614375 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/package-info.java 2013-04-04 15:28:50.428614374 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -24,6 +24,6 @@ */ /** - * {@link Message} and related abstractions that represent a SOAP message. + * {@link com.sun.xml.internal.ws.api.message.Message} and related abstractions that represent a SOAP message. */ package com.sun.xml.internal.ws.api.message; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java 2013-04-04 15:28:50.776614379 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java 2013-04-04 15:28:50.720614379 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 javax.xml.soap.SOAPException; import javax.xml.soap.SOAPFactory; import javax.xml.soap.SOAPMessage; +import javax.xml.stream.XMLStreamException; import org.xml.sax.SAXException; @@ -41,6 +42,7 @@ import com.sun.xml.internal.ws.api.message.Attachment; import com.sun.xml.internal.ws.api.message.AttachmentEx; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.message.saaj.SAAJMessage; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.xml.XmlUtil; @@ -76,14 +78,14 @@ * specified implementation of MessageFactory. * @see SAAJMetaFactory */ - public static MessageFactory getMessageFactory(String saajFactoryString) throws SOAPException { + public static MessageFactory getMessageFactory(String protocol) throws SOAPException { for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { - MessageFactory mf = s.createMessageFactory(saajFactoryString); + MessageFactory mf = s.createMessageFactory(protocol); if (mf != null) return mf; } - return instance.createMessageFactory(saajFactoryString); + return instance.createMessageFactory(protocol); } /** @@ -104,14 +106,14 @@ * specified SOAPFactory * @see SAAJMetaFactory */ - public static SOAPFactory getSOAPFactory(String saajFactoryString) throws SOAPException { + public static SOAPFactory getSOAPFactory(String protocol) throws SOAPException { for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { - SOAPFactory sf = s.createSOAPFactory(saajFactoryString); + SOAPFactory sf = s.createSOAPFactory(protocol); if (sf != null) return sf; } - return instance.createSOAPFactory(saajFactoryString); + return instance.createSOAPFactory(protocol); } /** @@ -146,6 +148,50 @@ return instance.readAsSOAPMessage(soapVersion, message); } + /** + * Reads Message as SOAPMessage. After this call message is consumed. + * @param soapVersion SOAP version + * @param message Message + * @param packet The packet that owns the Message + * @return Created SOAPMessage + * @throws SOAPException if SAAJ processing fails + */ + public static SOAPMessage read(SOAPVersion soapVersion, Message message, Packet packet) throws SOAPException { + for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { + SOAPMessage msg = s.readAsSOAPMessage(soapVersion, message, packet); + if (msg != null) + return msg; + } + + return instance.readAsSOAPMessage(soapVersion, message, packet); + } + + /** + * Reads the message within the Packet to a SAAJMessage. After this call message is consumed. + * @param packet Packet + * @return Created SAAJPMessage + * @throws SOAPException if SAAJ processing fails + */ + public static SAAJMessage read(Packet packet) throws SOAPException { + for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { + SAAJMessage msg = s.readAsSAAJ(packet); + if (msg != null) return msg; + } + return instance.readAsSAAJ(packet); + } + + /** + * Reads the message within the Packet to a SAAJMessage. After this call message is consumed. + * @param packet Packet + * @return Created SAAJPMessage + * @throws SOAPException if SAAJ processing fails + */ + public SAAJMessage readAsSAAJ(Packet packet) throws SOAPException { + SOAPVersion v = packet.getMessage().getSOAPVersion(); + SOAPMessage msg = readAsSOAPMessage(v, packet.getMessage()); + return new SAAJMessage(msg); + } + /** * Creates a new MessageFactory object that is an instance * of the specified implementation. May be a dynamic message factory, @@ -169,8 +215,8 @@ * specified implementation of MessageFactory. * @see SAAJMetaFactory */ - public MessageFactory createMessageFactory(String saajFactoryString) throws SOAPException { - return MessageFactory.newInstance(saajFactoryString); + public MessageFactory createMessageFactory(String protocol) throws SOAPException { + return MessageFactory.newInstance(protocol); } /** @@ -191,8 +237,8 @@ * specified SOAPFactory * @see SAAJMetaFactory */ - public SOAPFactory createSOAPFactory(String saajFactoryString) throws SOAPException { - return SOAPFactory.newInstance(saajFactoryString); + public SOAPFactory createSOAPFactory(String protocol) throws SOAPException { + return SOAPFactory.newInstance(protocol); } /** @@ -211,16 +257,36 @@ * @return Created SOAPMessage * @throws SOAPException if SAAJ processing fails */ - public SOAPMessage readAsSOAPMessage(SOAPVersion soapVersion, Message message) throws SOAPException { + public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); + SaajStaxWriter writer = new SaajStaxWriter(msg); + try { + message.writeTo(writer); + } catch (XMLStreamException e) { + throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e); + } + msg = writer.getSOAPMessage(); + addAttachmentsToSOAPMessage(msg, message); + if (msg.saveRequired()) + msg.saveChanges(); + return msg; + } + public SOAPMessage readAsSOAPMessageSax2Dom(final SOAPVersion soapVersion, final Message message) throws SOAPException { + SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart()); try { message.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); } catch (SAXException e) { throw new SOAPException(e); } + addAttachmentsToSOAPMessage(msg, message); + if (msg.saveRequired()) + msg.saveChanges(); + return msg; + } + static protected void addAttachmentsToSOAPMessage(SOAPMessage msg, Message message) { for(Attachment att : message.getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); @@ -249,9 +315,19 @@ } msg.addAttachmentPart(part); } + } - if (msg.saveRequired()) - msg.saveChanges(); - return msg; + /** + * Reads Message as SOAPMessage. After this call message is consumed. + * The implementation in this class simply calls readAsSOAPMessage(SOAPVersion, Message), + * and ignores the other parameters + * Subclasses can override and choose to base SOAPMessage creation on Packet properties if needed + * @param soapVersion SOAP version + * @param message Message + * @return Created SOAPMessage + * @throws SOAPException if SAAJ processing fails + */ + public SOAPMessage readAsSOAPMessage(SOAPVersion soapVersion, Message message, Packet packet) throws SOAPException { + return readAsSOAPMessage(soapVersion, message); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java 2013-04-04 15:28:51.096614384 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java 2013-04-04 15:28:51.032614383 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java 2013-04-04 15:28:51.400614389 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java 2013-04-04 15:28:51.344614389 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java 2013-04-04 15:28:51.716614394 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java 2013-04-04 15:28:51.656614393 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/CheckedException.java 2013-04-04 15:28:51.956614398 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/CheckedException.java 2013-04-04 15:28:51.900614397 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/ExceptionType.java 2013-04-04 15:28:52.164614401 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/ExceptionType.java 2013-04-04 15:28:52.116614401 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/JavaMethod.java 2013-04-04 15:28:52.364614404 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/JavaMethod.java 2013-04-04 15:28:52.316614403 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 java.lang.reflect.Method; +import javax.jws.WebService; /** * Abstracts the annotated {@link Method} of a SEI. @@ -48,18 +49,18 @@ * On the server side, it uses this for invocation of the web service * *

    - * {@link @WebService}(endpointInterface="I") + * {@literal @}{@link WebService}(endpointInterface="I") * class A { } * * In this case, it retuns A's method * *

    - * {@link @WebService}(endpointInterface="I") + * {@literal @}{@link WebService}(endpointInterface="I") * class A implements I { } * In this case, it returns A's method * *

    - * {@link @WebService} + * {@literal @}{@link WebService} * class A { } * In this case, it returns A's method * @@ -73,17 +74,17 @@ * Returns the SEI method if there is one. * *

    - * {@link @WebService}(endpointInterface="I") + * {@literal @}{@link WebService}(endpointInterface="I") * class A { } * In this case, it retuns I's method * *

    - * {@link @WebService}(endpointInterface="I") + * {@literal @}{@link WebService}(endpointInterface="I") * class A implements I { } * In this case, it returns I's method * *

    - * {@link @WebService} + * {@literal @}{@link WebService} * class A { } * In this case, it returns A's method * --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/MEP.java 2013-04-04 15:28:52.564614408 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/MEP.java 2013-04-04 15:28:52.516614407 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/Parameter.java 2013-04-04 15:28:52.776614411 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/Parameter.java 2013-04-04 15:28:52.724614410 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/ParameterBinding.java 2013-04-04 15:28:52.996614414 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/ParameterBinding.java 2013-04-04 15:28:52.944614413 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/SEIModel.java 2013-04-04 15:28:53.204614417 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/SEIModel.java 2013-04-04 15:28:53.152614416 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -143,7 +143,7 @@ @NotNull String getWSDLLocation(); /** - * wsdl:service qualified name for the port associated with the {@link SEIModel) + * wsdl:service qualified name for the port associated with the {@link SEIModel} * * @return wsdl:service@name value - always non-null */ @@ -155,14 +155,14 @@ @NotNull WSDLPort getPort(); /** - * Value of the wsdl:port name associated with the {@link SEIModel) + * Value of the wsdl:port name associated with the {@link SEIModel} * * @return wsdl:service/wsdl:port@name value, always non-null */ @NotNull QName getPortName(); /** - * Value of wsdl:portType bound to the port associated with the {@link SEIModel) + * Value of wsdl:portType bound to the port associated with the {@link SEIModel} * * @return */ @@ -174,7 +174,7 @@ @NotNull QName getBoundPortTypeName(); /** - * Namespace of the wsd;:port associated with the {@link SEIModel) + * Namespace of the wsd;:port associated with the {@link SEIModel} */ @NotNull String getTargetNamespace(); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/soap/SOAPBinding.java 2013-04-04 15:28:53.532614423 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/soap/SOAPBinding.java 2013-04-04 15:28:53.468614422 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundFault.java 2013-04-04 15:28:53.844614427 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundFault.java 2013-04-04 15:28:53.788614427 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java 2013-04-04 15:28:54.156614432 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java 2013-04-04 15:28:54.092614431 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java 2013-04-04 15:28:54.472614437 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java 2013-04-04 15:28:54.416614436 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -120,7 +120,7 @@ * * @param operation wsdl:operation@name value. Must be non-null. * @param part wsdl:part@name such as value of soap:header@part. Must be non-null. - * @param mode {@link Mode#IN} or {@link Mode@OUT}. Must be non-null. + * @param mode {@link Mode#IN} or {@link Mode#OUT}. Must be non-null. * @return null if the binding could not be resolved for the part. */ ParameterBinding getBinding(QName operation, String part, Mode mode); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLDescriptorKind.java 2013-04-04 15:28:54.768614442 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLDescriptorKind.java 2013-04-04 15:28:54.712614441 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java 2013-04-04 15:28:55.096614446 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java 2013-04-04 15:28:55.028614445 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtension.java 2013-04-04 15:28:55.420614452 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtension.java 2013-04-04 15:28:55.364614451 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java 2013-04-04 15:28:55.708614456 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java 2013-04-04 15:28:55.632614455 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ /** * Gives the Action Message Addressing Property value for - * {@link this} message. - * {@link this} message. + * {@link WSDLFault} message. *

    * This method provides the correct value irrespective of * whether the Action is explicitly specified in the WSDL or --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFeaturedObject.java 2013-04-04 15:28:55.968614461 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFeaturedObject.java 2013-04-04 15:28:55.920614460 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java 2013-04-04 15:28:56.228614465 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java 2013-04-04 15:28:56.176614464 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +54,7 @@ /** * Gives the Action Message Addressing Property value for - * {@link this} message. + * {@link WSDLInput} message. *

    * This method provides the correct value irrespective of * whether the Action is explicitly specified in the WSDL or --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java 2013-04-04 15:28:56.500614469 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java 2013-04-04 15:28:56.440614468 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java 2013-04-04 15:28:56.768614473 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java 2013-04-04 15:28:56.716614472 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLObject.java 2013-04-04 15:28:57.036614477 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLObject.java 2013-04-04 15:28:56.984614476 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java 2013-04-04 15:28:57.348614482 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java 2013-04-04 15:28:57.288614481 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java 2013-04-04 15:28:57.652614486 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java 2013-04-04 15:28:57.596614486 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -53,7 +53,7 @@ /** * Gives the Action Message Addressing Property value for - * {@link this} message. + * {@link WSDLOutput} message. *

    * This method provides the correct value irrespective of * whether the Action is explicitly specified in the WSDL or --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPart.java 2013-04-04 15:28:57.940614491 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPart.java 2013-04-04 15:28:57.880614490 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPartDescriptor.java 2013-04-04 15:28:58.252614496 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPartDescriptor.java 2013-04-04 15:28:58.192614495 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java 2013-04-04 15:28:58.544614501 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java 2013-04-04 15:28:58.496614500 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java 2013-04-04 15:28:58.864614506 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java 2013-04-04 15:28:58.800614505 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java 2013-04-04 15:28:59.160614510 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java 2013-04-04 15:28:59.108614509 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/package-info.java 2013-04-04 15:28:59.472614515 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/package-info.java 2013-04-04 15:28:59.416614514 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java 2013-04-04 15:28:59.796614520 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java 2013-04-04 15:28:59.736614519 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java 2013-04-04 15:29:00.056614524 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java 2013-04-04 15:28:59.996614523 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -78,7 +78,7 @@ /** * This constructor should be used only by JAX-WS Runtime and is not meant for external consumption. * @deprecated - * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSBindingProvider, WSBinding, Container, Codec, SEIModel)} + * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSService, WSBindingProvider, WSBinding, Container, Codec, SEIModel, Class)} */ public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding) { this(address, wsdlModel, rootOwner, binding, Container.NONE); @@ -87,7 +87,7 @@ /** * This constructor should be used only by JAX-WS Runtime and is not meant for external consumption. * @deprecated - * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSBindingProvider, WSBinding, Container, Codec, SEIModel)}. + * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSService, WSBindingProvider, WSBinding, Container, Codec, SEIModel, Class)} */ public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding, @@ -99,7 +99,7 @@ /** * This constructor should be used only by JAX-WS Runtime and is not meant for external consumption. * @deprecated - * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSBindingProvider, WSBinding, Container, Codec,SEIModel)}. + * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSService, WSBindingProvider, WSBinding, Container, Codec, SEIModel, Class)} */ public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding, @@ -110,7 +110,7 @@ /** * This constructor should be used only by JAX-WS Runtime and is not meant for external consumption. * @deprecated - * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSBindingProvider, WSBinding, Container, Codec, SEIModel)}. + * Use {@link #ClientTubeAssemblerContext(EndpointAddress, WSDLPort, WSService, WSBindingProvider, WSBinding, Container, Codec, SEIModel, Class)} */ public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding, --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Codec.java 2013-04-04 15:29:00.364614528 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Codec.java 2013-04-04 15:29:00.308614528 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -56,15 +56,17 @@ * {@link Codec} does not produce transport-specific information, such as HTTP headers. * *

    - * {@link Codec} is a non-reentrant object, meaning no two threads - * can concurrently invoke the decode method. This allows the implementation - * to easily reuse parser objects (as instance variables), which are costly otherwise. - * + * {@link Codec} implementations should be thread-safe; a codec instance could be used + * concurrently in multiple threads. If a codec have to generate or use a per-request + * state, the codec implementation must store the state in the Packet instead of using an + * instance variable of the codec implementation. * *

    * {@link BindingID} determines the {@link Codec}. See {@link BindingID#createEncoder(WSBinding)}. * * @author Kohsuke Kawaguchi + * @author shih-chang.chen@oracle.com + * * @see EndpointAwareCodec */ public interface Codec { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Codecs.java 2013-04-04 15:29:00.676614534 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Codecs.java 2013-04-04 15:29:00.616614533 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ContentType.java 2013-04-04 15:29:00.992614538 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ContentType.java 2013-04-04 15:29:00.932614538 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,10 +29,10 @@ * A Content-Type transport header that will be returned by {@link Codec#encode(com.sun.xml.internal.ws.api.message.Packet, java.io.OutputStream)}. * It will provide the Content-Type header and also take care of SOAP 1.1 SOAPAction header. * - * @see {@link com.sun.xml.internal.org.jvnet.ws.message.ContentType} + * @see com.oracle.webservices.internal.api.message.ContentType * TODO: rename to ContentMetadata? * * @author Vivek Pandey */ -public interface ContentType extends com.sun.xml.internal.org.jvnet.ws.message.ContentType { +public interface ContentType extends com.oracle.webservices.internal.api.message.ContentType { } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Engine.java 2013-04-04 15:29:01.300614544 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Engine.java 2013-04-04 15:29:01.232614542 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 @@ import java.util.concurrent.atomic.AtomicInteger; import com.sun.xml.internal.ws.api.message.Packet; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ContainerResolver; /** * Collection of {@link Fiber}s. @@ -42,29 +44,47 @@ public class Engine { private volatile Executor threadPool; public final String id; + private final Container container; + + String getId() { return id; } + Container getContainer() { return container; } + Executor getExecutor() { return threadPool; } public Engine(String id, Executor threadPool) { - this(id); - this.threadPool = threadPool; + this(id, ContainerResolver.getDefault().getContainer(), threadPool); + } + + public Engine(String id, Container container, Executor threadPool) { + this(id, container); + this.threadPool = threadPool != null ? wrap(threadPool) : null; } public Engine(String id) { + this(id, ContainerResolver.getDefault().getContainer()); + } + + public Engine(String id, Container container) { this.id = id; + this.container = container; } public void setExecutor(Executor threadPool) { - this.threadPool = threadPool; + this.threadPool = threadPool != null ? wrap(threadPool) : null; } void addRunnable(Fiber fiber) { if(threadPool==null) { synchronized(this) { - threadPool = Executors.newCachedThreadPool(new DaemonThreadFactory()); + threadPool = wrap(Executors.newCachedThreadPool(new DaemonThreadFactory())); } } threadPool.execute(fiber); } + private Executor wrap(Executor ex) { + return ContainerResolver.getDefault().wrapExecutor(container, ex); + } + /** * Creates a new fiber in a suspended state. * @@ -80,27 +100,21 @@ private static class DaemonThreadFactory implements ThreadFactory { static final AtomicInteger poolNumber = new AtomicInteger(1); - final ThreadGroup group; final AtomicInteger threadNumber = new AtomicInteger(1); final String namePrefix; DaemonThreadFactory() { - SecurityManager s = System.getSecurityManager(); - group = (s != null)? s.getThreadGroup() : - Thread.currentThread().getThreadGroup(); - namePrefix = "jaxws-engine-" + - poolNumber.getAndIncrement() + - "-thread-"; + namePrefix = "jaxws-engine-" + poolNumber.getAndIncrement() + "-thread-"; } public Thread newThread(Runnable r) { - Thread t = new Thread(group, r, - namePrefix + threadNumber.getAndIncrement(), - 0); - if (!t.isDaemon()) + Thread t = new Thread(null, r, namePrefix + threadNumber.getAndIncrement(), 0); + if (!t.isDaemon()) { t.setDaemon(true); - if (t.getPriority() != Thread.NORM_PRIORITY) + } + if (t.getPriority() != Thread.NORM_PRIORITY) { t.setPriority(Thread.NORM_PRIORITY); + } return t; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Fiber.java 2013-04-04 15:29:01.588614548 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Fiber.java 2013-04-04 15:29:01.532614547 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,20 +32,27 @@ import com.sun.xml.internal.ws.api.ComponentRegistry; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl; +import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl; import com.sun.xml.internal.ws.api.server.Adapter; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ContainerResolver; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import java.util.logging.Logger; +import javax.xml.ws.Holder; +import javax.xml.ws.WebServiceException; + /** * User-level thread. Represents the execution of one request/response processing. *

    @@ -108,6 +115,7 @@ * Callback interface for notification of suspend and resume. * * @since 2.2.6 + * @deprecated Use {@link NextAction#suspend(Runnable)} */ public interface Listener { /** @@ -123,12 +131,13 @@ public void fiberResumed(Fiber fiber); } - private List _listeners = new ArrayList(); + private final List _listeners = new ArrayList(); /** * Adds suspend/resume callback listener * @param listener Listener * @since 2.2.6 + * @deprecated */ public void addListener(Listener listener) { synchronized(_listeners) { @@ -142,6 +151,7 @@ * Removes suspend/resume callback listener * @param listener Listener * @since 2.2.6 + * @deprecated */ public void removeListener(Listener listener) { synchronized(_listeners) { @@ -149,7 +159,7 @@ } } - private List getCurrentListeners() { + List getCurrentListeners() { synchronized(_listeners) { return new ArrayList(_listeners); } @@ -210,11 +220,6 @@ private volatile boolean isInsideSuspendCallbacks = false; /** - * Is this fiber completed? - */ - private volatile boolean completed; - - /** * Is this {@link Fiber} currently running in the synchronous mode? */ private boolean synchronous; @@ -229,20 +234,6 @@ private List interceptors; /** - * Not null when {@link #interceptors} is not null. - */ - private InterceptorHandler interceptorHandler; - - /** - * This flag is set to true when a new interceptor is added. - *

    - * When that happens, we need to first exit the current interceptors - * and then reenter them, so that the newly added interceptors start - * taking effect. This flag is used to control that flow. - */ - private boolean needsToReenter; - - /** * Fiber's context {@link ClassLoader}. */ private @@ -253,11 +244,24 @@ @Nullable CompletionCallback completionCallback; + private boolean isDeliverThrowableInPacket = false; + + public void setDeliverThrowableInPacket(boolean isDeliverThrowableInPacket) { + this.isDeliverThrowableInPacket = isDeliverThrowableInPacket; + } + /** * The thread on which this Fiber is currently executing, if applicable. */ private Thread currentThread; + /** + * Replace uses of synchronized(this) with this lock so that we can control + * unlocking for resume use cases + */ + private final ReentrantLock lock = new ReentrantLock(); + private final Condition condition = lock.newCondition(); + private volatile boolean isCanceled; /** @@ -277,7 +281,7 @@ private boolean startedSync; /** - * Callback to be invoked when a {@link Fiber} finishs execution. + * Callback to be invoked when a {@link Fiber} finishes execution. */ public interface CompletionCallback { /** @@ -298,11 +302,9 @@ Fiber(Engine engine) { this.owner = engine; + id = iotaGen.incrementAndGet(); if (isTraceEnabled()) { - id = iotaGen.incrementAndGet(); - LOGGER.fine(getName() + " created"); - } else { - id = -1; + LOGGER.log(Level.FINE, "{0} created", getName()); } // if this is run from another fiber, then we naturally inherit its context classloader, @@ -333,8 +335,8 @@ if (packet != null) { for (SOAPVersion sv: SOAPVersion.values()) { for (AddressingVersion av: AddressingVersion.values()) { - action = packet.getMessage() != null ? packet.getMessage().getHeaders().getAction(av, sv) : null; - msgId = packet.getMessage() != null ? packet.getMessage().getHeaders().getMessageID(av, sv) : null; + action = packet.getMessage() != null ? AddressingUtils.getAction(packet.getMessage().getHeaders(), av, sv) : null; + msgId = packet.getMessage() != null ? AddressingUtils.getMessageID(packet.getMessage().getHeaders(), av, sv) : null; if (action != null || msgId != null) { break; } @@ -358,7 +360,7 @@ tubeDesc = peekCont() + ".processResponse()"; } - LOGGER.fine(getName() + " " + desc + " with " + actionAndMsgDesc + " and 'current' tube " + tubeDesc + " from thread " + Thread.currentThread().getName() + " with Packet: " + (packet != null ? packet.toShortString() : null)); + LOGGER.log(Level.FINE, "{0} {1} with {2} and ''current'' tube {3} from thread {4} with Packet: {5}", new Object[]{getName(), desc, actionAndMsgDesc, tubeDesc, Thread.currentThread().getName(), packet != null ? packet.toShortString() : null}); } } @@ -445,9 +447,9 @@ * until message order is confirmed prior to returning to asynchronous processing. * @since 2.2.6 */ - public synchronized void resume(@NotNull Packet resumePacket, - boolean forceSync) { - resume(resumePacket, forceSync, null); + public void resume(@NotNull Packet resumePacket, + boolean forceSync) { + resume(resumePacket, forceSync, null); } /** @@ -458,51 +460,53 @@ public void resume(@NotNull Packet resumePacket, boolean forceSync, CompletionCallback callback) { - - synchronized(this) { + lock.lock(); + try { if (callback != null) { setCompletionCallback(callback); } if(isTraceEnabled()) - LOGGER.fine(getName()+" resuming. Will have suspendedCount=" + (suspendedCount-1)); - packet = resumePacket; - if( --suspendedCount == 0 ) { - if (!isInsideSuspendCallbacks) { + LOGGER.log(Level.FINE, "{0} resuming. Will have suspendedCount={1}", new Object[]{getName(), suspendedCount-1}); + packet = resumePacket; + if( --suspendedCount == 0 ) { + if (!isInsideSuspendCallbacks) { List listeners = getCurrentListeners(); for (Listener listener: listeners) { try { listener.fiberResumed(this); } catch (Throwable e) { if (isTraceEnabled()) - LOGGER.fine("Listener " + listener + " threw exception: " + e.getMessage()); + LOGGER.log(Level.FINE, "Listener {0} threw exception: {1}", new Object[]{listener, e.getMessage()}); } } if(synchronous) { - notifyAll(); + condition.signalAll(); } else if (forceSync || startedSync) { run(); } else { dumpFiberContext("resuming (async)"); owner.addRunnable(this); } - } - } else { - if (isTraceEnabled()) { - LOGGER.fine(getName() + " taking no action on resume because suspendedCount != 0: " + suspendedCount); + } + } else { + if (isTraceEnabled()) { + LOGGER.log(Level.FINE, "{0} taking no action on resume because suspendedCount != 0: {1}", new Object[]{getName(), suspendedCount}); } } - } + } finally { + lock.unlock(); + } } /** * Wakes up a suspended fiber and begins response processing. * @since 2.2.6 */ - public synchronized void resumeAndReturn(@NotNull Packet resumePacket, - boolean forceSync) { + public void resumeAndReturn(@NotNull Packet resumePacket, + boolean forceSync) { if(isTraceEnabled()) - LOGGER.fine(getName()+" resumed with Return Packet"); + LOGGER.log(Level.FINE, "{0} resumed with Return Packet", getName()); next = null; resume(resumePacket, forceSync); } @@ -523,8 +527,30 @@ * * @param throwable exception that is used in the resumed processing */ - public synchronized void resume(@NotNull Throwable throwable) { - resume(throwable, false); + public void resume(@NotNull Throwable throwable) { + resume(throwable, packet, false); + } + + /** + * Wakes up a suspended fiber with an exception. + *

    + *

    + * The execution of the suspended fiber will be resumed in the response + * processing direction, by calling the {@link Tube#processException(Throwable)} method + * on the next/first {@link Tube} in the {@link Fiber}'s processing stack with + * the specified exception as the parameter. + *

    + *

    + * This method is implemented in a race-free way. Another thread can invoke + * this method even before this fiber goes into the suspension mode. So the caller + * need not worry about synchronizing {@link NextAction#suspend()} and this method. + * + * @param throwable exception that is used in the resumed processing + * @param packet Packet that will be visible on the Fiber after the resume + * @since 2.2.8 + */ + public void resume(@NotNull Throwable throwable, @NotNull Packet packet) { + resume(throwable, packet, false); } /** @@ -539,10 +565,29 @@ * @param forceSync if processing begins synchronously * @since 2.2.6 */ - public synchronized void resume(@NotNull Throwable error, - boolean forceSync) { + public void resume(@NotNull Throwable error, + boolean forceSync) { + resume(error, packet, forceSync); + } + + /** + * Wakes up a suspend fiber with an exception. + * + * If forceSync is true, then the suspended fiber will resume with + * synchronous processing on the current thread. This will continue + * until some Tube indicates that it is safe to switch to asynchronous + * processing. + * + * @param error exception that is used in the resumed processing + * @param packet Packet that will be visible on the Fiber after the resume + * @param forceSync if processing begins synchronously + * @since 2.2.8 + */ + public void resume(@NotNull Throwable error, + @NotNull Packet packet, + boolean forceSync) { if(isTraceEnabled()) - LOGGER.fine(getName()+" resumed with Return Throwable"); + LOGGER.log(Level.FINE, "{0} resumed with Return Throwable", getName()); next = null; throwable = error; resume(packet, forceSync); @@ -550,17 +595,19 @@ /** * Marks this Fiber as cancelled. A cancelled Fiber will never invoke its completion callback - * @param mayInterrupt if cancel should use {@link Thread.interrupt()} - * @see java.util.Future.cancel + * @param mayInterrupt if cancel should use {@link Thread#interrupt()} + * @see java.util.concurrent.Future#cancel(boolean) * @since 2.2.6 */ + @Override public void cancel(boolean mayInterrupt) { isCanceled = true; if (mayInterrupt) { - synchronized(this) { - if (currentThread != null) - currentThread.interrupt(); - } + // synchronized(this) is used as Thread running Fiber will be holding lock + synchronized(this) { + if (currentThread != null) + currentThread.interrupt(); + } } } @@ -569,49 +616,85 @@ *

    * The call returns immediately, and when the fiber is resumed * the execution picks up from the last scheduled continuation. + * @param onExitRunnable runnable to be invoked after fiber is marked for suspension + * @return if control loop must exit */ - private boolean suspend() { + private boolean suspend(Holder isRequireUnlock, Runnable onExitRunnable) { + if(isTraceEnabled()) { + LOGGER.log(Level.FINE, "{0} suspending. Will have suspendedCount={1}", new Object[]{getName(), suspendedCount+1}); + if (suspendedCount > 0) { + LOGGER.log(Level.FINE, "WARNING - {0} suspended more than resumed. Will require more than one resume to actually resume this fiber.", getName()); + } + } - synchronized(this) { - if(isTraceEnabled()) { - LOGGER.fine(getName()+" suspending. Will have suspendedCount=" + (suspendedCount+1)); - if (suspendedCount > 0) { - LOGGER.fine("WARNING - " + getName()+" suspended more than resumed. Will require more than one resume to actually resume this fiber."); + List listeners = getCurrentListeners(); + if (++suspendedCount == 1) { + isInsideSuspendCallbacks = true; + try { + for (Listener listener: listeners) { + try { + listener.fiberSuspended(this); + } catch (Throwable e) { + if(isTraceEnabled()) + LOGGER.log(Level.FINE, "Listener {0} threw exception: {1}", new Object[]{listener, e.getMessage()}); + } } + } finally { + isInsideSuspendCallbacks = false; } + } - List listeners = getCurrentListeners(); - if (++suspendedCount == 1) { - isInsideSuspendCallbacks = true; + if (suspendedCount <= 0) { + // suspend callback caused fiber to resume + for (Listener listener: listeners) { try { - for (Listener listener: listeners) { - try { - listener.fiberSuspended(this); - } catch (Throwable e) { - if(isTraceEnabled()) - LOGGER.fine("Listener " + listener + " threw exception: " + e.getMessage()); - } - } - } finally { - isInsideSuspendCallbacks = false; + listener.fiberResumed(this); + } catch (Throwable e) { + if(isTraceEnabled()) + LOGGER.log(Level.FINE, "Listener {0} threw exception: {1}", new Object[]{listener, e.getMessage()}); } } - if (suspendedCount <= 0) { - // suspend callback caused fiber to resume - for (Listener listener: listeners) { - try { - listener.fiberResumed(this); - } catch (Throwable e) { - if(isTraceEnabled()) - LOGGER.fine("Listener " + listener + " threw exception: " + e.getMessage()); - } + } else if (onExitRunnable != null) { + // synchronous use cases cannot disconnect from the current thread + if (!synchronous) { + /* INTENTIONALLY UNLOCKING EARLY */ + synchronized(this) { + // currentThread is protected by the monitor for this fiber so + // that it is accessible to cancel() even when the lock is held + currentThread = null; } + lock.unlock(); + assert(!lock.isHeldByCurrentThread()); + isRequireUnlock.value = Boolean.FALSE; - return false; + try { + onExitRunnable.run(); + } catch(Throwable t) { + throw new OnExitRunnableException(t); + } + + return true; + + } else { + // for synchronous we will stay with current thread, so do not disconnect + if (isTraceEnabled()) + LOGGER.fine("onExitRunnable used with synchronous Fiber execution -- not exiting current thread"); + onExitRunnable.run(); } + } + + return false; + } + + private static final class OnExitRunnableException extends RuntimeException { + private static final long serialVersionUID = 1L; - return true; + Throwable target; + + public OnExitRunnableException(Throwable target) { + super((Throwable)null); // see pattern for InvocationTargetException + this.target = target; } } @@ -634,13 +717,15 @@ *

  • Y.processRequest() * */ - public void addInterceptor(@NotNull FiberContextSwitchInterceptor interceptor) { + public synchronized void addInterceptor(@NotNull FiberContextSwitchInterceptor interceptor) { if (interceptors == null) { interceptors = new ArrayList(); - interceptorHandler = new InterceptorHandler(); + } else { + List l = new ArrayList(); + l.addAll(interceptors); + interceptors = l; } interceptors.add(interceptor); - needsToReenter = true; } /** @@ -666,10 +751,17 @@ * @return true if the specified interceptor was removed. False if * the specified interceptor was not registered with this fiber to begin with. */ - public boolean removeInterceptor(@NotNull FiberContextSwitchInterceptor interceptor) { - if (interceptors != null && interceptors.remove(interceptor)) { - needsToReenter = true; - return true; + public synchronized boolean removeInterceptor(@NotNull FiberContextSwitchInterceptor interceptor) { + if (interceptors != null) { + boolean result = interceptors.remove(interceptor); + if (interceptors.isEmpty()) + interceptors = null; + else { + List l = new ArrayList(); + l.addAll(interceptors); + interceptors = l; + } + return result; } return false; } @@ -697,19 +789,27 @@ * of {@link Fiber}. */ @Deprecated + @Override public void run() { - assert !synchronous; - doRun(); - if (startedSync && suspendedCount == 0 && - (next != null || contsSize > 0)) { - // We bailed out of running this fiber we started as sync, and now - // want to finish running it async - startedSync = false; - // Start back up as an async fiber - dumpFiberContext("restarting (async) after startSync"); - owner.addRunnable(this); - } else { - completionCheck(); + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); + try { + assert !synchronous; + // doRun returns true to indicate an early exit from fiber processing + if (!doRun()) { + if (startedSync && suspendedCount == 0 && + (next != null || contsSize > 0)) { + // We bailed out of running this fiber we started as sync, and now + // want to finish running it async + startedSync = false; + // Start back up as an async fiber + dumpFiberContext("restarting (async) after startSync"); + owner.addRunnable(this); + } else { + completionCheck(); + } + } + } finally { + ContainerResolver.getDefault().exitContainer(old); } } @@ -739,85 +839,102 @@ * @return The response packet to the request. * @see #start(Tube, Packet, CompletionCallback) */ - public synchronized + public @NotNull Packet runSync(@NotNull Tube tubeline, @NotNull Packet request) { - // save the current continuation, so that we return runSync() without executing them. - final Tube[] oldCont = conts; - final int oldContSize = contsSize; - final boolean oldSynchronous = synchronous; - final Tube oldNext = next; - - if (oldContSize > 0) { - conts = new Tube[16]; - contsSize = 0; - } - + lock.lock(); try { - synchronous = true; - this.packet = request; - next = tubeline; - doRun(); - if (throwable != null) { - if (throwable instanceof RuntimeException) { - throw (RuntimeException) throwable; + // save the current continuation, so that we return runSync() without executing them. + final Tube[] oldCont = conts; + final int oldContSize = contsSize; + final boolean oldSynchronous = synchronous; + final Tube oldNext = next; + + if (oldContSize > 0) { + conts = new Tube[16]; + contsSize = 0; + } + + try { + synchronous = true; + this.packet = request; + next = tubeline; + doRun(); + if (throwable != null) { + if (isDeliverThrowableInPacket) { + packet.addSatellite(new ThrowableContainerPropertySet(throwable)); + } else { + if (throwable instanceof RuntimeException) { + throw (RuntimeException) throwable; + } + if (throwable instanceof Error) { + throw (Error) throwable; + } + // our system is supposed to only accept Error or RuntimeException + throw new AssertionError(throwable); + } } - if (throwable instanceof Error) { - throw (Error) throwable; + return this.packet; + } finally { + conts = oldCont; + contsSize = oldContSize; + synchronous = oldSynchronous; + next = oldNext; + if(interrupted) { + Thread.currentThread().interrupt(); + interrupted = false; } - // our system is supposed to only accept Error or RuntimeException - throw new AssertionError(throwable); + if(!started && !startedSync) + completionCheck(); } - return this.packet; } finally { - conts = oldCont; - contsSize = oldContSize; - synchronous = oldSynchronous; - next = oldNext; - if(interrupted) { - Thread.currentThread().interrupt(); - interrupted = false; - } - if(!started && !startedSync) - completionCheck(); + lock.unlock(); } } - private synchronized void completionCheck() { - // Don't trigger completion and callbacks if fiber is suspended - if(!isCanceled && contsSize==0 && suspendedCount == 0) { - if(isTraceEnabled()) - LOGGER.fine(getName()+" completed"); - completed = true; - clearListeners(); - notifyAll(); - if (completionCallback != null) { - if (throwable != null) - completionCallback.onCompletion(throwable); - else - completionCallback.onCompletion(packet); + private void completionCheck() { + lock.lock(); + try { + // Don't trigger completion and callbacks if fiber is suspended + if(!isCanceled && contsSize==0 && suspendedCount == 0) { + if(isTraceEnabled()) + LOGGER.log(Level.FINE, "{0} completed", getName()); + clearListeners(); + condition.signalAll(); + if (completionCallback != null) { + if (throwable != null) { + if (isDeliverThrowableInPacket) { + packet.addSatellite(new ThrowableContainerPropertySet(throwable)); + completionCallback.onCompletion(packet); + } else + completionCallback.onCompletion(throwable); + } else + completionCallback.onCompletion(packet); + } } + } finally { + lock.unlock(); } } - ///** - // * Blocks until the fiber completes. - // */ - //public synchronized void join() throws InterruptedException { - // while(!completed) - // wait(); - //} - /** * Invokes all registered {@link InterceptorHandler}s and then call into * {@link Fiber#__doRun()}. */ private class InterceptorHandler implements FiberContextSwitchInterceptor.Work { + private final Holder isUnlockRequired; + private final List ints; + /** * Index in {@link Fiber#interceptors} to invoke next. */ private int idx; + public InterceptorHandler(Holder isUnlockRequired, List ints) { + this.isUnlockRequired = isUnlockRequired; + this.ints = ints; + } + /** * Initiate the interception, and eventually invokes {@link Fiber#__doRun()}. */ @@ -826,86 +943,136 @@ return execute(next); } + @Override public Tube execute(Tube next) { - if (idx == interceptors.size()) { + if (idx == ints.size()) { Fiber.this.next = next; - __doRun(); + if (__doRun(isUnlockRequired, ints)) + return PLACEHOLDER; } else { - FiberContextSwitchInterceptor interceptor = interceptors.get(idx++); + FiberContextSwitchInterceptor interceptor = ints.get(idx++); return interceptor.execute(Fiber.this, next, this); } return Fiber.this.next; } } + private static final PlaceholderTube PLACEHOLDER = new PlaceholderTube(); + + private static class PlaceholderTube extends AbstractTubeImpl { + + @Override + public NextAction processRequest(Packet request) { + throw new UnsupportedOperationException(); + } + + @Override + public NextAction processResponse(Packet response) { + throw new UnsupportedOperationException(); + } + + @Override + public NextAction processException(Throwable t) { + return doThrow(t); + } + + @Override + public void preDestroy() { + } + + @Override + public PlaceholderTube copy(TubeCloner cloner) { + throw new UnsupportedOperationException(); + } + } + /** * Executes the fiber as much as possible. * */ - @SuppressWarnings({"LoopStatementThatDoesntLoop"}) // IntelliJ reports this bogus error - private void doRun() { - + private boolean doRun() { dumpFiberContext("running"); if (serializeExecution) { serializedExecutionLock.lock(); try { - _doRun(next); + return _doRun(next); } finally { serializedExecutionLock.unlock(); } } else { - _doRun(next); + return _doRun(next); } } - private String currentThreadMonitor = "CurrentThreadMonitor"; + private boolean _doRun(Tube next) { + // isRequireUnlock will contain Boolean.FALSE when lock has already been released in suspend + Holder isRequireUnlock = new Holder(Boolean.TRUE); + lock.lock(); + try { + List ints; + ClassLoader old; + synchronized(this) { + ints = interceptors; + + // currentThread is protected by the monitor for this fiber so + // that it is accessible to cancel() even when the lock is held + currentThread = Thread.currentThread(); + if (isTraceEnabled()) { + LOGGER.log(Level.FINE, "Thread entering _doRun(): {0}", currentThread); + } - private void _doRun(Tube next) { - Thread thread; - synchronized(currentThreadMonitor) { - if (currentThread != null && !synchronous) { - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.fine("Attempt to run Fiber ['" + this + "'] in more than one thread. Current Thread: " + currentThread + " Attempted Thread: " + Thread.currentThread()); - } - while (currentThread != null) { - try { - currentThreadMonitor.wait(); - } catch (Exception e) { - // ignore - } + old = currentThread.getContextClassLoader(); + currentThread.setContextClassLoader(contextClassLoader); } - } - currentThread = Thread.currentThread(); - thread = currentThread; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.fine("Thread entering _doRun(): " + thread); - } - } - ClassLoader old = thread.getContextClassLoader(); - thread.setContextClassLoader(contextClassLoader); - try { - do { - needsToReenter = false; + try { + boolean needsToReenter = false; + do { + // if interceptors are set, go through the interceptors. + if (ints == null) { + this.next = next; + if (__doRun(isRequireUnlock, ints)) { + return true; + } + } else { + next = new InterceptorHandler(isRequireUnlock, ints).invoke(next); + if (next == PLACEHOLDER) { + return true; + } + } - // if interceptors are set, go through the interceptors. - if(interceptorHandler ==null) { - this.next = next; - __doRun(); + synchronized(this) { + needsToReenter = (ints != interceptors); + if (needsToReenter) + ints = interceptors; + } + } while (needsToReenter); + } catch(OnExitRunnableException o) { + // catching this exception indicates onExitRunnable in suspend() threw. + // we must still avoid double unlock + Throwable t = o.target; + if (t instanceof WebServiceException) + throw (WebServiceException) t; + throw new WebServiceException(t); + } finally { + // don't reference currentThread here because fiber processing + // may already be running on a different thread (Note: isAlreadyExited + // tracks this state + Thread thread = Thread.currentThread(); + thread.setContextClassLoader(old); + if (isTraceEnabled()) { + LOGGER.log(Level.FINE, "Thread leaving _doRun(): {0}", thread); } - else - next = interceptorHandler.invoke(next); - } while (needsToReenter); + } + return false; } finally { - thread.setContextClassLoader(old); - synchronized(currentThreadMonitor) { - currentThread = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.fine("Thread leaving _doRun(): " + thread); - } - currentThreadMonitor.notify(); + if (isRequireUnlock.value) { + synchronized(this) { + currentThread = null; + } + lock.unlock(); } } } @@ -915,7 +1082,9 @@ * * @see #doRun() */ - private void __doRun() { + private boolean __doRun(Holder isRequireUnlock, List originalInterceptors) { + assert(lock.isHeldByCurrentThread()); + final Fiber old = CURRENT_FIBER.get(); CURRENT_FIBER.set(this); @@ -924,8 +1093,14 @@ try { boolean abortResponse = false; - boolean justSuspended = false; - while(!isCanceled && !isBlocking(justSuspended) && !needsToReenter) { + while(isReady(originalInterceptors)) { + if (isCanceled) { + next = null; + throwable = null; + contsSize = 0; + break; + } + try { NextAction na; Tube last; @@ -933,33 +1108,33 @@ if(contsSize==0 || abortResponse) { contsSize = 0; // abortResponse case // nothing else to execute. we are done. - return; + return false; } last = popCont(); if (traceEnabled) - LOGGER.finer(getName() + ' ' + last + ".processException(" + throwable + ')'); + LOGGER.log(Level.FINER, "{0} {1}.processException({2})", new Object[]{getName(), last, throwable}); na = last.processException(throwable); } else { if(next!=null) { if(traceEnabled) - LOGGER.finer(getName()+' '+next+".processRequest("+(packet != null ? "Packet@"+Integer.toHexString(packet.hashCode()) : "null")+')'); + LOGGER.log(Level.FINER, "{0} {1}.processRequest({2})", new Object[]{getName(), next, packet != null ? "Packet@"+Integer.toHexString(packet.hashCode()) : "null"}); na = next.processRequest(packet); last = next; } else { if(contsSize==0 || abortResponse) { // nothing else to execute. we are done. contsSize = 0; - return; + return false; } last = popCont(); if(traceEnabled) - LOGGER.finer(getName()+' '+last+".processResponse("+(packet != null ? "Packet@"+Integer.toHexString(packet.hashCode()) : "null")+')'); + LOGGER.log(Level.FINER, "{0} {1}.processResponse({2})", new Object[]{getName(), last, packet != null ? "Packet@"+Integer.toHexString(packet.hashCode()) : "null"}); na = last.processResponse(packet); } } if (traceEnabled) - LOGGER.finer(getName() + ' ' + last + " returned with " + na); + LOGGER.log(Level.FINER, "{0} {1} returned with {2}", new Object[]{getName(), last, na}); // If resume is called before suspend, then make sure // resume(Packet) is not lost @@ -981,14 +1156,14 @@ if (na.kind == NextAction.INVOKE_ASYNC && startedSync) { // Break out here - return; + return false; } break; case NextAction.THROW_ABORT_RESPONSE: case NextAction.ABORT_RESPONSE: abortResponse = true; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.fine("Fiber " + this + " is aborting a response due to exception: " + na.throwable); + if (isTraceEnabled()) { + LOGGER.log(Level.FINE, "Fiber {0} is aborting a response due to exception: {1}", new Object[]{this, na.throwable}); } case NextAction.RETURN: case NextAction.THROW: @@ -1001,7 +1176,8 @@ pushCont(last); } next = na.next; - justSuspended = suspend(); + if(suspend(isRequireUnlock, na.onExitRunnable)) + return true; // explicitly exiting control loop break; default: throw new AssertionError(); @@ -1019,18 +1195,14 @@ dumpFiberContext("After tube execution"); } - if (isCanceled) { - next = null; - throwable = null; - contsSize = 0; - } - // there's nothing we can execute right away. // we'll be back when this fiber is resumed. } finally { CURRENT_FIBER.set(old); } + + return false; } private void pushCont(Tube tube) { @@ -1068,26 +1240,34 @@ } /** - * Returns true if the fiber needs to block its execution. + * Returns true if the fiber is ready to execute. */ - private boolean isBlocking(boolean justSuspended) { + private boolean isReady(List originalInterceptors) { if (synchronous) { while (suspendedCount == 1) try { if (isTraceEnabled()) { - LOGGER.fine(getName() + " is blocking thread " + Thread.currentThread().getName()); + LOGGER.log(Level.FINE, "{0} is blocking thread {1}", new Object[]{getName(), Thread.currentThread().getName()}); } - wait(); // the synchronized block is the whole runSync method. + condition.await(); // the synchronized block is the whole runSync method. } catch (InterruptedException e) { // remember that we are interrupted, but don't respond to it // right away. This behavior is in line with what happens // when you are actually running the whole thing synchronously. interrupted = true; } - return false; + + synchronized(this) { + return interceptors == originalInterceptors; + } + } + else { + if (suspendedCount>0) + return false; + synchronized(this) { + return interceptors == originalInterceptors; + } } - else - return justSuspended || suspendedCount==1; } private String getName() { @@ -1215,16 +1395,19 @@ private final Set components = new CopyOnWriteArraySet(); - public S getSPI(Class spiType) { - for(Component c : components) { - S spi = c.getSPI(spiType); - if (spi != null) - return spi; - } - return null; + @Override + public S getSPI(Class spiType) { + for (Component c : components) { + S spi = c.getSPI(spiType); + if (spi != null) { + return spi; + } } + return null; + } - public Set getComponents() { - return components; - } + @Override + public Set getComponents() { + return components; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java 2013-04-04 15:29:01.980614554 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java 2013-04-04 15:29:01.920614553 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptorFactory.java 2013-04-04 15:29:02.300614559 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptorFactory.java 2013-04-04 15:29:02.240614558 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/NextAction.java 2013-04-04 15:29:02.608614563 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/NextAction.java 2013-04-04 15:29:02.544614562 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.api.pipe; import com.sun.xml.internal.ws.api.message.Packet; +import java.util.concurrent.Executor; /** * Indicates what shall happen after {@link Tube#processRequest(Packet)} or @@ -44,6 +45,7 @@ * Really either {@link RuntimeException} or {@link Error}. */ Throwable throwable; + Runnable onExitRunnable; // public enum Kind { INVOKE, INVOKE_AND_FORGET, RETURN, SUSPEND } @@ -97,6 +99,20 @@ /** * Indicates that the next action is to flip the processing direction + * and starts exception processing, but with the indicated context. + * + * @param t + * Either {@link RuntimeException} or {@link Error}, but defined to + * take {@link Throwable} because {@link Tube#processException(Throwable)} + * takes {@link Throwable}. + */ + public void throwException( Packet response, Throwable t ) { + // Use of RETURN is correct -- Fiber processing does not set packet for type of THROW + set(RETURN, null, response, t); + } + + /** + * Indicates that the next action is to flip the processing direction * and starts exception processing. * * @param t @@ -145,18 +161,52 @@ /** * Indicates that the fiber should be suspended. * Once {@link Fiber#resume(Packet) resumed}, return the response processing. + * @deprecated Use variants that pass {@link Runnable} */ public void suspend() { - set(SUSPEND, null, null, null); + suspend(null, null); + } + + /** + * Indicates that the fiber should be suspended. Once the current {@link Thread} + * exits the fiber's control loop, the onExitRunnable will be invoked. This {@link Runnable} + * may call {@link Fiber#resume(Packet)}; however it is still guaranteed that the current + * Thread will return control, therefore, further processing will be handled on a {@link Thread} + * from the {@link Executor}. For synchronous cases, the Thread invoking this fiber cannot return + * until fiber processing is complete; therefore, the guarantee is only that the onExitRunnable + * will be invoked prior to completing the suspension. + * @since 2.2.7 + */ + public void suspend(Runnable onExitRunnable) { + suspend(null, onExitRunnable); } /** * Indicates that the fiber should be suspended. * Once {@link Fiber#resume(Packet) resumed}, resume with the * {@link Tube#processRequest(Packet)} on the given next tube. + * @deprecated Use variants that pass {@link Runnable} */ public void suspend(Tube next) { + suspend(next, null); + } + + /** + * Indicates that the fiber should be suspended. Once the current {@link Thread} + * exits the fiber's control loop, the onExitRunnable will be invoked. This {@link Runnable} + * may call {@link Fiber#resume(Packet)}; however it is still guaranteed that the current + * fiber will return control, therefore, further processing will be handled on a {@link Thread} + * from the {@link Executor}. For synchronous cases, the Thread invoking this fiber cannot return + * until fiber processing is complete; therefore, the guarantee is only that the onExitRunnable + * will be invoked prior to completing the suspension. + *

    + * Once {@link Fiber#resume(Packet) resumed}, resume with the + * {@link Tube#processRequest(Packet)} on the given next tube. + * @since 2.2.7 + */ + public void suspend(Tube next, Runnable onExitRunnable) { set(SUSPEND, next, null, null); + this.onExitRunnable = onExitRunnable; } /** Returns the next tube --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Pipe.java 2013-04-04 15:29:02.884614568 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Pipe.java 2013-04-04 15:29:02.832614567 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -341,7 +341,6 @@ * * @return * always non-null {@link Pipe}. - * @param cloner */ Pipe copy(PipeCloner cloner); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipeCloner.java 2013-04-04 15:29:03.120614572 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipeCloner.java 2013-04-04 15:29:03.068614571 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipeClonerImpl.java 2013-04-04 15:29:03.328614575 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipeClonerImpl.java 2013-04-04 15:29:03.280614574 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipelineAssembler.java 2013-04-04 15:29:03.540614578 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipelineAssembler.java 2013-04-04 15:29:03.488614578 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipelineAssemblerFactory.java 2013-04-04 15:29:03.752614581 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/PipelineAssemblerFactory.java 2013-04-04 15:29:03.700614580 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/SOAPBindingCodec.java 2013-04-04 15:29:03.964614585 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/SOAPBindingCodec.java 2013-04-04 15:29:03.916614584 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java 2013-04-04 15:29:04.172614588 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java 2013-04-04 15:29:04.124614587 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java 2013-04-04 15:29:04.400614592 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java 2013-04-04 15:29:04.340614591 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -225,7 +225,7 @@ * encode/decode entire MIME messages in SOAP binding) * * @return codec to be used for web service requests - * @see {@link Codecs} + * @see Codecs */ public @NotNull Codec getCodec() { return codec; @@ -247,7 +247,7 @@ * serving requests concurrently. * * @param codec codec to be used for web service requests - * @see {@link Codecs} + * @see Codecs */ public void setCodec(@NotNull Codec codec) { this.codec = codec; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java 2013-04-04 15:29:04.660614596 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java 2013-04-04 15:29:04.600614594 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Stubs.java 2013-04-04 15:29:04.932614600 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Stubs.java 2013-04-04 15:29:04.884614599 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -321,7 +321,7 @@ /** * Creates a new {@link Message}-based {@link Dispatch} stub that connects to the given pipe. - * The returned dispatch is always {@link Service.Mode#MESSAGE}. + * The returned dispatch is always {@link Mode#MESSAGE}. * * @param portName * see {@link Service#createDispatch(QName, Class, Service.Mode)}. @@ -344,7 +344,7 @@ /** * Creates a new {@link Message}-based {@link Dispatch} stub that connects to the given pipe. - * The returned dispatch is always {@link Service.Mode#MESSAGE}. + * The returned dispatch is always {@link Mode#MESSAGE}. * * @param portInfo * see common parameters @@ -381,7 +381,7 @@ /** * Creates a new {@link Message}-based {@link Dispatch} stub that connects to the given pipe. - * The returned dispatch is always {@link Service.Mode#MESSAGE}. + * The returned dispatch is always {@link Mode#MESSAGE}. * * @param portInfo * see common parameters --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/SyncStartForAsyncFeature.java 2013-04-04 15:29:05.200614604 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/SyncStartForAsyncFeature.java 2013-04-04 15:29:05.140614603 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TransportPipeFactory.java 2013-04-04 15:29:05.508614609 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TransportPipeFactory.java 2013-04-04 15:29:05.444614608 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java 2013-04-04 15:29:05.812614614 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java 2013-04-04 15:29:05.756614612 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,10 +29,10 @@ import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter; -import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.pipe.StandaloneTubeAssembler; +import java.util.logging.Level; import javax.xml.ws.WebServiceException; import java.util.logging.Logger; @@ -68,7 +68,7 @@ *

    * {@link TransportTubeFactory} look-up follows the standard service * discovery mechanism, so you need - * {@code META-INF/services/com.sun.xml.internal.ws.api.pipe.TransportTubeFactory}. + * {@code META-INF/services/com.sun.xml.internal.ws.api.pipe.BasicTransportTubeFactory}. * * @author Jitendra Kotamraju * @see StandaloneTubeAssembler @@ -116,8 +116,10 @@ public static Tube create(@Nullable ClassLoader classLoader, @NotNull ClientTubeAssemblerContext context) { for (TransportTubeFactory factory : ServiceFinder.find(TransportTubeFactory.class,classLoader, context.getContainer())) { Tube tube = factory.doCreate(context); - if(tube !=null) { - TransportTubeFactory.logger.fine(factory.getClass()+" successfully created "+tube); + if (tube !=null) { + if (logger.isLoggable(Level.FINE)) { + TransportTubeFactory.logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), tube}); + } return tube; } } @@ -130,7 +132,9 @@ for (TransportPipeFactory factory : ServiceFinder.find(TransportPipeFactory.class,classLoader)) { Pipe pipe = factory.doCreate(ctxt); if (pipe!=null) { - logger.fine(factory.getClass()+" successfully created "+pipe); + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), pipe}); + } return PipeAdapter.adapt(pipe); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Tube.java 2013-04-04 15:29:06.112614618 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Tube.java 2013-04-04 15:29:06.052614617 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -391,7 +391,6 @@ * * @return * always non-null {@link Tube}. - * @param cloner */ Tube copy(TubeCloner cloner); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TubeCloner.java 2013-04-04 15:29:06.424614623 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TubeCloner.java 2013-04-04 15:29:06.364614622 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +45,7 @@ * Invoked by a client of a tube to clone the whole pipeline. * *

    - * {@link Tube}s implementing the {@link Tube#copy(TubeClonerImpl)} method + * {@link Tube}s implementing the {@link Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)} method * shall use {@link #copy(Tube)} method. * * @param p @@ -66,7 +66,7 @@ } /** - * Invoked by a {@link Tube#copy(TubeClonerImpl)} implementation + * Invoked by a {@link Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)} implementation * to copy a reference to another pipe. * *

    --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TubelineAssembler.java 2013-04-04 15:29:06.744614628 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TubelineAssembler.java 2013-04-04 15:29:06.672614627 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TubelineAssemblerFactory.java 2013-04-04 15:29:07.040614633 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/TubelineAssemblerFactory.java 2013-04-04 15:29:06.984614632 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +30,9 @@ import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter; import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.assembler.MetroTubelineAssembler; import com.sun.xml.internal.ws.util.ServiceFinder; -import com.sun.xml.internal.ws.util.pipe.StandaloneTubeAssembler; +import java.util.logging.Level; import java.util.logging.Logger; @@ -85,15 +86,16 @@ TubelineAssemblerFactory taf = container.getSPI(TubelineAssemblerFactory.class); if(taf!=null) { TubelineAssembler a = taf.doCreate(bindingId); - if(a!=null) + if (a != null) { return a; + } } } for (TubelineAssemblerFactory factory : ServiceFinder.find(TubelineAssemblerFactory.class, classLoader)) { TubelineAssembler assembler = factory.doCreate(bindingId); if (assembler != null) { - TubelineAssemblerFactory.logger.fine(factory.getClass() + " successfully created " + assembler); + TubelineAssemblerFactory.logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), assembler}); return assembler; } } @@ -102,13 +104,13 @@ for (PipelineAssemblerFactory factory : ServiceFinder.find(PipelineAssemblerFactory.class,classLoader)) { PipelineAssembler assembler = factory.doCreate(bindingId); if(assembler!=null) { - logger.fine(factory.getClass()+" successfully created "+assembler); + logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), assembler}); return new TubelineAssemblerAdapter(assembler); } } // default binding IDs that are known - return new StandaloneTubeAssembler(); + return new MetroTubelineAssembler(bindingId, MetroTubelineAssembler.JAXWS_TUBES_CONFIG_NAMES); } private static class TubelineAssemblerAdapter implements TubelineAssembler { @@ -118,6 +120,7 @@ this.assembler = assembler; } + @Override public @NotNull Tube createClient(@NotNull ClientTubeAssemblerContext context) { ClientPipeAssemblerContext ctxt = new ClientPipeAssemblerContext( context.getAddress(), context.getWsdlModel(), context.getService(), @@ -125,7 +128,11 @@ return PipeAdapter.adapt(assembler.createClient(ctxt)); } + @Override public @NotNull Tube createServer(@NotNull ServerTubeAssemblerContext context) { + if (!(context instanceof ServerPipeAssemblerContext)) { + throw new IllegalArgumentException("{0} is not instance of ServerPipeAssemblerContext"); + } return PipeAdapter.adapt(assembler.createServer((ServerPipeAssemblerContext) context)); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterPipeImpl.java 2013-04-04 15:29:07.348614637 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterPipeImpl.java 2013-04-04 15:29:07.288614636 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java 2013-04-04 15:29:07.644614642 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java 2013-04-04 15:29:07.588614641 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractPipeImpl.java 2013-04-04 15:29:07.948614647 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractPipeImpl.java 2013-04-04 15:29:07.896614646 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java 2013-04-04 15:29:08.208614651 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java 2013-04-04 15:29:08.148614650 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,18 +75,38 @@ return na; } + protected final NextAction doThrow(Packet response, Throwable t) { + NextAction na = new NextAction(); + na.throwException(response, t); + return na; + } + + @Deprecated protected final NextAction doSuspend() { NextAction na = new NextAction(); na.suspend(); return na; } + protected final NextAction doSuspend(Runnable onExitRunnable) { + NextAction na = new NextAction(); + na.suspend(onExitRunnable); + return na; + } + + @Deprecated protected final NextAction doSuspend(Tube next) { NextAction na = new NextAction(); na.suspend(next); return na; } + protected final NextAction doSuspend(Tube next, Runnable onExitRunnable) { + NextAction na = new NextAction(); + na.suspend(next, onExitRunnable); + return na; + } + protected final NextAction doThrow(Throwable t) { NextAction na = new NextAction(); na.throwException(t); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/PipeAdapter.java 2013-04-04 15:29:08.476614655 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/PipeAdapter.java 2013-04-04 15:29:08.424614654 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/package-info.java 2013-04-04 15:29:08.788614660 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/helper/package-info.java 2013-04-04 15:29:08.724614659 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -24,7 +24,7 @@ */ /** - * Default partial implementations of {@link Pipe}. + * Default partial implementations of {@link com.sun.xml.internal.ws.api.pipe.Pipe}. * *

    * This is intended to be useful for projects building on --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/package-info.java 2013-04-04 15:29:09.076614665 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/package-info.java 2013-04-04 15:29:09.016614663 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/AlternativeSelector.java 2013-04-04 15:29:09.388614669 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/AlternativeSelector.java 2013-04-04 15:29:09.332614669 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ModelGenerator.java 2013-04-04 15:29:09.696614674 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ModelGenerator.java 2013-04-04 15:29:09.636614673 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ModelTranslator.java 2013-04-04 15:29:10.000614678 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ModelTranslator.java 2013-04-04 15:29:09.940614678 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ModelUnmarshaller.java 2013-04-04 15:29:10.312614684 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ModelUnmarshaller.java 2013-04-04 15:29:10.256614683 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.api.policy; +import com.sun.xml.internal.ws.policy.sourcemodel.PolicyModelGenerator; import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; import com.sun.xml.internal.ws.policy.sourcemodel.XmlPolicyModelUnmarshaller; import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.NamespaceVersion; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/PolicyResolver.java 2013-04-04 15:29:10.624614688 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/PolicyResolver.java 2013-04-04 15:29:10.560614687 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/PolicyResolverFactory.java 2013-04-04 15:29:10.920614693 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/PolicyResolverFactory.java 2013-04-04 15:29:10.864614692 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/SourceModel.java 2013-04-04 15:29:11.200614698 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/SourceModel.java 2013-04-04 15:29:11.144614697 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ValidationProcessor.java 2013-04-04 15:29:11.504614702 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/ValidationProcessor.java 2013-04-04 15:29:11.444614701 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/subject/BindingSubject.java 2013-04-04 15:29:11.812614707 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/policy/subject/BindingSubject.java 2013-04-04 15:29:11.752614706 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java 2013-04-04 15:29:12.104614711 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java 2013-04-04 15:29:12.048614711 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,26 +26,18 @@ package com.sun.xml.internal.ws.api.server; import com.sun.istack.internal.Nullable; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.api.server.InstanceResolver; import com.sun.xml.internal.ws.api.server.ResourceInjector; import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.resources.ServerMessages; import com.sun.xml.internal.ws.server.ServerRtException; -import com.sun.xml.internal.ws.util.localization.Localizable; -import javax.annotation.Resource; -import javax.xml.ws.WebServiceContext; -import javax.xml.ws.WebServiceException; import java.lang.annotation.Annotation; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; /** * Partial implementation of {@link InstanceResolver} with @@ -56,91 +48,6 @@ */ public abstract class AbstractInstanceResolver extends InstanceResolver { - /** - * Encapsulates which field/method the injection is done, - * and performs the injection. - */ - public static interface InjectionPlan { - void inject(T instance,R resource); - /** - * Gets the number of injections to be performed. - */ - int count(); - } - - /** - * Injects to a field. - */ - protected static class FieldInjectionPlan implements InjectionPlan { - private final Field field; - - public FieldInjectionPlan(Field field) { - this.field = field; - } - - public void inject(final T instance, final R resource) { - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - try { - if (!field.isAccessible()) { - field.setAccessible(true); - } - field.set(instance,resource); - return null; - } catch (IllegalAccessException e) { - throw new ServerRtException("server.rt.err",e); - } - } - }); - } - - public int count() { - return 1; - } - } - - /** - * Injects to a method. - */ - protected static class MethodInjectionPlan implements InjectionPlan { - private final Method method; - - public MethodInjectionPlan(Method method) { - this.method = method; - } - - public void inject(T instance, R resource) { - invokeMethod(method, instance, resource); - } - - public int count() { - return 1; - } - } - - /** - * Combines multiple {@link InjectionPlan}s into one. - */ - private static class Compositor implements InjectionPlan { - private final InjectionPlan[] children; - - public Compositor(Collection> children) { - this.children = children.toArray(new InjectionPlan[children.size()]); - } - - public void inject(T instance, R res) { - for (InjectionPlan plan : children) - plan.inject(instance,res); - } - - public int count() { - int r = 0; - for (InjectionPlan plan : children) - r += plan.count(); - return r; - } - } - protected static ResourceInjector getResourceInjector(WSEndpoint endpoint) { ResourceInjector ri = endpoint.getContainer().getSPI(ResourceInjector.class); if(ri==null) @@ -189,76 +96,4 @@ } return r; } - - /** - * Creates an {@link InjectionPlan} that injects the given resource type to the given class. - * - * @param isStatic - * Only look for static field/method - * - */ - public static - InjectionPlan buildInjectionPlan(Class clazz, Class resourceType, boolean isStatic) { - List> plan = new ArrayList>(); - - Class cl = clazz; - while(cl != Object.class) { - for(Field field: cl.getDeclaredFields()) { - Resource resource = field.getAnnotation(Resource.class); - if (resource != null) { - if(isInjectionPoint(resource, field.getType(), - ServerMessages.localizableWRONG_FIELD_TYPE(field.getName()),resourceType)) { - - if(isStatic && !Modifier.isStatic(field.getModifiers())) - throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(resourceType,field)); - - plan.add(new FieldInjectionPlan(field)); - } - } - } - cl = cl.getSuperclass(); - } - - cl = clazz; - while(cl != Object.class) { - for(Method method : cl.getDeclaredMethods()) { - Resource resource = method.getAnnotation(Resource.class); - if (resource != null) { - Class[] paramTypes = method.getParameterTypes(); - if (paramTypes.length != 1) - throw new ServerRtException(ServerMessages.WRONG_NO_PARAMETERS(method)); - if(isInjectionPoint(resource,paramTypes[0], - ServerMessages.localizableWRONG_PARAMETER_TYPE(method.getName()),resourceType)) { - - if(isStatic && !Modifier.isStatic(method.getModifiers())) - throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(resourceType,method)); - - plan.add(new MethodInjectionPlan(method)); - } - } - } - cl = cl.getSuperclass(); - } - - return new Compositor(plan); - } - - /** - * Returns true if the combination of {@link Resource} and the field/method type - * are consistent for {@link WebServiceContext} injection. - */ - private static boolean isInjectionPoint(Resource resource, Class fieldType, Localizable errorMessage, Class resourceType ) { - Class t = resource.type(); - if (t.equals(Object.class)) { - return fieldType.equals(resourceType); - } else if (t.equals(resourceType)) { - if (fieldType.isAssignableFrom(resourceType)) { - return true; - } else { - // type compatibility error - throw new ServerRtException(errorMessage); - } - } - return false; - } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java 2013-04-04 15:29:12.420614717 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java 2013-04-04 15:29:12.368614716 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,17 +25,17 @@ package com.sun.xml.internal.ws.api.server; +import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.Codec; -import com.sun.xml.internal.ws.api.pipe.Fiber; import com.sun.xml.internal.ws.util.Pool; import java.io.IOException; + /** * Partial server side async transport implementation. It manages pooling of * {@link Codec} and other details. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Adapter.java 2013-04-04 15:29:12.720614721 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Adapter.java 2013-04-04 15:29:12.660614720 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java 2013-04-04 15:29:13.036614726 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java 2013-04-04 15:29:12.980614725 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AsyncProviderCallback.java 2013-04-04 15:29:13.356614731 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AsyncProviderCallback.java 2013-04-04 15:29:13.296614730 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java 2013-04-04 15:29:13.660614736 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java 2013-04-04 15:29:13.604614735 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Container.java 2013-04-04 15:29:13.960614741 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Container.java 2013-04-04 15:29:13.896614740 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ContainerResolver.java 2013-04-04 15:29:14.228614745 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ContainerResolver.java 2013-04-04 15:29:14.176614743 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +30,7 @@ /** * This class determines an instance of {@link Container} for the runtime. * It applies for both server and client runtimes(for e.g in Servlet could - * be accessing a Web Service). Always call {@link #setInstance} when the - * application's environment is initailized and a Container instance should - * be associated with an application. + * be accessing a Web Service). * * A client that is invoking a web service may be running in a * container(for e.g servlet). T @@ -46,13 +44,9 @@ */ public abstract class ContainerResolver { - private static final ContainerResolver NONE = new ContainerResolver() { - public Container getContainer() { - return Container.NONE; - } - }; + private static final ThreadLocalContainerResolver DEFAULT = new ThreadLocalContainerResolver(); - private static volatile ContainerResolver theResolver = NONE; + private static volatile ContainerResolver theResolver = DEFAULT; /** * Sets the custom container resolver which can be used to get client's @@ -62,7 +56,7 @@ */ public static void setInstance(ContainerResolver resolver) { if(resolver==null) - resolver = NONE; + resolver = DEFAULT; theResolver = resolver; } @@ -80,8 +74,8 @@ * * @return default container resolver */ - public static ContainerResolver getDefault() { - return NONE; + public static ThreadLocalContainerResolver getDefault() { + return DEFAULT; } /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/DocumentAddressResolver.java 2013-04-04 15:29:14.428614748 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/DocumentAddressResolver.java 2013-04-04 15:29:14.380614747 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointAwareCodec.java 2013-04-04 15:29:14.640614751 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointAwareCodec.java 2013-04-04 15:29:14.596614750 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ */ public interface EndpointAwareCodec extends Codec { /** - * Called by the {@linK WSEndpoint} implementation + * Called by the {@link WSEndpoint} implementation * when the codec is associated with an endpoint. */ void setEndpoint(@NotNull WSEndpoint endpoint); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointComponent.java 2013-04-04 15:29:14.872614755 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointComponent.java 2013-04-04 15:29:14.804614753 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointData.java 2013-04-04 15:29:15.076614757 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointData.java 2013-04-04 15:29:15.024614757 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointReferenceExtensionContributor.java 2013-04-04 15:29:15.288614761 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/EndpointReferenceExtensionContributor.java 2013-04-04 15:29:15.236614760 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/HttpEndpoint.java 2013-04-04 15:29:15.500614765 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/HttpEndpoint.java 2013-04-04 15:29:15.448614763 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java 2013-04-04 15:29:15.772614769 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java 2013-04-04 15:29:15.716614768 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java 2013-04-04 15:29:16.000614772 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java 2013-04-04 15:29:15.944614771 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Invoker.java 2013-04-04 15:29:16.264614776 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Invoker.java 2013-04-04 15:29:16.212614775 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/LazyMOMProvider.java 2013-04-04 15:29:16.512614780 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/LazyMOMProvider.java 2013-04-04 15:29:16.460614779 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, 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,8 +25,12 @@ package com.sun.xml.internal.ws.api.server; +import com.sun.xml.internal.ws.server.WSEndpointImpl; import java.util.HashSet; import java.util.Set; +import com.sun.org.glassfish.external.amx.AMXGlassfish; +import com.sun.org.glassfish.external.amx.MBeanListener; +import com.sun.org.glassfish.gmbal.ManagedObjectManager; /** * The lazy provider is intended to defer Gmbal API calls until there is a JMX connection. The provider is scope @@ -41,7 +45,7 @@ * Glassfish: * {@link WebServicesContainer} is one of two classes for which a {@link ManagedObjectManager} instance (see Gmbal API) * is created when a webservice application is deployed into the Glassfish. For the purpose of postponing Gmbal API calls - * the {@code WebServiceContainer} extends {@link MBeanListener.CallbackImpl} so it can register itself as a listener of + * the {@code WebServicesContainer} extends {@link MBeanListener.CallbackImpl} so it can register itself as a listener of * {@link AMXGlassfish} and receive a notification about a connection of a JMX client to the Glassfish server (see * {@code WebServicesContainer#postConstruct} for registration details). The moment the JMX client is connected a notification * is sent to the listeners of {@code AMXGlassfish}. When this event is received by {@code WebServiceContainer} (see the @@ -53,7 +57,7 @@ * libraries (outside of Glassfish) so no notification from the Glassfish server can be expected in this case. This leads * to a situation when Metro/JAX-WS has to be aware of context in which it is used and acts appropriately. There are 3 * scopes an application using Metro/JAX-WS can be in: {@code STANDALONE}, {@code GLASSFISH_NO_JMX}, {@code GLASSFISH_JMX} - * ({@link LazyMOMProvider.Scope}). The default scope is {@code STANDALONE} and all Gmbal API calls are invoked as they + * ({@link LazyMOMProvider#scope}). The default scope is {@code STANDALONE} and all Gmbal API calls are invoked as they * are requested. The other two scopes are applied only when an application is deployed into a Glassfish server. The * {@code GLASSFISH_NO_JMX} is set at the moment the application is deployed (see below) and its purpose is to defer Gmbal * API calls for as long as possible. For some classes e.g. {@code ManagedObjectManager} proxy classes were introduced to @@ -181,7 +185,8 @@ /** * Returns {@code true} if this provider is in the default scope. * - * @return + * @return {@code true} if this provider is in the default scope, + * {@code false} otherwise */ private boolean isProviderInDefaultScope() { return this.scope == Scope.STANDALONE; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Module.java 2013-04-04 15:29:16.780614784 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/Module.java 2013-04-04 15:29:16.724614784 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java 2013-04-04 15:29:17.052614788 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java 2013-04-04 15:29:16.996614788 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ResourceInjector.java 2013-04-04 15:29:17.380614794 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ResourceInjector.java 2013-04-04 15:29:17.312614793 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/SDDocument.java 2013-04-04 15:29:17.700614799 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/SDDocument.java 2013-04-04 15:29:17.636614798 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java 2013-04-04 15:29:18.028614804 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java 2013-04-04 15:29:17.968614803 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java 2013-04-04 15:29:18.348614808 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java 2013-04-04 15:29:18.288614807 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java 2013-04-04 15:29:18.664614814 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java 2013-04-04 15:29:18.604614813 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ServiceDefinition.java 2013-04-04 15:29:18.984614819 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/ServiceDefinition.java 2013-04-04 15:29:18.928614818 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/TransportBackChannel.java 2013-04-04 15:29:19.288614824 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/TransportBackChannel.java 2013-04-04 15:29:19.232614822 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java 2013-04-04 15:29:19.572614827 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java 2013-04-04 15:29:19.520614827 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,9 +30,11 @@ import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.Component; import com.sun.xml.internal.ws.api.ComponentRegistry; +import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.config.management.EndpointCreationAttributes; import com.sun.xml.internal.ws.api.config.management.ManagedEndpointFactory; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.SEIModel; @@ -41,18 +43,24 @@ import com.sun.xml.internal.ws.api.pipe.Engine; import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; +import com.sun.xml.internal.ws.api.pipe.ThrowableContainerPropertySet; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.policy.PolicyMap; +import com.sun.xml.internal.ws.server.EndpointAwareTube; import com.sun.xml.internal.ws.server.EndpointFactory; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.xml.XmlUtil; +import com.sun.xml.internal.ws.wsdl.OperationDispatcher; import com.sun.org.glassfish.gmbal.ManagedObjectManager; import org.xml.sax.EntityResolver; +import org.w3c.dom.Element; import javax.xml.namespace.QName; import javax.xml.ws.Binding; +import javax.xml.ws.EndpointReference; import javax.xml.ws.WebServiceContext; import javax.xml.ws.WebServiceException; + import java.net.URL; import java.util.Collection; import java.util.Collections; @@ -217,8 +225,8 @@ * one-way message processing happens correctly. {@link Packet#webServiceContextDelegate} * should have the correct value, so that some {@link WebServiceContext} methods correctly. * - * @see {@link Packet#transportBackChannel} - * @see {@link Packet#webServiceContextDelegate} + * @see Packet#transportBackChannel + * @see Packet#webServiceContextDelegate * * @param request web service request * @param callback callback to get response packet @@ -230,7 +238,7 @@ /** * Schedule invocation of web service asynchronously. * - * @see {@link #schedule(Packet, CompletionCallback)} + * @see #schedule(Packet, CompletionCallback) * * @param request web service request * @param callback callback to get response packet(exception if there is one) @@ -560,9 +568,17 @@ final ManagedEndpointFactory managementFactory = managementFactories.next(); final EndpointCreationAttributes attributes = new EndpointCreationAttributes( processHandlerAnnotation, invoker, resolver, isTransportSynchronous); - return managementFactory.createEndpoint(endpoint, attributes); + + WSEndpoint managedEndpoint = managementFactory.createEndpoint(endpoint, attributes); + + if (endpoint.getAssemblerContext().getTerminalTube() instanceof EndpointAwareTube) { + ((EndpointAwareTube)endpoint.getAssemblerContext().getTerminalTube()).setEndpoint(managedEndpoint); + } + + return managedEndpoint; } + return endpoint; } @@ -614,22 +630,85 @@ * Gives the wsdl:service default name computed from the endpoint implementaiton class */ public static @NotNull QName getDefaultServiceName(Class endpointClass){ - return getDefaultServiceName(endpointClass, true); + return getDefaultServiceName(endpointClass, true, null); + } + public static @NotNull QName getDefaultServiceName(Class endpointClass, MetadataReader metadataReader){ + return getDefaultServiceName(endpointClass, true, metadataReader); } public static @NotNull QName getDefaultServiceName(Class endpointClass, boolean isStandard){ - return EndpointFactory.getDefaultServiceName(endpointClass, isStandard); + return getDefaultServiceName(endpointClass, isStandard, null); + } + public static @NotNull QName getDefaultServiceName(Class endpointClass, boolean isStandard, MetadataReader metadataReader){ + return EndpointFactory.getDefaultServiceName(endpointClass, isStandard, metadataReader); } /** * Gives the wsdl:service/wsdl:port default name computed from the endpoint implementaiton class */ - public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass){ - return getDefaultPortName(serviceName, endpointClass, true); + public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass) { + return getDefaultPortName(serviceName, endpointClass, null); } + public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass, MetadataReader metadataReader) { + return getDefaultPortName(serviceName, endpointClass, true, metadataReader); + } + + public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass, boolean isStandard) { + return getDefaultPortName(serviceName, endpointClass, isStandard, null); + } + public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass, boolean isStandard, MetadataReader metadataReader){ + return EndpointFactory.getDefaultPortName(serviceName, endpointClass, isStandard, metadataReader); + } + + /** + * Return EndpointReference instance, based on passed parameters and spec version represented by clazz + * @param + * @param clazz represents spec version + * @param address endpoint address + * @param wsdlAddress wsdl address + * @param referenceParameters any reference parameters to be added to the instance + * @return EndpointReference instance based on passed parameters and values obtained from current instance + */ + public abstract T getEndpointReference(Class clazz, String address, String wsdlAddress, Element... referenceParameters); - public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass, boolean isStandard){ - return EndpointFactory.getDefaultPortName(serviceName, endpointClass, isStandard); + /** + * + * @param + * @param clazz + * @param address + * @param wsdlAddress + * @param metadata + * @param referenceParameters + * @return EndpointReference instance based on passed parameters and values obtained from current instance + */ + public abstract T getEndpointReference(Class clazz, + String address, String wsdlAddress, List metadata, + List referenceParameters); + + /** + * Used for managed endpoints infrastructure to compare equality of proxies vs proxied endpoints. + * @param endpoint + * @return true if the proxied endpoint instance held by this instance equals to 'endpoint', otherwise return false. + */ + public boolean equalsProxiedInstance(WSEndpoint endpoint) { + if (endpoint == null) return false; + return this.equals(endpoint); } + /** + * Nullable when there is no associated WSDL Model + * @return + */ + public abstract @Nullable OperationDispatcher getOperationDispatcher(); + + + /** + * This is used by WsaServerTube and WSEndpointImpl to create a Packet with SOAPFault message from a Java exception. + */ + public abstract Packet createServiceResponseForException(final ThrowableContainerPropertySet tc, + final Packet responsePacket, + final SOAPVersion soapVersion, + final WSDLPort wsdlPort, + final SEIModel seiModel, + final WSBinding binding); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WSWebServiceContext.java 2013-04-04 15:29:19.908614833 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WSWebServiceContext.java 2013-04-04 15:29:19.848614832 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WebModule.java 2013-04-04 15:29:20.236614838 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WebModule.java 2013-04-04 15:29:20.172614837 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java 2013-04-04 15:29:20.536614842 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java 2013-04-04 15:29:20.476614842 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/package-info.java 2013-04-04 15:29:20.848614848 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/package-info.java 2013-04-04 15:29:20.792614847 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 @@ /** * APIs for hosting JAX-WS services. * - * If you are new to the code, start with {@link WSEndpoint}. + * If you are new to the code, start with {@link com.sun.xml.internal.ws.api.server.WSEndpoint}. */ package com.sun.xml.internal.ws.api.server; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java 2013-04-04 15:29:21.136614852 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java 2013-04-04 15:29:21.076614851 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,22 +28,19 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.streaming.XMLReaderException; +import com.sun.xml.internal.ws.util.xml.XmlUtil; import org.xml.sax.InputSource; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringReader; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; -import java.util.logging.Logger; import java.security.AccessController; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Factory for {@link XMLStreamReader}. @@ -54,6 +51,7 @@ * * @author Kohsuke Kawaguchi */ +@SuppressWarnings("StaticNonFinalUsedInInitialization") public abstract class XMLStreamReaderFactory { private static final Logger LOGGER = Logger.getLogger(XMLStreamReaderFactory.class.getName()); @@ -69,20 +67,23 @@ // this system property can be used to disable the pooling altogether, // in case someone hits an issue with pooling in the production system. - if(!getProperty(XMLStreamReaderFactory.class.getName()+".noPool")) + if(!getProperty(XMLStreamReaderFactory.class.getName()+".noPool")) { f = Zephyr.newInstance(xif); + } if(f==null) { // is this Woodstox? - if(xif.getClass().getName().equals("com.ctc.wstx.stax.WstxInputFactory")) + if (xif.getClass().getName().equals("com.ctc.wstx.stax.WstxInputFactory")) { f = new Woodstox(xif); + } } - if(f==null) + if (f==null) { f = new Default(); + } theInstance = f; - LOGGER.fine("XMLStreamReaderFactory instance is = "+theInstance); + LOGGER.log(Level.FINE, "XMLStreamReaderFactory instance is = {0}", theInstance); } private static XMLInputFactory getXMLInputFactory() { @@ -95,7 +96,7 @@ } } if (xif == null) { - xif = XMLInputFactory.newInstance(); + xif = XmlUtil.newXMLInputFactory(true); } xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true); xif.setProperty(XMLInputFactory.SUPPORT_DTD, false); @@ -109,7 +110,9 @@ * the JAX-WS RI uses. */ public static void set(XMLStreamReaderFactory f) { - if(f==null) throw new IllegalArgumentException(); + if(f==null) { + throw new IllegalArgumentException(); + } theInstance = f; } @@ -213,7 +216,7 @@ /** * {@link XMLStreamReaderFactory} implementation for SJSXP/JAXP RI. */ - public static final class Zephyr extends XMLStreamReaderFactory { + private static final class Zephyr extends XMLStreamReaderFactory { private final XMLInputFactory xif; private final ThreadLocal pool = new ThreadLocal(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java 2013-04-04 15:29:21.476614858 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java 2013-04-04 15:29:21.400614856 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/MetaDataResolver.java 2013-04-04 15:29:21.796614863 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/MetaDataResolver.java 2013-04-04 15:29:21.744614861 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/MetadataResolverFactory.java 2013-04-04 15:29:22.120614868 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/MetadataResolverFactory.java 2013-04-04 15:29:22.064614866 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/PolicyWSDLParserExtension.java 2013-04-04 15:29:22.396614871 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/PolicyWSDLParserExtension.java 2013-04-04 15:29:22.344614871 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java 2013-04-04 15:29:22.704614876 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java 2013-04-04 15:29:22.648614876 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java 2013-04-04 15:29:23.008614881 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java 2013-04-04 15:29:22.952614881 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java 2013-04-04 15:29:23.328614886 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java 2013-04-04 15:29:23.280614885 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/XMLEntityResolver.java 2013-04-04 15:29:23.624614891 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/XMLEntityResolver.java 2013-04-04 15:29:23.576614890 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/package-info.java 2013-04-04 15:29:23.948614896 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/package-info.java 2013-04-04 15:29:23.880614895 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGenExtnContext.java 2013-04-04 15:29:24.264614901 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGenExtnContext.java 2013-04-04 15:29:24.208614900 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGeneratorExtension.java 2013-04-04 15:29:24.576614906 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGeneratorExtension.java 2013-04-04 15:29:24.516614904 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/BindingImpl.java 2013-04-04 15:29:24.880614911 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/BindingImpl.java 2013-04-04 15:29:24.824614909 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,6 +25,7 @@ package com.sun.xml.internal.ws.binding; +import com.oracle.webservices.internal.api.message.MessageContextFactory; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.BindingID; @@ -43,10 +44,12 @@ import javax.xml.ws.handler.Handler; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.Map; + /** * Instances are created by the service, which then * sets the handler chain on the binding impl. @@ -67,10 +70,13 @@ protected static final WebServiceFeature[] EMPTY_FEATURES = new WebServiceFeature[0]; //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called. - protected HandlerConfiguration handlerConfig; + private HandlerConfiguration handlerConfig; + private final Set addedHeaders = new HashSet(); + private final Set knownHeaders = new HashSet(); + private final Set unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders); private final BindingID bindingId; // Features that are set(enabled/disabled) on the binding - protected final WebServiceFeatureList features = new WebServiceFeatureList(); + protected final WebServiceFeatureList features; // Features that are set(enabled/disabled) on the binding or an operation protected final Map operationFeatures = new HashMap(); // Features that are set(enabled/disabled) on the binding, an operation or an input message @@ -82,10 +88,15 @@ protected javax.xml.ws.Service.Mode serviceMode = javax.xml.ws.Service.Mode.PAYLOAD; + protected MessageContextFactory messageContextFactory; + protected BindingImpl(BindingID bindingId, WebServiceFeature ... features) { this.bindingId = bindingId; handlerConfig = new HandlerConfiguration(Collections.emptySet(), Collections.emptyList()); - setFeatures(features); + if (handlerConfig.getHandlerKnownHeaders() != null) + knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders()); + this.features = new WebServiceFeatureList(features); + this.features.validate(); } public @@ -98,13 +109,25 @@ return handlerConfig; } + protected void setHandlerConfig(HandlerConfiguration handlerConfig) { + this.handlerConfig = handlerConfig; + knownHeaders.clear(); + knownHeaders.addAll(addedHeaders); + if (handlerConfig != null && handlerConfig.getHandlerKnownHeaders() != null) + knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders()); + } public void setMode(@NotNull Service.Mode mode) { this.serviceMode = mode; } public Set getKnownHeaders() { - return handlerConfig.getHandlerKnownHeaders(); + return unmodKnownHeaders; + } + + public boolean addKnownHeader(QName headerQName) { + addedHeaders.add(headerQName); + return knownHeaders.add(headerQName); } public @@ -186,7 +209,7 @@ @NotNull public WebServiceFeatureList getFeatures() { //TODO scchen convert BindingID to WebServiceFeature[] - if(!isFeatureEnabled(com.sun.xml.internal.org.jvnet.ws.EnvelopeStyleFeature.class)) { + if(!isFeatureEnabled(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) { WebServiceFeature[] f = { getSOAPVersion().toFeature() }; features.mergeFeatures(f, false); } @@ -219,14 +242,6 @@ return FeatureListUtil.mergeList(operationFeatureList, messageFeatureList, features); } - public void setFeatures(WebServiceFeature... newFeatures) { - if (newFeatures != null) { - for (WebServiceFeature f : newFeatures) { - features.add(f); - } - } - } - public void setOperationFeatures(@NotNull final QName operationName, WebServiceFeature... newFeatures) { if (newFeatures != null) { WebServiceFeatureList featureList = operationFeatures.get(operationName); @@ -280,11 +295,13 @@ } } - public void addFeature(@NotNull WebServiceFeature newFeature) { - features.add(newFeature); + public synchronized @NotNull com.oracle.webservices.internal.api.message.MessageContextFactory getMessageContextFactory () { + if (messageContextFactory == null) { + messageContextFactory = MessageContextFactory.createFactory(getFeatures().toArray()); + } + return messageContextFactory; } - /** * Experimental: Identify messages based on the name of the message and the * operation that uses this message. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/FeatureListUtil.java 2013-04-04 15:29:25.180614915 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/FeatureListUtil.java 2013-04-04 15:29:25.128614914 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java 2013-04-04 15:29:25.464614919 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java 2013-04-04 15:29:25.404614918 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -65,6 +65,6 @@ throw new WebServiceException(ClientMessages.NON_LOGICAL_HANDLER_SET(handler.getClass())); } } - handlerConfig = new HandlerConfiguration(Collections.emptySet(), chain); + setHandlerConfig(new HandlerConfiguration(Collections.emptySet(), chain)); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java 2013-04-04 15:29:25.652614923 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java 2013-04-04 15:29:25.604614922 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,6 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.SOAPVersion; -import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.client.HandlerConfiguration; import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants; import com.sun.xml.internal.ws.resources.ClientMessages; @@ -44,7 +43,6 @@ import javax.xml.ws.soap.SOAPBinding; import java.util.*; - /** * @author WS Development Team */ @@ -118,7 +116,7 @@ * Protocol Handlers and sets the HandlerConfiguration. */ public void setHandlerChain(List chain) { - handlerConfig = new HandlerConfiguration(handlerConfig.getRoles(), chain); + setHandlerConfig(new HandlerConfiguration(getHandlerConfig().getRoles(), chain)); } protected void addRequiredRoles(Set roles) { @@ -126,7 +124,7 @@ } public Set getRoles() { - return handlerConfig.getRoles(); + return getHandlerConfig().getRoles(); } /** @@ -142,7 +140,7 @@ throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE()); } addRequiredRoles(roles); - handlerConfig = new HandlerConfiguration(roles, getHandlerConfig()); + setHandlerConfig(new HandlerConfiguration(roles, getHandlerConfig())); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java 2013-04-04 15:29:25.844614926 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java 2013-04-04 15:29:25.796614925 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,6 +28,8 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.BindingID; +import com.sun.xml.internal.ws.api.FeatureListValidator; +import com.sun.xml.internal.ws.api.FeatureListValidatorAnnotation; import com.sun.xml.internal.ws.api.ImpliesWebServiceFeature; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; @@ -50,7 +52,7 @@ import javax.xml.ws.soap.MTOMFeature; import javax.xml.ws.spi.WebServiceFeatureAnnotation; -import com.sun.xml.internal.org.jvnet.ws.EnvelopeStyleFeature; +import com.oracle.webservices.internal.api.EnvelopeStyleFeature; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; @@ -76,6 +78,7 @@ } private Map, WebServiceFeature> wsfeatures = new HashMap, WebServiceFeature>(); + private boolean isValidating = false; public WebServiceFeatureList() { } @@ -89,7 +92,34 @@ public WebServiceFeatureList(@NotNull WebServiceFeature... features) { if (features != null) { for (WebServiceFeature f : features) { - add(f); + addNoValidate(f); + } + } + } + + public void validate() { + if (!isValidating) { + isValidating = true; + + // validation + for (WebServiceFeature ff : this) { + validate(ff); + } + } + } + + private void validate(WebServiceFeature feature) { + // run validation + FeatureListValidatorAnnotation fva = feature.getClass().getAnnotation(FeatureListValidatorAnnotation.class); + if (fva != null) { + Class beanClass = fva.bean(); + try { + FeatureListValidator validator = beanClass.newInstance(); + validator.validate(this); + } catch (InstantiationException e) { + throw new WebServiceException(e); + } catch (IllegalAccessException e) { + throw new WebServiceException(e); } } } @@ -98,6 +128,7 @@ if (features != null) { wsfeatures.putAll(features.wsfeatures); parent = features.parent; + isValidating = features.isValidating; } } @@ -247,6 +278,9 @@ final Method annotationMethod = annotation.annotationType().getDeclaredMethod(methodName); final Object annotationFieldValue = annotationMethod.invoke(annotation); final Object[] arg = { annotationFieldValue }; + if (skipDuringOrgJvnetWsToComOracleWebservicesPackageMove(builderMethod, annotationFieldValue)) { + continue; + } builderMethod.invoke(builder, arg); } } @@ -266,6 +300,27 @@ } } + // TODO this will be removed after package move is complete. + private static boolean skipDuringOrgJvnetWsToComOracleWebservicesPackageMove( + final Method builderMethod, + final Object annotationFieldValue) + { + final Class annotationFieldValueClass = annotationFieldValue.getClass(); + if (! annotationFieldValueClass.isEnum()) { + return false; + } + final Class[] builderMethodParameterTypes = builderMethod.getParameterTypes(); + if (builderMethodParameterTypes.length != 1) { + throw new WebServiceException("expected only 1 parameter"); + } + final String builderParameterTypeName = builderMethodParameterTypes[0].getName(); + if (! builderParameterTypeName.startsWith("com.oracle.webservices.internal.test.features_annotations_enums.apinew") && + ! builderParameterTypeName.startsWith("com.oracle.webservices.internal.api")) { + return false; + } + return false; + } + public Iterator iterator() { if (parent != null) return new MergedFeatures(parent.getFeatures()); @@ -302,12 +357,21 @@ * Adds a feature to the list if it's not already added. */ public void add(@NotNull WebServiceFeature f) { + if(addNoValidate(f) && isValidating) + validate(f); + } + + private boolean addNoValidate(@NotNull WebServiceFeature f) { if (!wsfeatures.containsKey(f.getClass())) { wsfeatures.put(f.getClass(), f); if (f instanceof ImpliesWebServiceFeature) ((ImpliesWebServiceFeature) f).implyFeatures(this); + + return true; } + + return false; } /** @@ -500,7 +564,13 @@ } static public SOAPVersion getSoapVersion(WSFeatureList features) { - EnvelopeStyleFeature env = features.get(EnvelopeStyleFeature.class); + { + EnvelopeStyleFeature env = features.get(EnvelopeStyleFeature.class); + if (env != null) { + return SOAPVersion.from(env); + } + } + com.oracle.webservices.internal.api.EnvelopeStyleFeature env = features.get(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class); return env != null ? SOAPVersion.from(env) : null; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/AsyncInvoker.java 2013-04-04 15:29:26.052614929 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/AsyncInvoker.java 2013-04-04 15:29:25.996614928 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ /** * Invokes {@link Tube}line asynchronously for the client's async API(for e.g.: Dispatch#invokeAsync} - * The concrete classes need to call {@link Stub#processAsync(Packet, RequestContext, CompletionCallback)} in + * The concrete classes need to call {@link Stub#processAsync(AsyncResponseImpl, Packet, RequestContext, Fiber.CompletionCallback) } in * run() method. * * @author Jitendra Kotamraju --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java 2013-04-04 15:29:26.256614932 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java 2013-04-04 15:29:26.208614931 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java 2013-04-04 15:29:26.472614935 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java 2013-04-04 15:29:26.416614934 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ClientContainer.java 2013-04-04 15:29:26.664614938 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ClientContainer.java 2013-04-04 15:29:26.616614938 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +47,9 @@ }; public T getSPI(Class spiType) { + T t = super.getSPI(spiType); + if (t != null) + return t; if (spiType == ResourceLoader.class) { return spiType.cast(loader); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ClientSchemaValidationTube.java 2013-04-04 15:29:26.900614942 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ClientSchemaValidationTube.java 2013-04-04 15:29:26.840614941 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ClientTransportException.java 2013-04-04 15:29:27.188614946 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ClientTransportException.java 2013-04-04 15:29:27.140614945 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.client; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ContentNegotiation.java 2013-04-04 15:29:27.468614951 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ContentNegotiation.java 2013-04-04 15:29:27.408614950 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -66,7 +66,9 @@ try { String value = System.getProperty(PROPERTY); - if (value == null) return none; + if (value == null) { + return none; + } return valueOf(value); } catch (Exception e) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java 2013-04-04 15:29:27.756614955 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java 2013-04-04 15:29:27.704614955 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -54,7 +54,7 @@ private final List logicalHandlers; private final List soapHandlers; private final List messageHandlers; - private Set handlerKnownHeaders; + private final Set handlerKnownHeaders; /** * @param roles This contains the roles assumed by the Binding implementation. @@ -66,7 +66,7 @@ logicalHandlers = new ArrayList(); soapHandlers = new ArrayList(); messageHandlers = new ArrayList(); - handlerKnownHeaders = new HashSet(); + Set modHandlerKnownHeaders = new HashSet(); for (Handler handler : handlerChain) { if (handler instanceof LogicalHandler) { @@ -75,19 +75,21 @@ soapHandlers.add((SOAPHandler) handler); Set headers = ((SOAPHandler) handler).getHeaders(); if (headers != null) { - handlerKnownHeaders.addAll(headers); + modHandlerKnownHeaders.addAll(headers); } } else if (handler instanceof MessageHandler) { messageHandlers.add((MessageHandler) handler); Set headers = ((MessageHandler) handler).getHeaders(); if (headers != null) { - handlerKnownHeaders.addAll(headers); + modHandlerKnownHeaders.addAll(headers); } }else { throw new HandlerException("handler.not.valid.type", handler.getClass()); } } + + handlerKnownHeaders = Collections.unmodifiableSet(modHandlerKnownHeaders); } /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/HandlerConfigurator.java 2013-04-04 15:29:28.044614960 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/HandlerConfigurator.java 2013-04-04 15:29:27.988614958 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -81,12 +81,15 @@ this.resolver = resolver; } + @Override void configureHandlers(@NotNull WSPortInfo port, @NotNull BindingImpl binding) { - if(resolver!=null) + if (resolver!=null) { binding.setHandlerChain(resolver.getHandlerChain(port)); + } } + @Override HandlerResolver getResolver() { return resolver; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/MonitorRootClient.java 2013-04-04 15:29:28.368614965 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/MonitorRootClient.java 2013-04-04 15:29:28.320614964 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/PortInfo.java 2013-04-04 15:29:28.684614970 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/PortInfo.java 2013-04-04 15:29:28.624614969 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/RequestContext.java 2013-04-04 15:29:28.956614974 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/RequestContext.java 2013-04-04 15:29:28.908614973 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,17 +25,13 @@ package com.sun.xml.internal.ws.client; +import com.oracle.webservices.internal.api.message.BaseDistributedPropertySet; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.DistributedPropertySet; import com.sun.xml.internal.ws.api.EndpointAddress; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.transport.Headers; import javax.xml.ws.BindingProvider; -import javax.xml.ws.handler.MessageContext; - -import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -44,6 +40,10 @@ import java.util.Set; import java.util.logging.Logger; + +import static javax.xml.ws.BindingProvider.*; +import static javax.xml.ws.handler.MessageContext.HTTP_REQUEST_HEADERS; + /** * Request context implementation. * @@ -60,53 +60,31 @@ * then use that computed value during a method invocation again and again. * *

    - * For this goal, we use {@link PropertySet} and implement some properties + * For this goal, we use {@link com.sun.xml.internal.ws.api.PropertySet} and implement some properties * as virtual properties backed by methods. This allows us to do the computation * in the setter, and store it in a field. * *

    * These fields are used by {@link Stub#process} to populate a {@link Packet}. * - * - * *

    How it works?

    *

    - * We make an assumption that a request context is mostly used to just - * get and put values, not really for things like enumerating or size. - * - *

    - * So we start by maintaining state as a combination of {@link #others} - * bag and strongly-typed fields. As long as the application uses - * just {@link Map#put}, {@link Map#get}, and {@link Map#putAll}, we can - * do things in this way. In this mode a {@link Map} we return works as - * a view into {@link RequestContext}, and by itself it maintains no state. - * - *

    - * If {@link RequestContext} is in this mode, its state can be copied - * efficiently into {@link Packet}. - * - *

    - * Once the application uses any other {@link Map} method, we move to - * the "fallback" mode, where the data is actually stored in a {@link HashMap}, - * this is necessary for implementing the map interface contract correctly. + * For better performance, we wan't use strongly typed field as much as possible + * to avoid reflection and unnecessary collection iterations; * + * Using {@link com.oracle.webservices.internal.api.message.BasePropertySet.MapView} implementation allows client to use {@link Map} interface + * in a way that all the strongly typed properties are reflected to the fields + * right away. Any additional (extending) properties can be added by client as well; + * those would be processed using iterating the {@link MapView} and their processing, + * of course, would be slower. *

    - * To be safe, once we fallback, we'll never come back to the efficient state. - * - * - * - *

    Caution

    - *

    - * Once we are in the fallback mode, none of the strongly typed field will - * be used, and they may contain stale values. So the only method - * the code outside this class can safely use is {@link #copy()}, - * {@link #fill(Packet)}, and constructors. Do not access the strongly - * typed fields nor {@link #others} directly. + * The previous implementation with fallback mode has been removed to simplify + * the code and remove the bugs. * * @author Kohsuke Kawaguchi */ @SuppressWarnings({"SuspiciousMethodCalls"}) -public final class RequestContext extends DistributedPropertySet { +public final class RequestContext extends BaseDistributedPropertySet { private static final Logger LOGGER = Logger.getLogger(RequestContext.class.getName()); /** @@ -120,9 +98,11 @@ ContentNegotiation.obtainFromSystemProperty(); /** - * Stores properties that don't fit the strongly-typed fields. + * @deprecated */ - private final Map others; + public void addSatellite(@NotNull com.sun.xml.internal.ws.api.PropertySet satellite) { + super.addSatellite(satellite); + } /** * The endpoint address to which this message is sent to. @@ -139,16 +119,17 @@ * @deprecated * always access {@link #endpointAddress}. */ - @Property(BindingProvider.ENDPOINT_ADDRESS_PROPERTY) + @Property(ENDPOINT_ADDRESS_PROPERTY) public String getEndPointAddressString() { return endpointAddress != null ? endpointAddress.toString() : null; } public void setEndPointAddressString(String s) { - if(s==null) + if (s == null) { throw new IllegalArgumentException(); - else + } else { this.endpointAddress = EndpointAddress.create(s); + } } public void setEndpointAddress(@NotNull EndpointAddress epa) { @@ -171,9 +152,9 @@ } public void setContentNegotiationString(String s) { - if(s==null) + if (s == null) { contentNegotiation = ContentNegotiation.none; - else { + } else { try { contentNegotiation = ContentNegotiation.valueOf(s); } catch (IllegalArgumentException e) { @@ -182,6 +163,7 @@ } } } + /** * The value of the SOAPAction header associated with the message. * @@ -209,14 +191,12 @@ private String soapAction; - @Property(BindingProvider.SOAPACTION_URI_PROPERTY) - public String getSoapAction(){ + @Property(SOAPACTION_URI_PROPERTY) + public String getSoapAction() { return soapAction; } - public void setSoapAction(String sAction){ - if(sAction == null) { - throw new IllegalArgumentException("SOAPAction value cannot be null"); - } + + public void setSoapAction(String sAction) { soapAction = sAction; } @@ -228,35 +208,34 @@ * if it can be sent if it can be obtained by other means such as WSDL binding */ private Boolean soapActionUse; - @Property(BindingProvider.SOAPACTION_USE_PROPERTY) - public Boolean getSoapActionUse(){ + + @Property(SOAPACTION_USE_PROPERTY) + public Boolean getSoapActionUse() { return soapActionUse; } - public void setSoapActionUse(Boolean sActionUse){ + + public void setSoapActionUse(Boolean sActionUse) { soapActionUse = sActionUse; } /** - * {@link Map} exposed to the user application. - */ - private final MapView mapView = new MapView(); - - /** * Creates an empty {@link RequestContext}. */ - /*package*/ RequestContext() { - others = new HashMap(); + RequestContext() { } /** * Copy constructor. */ private RequestContext(RequestContext that) { - others = new HashMap(that.others); - mapView.fallbackMap = that.mapView.fallbackMap != null ? - new HashMap(that.mapView.fallback()) : null; + for (Map.Entry entry : that.asMapLocal().entrySet()) { + if (!propMap.containsKey(entry.getKey())) { + asMap().put(entry.getKey(), entry.getValue()); + } + } endpointAddress = that.endpointAddress; soapAction = that.soapAction; + soapActionUse = that.soapActionUse; contentNegotiation = that.contentNegotiation; that.copySatelliteInto(this); } @@ -264,190 +243,140 @@ /** * The efficient get method that reads from {@link RequestContext}. */ + @Override public Object get(Object key) { - if(super.supports(key)) + if(supports(key)) { return super.get(key); - else - return others.get(key); + } else { + // use mapView to get extending property + return asMap().get(key); + } } /** * The efficient put method that updates {@link RequestContext}. */ + @Override public Object put(String key, Object value) { - if(super.supports(key)) - return super.put(key,value); - else - return others.put(key,value); - } - /** - * Gets the {@link Map} view of this request context. - * - * @return - * Always same object. Returned map is live. - */ - public Map getMapView() { - return mapView; + if(supports(key)) { + return super.put(key,value); + } else { + // use mapView to put extending property (if the map allows that) + return asMap().put(key, value); + } } /** * Fill a {@link Packet} with values of this {@link RequestContext}. + * + * @param packet to be filled with context values + * @param isAddressingEnabled flag if addressing enabled (to provide warning if necessary) */ + @SuppressWarnings("unchecked") public void fill(Packet packet, boolean isAddressingEnabled) { - if(mapView.fallbackMap==null) { - if (endpointAddress != null) - packet.endpointAddress = endpointAddress; - packet.contentNegotiation = contentNegotiation; - - //JAX-WS-596: Check the semantics of SOAPACTION_USE_PROPERTY before using the SOAPACTION_URI_PROPERTY for - // SoapAction as specified in the javadoc of BindingProvider. The spec seems to be little contradicting with - // javadoc and says that the use property effects the sending of SOAPAction property. - // Since the user has the capability to set the value as "" if needed, implement the javadoc behavior. - - if ((soapActionUse != null && soapActionUse) || (soapActionUse == null && isAddressingEnabled)) { - if (soapAction != null) { - packet.soapAction = soapAction; - } - } - - if((!isAddressingEnabled && (soapActionUse == null || !soapActionUse)) && soapAction != null) { - LOGGER.warning("BindingProvider.SOAPACTION_URI_PROPERTY is set in the RequestContext but is ineffective," + - " Either set BindingProvider.SOAPACTION_USE_PROPERTY to true or enable AddressingFeature"); - } - copySatelliteInto((DistributedPropertySet)packet); - - if(!others.isEmpty()) { - //for bug 12883765 - //retrieve headers which is set in soap message - Headers headerFromPacketProperty = (Headers)packet.invocationProperties.get(MessageContext.HTTP_REQUEST_HEADERS); - //retrieve headers from request context - Map> headerFromOthers =(Map>) others.get(MessageContext.HTTP_REQUEST_HEADERS); - if((headerFromPacketProperty != null) && (headerFromOthers != null) ) { - //update the headers set in soap message with those in request context - for(String key: headerFromOthers.keySet()) { - if(key!=null && key.trim().length()!=0) { - List valueFromPacketProperty = headerFromPacketProperty.get(key); - //if the two headers contain the same key, combine the value - if(valueFromPacketProperty!=null) { - valueFromPacketProperty.addAll(headerFromOthers.get(key)); - }else{ - //add the headers in request context to those set in soap message - headerFromPacketProperty.put(key, headerFromOthers.get(key)); - } - } - } - // update headers in request context with those set in soap message since 'others' may contain other properties.. - others.put(MessageContext.HTTP_REQUEST_HEADERS, headerFromPacketProperty); - } - packet.invocationProperties.putAll(others); - //if it is not standard property it deafults to Scope.HANDLER - packet.getHandlerScopePropertyNames(false).addAll(others.keySet()); - } - } else { - Set handlerScopePropertyNames = new HashSet(); - // fallback mode, simply copy map in a slow way - for (Entry entry : mapView.fallbackMap.entrySet()) { - String key = entry.getKey(); - if(packet.supports(key)) - packet.put(key,entry.getValue()); - else - packet.invocationProperties.put(key,entry.getValue()); - - //if it is not standard property it deafults to Scope.HANDLER - if(!super.supports(key)) { - handlerScopePropertyNames.add(key); - } - } - - if(!handlerScopePropertyNames.isEmpty()) - packet.getHandlerScopePropertyNames(false).addAll(handlerScopePropertyNames); - } - } - - public RequestContext copy() { - return new RequestContext(this); - } - - private final class MapView implements Map { - private Map fallbackMap; - - private Map fallback() { - if(fallbackMap==null) { - // has to fall back. fill in fallbackMap - fallbackMap = new HashMap(others); - // then put all known properties - fallbackMap.putAll(createMapView()); - } - return fallbackMap; + // handling as many properties as possible (all in propMap.keySet()) + // to avoid slow Packet.put() + if (endpointAddress != null) { + packet.endpointAddress = endpointAddress; } + packet.contentNegotiation = contentNegotiation; + fillSOAPAction(packet, isAddressingEnabled); + mergeRequestHeaders(packet); - public int size() { - return fallback().size(); - } + Set handlerScopeNames = new HashSet(); - public boolean isEmpty() { - return fallback().isEmpty(); - } + copySatelliteInto(packet); - public boolean containsKey(Object key) { - return fallback().containsKey(key); - } + // extending properties ... + for (String key : asMapLocal().keySet()) { - public boolean containsValue(Object value) { - return fallback().containsValue(value); - } + //if it is not standard property it defaults to Scope.HANDLER + if (!supportsLocal(key)) { + handlerScopeNames.add(key); + } - public Object get(Object key) { - if (fallbackMap ==null) { - return RequestContext.this.get(key); - } else { - return fallback().get(key); + // to avoid slow Packet.put(), handle as small number of props as possible + // => only properties not from RequestContext object + if (!propMap.containsKey(key)) { + Object value = asMapLocal().get(key); + if (packet.supports(key)) { + // very slow operation - try to avoid it! + packet.put(key, value); + } else { + packet.invocationProperties.put(key, value); + } } } - public Object put(String key, Object value) { - if(fallbackMap ==null) - return RequestContext.this.put(key,value); - else - return fallback().put(key, value); + if (!handlerScopeNames.isEmpty()) { + packet.getHandlerScopePropertyNames(false).addAll(handlerScopeNames); } + } - public Object remove(Object key) { - if (fallbackMap ==null) { - return RequestContext.this.remove(key); - } else { - return fallback().remove(key); + @SuppressWarnings("unchecked") + private void mergeRequestHeaders(Packet packet) { + //for bug 12883765 + //retrieve headers which is set in soap message + Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS); + //retrieve headers from request context + Map> myHeaders = (Map>) asMap().get(HTTP_REQUEST_HEADERS); + if ((packetHeaders != null) && (myHeaders != null)) { + //update the headers set in soap message with those in request context + for (Entry> entry : myHeaders.entrySet()) { + String key = entry.getKey(); + if (key != null && key.trim().length() != 0) { + List listFromPacket = packetHeaders.get(key); + //if the two headers contain the same key, combine the value + if (listFromPacket != null) { + listFromPacket.addAll(entry.getValue()); + } else { + //add the headers in request context to those set in soap message + packetHeaders.put(key, myHeaders.get(key)); + } + } } + // update headers in request context with those set in soap message since it may contain other properties.. + asMap().put(HTTP_REQUEST_HEADERS, packetHeaders); } + } - public void putAll(Map t) { - for (Entry e : t.entrySet()) { - put(e.getKey(),e.getValue()); + private void fillSOAPAction(Packet packet, boolean isAddressingEnabled) { + final boolean p = packet.packetTakesPriorityOverRequestContext; + final String localSoapAction = p ? packet.soapAction : soapAction; + final Boolean localSoapActionUse = p ? (Boolean) packet.invocationProperties.get(BindingProvider.SOAPACTION_USE_PROPERTY) + : soapActionUse; + + //JAX-WS-596: Check the semantics of SOAPACTION_USE_PROPERTY before using the SOAPACTION_URI_PROPERTY for + // SoapAction as specified in the javadoc of BindingProvider. The spec seems to be little contradicting with + // javadoc and says that the use property effects the sending of SOAPAction property. + // Since the user has the capability to set the value as "" if needed, implement the javadoc behavior. + if ((localSoapActionUse != null && localSoapActionUse) || (localSoapActionUse == null && isAddressingEnabled)) { + if (localSoapAction != null) { + packet.soapAction = localSoapAction; } } - public void clear() { - fallback().clear(); - } - - public Set keySet() { - return fallback().keySet(); - } - - public Collection values() { - return fallback().values(); + if ((!isAddressingEnabled && (localSoapActionUse == null || !localSoapActionUse)) && localSoapAction != null) { + LOGGER.warning("BindingProvider.SOAPACTION_URI_PROPERTY is set in the RequestContext but is ineffective," + + " Either set BindingProvider.SOAPACTION_USE_PROPERTY to true or enable AddressingFeature"); } + } - public Set> entrySet() { - return fallback().entrySet(); - } + public RequestContext copy() { + return new RequestContext(this); } + @Override protected PropertyMap getPropertyMap() { return propMap; } private static final PropertyMap propMap = parse(RequestContext.class); + + @Override + protected boolean mapAllowsAdditionalProperties() { + return true; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ResponseContext.java 2013-04-04 15:29:29.256614978 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ResponseContext.java 2013-04-04 15:29:29.196614977 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ResponseContextReceiver.java 2013-04-04 15:29:29.560614983 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/ResponseContextReceiver.java 2013-04-04 15:29:29.504614983 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SCAnnotations.java 2013-04-04 15:29:29.848614987 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SCAnnotations.java 2013-04-04 15:29:29.784614986 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 javax.xml.ws.WebServiceException; import java.io.IOException; import java.lang.reflect.Method; -import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; @@ -48,16 +47,16 @@ final class SCAnnotations { SCAnnotations(final Class sc) { AccessController.doPrivileged(new PrivilegedAction() { + @Override public Void run() { WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class); - if(wsc==null) + if(wsc==null) { throw new WebServiceException("Service Interface Annotations required, exiting..."); + } - String name = wsc.name(); String tns = wsc.targetNamespace(); - serviceQName = new QName(tns, name); try { - wsdlLocation = JAXWSUtils.getFileOrURL(wsc.wsdlLocation()); + JAXWSUtils.getFileOrURL(wsc.wsdlLocation()); } catch (IOException e) { // TODO: report a reasonable error message throw new WebServiceException(e); @@ -81,8 +80,6 @@ }); } - QName serviceQName; final ArrayList portQNames = new ArrayList(); final ArrayList classes = new ArrayList(); - URL wsdlLocation; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SEIPortInfo.java 2013-04-04 15:29:30.160614993 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SEIPortInfo.java 2013-04-04 15:29:30.092614991 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +33,6 @@ import com.sun.xml.internal.ws.binding.WebServiceFeatureList; import com.sun.xml.internal.ws.model.SOAPSEIModel; -import javax.xml.ws.WebServiceFeature; - - /** * {@link PortInfo} that has {@link SEIModel}. * --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SenderException.java 2013-04-04 15:29:30.460614997 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SenderException.java 2013-04-04 15:29:30.404614997 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.client; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/Stub.java 2013-04-04 15:29:30.748615001 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/Stub.java 2013-04-04 15:29:30.692615001 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,30 +30,41 @@ import com.sun.xml.internal.stream.buffer.XMLStreamBuffer; import com.sun.xml.internal.ws.addressing.WSEPRExtension; import com.sun.xml.internal.ws.api.BindingID; -import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortProperties; -import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; -import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl; import com.sun.xml.internal.ws.api.Component; import com.sun.xml.internal.ws.api.ComponentFeature; import com.sun.xml.internal.ws.api.ComponentFeature.Target; import com.sun.xml.internal.ws.api.ComponentRegistry; +import com.sun.xml.internal.ws.api.ComponentsFeature; import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.WSService; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.client.WSPortInfo; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.HeaderList; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.api.pipe.*; +import com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext; +import com.sun.xml.internal.ws.api.pipe.Engine; +import com.sun.xml.internal.ws.api.pipe.Fiber; +import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptorFactory; +import com.sun.xml.internal.ws.api.pipe.SyncStartForAsyncFeature; +import com.sun.xml.internal.ws.api.pipe.Tube; +import com.sun.xml.internal.ws.api.pipe.TubelineAssembler; +import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.developer.JAXWSProperties; import com.sun.xml.internal.ws.developer.WSBindingProvider; +import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties; import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; +import com.sun.xml.internal.ws.model.wsdl.WSDLPortProperties; +import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.util.Pool; import com.sun.xml.internal.ws.util.Pool.TubePool; @@ -66,6 +77,7 @@ import javax.xml.ws.BindingProvider; import javax.xml.ws.EndpointReference; import javax.xml.ws.RespectBindingFeature; +import javax.xml.ws.Response; import javax.xml.ws.WebServiceException; import javax.xml.ws.http.HTTPBinding; import javax.xml.ws.wsaddressing.W3CEndpointReference; @@ -76,7 +88,9 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.Executor; -import org.xml.sax.InputSource; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.management.ObjectName; /** * Base class for stubs, which accept method invocations from @@ -232,49 +246,64 @@ } private Stub(WSServiceDelegate owner, @Nullable Tube master, @Nullable WSPortInfo portInfo, QName portname, BindingImpl binding, @Nullable WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) { - this.owner = owner; - this.portInfo = portInfo; - this.wsdlPort = wsdlPort != null ? wsdlPort : (portInfo != null ? portInfo.getPort() : null); - this.portname = portname; - if (portname == null) { - if (portInfo != null) - this.portname = portInfo.getPortName(); - else if (wsdlPort != null) - this.portname = wsdlPort.getName(); - } - this.binding = binding; - - ComponentFeature cf = binding.getFeature(ComponentFeature.class); - if (cf != null && Target.STUB.equals(cf.getTarget())) { - components.add(cf.getComponent()); - } - - // if there is an EPR, EPR's address should be used for invocation instead of default address - if (epr != null) - this.requestContext.setEndPointAddressString(epr.getAddress()); - else - this.requestContext.setEndpointAddress(defaultEndPointAddress); - this.engine = new Engine(toString(), owner.getExecutor()); - this.endpointReference = epr; - wsdlProperties = (wsdlPort == null) ? new WSDLDirectProperties(owner.getServiceName(), portname) : new WSDLPortProperties(wsdlPort); - - this.cleanRequestContext = this.requestContext.copy(); - - // ManagedObjectManager MUST be created before the pipeline - // is constructed. - - managedObjectManager = new MonitorRootClient(this).createManagedObjectManager(this); - - if (master != null) - this.tubes = new TubePool(master); - else - this.tubes = new TubePool(createPipeline(portInfo, binding)); - - addrVersion = binding.getAddressingVersion(); - - // This needs to happen after createPipeline. - // TBD: Check if it needs to happen outside the Stub constructor. - managedObjectManager.resumeJMXRegistration(); + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); + try { + this.owner = owner; + this.portInfo = portInfo; + this.wsdlPort = wsdlPort != null ? wsdlPort : (portInfo != null ? portInfo.getPort() : null); + this.portname = portname; + if (portname == null) { + if (portInfo != null) { + this.portname = portInfo.getPortName(); + } else if (wsdlPort != null) { + this.portname = wsdlPort.getName(); + } + } + this.binding = binding; + + ComponentFeature cf = binding.getFeature(ComponentFeature.class); + if (cf != null && Target.STUB.equals(cf.getTarget())) { + components.add(cf.getComponent()); + } + ComponentsFeature csf = binding.getFeature(ComponentsFeature.class); + if (csf != null) { + for (ComponentFeature cfi : csf.getComponentFeatures()) { + if (Target.STUB.equals(cfi.getTarget())) + components.add(cfi.getComponent()); + } + } + + // if there is an EPR, EPR's address should be used for invocation instead of default address + if (epr != null) { + this.requestContext.setEndPointAddressString(epr.getAddress()); + } else { + this.requestContext.setEndpointAddress(defaultEndPointAddress); + } + this.engine = new Engine(getStringId(), owner.getContainer(), owner.getExecutor()); + this.endpointReference = epr; + wsdlProperties = (wsdlPort == null) ? new WSDLDirectProperties(owner.getServiceName(), portname) : new WSDLPortProperties(wsdlPort); + + this.cleanRequestContext = this.requestContext.copy(); + + // ManagedObjectManager MUST be created before the pipeline + // is constructed. + + managedObjectManager = new MonitorRootClient(this).createManagedObjectManager(this); + + if (master != null) { + this.tubes = new TubePool(master); + } else { + this.tubes = new TubePool(createPipeline(portInfo, binding)); + } + + addrVersion = binding.getAddressingVersion(); + + // This needs to happen after createPipeline. + // TBD: Check if it needs to happen outside the Stub constructor. + managedObjectManager.resumeJMXRegistration(); + } finally { + ContainerResolver.getDefault().exitContainer(old); + } } /** @@ -293,9 +322,10 @@ BindingID bindingId = portInfo.getBindingId(); TubelineAssembler assembler = TubelineAssemblerFactory.create( - Thread.currentThread().getContextClassLoader(), bindingId); - if (assembler == null) - throw new WebServiceException("Unable to process bindingID=" + bindingId); // TODO: i18n + Thread.currentThread().getContextClassLoader(), bindingId, owner.getContainer()); + if (assembler == null) { + throw new WebServiceException("Unable to process bindingID=" + bindingId); // TODO: i18n + } return assembler.createClient( new ClientTubeAssemblerContext( portInfo.getEndpointAddress(), @@ -328,6 +358,7 @@ } } + @Override public WSPortInfo getPortInfo() { return portInfo; } @@ -339,8 +370,9 @@ public @Nullable OperationDispatcher getOperationDispatcher() { - if (operationDispatcher == null && wsdlPort != null) + if (operationDispatcher == null && wsdlPort != null) { operationDispatcher = new OperationDispatcher(wsdlPort, binding, null); + } return operationDispatcher; } @@ -403,10 +435,13 @@ packet.component = this; configureRequestPacket(packet, requestContext); Pool pool = tubes; - if (pool == null) + if (pool == null) { throw new WebServiceException("close method has already been invoked"); // TODO: i18n + } Fiber fiber = engine.createFiber(); + configureFiber(fiber); + // then send it away! Tube tube = pool.take(); @@ -433,16 +468,20 @@ // to make it multi-thread safe we need to first get a stable snapshot Header[] hl = userOutboundHeaders; - if (hl != null) - packet.getMessage().getHeaders().addAll(hl); + if (hl != null) { + MessageHeaders mh = packet.getMessage().getHeaders(); + for (Header h : hl) { + mh.add(h); + } + } requestContext.fill(packet, (binding.getAddressingVersion() != null)); packet.addSatellite(wsdlProperties); if (addrVersion != null) { // populate request WS-Addressing headers - HeaderList headerList = packet.getMessage().getHeaders(); - headerList.fillRequestAddressingHeaders(wsdlPort, binding, packet); + MessageHeaders headerList = packet.getMessage().getHeaders(); + AddressingUtils.fillRequestAddressingHeaders(headerList, wsdlPort, binding, packet); // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled, @@ -478,30 +517,36 @@ configureRequestPacket(request, requestContext); final Pool pool = tubes; - if (pool == null) + if (pool == null) { throw new WebServiceException("close method has already been invoked"); // TODO: i18n + } final Fiber fiber = engine.createFiber(); + configureFiber(fiber); receiver.setCancelable(fiber); // check race condition on cancel - if (receiver.isCancelled()) - return; + if (receiver.isCancelled()) { + return; + } FiberContextSwitchInterceptorFactory fcsif = owner.getSPI(FiberContextSwitchInterceptorFactory.class); - if(fcsif != null) + if (fcsif != null) { fiber.addInterceptor(fcsif.create()); + } // then send it away! final Tube tube = pool.take(); Fiber.CompletionCallback fiberCallback = new Fiber.CompletionCallback() { + @Override public void onCompletion(@NotNull Packet response) { pool.recycle(tube); completionCallback.onCompletion(response); } + @Override public void onCompletion(@NotNull Throwable error) { // let's not reuse tubes as they might be in a wrong state, so not // calling pool.recycle() @@ -516,51 +561,79 @@ !requestContext.containsKey(PREVENT_SYNC_START_FOR_ASYNC_INVOKE)); } + protected void configureFiber(Fiber fiber) { + // no-op in the base class, but can be used by derived classes to configure the Fiber prior + // to invocation + } + + private static final Logger monitoringLogger = Logger.getLogger(com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".monitoring"); + + @Override public void close() { - if (tubes != null) { + TubePool tp = (TubePool) tubes; + if (tp != null) { // multi-thread safety of 'close' needs to be considered more carefully. // some calls might be pending while this method is invoked. Should we // block until they are complete, or should we abort them (but how?) - Tube p = tubes.take(); - tubes = null; + Tube p = tp.takeMaster(); p.preDestroy(); + tubes = null; } - if (managedObjectManagerClosed) { - return; - } else { - com.sun.xml.internal.ws.server.MonitorBase.closeMOM(managedObjectManager); + if (!managedObjectManagerClosed) { + try { + final ObjectName name = managedObjectManager.getObjectName(managedObjectManager.getRoot()); + // The name is null when the MOM is a NOOP. + if (name != null) { + monitoringLogger.log(Level.INFO, "Closing Metro monitoring root: {0}", name); + } + managedObjectManager.close(); + } catch (java.io.IOException e) { + monitoringLogger.log(Level.WARNING, "Ignoring error when closing Managed Object Manager", e); + } managedObjectManagerClosed = true; } - } + @Override public final WSBinding getBinding() { return binding; } + @Override public final Map getRequestContext() { - return requestContext.getMapView(); + return requestContext.asMap(); } public void resetRequestContext() { requestContext = cleanRequestContext.copy(); } + @Override public final ResponseContext getResponseContext() { return responseContext; } + @Override public void setResponseContext(ResponseContext rc) { this.responseContext = rc; } - public String toString() { + private String getStringId() { return RuntimeVersion.VERSION + ": Stub for " + getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY); } + @Override + public String toString() { + return getStringId(); + } + + @Override public final WSEndpointReference getWSEndpointReference() { - if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) - throw new java.lang.UnsupportedOperationException(ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference(Class class)", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding")); + if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) { + throw new java.lang.UnsupportedOperationException( + ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference(Class class)", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding") + ); + } if (endpointReference != null) { return endpointReference; @@ -596,18 +669,23 @@ } + @Override public final W3CEndpointReference getEndpointReference() { - if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) - throw new java.lang.UnsupportedOperationException(ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference()", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding")); + if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) { + throw new java.lang.UnsupportedOperationException( + ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference()", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding")); + } return getEndpointReference(W3CEndpointReference.class); } + @Override public final T getEndpointReference(Class clazz) { return getWSEndpointReference().toSpec(clazz); } public @NotNull + @Override ManagedObjectManager getManagedObjectManager() { return managedObjectManager; } @@ -617,25 +695,29 @@ // WSBindingProvider methods // // + @Override public final void setOutboundHeaders(List
    headers) { if (headers == null) { this.userOutboundHeaders = null; } else { for (Header h : headers) { - if (h == null) + if (h == null) { throw new IllegalArgumentException(); + } } userOutboundHeaders = headers.toArray(new Header[headers.size()]); } } + @Override public final void setOutboundHeaders(Header... headers) { if (headers == null) { this.userOutboundHeaders = null; } else { for (Header h : headers) { - if (h == null) + if (h == null) { throw new IllegalArgumentException(); + } } Header[] hl = new Header[headers.length]; System.arraycopy(headers, 0, hl, 0, headers.length); @@ -643,24 +725,29 @@ } } + @Override public final List
    getInboundHeaders() { - return Collections.unmodifiableList((HeaderList) - responseContext.get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY)); + return Collections.unmodifiableList(((MessageHeaders) + responseContext.get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY)).asList()); } + @Override public final void setAddress(String address) { requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address); } + @Override public S getSPI(Class spiType) { for (Component c : components) { S s = c.getSPI(spiType); - if (s != null) + if (s != null) { return s; + } } return owner.getSPI(spiType); } + @Override public Set getComponents() { return components; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java 2013-04-04 15:29:31.092615007 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java 2013-04-04 15:29:31.028615006 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,18 +30,19 @@ import com.sun.xml.internal.ws.Closeable; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.ComponentFeature; +import com.sun.xml.internal.ws.api.ComponentsFeature; import com.sun.xml.internal.ws.api.ComponentFeature.Target; import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.WSService; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.client.ServiceInterceptor; import com.sun.xml.internal.ws.api.client.ServiceInterceptorFactory; -import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; +import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; -import com.sun.xml.internal.ws.api.pipe.*; +import com.sun.xml.internal.ws.api.pipe.Stubs; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; @@ -50,9 +51,10 @@ import com.sun.xml.internal.ws.client.HandlerConfigurator.AnnotationConfigurator; import com.sun.xml.internal.ws.client.HandlerConfigurator.HandlerResolverImpl; import com.sun.xml.internal.ws.client.sei.SEIStub; + import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature; -import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; +import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.model.SOAPSEIModel; import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; @@ -64,9 +66,7 @@ import com.sun.xml.internal.ws.util.JAXWSUtils; import com.sun.xml.internal.ws.util.ServiceConfigurationError; import com.sun.xml.internal.ws.util.ServiceFinder; -import static com.sun.xml.internal.ws.util.xml.XmlUtil.createDefaultCatalogResolver; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; - import org.xml.sax.EntityResolver; import org.xml.sax.SAXException; @@ -77,7 +77,13 @@ import javax.xml.stream.XMLStreamException; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; -import javax.xml.ws.*; +import javax.xml.ws.BindingProvider; +import javax.xml.ws.Dispatch; +import javax.xml.ws.EndpointReference; +import javax.xml.ws.Service; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; import javax.xml.ws.handler.HandlerResolver; import javax.xml.ws.soap.AddressingFeature; import java.io.IOException; @@ -87,10 +93,17 @@ import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; import java.util.concurrent.Executor; import java.util.concurrent.ThreadFactory; +import static com.sun.xml.internal.ws.util.xml.XmlUtil.createDefaultCatalogResolver; + /** * Service objects provide the client view of a Web service. * @@ -177,6 +190,10 @@ public WSServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeature... features) { + this(wsdlDocumentLocation, serviceName, serviceClass, new WebServiceFeatureList(features)); + } + + protected WSServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeatureList features) { this( wsdlDocumentLocation==null ? null : new StreamSource(wsdlDocumentLocation.toExternalForm()), serviceName,serviceClass, features); @@ -187,6 +204,14 @@ * Either {@link Service}.class or other generated service-derived classes. */ public WSServiceDelegate(@Nullable Source wsdl, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeature... features) { + this(wsdl, serviceName, serviceClass, new WebServiceFeatureList(features)); + } + + /** + * @param serviceClass + * Either {@link Service}.class or other generated service-derived classes. + */ + protected WSServiceDelegate(@Nullable Source wsdl, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeatureList features) { this(wsdl, null, serviceName, serviceClass, features); } @@ -195,15 +220,26 @@ * Either {@link Service}.class or other generated service-derived classes. */ public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLServiceImpl service, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeature... features) { + this(wsdl, service, serviceName, serviceClass, new WebServiceFeatureList(features)); + } + + /** + * @param serviceClass + * Either {@link Service}.class or other generated service-derived classes. + */ + public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLServiceImpl service, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeatureList features) { //we cant create a Service without serviceName - if (serviceName == null) - throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(serviceName)); + if (serviceName == null) { + throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(null)); + } - this.features = new WebServiceFeatureList(features); + this.features = features; InitParams initParams = INIT_PARAMS.get(); INIT_PARAMS.set(null); // mark it as consumed - if(initParams==null) initParams = EMPTY_PARAMS; + if(initParams==null) { + initParams = EMPTY_PARAMS; + } this.serviceName = serviceName; this.serviceClass = serviceClass; @@ -221,10 +257,26 @@ break; case CONTAINER: this.container.getComponents().add(cf.getComponent()); + break; default: throw new IllegalArgumentException(); } } + ComponentsFeature csf = this.features.get(ComponentsFeature.class); + if (csf != null) { + for (ComponentFeature cfi : csf.getComponentFeatures()) { + switch(cfi.getTarget()) { + case SERVICE: + getComponents().add(cfi.getComponent()); + break; + case CONTAINER: + this.container.getComponents().add(cfi.getComponent()); + break; + default: + throw new IllegalArgumentException(); + } + } + } // load interceptor ServiceInterceptor interceptor = ServiceInterceptorFactory.load(this, Thread.currentThread().getContextClassLoader()); @@ -354,10 +406,11 @@ public T getPort(WSEndpointReference wsepr, Class portInterface, WebServiceFeature... features) { //get the portType from SEI, so that it can be used if EPR does n't have endpointName - QName portTypeName = RuntimeModeler.getPortTypeName(portInterface); + WebServiceFeatureList featureList = new WebServiceFeatureList(features); + QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(featureList, portInterface.getClassLoader())); //if port name is not specified in EPR, it will use portTypeName to get it from the WSDL model. QName portName = getPortNameFromEPR(wsepr, portTypeName); - return getPort(wsepr,portName,portInterface,new WebServiceFeatureList(features)); + return getPort(wsepr,portName,portInterface, featureList); } protected T getPort(WSEndpointReference wsepr, QName portName, Class portInterface, @@ -366,29 +419,38 @@ if (cf != null && !Target.STUB.equals(cf.getTarget())) { throw new IllegalArgumentException(); } + ComponentsFeature csf = features.get(ComponentsFeature.class); + if (csf != null) { + for (ComponentFeature cfi : csf.getComponentFeatures()) { + if (!Target.STUB.equals(cfi.getTarget())) + throw new IllegalArgumentException(); + } + } features.addAll(this.features); SEIPortInfo spi = addSEI(portName, portInterface, features); return createEndpointIFBaseProxy(wsepr,portName,portInterface,features, spi); } + @Override public T getPort(Class portInterface, WebServiceFeature... features) { //get the portType from SEI - QName portTypeName = RuntimeModeler.getPortTypeName(portInterface); - WSDLServiceImpl wsdlService = this.wsdlService; - if(wsdlService == null) { + QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader())); + WSDLServiceImpl tmpWsdlService = this.wsdlService; + if (tmpWsdlService == null) { // assigning it to local variable and not setting it back to this.wsdlService intentionally // as we don't want to include the service instance with information gathered from sei - wsdlService = getWSDLModelfromSEI(portInterface); + tmpWsdlService = getWSDLModelfromSEI(portInterface); //still null? throw error need wsdl metadata to create a proxy - if(wsdlService == null) { + if(tmpWsdlService == null) { throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName())); } } //get the first port corresponding to the SEI - WSDLPortImpl port = wsdlService.getMatchingPort(portTypeName); - if (port == null) - throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName)); + WSDLPortImpl port = tmpWsdlService.getMatchingPort(portTypeName); + if (port == null) { + throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName)); + } QName portName = port.getName(); return getPort(portName, portInterface,features); } @@ -424,6 +486,13 @@ if (cf != null && !Target.STUB.equals(cf.getTarget())) { throw new IllegalArgumentException(); } + ComponentsFeature csf = features.get(ComponentsFeature.class); + if (csf != null) { + for (ComponentFeature cfi : csf.getComponentFeatures()) { + if (!Target.STUB.equals(cfi.getTarget())) + throw new IllegalArgumentException(); + } + } features.addAll(this.features); BindingImpl binding = port.createBinding(features, null, null); @@ -507,6 +576,13 @@ if (cf != null && !Target.STUB.equals(cf.getTarget())) { throw new IllegalArgumentException(); } + ComponentsFeature csf = features.get(ComponentsFeature.class); + if (csf != null) { + for (ComponentFeature cfi : csf.getComponentFeatures()) { + if (!Target.STUB.equals(cfi.getTarget())) + throw new IllegalArgumentException(); + } + } features.addAll(this.features); BindingImpl binding = port.createBinding(features, null, null); @@ -664,6 +740,7 @@ return ports.keySet().iterator(); } + @Override public URL getWSDLDocumentLocation() { if(wsdlService==null) return null; try { @@ -676,8 +753,9 @@ private T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr,QName portName, Class portInterface, WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) { //fail if service doesnt have WSDL - if (wsdlService == null) + if (wsdlService == null) { throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName)); + } if (wsdlService.get(portName)==null) { throw new WebServiceException( @@ -706,7 +784,6 @@ } protected InvocationHandler getStubHandler(BindingImpl binding, SEIPortInfo eif, @Nullable WSEndpointReference epr) { - SEIPortInfo spi = (SEIPortInfo) eif; return new SEIStub(eif, binding, eif.model, epr); } @@ -715,8 +792,9 @@ */ private StringBuilder buildWsdlPortNames() { Set wsdlPortNames = new HashSet(); - for (WSDLPortImpl port : wsdlService.getPorts()) + for (WSDLPortImpl port : wsdlService.getPorts()) { wsdlPortNames.add(port.getName()); + } return buildNameList(wsdlPortNames); } @@ -764,11 +842,24 @@ config.setClassLoader(portInterface.getClassLoader()); config.getMappingInfo().setPortName(portName); + // if ExternalMetadataFeature present, ExternalMetadataReader will be created ... + config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader())); + com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config); return rt.getModel(); } + private MetadataReader getMetadadaReader(WebServiceFeatureList features, ClassLoader classLoader) { + if (features == null) return null; + com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef = + features.get(com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class); + // TODO-Miran: would it be necessary to disable secure xml processing? + if (ef != null) + return ef.getMetadataReader(classLoader, false); + return null; + } + private SEIPortInfo createSEIPortInfo(QName portName, Class portInterface, WebServiceFeatureList features) { WSDLPortImpl wsdlPort = getPortModel(wsdlService, portName); SEIModel model = buildRuntimeModel(serviceName, portName, portInterface, wsdlPort, features); @@ -784,7 +875,8 @@ return wsdlService; } - class DaemonThreadFactory implements ThreadFactory { + static class DaemonThreadFactory implements ThreadFactory { + @Override public Thread newThread(Runnable r) { Thread daemonThread = new Thread(r); daemonThread.setDaemon(Boolean.TRUE); @@ -800,26 +892,53 @@ return new DelegatingLoader(loader1, loader2); } - private static final class DelegatingLoader - extends ClassLoader - { - private final ClassLoader loader; - - DelegatingLoader(ClassLoader loader1, ClassLoader loader2) - { - super(loader2); - this.loader = loader1; - } - - protected Class findClass(String name) - throws ClassNotFoundException - { - return loader.loadClass(name); - } - - protected URL findResource(String name) - { - return loader.getResource(name); - } + private static final class DelegatingLoader extends ClassLoader { + private final ClassLoader loader; + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((loader == null) ? 0 : loader.hashCode()); + result = prime * result + + ((getParent() == null) ? 0 : getParent().hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + DelegatingLoader other = (DelegatingLoader) obj; + if (loader == null) { + if (other.loader != null) + return false; + } else if (!loader.equals(other.loader)) + return false; + if (getParent() == null) { + if (other.getParent() != null) + return false; + } else if (!getParent().equals(other.getParent())) + return false; + return true; + } + + DelegatingLoader(ClassLoader loader1, ClassLoader loader2) { + super(loader2); + this.loader = loader1; + } + + protected Class findClass(String name) throws ClassNotFoundException { + return loader.loadClass(name); + } + + protected URL findResource(String name) { + return loader.getResource(name); + } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java 2013-04-04 15:29:31.424615012 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java 2013-04-04 15:29:31.368615012 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ } DataSource toReturnValue(Packet response) { - Message message = response.getMessage(); + Message message = response.getInternalMessage(); return (message instanceof MessageDataSource) ? ((MessageDataSource)message).getDataSource() : XMLMessage.getDataSource(message, binding.getFeatures()); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java 2013-04-04 15:29:31.724615017 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java 2013-04-04 15:29:31.664615016 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -33,13 +33,15 @@ import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.client.WSPortInfo; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Attachment; import com.sun.xml.internal.ws.api.message.AttachmentSet; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.Fiber; import com.sun.xml.internal.ws.api.pipe.Tube; -import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.client.*; import com.sun.xml.internal.ws.encoding.soap.DeserializationException; @@ -63,8 +65,6 @@ import javax.xml.ws.http.HTTPBinding; import javax.xml.ws.soap.SOAPBinding; import javax.xml.ws.soap.SOAPFaultException; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.WebEndpoint; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; @@ -74,11 +74,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Callable; -import java.util.concurrent.Executor; -import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.lang.reflect.Method; import java.util.logging.Level; import java.util.logging.Logger; @@ -152,9 +148,8 @@ } /** * - * @param port dispatch instance is associated with this wsdl port qName + * @param portportInfo dispatch instance is associated with this wsdl port qName * @param mode Service.mode associated with this Dispatch instance - Service.mode.MESSAGE or Service.mode.PAYLOAD - * @param owner Service that created the Dispatch * @param pipe Master pipe for the pipeline * @param binding Binding of this Dispatch instance, current one of SOAP/HTTP or XML/HTTP * @param allowFaultResponseMsg A packet containing a SOAP fault message is allowed as the response to a request on this dispatch instance. @@ -180,14 +175,19 @@ abstract T toReturnValue(Packet response); public final Response invokeAsync(T param) { - if (LOGGER.isLoggable(Level.FINE)) { - dumpParam(param, "invokeAsync(T)"); + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); + try { + if (LOGGER.isLoggable(Level.FINE)) { + dumpParam(param, "invokeAsync(T)"); + } + AsyncInvoker invoker = new DispatchAsyncInvoker(param); + AsyncResponseImpl ft = new AsyncResponseImpl(invoker,null); + invoker.setReceiver(ft); + ft.run(); + return ft; + } finally { + ContainerResolver.getDefault().exitContainer(old); } - AsyncInvoker invoker = new DispatchAsyncInvoker(param); - AsyncResponseImpl ft = new AsyncResponseImpl(invoker,null); - invoker.setReceiver(ft); - ft.run(); - return ft; } private void dumpParam(T param, String method) { @@ -201,10 +201,10 @@ SOAPVersion sv = DispatchImpl.this.getBinding().getSOAPVersion(); action = av != null && message.getMessage() != null ? - message.getMessage().getHeaders().getAction(av, sv) : null; + AddressingUtils.getAction(message.getMessage().getHeaders(), av, sv) : null; msgId = av != null && message.getMessage() != null ? - message.getMessage().getHeaders().getMessageID(av, sv) : null; + AddressingUtils.getMessageID(message.getMessage().getHeaders(), av, sv) : null; LOGGER.fine("In DispatchImpl." + method + " for message with action: " + action + " and msg ID: " + msgId + " msg: " + message.getMessage()); if (message.getMessage() == null) { @@ -214,16 +214,21 @@ } } public final Future invokeAsync(T param, AsyncHandler asyncHandler) { - if (LOGGER.isLoggable(Level.FINE)) { - dumpParam(param, "invokeAsync(T, AsyncHandler)"); - } - AsyncInvoker invoker = new DispatchAsyncInvoker(param); - AsyncResponseImpl ft = new AsyncResponseImpl(invoker,asyncHandler); - invoker.setReceiver(ft); - invoker.setNonNullAsyncHandlerGiven(asyncHandler != null); + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); + try { + if (LOGGER.isLoggable(Level.FINE)) { + dumpParam(param, "invokeAsync(T, AsyncHandler)"); + } + AsyncInvoker invoker = new DispatchAsyncInvoker(param); + AsyncResponseImpl ft = new AsyncResponseImpl(invoker,asyncHandler); + invoker.setReceiver(ft); + invoker.setNonNullAsyncHandlerGiven(asyncHandler != null); - ft.run(); - return ft; + ft.run(); + return ft; + } finally { + ContainerResolver.getDefault().exitContainer(old); + } } /** @@ -239,6 +244,7 @@ checkNullAllowed(in, rc, binding, mode); Packet message = createPacket(in); + message.setState(Packet.State.ClientRequest); resolveEndpointAddress(message, rc); setProperties(message,true); response = process(message,rc,receiver); @@ -274,32 +280,43 @@ } public final T invoke(T in) { - if (LOGGER.isLoggable(Level.FINE)) { - dumpParam(in, "invoke(T)"); - } + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); + try { + if (LOGGER.isLoggable(Level.FINE)) { + dumpParam(in, "invoke(T)"); + } - return doInvoke(in,requestContext,this); + return doInvoke(in,requestContext,this); + } finally { + ContainerResolver.getDefault().exitContainer(old); + } } public final void invokeOneWay(T in) { - if (LOGGER.isLoggable(Level.FINE)) { - dumpParam(in, "invokeOneWay(T)"); - } - + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); try { - checkNullAllowed(in, requestContext, binding, mode); + if (LOGGER.isLoggable(Level.FINE)) { + dumpParam(in, "invokeOneWay(T)"); + } + + try { + checkNullAllowed(in, requestContext, binding, mode); - Packet request = createPacket(in); - setProperties(request,false); - Packet response = process(request,requestContext,this); - } catch(WebServiceException e){ - //it could be a WebServiceException or a ProtocolException - throw e; - } catch(Throwable e){ - // it could be a RuntimeException resulting due to some internal bug or - // its some other exception resulting from user error, wrap it in - // WebServiceException - throw new WebServiceException(e); + Packet request = createPacket(in); + request.setState(Packet.State.ClientRequest); + setProperties(request,false); + process(request,requestContext,this); + } catch(WebServiceException e){ + //it could be a WebServiceException or a ProtocolException + throw e; + } catch(Throwable e){ + // it could be a RuntimeException resulting due to some internal bug or + // its some other exception resulting from user error, wrap it in + // WebServiceException + throw new WebServiceException(e); + } + } finally { + ContainerResolver.getDefault().exitContainer(old); } } @@ -358,36 +375,54 @@ return portname; } - void resolveEndpointAddress(@NotNull Packet message, @NotNull RequestContext requestContext) { + void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) { + final boolean p = message.packetTakesPriorityOverRequestContext; + //resolve endpoint look for query parameters, pathInfo - String endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY); + String endpoint; + if (p && message.endpointAddress != null) { + endpoint = message.endpointAddress.toString(); + } else { + endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY); + } + // This is existing before packetTakesPriorityOverRequestContext so leaving in place. if (endpoint == null) endpoint = message.endpointAddress.toString(); String pathInfo = null; String queryString = null; - if (requestContext.get(MessageContext.PATH_INFO) != null) + if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) { + pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO); + } else if (requestContext.get(MessageContext.PATH_INFO) != null) { pathInfo = (String) requestContext.get(MessageContext.PATH_INFO); + } - if (requestContext.get(MessageContext.QUERY_STRING) != null) + if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) { + queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING); + } else if (requestContext.get(MessageContext.QUERY_STRING) != null) { queryString = (String) requestContext.get(MessageContext.QUERY_STRING); + } - - String resolvedEndpoint = null; if (pathInfo != null || queryString != null) { pathInfo = checkPath(pathInfo); queryString = checkQuery(queryString); if (endpoint != null) { try { final URI endpointURI = new URI(endpoint); - resolvedEndpoint = resolveURI(endpointURI, pathInfo, queryString); + endpoint = resolveURI(endpointURI, pathInfo, queryString); } catch (URISyntaxException e) { throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint)); } } - requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, resolvedEndpoint); - //message.endpointAddress = EndpointAddress.create(resolvedEndpoint); } + // These two lines used to be inside the above if. It is outside so: + // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString + // this will just put back what it found in the requestContext - basically a noop. + // - but when info is in the Packet this will update so it will get used later. + // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub. + requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint); + // This is not necessary because a later step will copy the resolvedEndpoint put above into message. + //message.endpointAddress = EndpointAddress.create(endpoint); } protected @NotNull String resolveURI(@NotNull URI endpointURI, @Nullable String pathInfo, @Nullable String queryString) { @@ -521,6 +556,7 @@ public void do_run () { checkNullAllowed(param, rc, binding, mode); final Packet message = createPacket(param); + message.setState(Packet.State.ClientRequest); message.nonNullAsyncHandlerGiven = this.nonNullAsyncHandlerGiven; resolveEndpointAddress(message, rc); setProperties(message,true); @@ -532,10 +568,10 @@ SOAPVersion sv = DispatchImpl.this.getBinding().getSOAPVersion(); action = av != null && message.getMessage() != null ? - message.getMessage().getHeaders().getAction(av, sv) : null; + AddressingUtils.getAction(message.getMessage().getHeaders(), av, sv) : null; msgId = av != null&& message.getMessage() != null ? - message.getMessage().getHeaders().getMessageID(av, sv) : null; + AddressingUtils.getMessageID(message.getMessage().getHeaders(), av, sv) : null; LOGGER.fine("In DispatchAsyncInvoker.do_run for async message with action: " + action + " and msg ID: " + msgId); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/JAXBDispatch.java 2013-04-04 15:29:32.040615022 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/JAXBDispatch.java 2013-04-04 15:29:31.980615021 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java 2013-04-04 15:29:32.356615027 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java 2013-04-04 15:29:32.296615026 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/PacketDispatch.java 2013-04-04 15:29:32.656615032 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/PacketDispatch.java 2013-04-04 15:29:32.600615030 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,10 @@ import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; +import com.sun.xml.internal.ws.api.client.ThrowableInPacketCompletionFeature; import com.sun.xml.internal.ws.api.client.WSPortInfo; import com.sun.xml.internal.ws.api.message.Packet; +import com.sun.xml.internal.ws.api.pipe.Fiber; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.client.WSServiceDelegate; @@ -43,10 +45,12 @@ * @since 2.2.6 */ public class PacketDispatch extends DispatchImpl { + private final boolean isDeliverThrowableInPacket; @Deprecated public PacketDispatch(QName port, WSServiceDelegate owner, Tube pipe, BindingImpl binding, @Nullable WSEndpointReference epr) { super(port, Mode.MESSAGE, owner, pipe, binding, epr); + isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding); } @@ -56,10 +60,21 @@ public PacketDispatch(WSPortInfo portInfo, Tube pipe, BindingImpl binding, WSEndpointReference epr, boolean allowFaultResponseMsg) { super(portInfo, Mode.MESSAGE, pipe, binding, epr, allowFaultResponseMsg); + isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding); } public PacketDispatch(WSPortInfo portInfo, BindingImpl binding, WSEndpointReference epr) { super(portInfo, Mode.MESSAGE, binding, epr, true); + isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding); + } + + private boolean calculateIsDeliverThrowableInPacket(BindingImpl binding) { + return binding.isFeatureEnabled(ThrowableInPacketCompletionFeature.class); + } + + @Override + protected void configureFiber(Fiber fiber) { + fiber.setDeliverThrowableInPacket(isDeliverThrowableInPacket); } @Override --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java 2013-04-04 15:29:32.956615036 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java 2013-04-04 15:29:32.900615035 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java 2013-04-04 15:29:33.252615040 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java 2013-04-04 15:29:33.196615040 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/SOAPSourceDispatch.java 2013-04-04 15:29:33.564615045 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/SOAPSourceDispatch.java 2013-04-04 15:29:33.504615045 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/package-info.java 2013-04-04 15:29:33.864615050 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/package-info.java 2013-04-04 15:29:33.804615049 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java 2013-04-04 15:29:34.156615054 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java 2013-04-04 15:29:34.096615054 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,30 +27,21 @@ //import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.databinding.ClientCallBridge; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.Fiber; -import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; import com.sun.xml.internal.ws.client.AsyncInvoker; import com.sun.xml.internal.ws.client.AsyncResponseImpl; import com.sun.xml.internal.ws.client.RequestContext; import com.sun.xml.internal.ws.client.ResponseContext; -import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; -import com.sun.xml.internal.ws.model.JavaMethodImpl; -import com.sun.xml.internal.ws.model.ParameterImpl; -import com.sun.xml.internal.ws.model.WrapperParameter; -import com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo; -import javax.jws.soap.SOAPBinding.Style; import javax.xml.ws.AsyncHandler; import javax.xml.ws.Response; import javax.xml.ws.WebServiceException; import java.lang.reflect.Method; -import java.util.List; /** * Common part between {@link CallbackMethodHandler} and {@link PollingMethodHandler}. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java 2013-04-04 15:29:34.456615060 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java 2013-04-04 15:29:34.400615059 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -140,11 +140,20 @@ */ protected final ValueGetter[] getters; - protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) { - super(wp.getXMLBridge(), soapVersion); + /** + * How does each wrapped parameter binds to XML? + */ + protected XMLBridge[] parameterBridges; - List children = wp.getWrapperChildren(); + /** + * List of Parameters packed in the body. + * Only used for error diagnostics. + */ + protected List children; + protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) { + super(wp.getXMLBridge(), soapVersion); + children = wp.getWrapperChildren(); indices = new int[children.size()]; getters = new ValueGetter[children.size()]; for( int i=0; i=0; i-- ) { + Object arg = getters[i].get(methodArgs[indices[i]]); + if(arg==null) { + throw new WebServiceException("Method Parameter: "+ + children.get(i).getName()+" cannot be null. This is BP 1.1 R2211 violation."); + } + cs.values[i] = arg; + } + + return cs; + } } /** @@ -174,6 +204,7 @@ * Needed to get wrapper instantiation method. */ private BindingContext bindingContext; + private boolean dynamicWrapper; /** * Creates a {@link BodyBuilder} from a {@link WrapperParameter}. @@ -181,21 +212,24 @@ DocLit(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) { super(wp, soapVersion, getter); bindingContext = wp.getOwner().getBindingContext(); - wrapper = (Class)wp.getXMLBridge().getTypeInfo().type; - - List children = wp.getWrapperChildren(); - + dynamicWrapper = WrapperComposite.class.equals(wrapper); + parameterBridges = new XMLBridge[children.size()]; accessors = new PropertyAccessor[children.size()]; for( int i=0; i children; /** * Creates a {@link BodyBuilder} from a {@link WrapperParameter}. @@ -261,32 +286,13 @@ // we'll use CompositeStructure to pack requests assert wp.getTypeInfo().type==WrapperComposite.class; - this.children = wp.getWrapperChildren(); - parameterBridges = new XMLBridge[children.size()]; for( int i=0; i=0; i-- ) { - Object arg = getters[i].get(methodArgs[indices[i]]); - if(arg==null) { - throw new WebServiceException("Method Parameter: "+ - children.get(i).getName()+" cannot be null. This is BP 1.1 R2211 violation."); - } - cs.values[i] = arg; - } - - return cs; + Object build(Object[] methodArgs) { + return buildWrapperComposite(methodArgs); } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java 2013-04-04 15:29:34.736615064 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java 2013-04-04 15:29:34.676615063 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java 2013-04-04 15:29:35.040615068 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java 2013-04-04 15:29:34.980615068 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java 2013-04-04 15:29:35.368615074 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java 2013-04-04 15:29:35.308615072 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java 2013-04-04 15:29:35.668615078 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java 2013-04-04 15:29:35.608615078 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java 2013-04-04 15:29:35.988615083 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java 2013-04-04 15:29:35.928615083 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,6 +35,7 @@ import com.sun.xml.internal.ws.model.ParameterImpl; import com.sun.xml.internal.ws.model.WrapperParameter; import com.sun.xml.internal.ws.resources.ServerMessages; +import com.sun.xml.internal.ws.spi.db.RepeatedElementBridge; import com.sun.xml.internal.ws.spi.db.XMLBridge; import com.sun.xml.internal.ws.spi.db.DatabindingException; import com.sun.xml.internal.ws.spi.db.PropertyAccessor; @@ -95,9 +96,80 @@ */ public abstract Object readResponse(Message reply, Object[] args) throws JAXBException, XMLStreamException; + static final class WrappedPartBuilder { + private final XMLBridge bridge; + private final ValueSetter setter; + public WrappedPartBuilder(XMLBridge bridge, ValueSetter setter) { + this.bridge = bridge; + this.setter = setter; + } + final Object readResponse(Object[] args, XMLStreamReader r, AttachmentSet att) throws JAXBException { + Object obj; + AttachmentUnmarshallerImpl au = (att != null)?new AttachmentUnmarshallerImpl(att):null; + if (bridge instanceof RepeatedElementBridge) { + RepeatedElementBridge rbridge = (RepeatedElementBridge)bridge; + ArrayList list = new ArrayList(); + QName name = r.getName(); + while (r.getEventType()==XMLStreamReader.START_ELEMENT && name.equals(r.getName())) { + list.add(rbridge.unmarshal(r, au)); + XMLStreamReaderUtil.toNextTag(r, name); + } + obj = rbridge.collectionHandler().convert(list); + } else { + obj = bridge.unmarshal(r, au); + } + return setter.put(obj,args); + } + } + /** + * {@link ResponseBuilder.PartBuilder} keyed by the element name (inside the wrapper element.) + */ + protected Map wrappedParts = null; + protected QName wrapperName; + + protected Object readWrappedResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException { + Object retVal = null; + + if (!msg.hasPayload()) { + throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); + } + XMLStreamReader reader = msg.readPayload(); + XMLStreamReaderUtil.verifyTag(reader,wrapperName); + reader.nextTag(); + + while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { + // TODO: QName has a performance issue + WrappedPartBuilder part = wrappedParts.get(reader.getName()); + if(part==null) { + // no corresponding part found. ignore + XMLStreamReaderUtil.skipElement(reader); + reader.nextTag(); + } else { + Object o = part.readResponse(args,reader, msg.getAttachments()); + // there's only at most one ResponseBuilder that returns a value. + if(o!=null) { + assert retVal==null; + retVal = o; + } + } + // skip any whitespace + if (reader.getEventType() != XMLStreamConstants.START_ELEMENT && + reader.getEventType() != XMLStreamConstants.END_ELEMENT) { + XMLStreamReaderUtil.nextElementContent(reader); + } + } + + // we are done with the body + reader.close(); + XMLStreamReaderFactory.recycle(reader); + + return retVal; + } + static final class None extends ResponseBuilder { private None(){ } + @Override public Object readResponse(Message msg, Object[] args) { msg.consume(); return null; @@ -108,7 +180,7 @@ * The singleton instance that produces null return value. * Used for operations that doesn't have any output. */ - public static ResponseBuilder NONE = new None(); + public final static ResponseBuilder NONE = new None(); /** * Returns the 'uninitialized' value for the given type. @@ -116,6 +188,7 @@ *

    * For primitive types, it's '0', and for reference types, it's null. */ + @SuppressWarnings("element-type-mismatch") public static Object getVMUninitializedValue(Type type) { // if this map returns null, that means the 'type' is a reference type, // in which case 'null' is the correct null value, so this code is correct. @@ -147,6 +220,7 @@ this.nullValue = nullValue; this.setter = setter; } + @Override public Object readResponse(Message msg, Object[] args) { return setter.put(nullValue, args); } @@ -178,6 +252,7 @@ this(builders.toArray(new ResponseBuilder[builders.size()])); } + @Override public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException { Object retVal = null; for (ResponseBuilder builder : builders) { @@ -238,6 +313,7 @@ } } + @Override public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException { // TODO not to loop for (Attachment att : msg.getAttachments()) { @@ -260,6 +336,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) { return setter.put(att.asDataHandler(), args); } @@ -270,6 +347,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) { att.getContentType(); StringDataContentHandler sdh = new StringDataContentHandler(); @@ -288,6 +366,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) { return setter.put(att.asByteArray(), args); } @@ -298,6 +377,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) { return setter.put(att.asSource(), args); } @@ -308,6 +388,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) { Image image; InputStream is = null; @@ -334,6 +415,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) { return setter.put(att.asInputStream(), args); } @@ -344,6 +426,7 @@ super(param, setter); } + @Override Object mapAttachment(Attachment att, Object[] args) throws JAXBException { Object obj = param.getXMLBridge().unmarshal(att.asInputStream()); return setter.put(obj, args); @@ -375,6 +458,7 @@ * @return null * if the parsing fails. */ + @SuppressWarnings("FinalStaticMethod") public static final String getWSDLPartName(com.sun.xml.internal.ws.api.message.Attachment att){ String cId = att.getContentId(); @@ -440,6 +524,7 @@ } } + @Override public Object readResponse(Message msg, Object[] args) throws JAXBException { com.sun.xml.internal.ws.api.message.Header header = null; Iterator it = @@ -477,6 +562,7 @@ this.setter = setter; } + @Override public Object readResponse(Message msg, Object[] args) throws JAXBException { return setter.put( msg.readPayloadAsJAXB(bridge), args ); } @@ -494,41 +580,50 @@ private final XMLBridge wrapper; - private final QName wrapperName; + private boolean dynamicWrapper; public DocLit(WrapperParameter wp, ValueSetterFactory setterFactory) { wrapperName = wp.getName(); wrapper = wp.getXMLBridge(); Class wrapperType = (Class) wrapper.getTypeInfo().type; + dynamicWrapper = WrapperComposite.class.equals(wrapperType); - List parts = new ArrayList(); + List tempParts = new ArrayList(); List children = wp.getWrapperChildren(); for (ParameterImpl p : children) { if(p.isIN()) continue; QName name = p.getName(); - try { - parts.add( new PartBuilder( - wp.getOwner().getBindingContext().getElementPropertyAccessor( - wrapperType, - name.getNamespaceURI(), - p.getName().getLocalPart()), - setterFactory.get(p) - )); - // wrapper parameter itself always bind to body, and - // so do all its children - assert p.getBinding()== ParameterBinding.BODY; - } catch (JAXBException e) { - throw new WebServiceException( // TODO: i18n - wrapperType+" do not have a property of the name "+name,e); + if (dynamicWrapper) { + if (wrappedParts == null) wrappedParts = new HashMap(); + XMLBridge xmlBridge = p.getInlinedRepeatedElementBridge(); + if (xmlBridge == null) xmlBridge = p.getXMLBridge(); + wrappedParts.put( p.getName(), new WrappedPartBuilder(xmlBridge, setterFactory.get(p))); + } else { + try { + tempParts.add(new PartBuilder( + wp.getOwner().getBindingContext().getElementPropertyAccessor( + wrapperType, + name.getNamespaceURI(), + p.getName().getLocalPart()), + setterFactory.get(p) + )); + // wrapper parameter itself always bind to body, and + // so do all its children + assert p.getBinding()== ParameterBinding.BODY; + } catch (JAXBException e) { + throw new WebServiceException( // TODO: i18n + wrapperType+" do not have a property of the name "+name,e); + } } } - - this.parts = parts.toArray(new PartBuilder[parts.size()]); + this.parts = tempParts.toArray(new PartBuilder[tempParts.size()]); } + @Override public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException { + if (dynamicWrapper) return readWrappedResponse(msg, args); Object retVal = null; if (parts.length>0) { @@ -599,20 +694,13 @@ * and processes all such wrapped parts. */ public static final class RpcLit extends ResponseBuilder { - /** - * {@link PartBuilder} keyed by the element name (inside the wrapper element.) - */ - private final Map parts = new HashMap(); - - private QName wrapperName; - public RpcLit(WrapperParameter wp, ValueSetterFactory setterFactory) { assert wp.getTypeInfo().type== WrapperComposite.class; - wrapperName = wp.getName(); + wrappedParts = new HashMap(); List children = wp.getWrapperChildren(); for (ParameterImpl p : children) { - parts.put( p.getName(), new PartBuilder( + wrappedParts.put( p.getName(), new WrappedPartBuilder( p.getXMLBridge(), setterFactory.get(p) )); // wrapper parameter itself always bind to body, and @@ -621,70 +709,9 @@ } } + @Override public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException { - Object retVal = null; - - if (!msg.hasPayload()) { - throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); - } - XMLStreamReader reader = msg.readPayload(); - XMLStreamReaderUtil.verifyTag(reader,wrapperName); - reader.nextTag(); - - while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { - // TODO: QName has a performance issue - PartBuilder part = parts.get(reader.getName()); - if(part==null) { - // no corresponding part found. ignore - XMLStreamReaderUtil.skipElement(reader); - reader.nextTag(); - } else { - Object o = part.readResponse(args,reader, msg.getAttachments()); - // there's only at most one ResponseBuilder that returns a value. - if(o!=null) { - assert retVal==null; - retVal = o; - } - } - // skip any whitespace - if (reader.getEventType() != XMLStreamConstants.START_ELEMENT && - reader.getEventType() != XMLStreamConstants.END_ELEMENT) { - XMLStreamReaderUtil.nextElementContent(reader); - } - } - - // we are done with the body - reader.close(); - XMLStreamReaderFactory.recycle(reader); - - return retVal; - } - - /** - * Unmarshals each wrapped part into a JAXB object and moves it - * to the expected place. - */ - static final class PartBuilder { - private final XMLBridge bridge; - private final ValueSetter setter; - - /** - * @param bridge - * specifies how the part is unmarshalled. - * @param setter - * specifies how the obtained value is returned to the client. - */ - public PartBuilder(XMLBridge bridge, ValueSetter setter) { - this.bridge = bridge; - this.setter = setter; - } - - final Object readResponse(Object[] args, XMLStreamReader r, AttachmentSet att) throws JAXBException { - Object obj = bridge.unmarshal(r, (att != null)?new AttachmentUnmarshallerImpl(att):null); - return setter.put(obj,args); - } - - + return readWrappedResponse(msg, args); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIMethodHandler.java 2013-04-04 15:29:36.248615088 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIMethodHandler.java 2013-04-04 15:29:36.192615086 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ {// prepare objects for creating messages List rp = method.getRequestParameters(); - BodyBuilder bodyBuilder = null; + BodyBuilder tmpBodyBuilder = null; List fillers = new ArrayList(); for (ParameterImpl param : rp) { @@ -105,11 +105,11 @@ case BODY: if(param.isWrapperStyle()) { if(param.getParent().getBinding().isRpcLit()) - bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); + tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); else - bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); + tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); } else { - bodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter); + tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter); } break; case HEADER: @@ -128,21 +128,21 @@ } } - if(bodyBuilder==null) { + if(tmpBodyBuilder==null) { // no parameter binds to body. we create an empty message switch(owner.soapVersion) { case SOAP_11: - bodyBuilder = BodyBuilder.EMPTY_SOAP11; + tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11; break; case SOAP_12: - bodyBuilder = BodyBuilder.EMPTY_SOAP12; + tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12; break; default: throw new AssertionError(); } } - this.bodyBuilder = bodyBuilder; + this.bodyBuilder = tmpBodyBuilder; this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java 2013-04-04 15:29:36.520615092 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java 2013-04-04 15:29:36.464615090 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +38,9 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.Fiber; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.binding.BindingImpl; -import com.sun.xml.internal.ws.client.AsyncResponseImpl; import com.sun.xml.internal.ws.client.*; import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.SOAPSEIModel; @@ -131,21 +132,26 @@ private final Map methodHandlers = new HashMap(); public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - MethodHandler handler = methodHandlers.get(method); - if (handler != null) { - return handler.invoke(proxy, args); - } else { - // we handle the other method invocations by ourselves - try { - return method.invoke(this, args); - } catch (IllegalAccessException e) { - // impossible - throw new AssertionError(e); - } catch (IllegalArgumentException e) { - throw new AssertionError(e); - } catch (InvocationTargetException e) { - throw e.getCause(); + Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); + try { + MethodHandler handler = methodHandlers.get(method); + if (handler != null) { + return handler.invoke(proxy, args); + } else { + // we handle the other method invocations by ourselves + try { + return method.invoke(this, args); + } catch (IllegalAccessException e) { + // impossible + throw new AssertionError(e); + } catch (IllegalArgumentException e) { + throw new AssertionError(e); + } catch (InvocationTargetException e) { + throw e.getCause(); + } } + } finally { + ContainerResolver.getDefault().exitContainer(old); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/StubAsyncHandler.java 2013-04-04 15:29:36.796615096 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/StubAsyncHandler.java 2013-04-04 15:29:36.740615095 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,6 +28,8 @@ import java.util.List; import javax.jws.soap.SOAPBinding.Style; + +import com.sun.xml.internal.ws.api.message.MessageContextFactory; import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.ParameterImpl; import com.sun.xml.internal.ws.model.WrapperParameter; @@ -36,8 +38,8 @@ private final Class asyncBeanClass; - public StubAsyncHandler(JavaMethodImpl jm, JavaMethodImpl sync) { - super(sync); + public StubAsyncHandler(JavaMethodImpl jm, JavaMethodImpl sync, MessageContextFactory mcf) { + super(sync, mcf); List rp = sync.getResponseParameters(); int size = 0; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/StubHandler.java 2013-04-04 15:29:37.012615099 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/StubHandler.java 2013-04-04 15:29:36.960615099 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 @@ package com.sun.xml.internal.ws.client.sei; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.databinding.ClientCallBridge; -import com.sun.xml.internal.ws.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageContextFactory; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; @@ -53,7 +54,7 @@ *

      *
    1. Accepts Object[] that represents arguments for a Java method, * and creates {@link com.sun.xml.internal.ws.message.jaxb.JAXBMessage} that represents a request message. - *
    2. Takes a {@link com.sun.xml.internal.ws.api.message.Message] that represents a response, + *
    3. Takes a {@link com.sun.xml.internal.ws.api.message.Message} that represents a response, * and extracts the return value (and updates {@link javax.xml.ws.Holder }s.) *
    * @@ -78,8 +79,9 @@ protected final Map checkedExceptions; protected SOAPVersion soapVersion = SOAPVersion.SOAP_11; protected ResponseBuilder responseBuilder; + protected MessageContextFactory packetFactory; - public StubHandler(JavaMethodImpl method) { + public StubHandler(JavaMethodImpl method, MessageContextFactory mcf) { //keep all the CheckedException model for the detail qname this.checkedExceptions = new HashMap(); for(CheckedExceptionImpl ce : method.getCheckedExceptions()){ @@ -93,6 +95,7 @@ this.soapAction = soapActionFromBinding; } this.javaMethod = method; + packetFactory = mcf; soapVersion = javaMethod.getBinding().getSOAPVersion(); @@ -210,12 +213,13 @@ * @param args proxy invocation arguments * @return Message for the arguments */ - public Packet createRequestPacket(JavaCallInfo call) { - Message msg = bodyBuilder.createMessage(call.getParameters()); + public Packet createRequestPacket(JavaCallInfo args) { + Message msg = bodyBuilder.createMessage(args.getParameters()); - for (MessageFiller filler : inFillers) filler.fillIn(call.getParameters(),msg); + for (MessageFiller filler : inFillers) filler.fillIn(args.getParameters(),msg); - Packet req = new Packet(msg); + Packet req = (Packet)packetFactory.createContext(msg); + req.setState(Packet.State.ClientRequest); req.soapAction = soapAction; req.expectReply = !isOneWay; req.getMessage().assertOneWay(isOneWay); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java 2013-04-04 15:29:37.240615102 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java 2013-04-04 15:29:37.192615102 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,30 +25,19 @@ package com.sun.xml.internal.ws.client.sei; -import com.sun.xml.internal.ws.api.databinding.ClientCallBridge; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.client.RequestContext; import com.sun.xml.internal.ws.client.ResponseContextReceiver; import com.sun.xml.internal.ws.encoding.soap.DeserializationException; -import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; -import com.sun.xml.internal.ws.model.CheckedExceptionImpl; -import com.sun.xml.internal.ws.model.JavaMethodImpl; -import com.sun.xml.internal.ws.model.ParameterImpl; -import com.sun.xml.internal.ws.model.WrapperParameter; -import com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo; import javax.xml.bind.JAXBException; -import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.ws.Holder; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * {@link MethodHandler} that handles synchronous method invocations. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java 2013-04-04 15:29:37.448615106 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java 2013-04-04 15:29:37.392615105 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueGetterFactory.java 2013-04-04 15:29:37.656615109 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueGetterFactory.java 2013-04-04 15:29:37.608615108 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java 2013-04-04 15:29:37.864615112 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java 2013-04-04 15:29:37.816615112 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueSetterFactory.java 2013-04-04 15:29:38.092615116 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/ValueSetterFactory.java 2013-04-04 15:29:38.032615115 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/pacakge-info.java 2013-04-04 15:29:38.392615120 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/pacakge-info.java 2013-04-04 15:29:38.340615120 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/config/management/policy/ManagementAssertionCreator.java 2013-04-04 15:29:38.692615126 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/config/management/policy/ManagementAssertionCreator.java 2013-04-04 15:29:38.636615124 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/config/management/policy/ManagementPolicyValidator.java 2013-04-04 15:29:38.992615130 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/config/management/policy/ManagementPolicyValidator.java 2013-04-04 15:29:38.936615129 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/config/management/policy/ManagementPrefixMapper.java 2013-04-04 15:29:39.316615135 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/config/management/policy/ManagementPrefixMapper.java 2013-04-04 15:29:39.256615134 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingFactoryImpl.java 2013-04-04 15:29:39.624615140 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingFactoryImpl.java 2013-04-04 15:29:39.564615139 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,6 @@ package com.sun.xml.internal.ws.db; -import java.io.File; import java.io.InputStream; import java.net.URL; import java.util.HashMap; @@ -38,19 +37,17 @@ import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; -import com.sun.xml.internal.org.jvnet.ws.databinding.Databinding; -import com.sun.xml.internal.org.jvnet.ws.databinding.DatabindingModeFeature; -import com.sun.xml.internal.org.jvnet.ws.databinding.Databinding.Builder; -import com.sun.xml.internal.org.jvnet.ws.databinding.Databinding.WSDLGenerator; import org.xml.sax.EntityResolver; +import com.oracle.webservices.internal.api.databinding.Databinding; +import com.oracle.webservices.internal.api.databinding.Databinding.Builder; +import com.oracle.webservices.internal.api.databinding.WSDLGenerator; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; -import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.spi.db.DatabindingException; import com.sun.xml.internal.ws.spi.db.DatabindingProvider; import com.sun.xml.internal.ws.util.ServiceFinder; @@ -115,7 +112,7 @@ return provider.create(config); } - public Databinding.WSDLGenerator createWsdlGen(DatabindingConfig config) { + public WSDLGenerator createWsdlGen(DatabindingConfig config) { DatabindingProvider provider = provider(config); return provider.wsdlGen(config); } @@ -145,8 +142,8 @@ config.getMappingInfo().getDatabindingMode() != null) return config.getMappingInfo().getDatabindingMode(); if ( config.getFeatures() != null) for (WebServiceFeature f : config.getFeatures()) { - if (f instanceof DatabindingModeFeature) { - DatabindingModeFeature dmf = (DatabindingModeFeature) f; + if (f instanceof com.oracle.webservices.internal.api.databinding.DatabindingModeFeature) { + com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf = (com.oracle.webservices.internal.api.databinding.DatabindingModeFeature) f; return dmf.getMode(); } } @@ -235,16 +232,19 @@ if (isfor(WSDLPort.class, name, value)) { config.setWsdlPort((WSDLPort)value); } + if (isfor(MetadataReader.class, name, value)) { + config.setMetadataReader((MetadataReader)value); + } return this; } boolean isfor(Class type, String name, Object value) { return type.getName().equals(name) && type.isInstance(value); } - public com.sun.xml.internal.org.jvnet.ws.databinding.Databinding build() { + public com.oracle.webservices.internal.api.databinding.Databinding build() { return factory.createRuntime(config); } - public WSDLGenerator createWSDLGenerator() { + public com.oracle.webservices.internal.api.databinding.WSDLGenerator createWSDLGenerator() { return factory.createWsdlGen(config); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingImpl.java 2013-04-04 15:29:39.928615145 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingImpl.java 2013-04-04 15:29:39.872615144 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,21 +32,21 @@ import java.util.HashMap; import java.util.Map; -import javax.xml.namespace.QName; import javax.xml.ws.WebServiceFeature; -import com.sun.xml.internal.org.jvnet.ws.message.MessageContext; - +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; +import com.oracle.webservices.internal.api.message.MessageContext; import com.sun.xml.internal.ws.api.databinding.EndpointCallBridge; -import com.sun.xml.internal.ws.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; import com.sun.xml.internal.ws.api.databinding.Databinding; import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; import com.sun.xml.internal.ws.api.databinding.ClientCallBridge; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageContextFactory; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.MEP; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.pipe.Codec; import com.sun.xml.internal.ws.api.pipe.ContentType; @@ -57,7 +57,6 @@ import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.server.sei.TieHandler; -import com.sun.xml.internal.ws.util.QNameMap; import com.sun.xml.internal.ws.wsdl.ActionBasedOperationSignature; import com.sun.xml.internal.ws.wsdl.DispatchException; import com.sun.xml.internal.ws.wsdl.OperationDispatcher; @@ -67,22 +66,25 @@ * * @author shih-chang.chen@oracle.com */ -public class DatabindingImpl implements Databinding, com.sun.xml.internal.org.jvnet.ws.databinding.Databinding { +public class DatabindingImpl implements Databinding { AbstractSEIModelImpl seiModel; Map stubHandlers; - QNameMap wsdlOpMap = new QNameMap(); +// QNameMap wsdlOpMap = new QNameMap(); + Map wsdlOpMap = new HashMap(); Map tieHandlers = new HashMap(); OperationDispatcher operationDispatcher; OperationDispatcher operationDispatcherNoWsdl; boolean clientConfig = false; Codec codec; + MessageContextFactory packetFactory = null; public DatabindingImpl(DatabindingProviderImpl p, DatabindingConfig config) { RuntimeModeler modeler = new RuntimeModeler(config); modeler.setClassLoader(config.getClassLoader()); seiModel = modeler.buildRuntimeModel(); WSDLPort wsdlport = config.getWsdlPort(); + packetFactory = new MessageContextFactory(seiModel.getWSBinding().getFeatures()); clientConfig = isClientConfig(config); if ( clientConfig ) initStubHandlers(); seiModel.setDatabinding(this); @@ -90,8 +92,8 @@ if (operationDispatcher == null) operationDispatcherNoWsdl = new OperationDispatcher(null, seiModel.getWSBinding(), seiModel); // if(!clientConfig) { for(JavaMethodImpl jm: seiModel.getJavaMethods()) if (!jm.isAsync()) { - TieHandler th = new TieHandler(jm, seiModel.getWSBinding()); - wsdlOpMap.put(jm.getOperationQName(), th); + TieHandler th = new TieHandler(jm, seiModel.getWSBinding(), packetFactory); + wsdlOpMap.put(jm, th); tieHandlers.put(th.getMethod(), th); } // } @@ -121,7 +123,7 @@ // first fill in sychronized versions for (JavaMethodImpl m : seiModel.getJavaMethods()) { if (!m.getMEP().isAsync) { - StubHandler handler = new StubHandler(m); + StubHandler handler = new StubHandler(m, packetFactory); syncs.put(m.getOperationSignature(), m); stubHandlers.put(m.getMethod(), handler); } @@ -130,22 +132,24 @@ JavaMethodImpl sync = syncs.get(jm.getOperationSignature()); if (jm.getMEP() == MEP.ASYNC_CALLBACK || jm.getMEP() == MEP.ASYNC_POLL) { Method m = jm.getMethod(); - StubAsyncHandler handler = new StubAsyncHandler(jm, sync); + StubAsyncHandler handler = new StubAsyncHandler(jm, sync, packetFactory); stubHandlers.put(m, handler); } } } - public QName resolveOperationQName(Packet req) throws DispatchException { - return (operationDispatcher != null)? - operationDispatcher.getWSDLOperationQName(req): - operationDispatcherNoWsdl.getWSDLOperationQName(req); + public JavaMethodImpl resolveJavaMethod(Packet req) throws DispatchException { + WSDLOperationMapping m = req.getWSDLOperationMapping(); + if (m == null) m = (operationDispatcher != null) ? + operationDispatcher.getWSDLOperationMapping(req): + operationDispatcherNoWsdl.getWSDLOperationMapping(req); + return (JavaMethodImpl) m.getJavaMethod(); } public JavaCallInfo deserializeRequest(Packet req) { - JavaCallInfo call = new JavaCallInfo(); + com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(); try { - QName wsdlOp = resolveOperationQName(req); + JavaMethodImpl wsdlOp = resolveJavaMethod(req); TieHandler tie = wsdlOpMap.get(wsdlOp); call.setMethod(tie.getMethod()); Object[] args = tie.readRequest(req.getMessage()); @@ -173,7 +177,9 @@ public Packet serializeRequest(JavaCallInfo call) { StubHandler stubHandler = stubHandlers.get(call.getMethod()); - return stubHandler.createRequestPacket(call); + Packet p = stubHandler.createRequestPacket(call); + p.setState(Packet.State.ClientRequest); + return p; } public Packet serializeResponse(JavaCallInfo call) { @@ -188,9 +194,9 @@ if (call.getException() instanceof DispatchException) { message = ((DispatchException)call.getException()).fault; } - Packet response = new Packet(); - response.setMessage(message); - return response; + Packet p = (Packet)packetFactory.createContext(message); + p.setState(Packet.State.ServerResponse); + return p; } public ClientCallBridge getClientBridge(Method method) { @@ -205,12 +211,13 @@ seiModel.getWSBinding(), info.getContainer(), seiModel.getEndpointClass(), info.isInlineSchemas(), - info.getExtensions()); + info.isSecureXmlProcessingDisabled(), + info.getExtensions()); wsdlGen.doGeneration(); } public EndpointCallBridge getEndpointBridge(Packet req) throws DispatchException { - QName wsdlOp = resolveOperationQName(req); + JavaMethodImpl wsdlOp = resolveJavaMethod(req); return wsdlOpMap.get(wsdlOp); } @@ -228,24 +235,20 @@ getCodec().decode(in, ct, p); } - public com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo createJavaCallInfo(Method method, Object[] args) { - return new JavaCallInfo(method, args); - } - - public MessageContext serializeRequest(com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo call) { - return serializeRequest((JavaCallInfo)call); + public com.oracle.webservices.internal.api.databinding.JavaCallInfo createJavaCallInfo(Method method, Object[] args) { + return new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(method, args); } - public com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo deserializeResponse( - MessageContext message, com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo call) { + public com.oracle.webservices.internal.api.databinding.JavaCallInfo deserializeResponse( + MessageContext message, com.oracle.webservices.internal.api.databinding.JavaCallInfo call) { return deserializeResponse((Packet)message, (JavaCallInfo)call); } - public com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo deserializeRequest(MessageContext message) { + public com.oracle.webservices.internal.api.databinding.JavaCallInfo deserializeRequest(MessageContext message) { return deserializeRequest((Packet)message); } - public MessageContext serializeResponse(com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo call) { - return serializeResponse((JavaCallInfo)call); + public MessageContextFactory getMessageContextFactory() { + return packetFactory; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingProviderImpl.java 2013-04-04 15:29:40.228615149 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingProviderImpl.java 2013-04-04 15:29:40.168615149 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,8 +28,8 @@ import java.io.File; import java.util.Map; -import com.sun.xml.internal.org.jvnet.ws.databinding.Databinding.WSDLGenerator; - +import com.oracle.webservices.internal.api.databinding.WSDLGenerator; +import com.oracle.webservices.internal.api.databinding.WSDLResolver; import com.sun.xml.internal.ws.api.databinding.Databinding; import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; @@ -45,7 +45,7 @@ Map properties; public void init(Map p) { - properties = p; + properties = p; } DatabindingImpl getCachedDatabindingImpl(DatabindingConfig config) { @@ -72,7 +72,7 @@ return true; } - static public class JaxwsWsdlGen implements Databinding.WSDLGenerator { + static public class JaxwsWsdlGen implements WSDLGenerator { DatabindingImpl databinding; WSDLGenInfo wsdlGenInfo; @@ -87,12 +87,12 @@ } public WSDLGenerator property(String name, Object value) { - // TODO Auto-generated method stub - return null; + // TODO wsdlGenInfo.set... + return this; } public void generate(WSDLResolver wsdlResolver) { -// wsdlGenInfo.setWsdlResolver(wsdlResolver); + wsdlGenInfo.setWsdlResolver(wsdlResolver); databinding.generateWSDL(wsdlGenInfo); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/BridgeWrapper.java 2013-04-04 15:29:40.532615154 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/BridgeWrapper.java 2013-04-04 15:29:40.472615153 +0200 @@ -50,37 +50,41 @@ public class BridgeWrapper implements XMLBridge { - private JAXBRIContextWrapper parent; - private com.sun.xml.internal.bind.api.Bridge bridge; + private JAXBRIContextWrapper parent; + private com.sun.xml.internal.bind.api.Bridge bridge; - public BridgeWrapper(JAXBRIContextWrapper p, com.sun.xml.internal.bind.api.Bridge b) { - parent = p; - bridge = b; - } + public BridgeWrapper(JAXBRIContextWrapper p, com.sun.xml.internal.bind.api.Bridge b) { + parent = p; + bridge = b; + } - public BindingContext context() { - return parent; - } + @Override + public BindingContext context() { + return parent; + } - com.sun.xml.internal.bind.api.Bridge getBridge() { - return bridge; - } + com.sun.xml.internal.bind.api.Bridge getBridge() { + return bridge; + } - public boolean equals(Object obj) { - return bridge.equals(obj); - } + @Override + public boolean equals(Object obj) { + return bridge.equals(obj); + } - public JAXBRIContext getContext() { - return bridge.getContext(); - } + public JAXBRIContext getContext() { + return bridge.getContext(); + } - public TypeInfo getTypeInfo() { - return parent.typeInfo(bridge.getTypeReference()); - } + @Override + public TypeInfo getTypeInfo() { + return parent.typeInfo(bridge.getTypeReference()); + } - public int hashCode() { - return bridge.hashCode(); - } + @Override + public int hashCode() { + return bridge.hashCode(); + } // public final void marshal(BridgeContext context, T object, ContentHandler contentHandler) throws JAXBException { // bridge.marshal(context, object, contentHandler); @@ -101,32 +105,32 @@ // public final void marshal(BridgeContext context, T object, XMLStreamWriter output) throws JAXBException { // bridge.marshal(context, object, output); // } + public void marshal(Marshaller m, T object, ContentHandler contentHandler) throws JAXBException { + bridge.marshal(m, object, contentHandler); + } - public void marshal(Marshaller m, T object, ContentHandler contentHandler) throws JAXBException { - bridge.marshal(m, object, contentHandler); - } - - public void marshal(Marshaller m, T object, Node output) throws JAXBException { - bridge.marshal(m, object, output); - } + public void marshal(Marshaller m, T object, Node output) throws JAXBException { + bridge.marshal(m, object, output); + } - public void marshal(Marshaller m, T object, OutputStream output, NamespaceContext nsContext) throws JAXBException { - bridge.marshal(m, object, output, nsContext); - } + public void marshal(Marshaller m, T object, OutputStream output, NamespaceContext nsContext) throws JAXBException { + bridge.marshal(m, object, output, nsContext); + } - public void marshal(Marshaller m, T object, Result result) throws JAXBException { - bridge.marshal(m, object, result); - } + public void marshal(Marshaller m, T object, Result result) throws JAXBException { + bridge.marshal(m, object, result); + } - public void marshal(Marshaller m, T object, XMLStreamWriter output) throws JAXBException { - bridge.marshal(m, object, output); + public void marshal(Marshaller m, T object, XMLStreamWriter output) throws JAXBException { + bridge.marshal(m, object, output); // bridge.marshal(m, (T) convert(object), output); - } + } - public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { + @Override + public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { // bridge.marshal((T) convert(object), contentHandler, am); - bridge.marshal(object, contentHandler, am); - } + bridge.marshal(object, contentHandler, am); + } // Object convert(Object o) { // return (o instanceof WrapperComposite)? convertWrapper((WrapperComposite)o) : o; @@ -140,44 +144,48 @@ // cs.bridges[i] = ((BridgeWrapper)w.bridges[i]).getBridge(); // return cs; // } - - public void marshal(T object, ContentHandler contentHandler) throws JAXBException { - bridge.marshal(object, contentHandler); + public void marshal(T object, ContentHandler contentHandler) throws JAXBException { + bridge.marshal(object, contentHandler); // bridge.marshal((T) convert(object), contentHandler); - } + } - public void marshal(T object, Node output) throws JAXBException { - bridge.marshal(object, output); + @Override + public void marshal(T object, Node output) throws JAXBException { + bridge.marshal(object, output); // bridge.marshal((T) convert(object), output); - } + } - public void marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { + @Override + public void marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { // bridge.marshal((T) convert(object), output, nsContext, am); - bridge.marshal(object, output, nsContext, am); - } + bridge.marshal(object, output, nsContext, am); + } - public void marshal(T object, OutputStream output, NamespaceContext nsContext) throws JAXBException { - bridge.marshal(object, output, nsContext); + public void marshal(T object, OutputStream output, NamespaceContext nsContext) throws JAXBException { + bridge.marshal(object, output, nsContext); // bridge.marshal((T) convert(object), output, nsContext); - } + } - public final void marshal(T object, Result result) throws JAXBException { - bridge.marshal(object, result); - } + @Override + public final void marshal(T object, Result result) throws JAXBException { + bridge.marshal(object, result); + } - public final void marshal(T object, XMLStreamWriter output, - AttachmentMarshaller am) throws JAXBException { - bridge.marshal(object, output, am); - } + @Override + public final void marshal(T object, XMLStreamWriter output, + AttachmentMarshaller am) throws JAXBException { + bridge.marshal(object, output, am); + } - public final void marshal(T object, XMLStreamWriter output) - throws JAXBException { - bridge.marshal(object, output); - } + public final void marshal(T object, XMLStreamWriter output) + throws JAXBException { + bridge.marshal(object, output); + } - public String toString() { - return BridgeWrapper.class.getName() + " : " + bridge.toString(); - } + @Override + public String toString() { + return BridgeWrapper.class.getName() + " : " + bridge.toString(); + } // public final T unmarshal(BridgeContext context, InputStream in) // throws JAXBException { @@ -198,58 +206,62 @@ // throws JAXBException { // return bridge.unmarshal(context, in); // } + @Override + public final T unmarshal(InputStream in) throws JAXBException { + return bridge.unmarshal(in); + } - public final T unmarshal(InputStream in) throws JAXBException { - return bridge.unmarshal(in); - } - - public final T unmarshal(Node n, AttachmentUnmarshaller au) - throws JAXBException { - return bridge.unmarshal(n, au); - } + @Override + public final T unmarshal(Node n, AttachmentUnmarshaller au) + throws JAXBException { + return bridge.unmarshal(n, au); + } - public final T unmarshal(Node n) throws JAXBException { - return bridge.unmarshal(n); - } + public final T unmarshal(Node n) throws JAXBException { + return bridge.unmarshal(n); + } - public final T unmarshal(Source in, AttachmentUnmarshaller au) - throws JAXBException { - return bridge.unmarshal(in, au); - } + @Override + public final T unmarshal(Source in, AttachmentUnmarshaller au) + throws JAXBException { + return bridge.unmarshal(in, au); + } - public final T unmarshal(Source in) throws DatabindingException { - try { - return bridge.unmarshal(in); - } catch (JAXBException e) { - throw new DatabindingException(e); - } + public final T unmarshal(Source in) throws DatabindingException { + try { + return bridge.unmarshal(in); + } catch (JAXBException e) { + throw new DatabindingException(e); } + } - public T unmarshal(Unmarshaller u, InputStream in) throws JAXBException { - return bridge.unmarshal(u, in); - } + public T unmarshal(Unmarshaller u, InputStream in) throws JAXBException { + return bridge.unmarshal(u, in); + } - public T unmarshal(Unmarshaller context, Node n) throws JAXBException { - return bridge.unmarshal(context, n); - } + public T unmarshal(Unmarshaller context, Node n) throws JAXBException { + return bridge.unmarshal(context, n); + } - public T unmarshal(Unmarshaller u, Source in) throws JAXBException { - return bridge.unmarshal(u, in); - } + public T unmarshal(Unmarshaller u, Source in) throws JAXBException { + return bridge.unmarshal(u, in); + } - public T unmarshal(Unmarshaller u, XMLStreamReader in) throws JAXBException { - return bridge.unmarshal(u, in); - } + public T unmarshal(Unmarshaller u, XMLStreamReader in) throws JAXBException { + return bridge.unmarshal(u, in); + } - public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) - throws JAXBException { - return bridge.unmarshal(in, au); - } + @Override + public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) + throws JAXBException { + return bridge.unmarshal(in, au); + } - public final T unmarshal(XMLStreamReader in) throws JAXBException { - return bridge.unmarshal(in); - } + public final T unmarshal(XMLStreamReader in) throws JAXBException { + return bridge.unmarshal(in); + } + @Override public boolean supportOutputStream() { return true; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/JAXBRIContextFactory.java 2013-04-04 15:29:40.828615159 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/JAXBRIContextFactory.java 2013-04-04 15:29:40.768615157 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 +31,8 @@ import java.util.Map; import java.lang.reflect.Type; import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; -import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; import com.sun.xml.internal.bind.api.TypeReference; import com.sun.xml.internal.bind.api.JAXBRIContext; import com.sun.xml.internal.bind.api.CompositeStructure; @@ -49,6 +46,7 @@ import com.sun.xml.internal.ws.spi.db.DatabindingException; import com.sun.xml.internal.ws.spi.db.TypeInfo; import com.sun.xml.internal.ws.spi.db.WrapperComposite; +import java.util.Arrays; /** * JAXBRIContextFactory @@ -57,68 +55,76 @@ */ public class JAXBRIContextFactory extends BindingContextFactory { - public BindingContext newContext(JAXBContext context) { - return new JAXBRIContextWrapper((JAXBRIContext)context, null); - } - - public BindingContext newContext(BindingInfo bi) { - Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]); - for (int i = 0; i < classes.length; i++) if (WrapperComposite.class.equals(classes[i])) - classes[i] = CompositeStructure.class; - Map typeInfoMappings = typeInfoMappings(bi.typeInfos()); - Map subclassReplacements = bi.subclassReplacements(); - String defaultNamespaceRemap = bi.getDefaultNamespace(); - Boolean c14nSupport = (Boolean)bi.properties().get("c14nSupport"); - RuntimeAnnotationReader ar = (RuntimeAnnotationReader)bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader"); - JAXBContextFactory jaxbContextFactory = (JAXBContextFactory)bi.properties().get(JAXBContextFactory.class.getName()); + @Override + public BindingContext newContext(JAXBContext context) { + return new JAXBRIContextWrapper((JAXBRIContext) context, null); + } + + @Override + public BindingContext newContext(BindingInfo bi) { + Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]); + for (int i = 0; i < classes.length; i++) { + if (WrapperComposite.class.equals(classes[i])) { + classes[i] = CompositeStructure.class; + } + } + Map typeInfoMappings = typeInfoMappings(bi.typeInfos()); + Map subclassReplacements = bi.subclassReplacements(); + String defaultNamespaceRemap = bi.getDefaultNamespace(); + Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport"); + RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader"); + JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName()); try { - JAXBRIContext context = (jaxbContextFactory != null)? - jaxbContextFactory.createJAXBContext( - bi.getSEIModel(), - toList(classes), - toList(typeInfoMappings.values())) : - ContextFactory.createContext( - classes, typeInfoMappings.values(), - subclassReplacements, defaultNamespaceRemap, - (c14nSupport != null)? c14nSupport : false, - ar, false, false, false); - return new JAXBRIContextWrapper(context, typeInfoMappings); - } catch (Exception e) { - throw new DatabindingException(e); - } - } - - - private List toList(T[] a) { - List l = new ArrayList(); - for(T t : a) l.add(t); - return l; - } - - private List toList(Collection col) { - if (col instanceof List) return (List) col; - List l = new ArrayList(); - l.addAll(col); - return l; - } - - private Map typeInfoMappings(Collection typeInfos) { - Map map = new java.util.HashMap(); - for (TypeInfo ti : typeInfos) { - Type type = WrapperComposite.class.equals(ti.type)? CompositeStructure.class : ti.type; - TypeReference tr = new TypeReference(ti.tagName, type, ti.annotations); - map.put(ti, tr); - } - return map; - } - - protected BindingContext getContext(Marshaller m) { - return newContext(((MarshallerImpl)m).getContext()); - } - - protected boolean isFor(String str) { - return (str.equals("glassfish.jaxb") || - str.equals(this.getClass().getName())|| - str.equals("com.sun.xml.internal.bind.v2.runtime")); - } + JAXBRIContext context = (jaxbContextFactory != null) + ? jaxbContextFactory.createJAXBContext( + bi.getSEIModel(), + toList(classes), + toList(typeInfoMappings.values())) + : ContextFactory.createContext( + classes, typeInfoMappings.values(), + subclassReplacements, defaultNamespaceRemap, + (c14nSupport != null) ? c14nSupport : false, + ar, false, false, false); + return new JAXBRIContextWrapper(context, typeInfoMappings); + } catch (Exception e) { + throw new DatabindingException(e); + } + } + + private List toList(T[] a) { + List l = new ArrayList(); + l.addAll(Arrays.asList(a)); + return l; + } + + private List toList(Collection col) { + if (col instanceof List) { + return (List) col; + } + List l = new ArrayList(); + l.addAll(col); + return l; + } + + private Map typeInfoMappings(Collection typeInfos) { + Map map = new java.util.HashMap(); + for (TypeInfo ti : typeInfos) { + Type type = WrapperComposite.class.equals(ti.type) ? CompositeStructure.class : ti.type; + TypeReference tr = new TypeReference(ti.tagName, type, ti.annotations); + map.put(ti, tr); + } + return map; + } + + @Override + protected BindingContext getContext(Marshaller m) { + return newContext(((MarshallerImpl) m).getContext()); + } + + @Override + protected boolean isFor(String str) { + return (str.equals("glassfish.jaxb") + || str.equals(this.getClass().getName()) + || str.equals("com.sun.xml.internal.bind.v2.runtime")); + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/JAXBRIContextWrapper.java 2013-04-04 15:29:41.072615163 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/JAXBRIContextWrapper.java 2013-04-04 15:29:41.024615162 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,129 +29,152 @@ import java.util.List; import java.util.Map; -import javax.xml.bind.Binder; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; -import javax.xml.bind.JAXBIntrospector; import javax.xml.bind.Marshaller; import javax.xml.bind.SchemaOutputResolver; import javax.xml.bind.Unmarshaller; import javax.xml.namespace.QName; -import javax.xml.transform.Result; - -import org.w3c.dom.Node; - -import com.sun.xml.internal.bind.api.BridgeContext; -import com.sun.xml.internal.bind.api.CompositeStructure; import com.sun.xml.internal.bind.api.JAXBRIContext; import com.sun.xml.internal.bind.api.TypeReference; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet; -import com.sun.xml.internal.bind.api.Bridge; import com.sun.xml.internal.ws.spi.db.BindingContext; import com.sun.xml.internal.ws.spi.db.XMLBridge; -import com.sun.xml.internal.ws.spi.db.PropertyAccessor; import com.sun.xml.internal.ws.spi.db.TypeInfo; import com.sun.xml.internal.ws.spi.db.WrapperComposite; class JAXBRIContextWrapper implements BindingContext { - private Map typeRefs; - private Map typeInfos; - private JAXBRIContext context; - - JAXBRIContextWrapper(JAXBRIContext cxt, Map refs) { - context = cxt; - typeRefs = refs; - if (refs != null) { - typeInfos = new java.util.HashMap(); - for (TypeInfo ti : refs.keySet()) typeInfos.put(typeRefs.get(ti), ti); - } - } - - TypeReference typeReference(TypeInfo ti) { - return (typeRefs != null)? typeRefs.get(ti) : null; - } - - TypeInfo typeInfo(TypeReference tr) { - return (typeInfos != null)? typeInfos.get(tr) : null; - } - - public Marshaller createMarshaller() throws JAXBException { - return context.createMarshaller(); - } - - public Unmarshaller createUnmarshaller() throws JAXBException { - return context.createUnmarshaller(); - } - - public void generateSchema(SchemaOutputResolver outputResolver) - throws IOException { - context.generateSchema(outputResolver); - } - - public String getBuildId() { - return context.getBuildId(); - } - - public QName getElementName(Class o) throws JAXBException { - return context.getElementName(o); - } - - public QName getElementName(Object o) throws JAXBException { - return context.getElementName(o); - } - - public com.sun.xml.internal.ws.spi.db.PropertyAccessor getElementPropertyAccessor( - Class wrapperBean, String nsUri, String localName) - throws JAXBException { - return new RawAccessorWrapper(context.getElementPropertyAccessor(wrapperBean, nsUri, localName)); - } - - public List getKnownNamespaceURIs() { - return context.getKnownNamespaceURIs(); - } - - public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { - return context.getRuntimeTypeInfoSet(); - } - - public QName getTypeName(com.sun.xml.internal.bind.api.TypeReference tr) { - return context.getTypeName(tr); - } - - public int hashCode() { - return context.hashCode(); - } - - public boolean hasSwaRef() { - return context.hasSwaRef(); - } - - public String toString() { - return JAXBRIContextWrapper.class.getName() + " : " + context.toString(); - } - - public XMLBridge createBridge(TypeInfo ti) { - TypeReference tr = typeRefs.get(ti); - com.sun.xml.internal.bind.api.Bridge b = context.createBridge(tr); - return WrapperComposite.class.equals(ti.type) ? - new WrapperBridge(this, b) : - new BridgeWrapper(this, b); - } - - public JAXBContext getJAXBContext() { - return context; - } - - public QName getTypeName(TypeInfo ti) { - TypeReference tr = typeRefs.get(ti); - return context.getTypeName(tr); - } - - public XMLBridge createFragmentBridge() { - return new MarshallerBridge((com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl)context); - } + private Map typeRefs; + private Map typeInfos; + private JAXBRIContext context; + + JAXBRIContextWrapper(JAXBRIContext cxt, Map refs) { + context = cxt; + typeRefs = refs; + if (refs != null) { + typeInfos = new java.util.HashMap(); + for (TypeInfo ti : refs.keySet()) { + typeInfos.put(typeRefs.get(ti), ti); + } + } + } + + TypeReference typeReference(TypeInfo ti) { + return (typeRefs != null) ? typeRefs.get(ti) : null; + } + + TypeInfo typeInfo(TypeReference tr) { + return (typeInfos != null) ? typeInfos.get(tr) : null; + } + + @Override + public Marshaller createMarshaller() throws JAXBException { + return context.createMarshaller(); + } + + @Override + public Unmarshaller createUnmarshaller() throws JAXBException { + return context.createUnmarshaller(); + } + + @Override + public void generateSchema(SchemaOutputResolver outputResolver) + throws IOException { + context.generateSchema(outputResolver); + } + + @Override + public String getBuildId() { + return context.getBuildId(); + } + + @Override + public QName getElementName(Class o) throws JAXBException { + return context.getElementName(o); + } + + @Override + public QName getElementName(Object o) throws JAXBException { + return context.getElementName(o); + } + + @Override + public com.sun.xml.internal.ws.spi.db.PropertyAccessor getElementPropertyAccessor( + Class wrapperBean, String nsUri, String localName) + throws JAXBException { + return new RawAccessorWrapper(context.getElementPropertyAccessor(wrapperBean, nsUri, localName)); + } + + @Override + public List getKnownNamespaceURIs() { + return context.getKnownNamespaceURIs(); + } + + public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { + return context.getRuntimeTypeInfoSet(); + } + + public QName getTypeName(com.sun.xml.internal.bind.api.TypeReference tr) { + return context.getTypeName(tr); + } + + @Override + public int hashCode() { + return context.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final JAXBRIContextWrapper other = (JAXBRIContextWrapper) obj; + if (this.context != other.context && (this.context == null || !this.context.equals(other.context))) { + return false; + } + return true; + } + + @Override + public boolean hasSwaRef() { + return context.hasSwaRef(); + } + + @Override + public String toString() { + return JAXBRIContextWrapper.class.getName() + " : " + context.toString(); + } + + @Override + public XMLBridge createBridge(TypeInfo ti) { + TypeReference tr = typeRefs.get(ti); + com.sun.xml.internal.bind.api.Bridge b = context.createBridge(tr); + return WrapperComposite.class.equals(ti.type) + ? new WrapperBridge(this, b) + : new BridgeWrapper(this, b); + } + + @Override + public JAXBContext getJAXBContext() { + return context; + } + + @Override + public QName getTypeName(TypeInfo ti) { + TypeReference tr = typeRefs.get(ti); + return context.getTypeName(tr); + } + + @Override + public XMLBridge createFragmentBridge() { + return new MarshallerBridge((com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl) context); + } + @Override public Object newWrapperInstace(Class wrapperType) throws InstantiationException, IllegalAccessException { return wrapperType.newInstance(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/MarshallerBridge.java 2013-04-04 15:29:41.376615167 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/MarshallerBridge.java 2013-04-04 15:29:41.320615166 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/RawAccessorWrapper.java 2013-04-04 15:29:41.672615171 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/RawAccessorWrapper.java 2013-04-04 15:29:41.612615171 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,37 +32,43 @@ @SuppressWarnings("unchecked") public class RawAccessorWrapper implements PropertyAccessor { - private RawAccessor accessor; - public RawAccessorWrapper(RawAccessor a) { - accessor = a; - } - - public boolean equals(Object obj) { - return accessor.equals(obj); - } - - public Object get(Object bean) throws DatabindingException { - try { - return accessor.get(bean); - } catch (AccessorException e) { - throw new DatabindingException(e); - } - } + private RawAccessor accessor; - public int hashCode() { - return accessor.hashCode(); - } - - public void set(Object bean, Object value) throws DatabindingException { - try { - accessor.set(bean, value); - } catch (AccessorException e) { - throw new DatabindingException(e); - } - } - - public String toString() { - return accessor.toString(); - } + public RawAccessorWrapper(RawAccessor a) { + accessor = a; + } + + @Override + public boolean equals(Object obj) { + return accessor.equals(obj); + } + + @Override + public Object get(Object bean) throws DatabindingException { + try { + return accessor.get(bean); + } catch (AccessorException e) { + throw new DatabindingException(e); + } + } + + @Override + public int hashCode() { + return accessor.hashCode(); + } + + @Override + public void set(Object bean, Object value) throws DatabindingException { + try { + accessor.set(bean, value); + } catch (AccessorException e) { + throw new DatabindingException(e); + } + } + + @Override + public String toString() { + return accessor.toString(); + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/WrapperBridge.java 2013-04-04 15:29:41.968615177 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/db/glassfish/WrapperBridge.java 2013-04-04 15:29:41.912615175 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -49,92 +49,108 @@ public class WrapperBridge implements XMLBridge { - private JAXBRIContextWrapper parent; - private com.sun.xml.internal.bind.api.Bridge bridge; + private JAXBRIContextWrapper parent; + private com.sun.xml.internal.bind.api.Bridge bridge; - public WrapperBridge(JAXBRIContextWrapper p, com.sun.xml.internal.bind.api.Bridge b) { - parent = p; - bridge = b; - } + public WrapperBridge(JAXBRIContextWrapper p, com.sun.xml.internal.bind.api.Bridge b) { + parent = p; + bridge = b; + } - public BindingContext context() { - return parent; - } + @Override + public BindingContext context() { + return parent; + } - public boolean equals(Object obj) { - return bridge.equals(obj); - } + @Override + public boolean equals(Object obj) { + return bridge.equals(obj); + } - public TypeInfo getTypeInfo() { - return parent.typeInfo(bridge.getTypeReference()); - } + @Override + public TypeInfo getTypeInfo() { + return parent.typeInfo(bridge.getTypeReference()); + } - public int hashCode() { - return bridge.hashCode(); - } + @Override + public int hashCode() { + return bridge.hashCode(); + } - static CompositeStructure convert(Object o) { - WrapperComposite w = (WrapperComposite) o; - CompositeStructure cs = new CompositeStructure(); - cs.values = w.values; - cs.bridges = new Bridge[w.bridges.length]; - for (int i = 0; i < cs.bridges.length; i++) - cs.bridges[i] = ((BridgeWrapper)w.bridges[i]).getBridge(); - return cs; + static CompositeStructure convert(Object o) { + WrapperComposite w = (WrapperComposite) o; + CompositeStructure cs = new CompositeStructure(); + cs.values = w.values; + cs.bridges = new Bridge[w.bridges.length]; + for (int i = 0; i < cs.bridges.length; i++) { + cs.bridges[i] = ((BridgeWrapper) w.bridges[i]).getBridge(); } + return cs; + } - public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { - bridge.marshal((T) convert(object), contentHandler, am); + @Override + public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { + bridge.marshal((T) convert(object), contentHandler, am); // bridge.marshal(object, contentHandler, am); - } + } - public void marshal(T object, Node output) throws JAXBException { - throw new UnsupportedOperationException(); + @Override + public void marshal(T object, Node output) throws JAXBException { + throw new UnsupportedOperationException(); // bridge.marshal(object, output); // bridge.marshal((T) convert(object), output); - } + } - public void marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { - bridge.marshal((T) convert(object), output, nsContext, am); - } + @Override + public void marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { + bridge.marshal((T) convert(object), output, nsContext, am); + } - public final void marshal(T object, Result result) throws JAXBException { - throw new UnsupportedOperationException(); + @Override + public final void marshal(T object, Result result) throws JAXBException { + throw new UnsupportedOperationException(); // bridge.marshal(object, result); - } + } - public final void marshal(T object, XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException { - bridge.marshal((T) convert(object), output, am); - } + @Override + public final void marshal(T object, XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException { + bridge.marshal((T) convert(object), output, am); + } - public String toString() { - return BridgeWrapper.class.getName() + " : " + bridge.toString(); - } + @Override + public String toString() { + return BridgeWrapper.class.getName() + " : " + bridge.toString(); + } - public final T unmarshal(InputStream in) throws JAXBException { - //EndpointArgumentsBuilder.RpcLit.readRequest - throw new UnsupportedOperationException(); + @Override + public final T unmarshal(InputStream in) throws JAXBException { + //EndpointArgumentsBuilder.RpcLit.readRequest + throw new UnsupportedOperationException(); // return bridge.unmarshal(in); - } + } - public final T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException { - //EndpointArgumentsBuilder.RpcLit.readRequest - throw new UnsupportedOperationException(); + @Override + public final T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException { + //EndpointArgumentsBuilder.RpcLit.readRequest + throw new UnsupportedOperationException(); // return bridge.unmarshal(n, au); - } + } - public final T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException { - //EndpointArgumentsBuilder.RpcLit.readRequest - throw new UnsupportedOperationException(); + @Override + public final T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException { + //EndpointArgumentsBuilder.RpcLit.readRequest + throw new UnsupportedOperationException(); // return bridge.unmarshal(in, au); - } + } - public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException { - //EndpointArgumentsBuilder.RpcLit.readRequest - throw new UnsupportedOperationException(); + @Override + public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException { + //EndpointArgumentsBuilder.RpcLit.readRequest + throw new UnsupportedOperationException(); // return bridge.unmarshal(in, au); - } + } + @Override public boolean supportOutputStream() { return true; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/BindingTypeFeature.java 2013-04-04 15:29:42.276615181 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/BindingTypeFeature.java 2013-04-04 15:29:42.216615180 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/EPRRecipe.java 2013-04-04 15:29:42.592615186 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/EPRRecipe.java 2013-04-04 15:29:42.532615185 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/HttpConfigFeature.java 2013-04-04 15:29:42.872615190 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/HttpConfigFeature.java 2013-04-04 15:29:42.808615189 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +42,7 @@ */ public final class HttpConfigFeature extends WebServiceFeature { /** - * Constant value identifying the {@link @HttpConfigFeature} feature. + * Constant value identifying the {@link HttpConfigFeature} feature. */ public static final String ID = "http://jax-ws.java.net/features/http-config"; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/JAXBContextFactory.java 2013-04-04 15:29:43.192615196 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/JAXBContextFactory.java 2013-04-04 15:29:43.132615194 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java 2013-04-04 15:29:43.476615200 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java 2013-04-04 15:29:43.412615199 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -61,7 +61,7 @@ /** * Set this property on the {@link BindingProvider#getRequestContext()} to - * enable {@link HttpURLConnection#httpConnection.setReadTimeout(int)} + * enable {@link HttpURLConnection#setReadTimeout(int)} * *

    * int timeout = ...; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java 2013-04-04 15:29:43.776615204 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java 2013-04-04 15:29:43.720615204 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java 2013-04-04 15:29:44.084615209 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java 2013-04-04 15:29:44.024615209 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java 2013-04-04 15:29:44.404615214 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java 2013-04-04 15:29:44.344615214 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -81,8 +81,9 @@ */ public MemberSubmissionEndpointReference(@NotNull Source source) { - if (source == null) + if (source == null) { throw new WebServiceException("Source parameter can not be null on constructor"); + } try { Unmarshaller unmarshaller = MemberSubmissionEndpointReference.msjc.createUnmarshaller(); @@ -102,6 +103,7 @@ } } + @Override public void writeTo(Result result) { try { Marshaller marshaller = MemberSubmissionEndpointReference.msjc.createMarshaller(); @@ -160,6 +162,7 @@ @XmlAnyElement public List elements; + @XmlType(name="address", namespace=MemberSubmissionEndpointReference.MSNS) public static class Address { public Address() { } @@ -170,6 +173,7 @@ public Map attributes; } + @XmlType(name="elements", namespace=MemberSubmissionEndpointReference.MSNS) public static class Elements { public Elements() {} --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/SchemaValidation.java 2013-04-04 15:29:44.712615219 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/SchemaValidation.java 2013-04-04 15:29:44.656615218 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,8 +28,6 @@ import com.sun.xml.internal.ws.server.DraconianValidationErrorHandler; import javax.jws.WebService; -import javax.xml.transform.Source; -import javax.xml.validation.Schema; import javax.xml.ws.spi.WebServiceFeatureAnnotation; import java.lang.annotation.Documented; import static java.lang.annotation.ElementType.TYPE; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/SchemaValidationFeature.java 2013-04-04 15:29:44.968615223 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/SchemaValidationFeature.java 2013-04-04 15:29:44.908615222 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -82,6 +82,7 @@ } @ManagedAttribute + @Override public String getID() { return ID; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/Serialization.java 2013-04-04 15:29:45.280615228 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/Serialization.java 2013-04-04 15:29:45.220615227 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/SerializationFeature.java 2013-04-04 15:29:45.588615232 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/SerializationFeature.java 2013-04-04 15:29:45.528615231 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/ServerSideException.java 2013-04-04 15:29:45.916615238 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/ServerSideException.java 2013-04-04 15:29:45.856615237 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/StreamingAttachment.java 2013-04-04 15:29:46.248615243 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/StreamingAttachment.java 2013-04-04 15:29:46.188615242 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/StreamingAttachmentFeature.java 2013-04-04 15:29:46.560615248 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/StreamingAttachmentFeature.java 2013-04-04 15:29:46.500615247 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +55,7 @@ @ManagedData public final class StreamingAttachmentFeature extends WebServiceFeature { /** - * Constant value identifying the {@link @StreamingAttachment} feature. + * Constant value identifying the {@link StreamingAttachment} feature. */ public static final String ID = "http://jax-ws.dev.java.net/features/mime"; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/StreamingDataHandler.java 2013-04-04 15:29:46.852615253 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/StreamingDataHandler.java 2013-04-04 15:29:46.796615251 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,14 +25,9 @@ package com.sun.xml.internal.ws.developer; -import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart; +import java.net.URL; import javax.activation.DataSource; -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.File; -import java.net.URL; /** * Implementation of {@link com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler} to access MIME @@ -55,6 +50,8 @@ */ public abstract class StreamingDataHandler extends com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler { + private String hrefCid; + public StreamingDataHandler(Object o, String s) { super(o, s); } @@ -67,4 +64,12 @@ super(dataSource); } + public String getHrefCid() { + return hrefCid; + } + + public void setHrefCid(final String cid) { + this.hrefCid = cid; + } + } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/UsesJAXBContext.java 2013-04-04 15:29:47.148615257 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/UsesJAXBContext.java 2013-04-04 15:29:47.096615256 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/UsesJAXBContextFeature.java 2013-04-04 15:29:47.452615262 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/UsesJAXBContextFeature.java 2013-04-04 15:29:47.392615261 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/ValidationErrorHandler.java 2013-04-04 15:29:47.752615267 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/ValidationErrorHandler.java 2013-04-04 15:29:47.696615265 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,7 +35,7 @@ * An {@link ErrorHandler} to receive errors encountered during the * {@link Validator#validate} method invocation. Specify * a custom handler in {@link SchemaValidation}, {@link SchemaValidationFeature} - * to customize the error handling process during validaiton. + * to customize the error handling process during validation. * * @see SchemaValidation * @author Jitendra Kotamraju --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java 2013-04-04 15:29:48.044615271 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java 2013-04-04 15:29:47.992615270 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -98,7 +98,7 @@ * @param headers * Can be null or empty. * @throws UnsupportedOperationException - * If this {@lini WSBindingProvider} is a {@link Dispatch} + * If this {@link WSBindingProvider} is a {@link Dispatch} * that does not use JAXB. */ void setOutboundHeaders(Object... headers); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/package-info.java 2013-04-04 15:29:48.268615275 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/developer/package-info.java 2013-04-04 15:29:48.220615274 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ContentType.java 2013-04-04 15:29:48.492615278 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ContentType.java 2013-04-04 15:29:48.440615277 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java 2013-04-04 15:29:48.700615281 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java 2013-04-04 15:29:48.648615281 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +34,12 @@ public final class ContentTypeImpl implements com.sun.xml.internal.ws.api.pipe.ContentType { private final @NotNull String contentType; private final @NotNull String soapAction; - private final @Nullable String accept; + private String accept; private final @Nullable String charset; + private String boundary; + private String boundaryParameter; + private String rootId; + private ContentType internalContentType; public ContentTypeImpl(String contentType) { this(contentType, null, null); @@ -56,7 +60,8 @@ if (charsetParam == null) { String tmpCharset = null; try { - tmpCharset = new ContentType(contentType).getParameter("charset"); + internalContentType = new ContentType(contentType); + tmpCharset = internalContentType.getParameter("charset"); } catch(Exception e) { //Ignore the parsing exception. } @@ -87,18 +92,57 @@ } } + @Override public String getContentType() { return contentType; } + @Override public String getSOAPActionHeader() { return soapAction; } + @Override public String getAcceptHeader() { return accept; } + public void setAcceptHeader(String accept) { + this.accept = accept; + } + + public String getBoundary() { + if (boundary == null) { + if (internalContentType == null) internalContentType = new ContentType(contentType); + boundary = internalContentType.getParameter("boundary"); + } + return boundary; + } + + public void setBoundary(String boundary) { + this.boundary = boundary; + } + + public String getBoundaryParameter() { + return boundaryParameter; + } + + public void setBoundaryParameter(String boundaryParameter) { + this.boundaryParameter = boundaryParameter; + } + + public String getRootId() { + if (rootId == null) { + if (internalContentType == null) internalContentType = new ContentType(contentType); + rootId = internalContentType.getParameter("start"); + } + return rootId; + } + + public void setRootId(String rootId) { + this.rootId = rootId; + } + public static class Builder { public String contentType; public String soapAction; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/DataHandlerDataSource.java 2013-04-04 15:29:48.904615285 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/DataHandlerDataSource.java 2013-04-04 15:29:48.852615283 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/DataSourceStreamingDataHandler.java 2013-04-04 15:29:49.100615288 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/DataSourceStreamingDataHandler.java 2013-04-04 15:29:49.052615287 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,6 @@ package com.sun.xml.internal.ws.encoding; -import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart; - import javax.activation.DataSource; import java.io.*; @@ -41,22 +39,30 @@ super(ds); } + @Override public InputStream readOnce() throws IOException { return getInputStream(); } + @Override public void moveTo(File file) throws IOException { InputStream in = getInputStream(); OutputStream os = new FileOutputStream(file); - byte[] temp = new byte[8192]; - int len; - while((len=in.read(temp)) != -1) { - os.write(temp, 0, len); + try { + byte[] temp = new byte[8192]; + int len; + while((len=in.read(temp)) != -1) { + os.write(temp, 0, len); + } + in.close(); + } finally { + if (os != null) { + os.close(); + } } - in.close(); - os.close(); } + @Override public void close() throws IOException { // nothing to do here } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/HasEncoding.java 2013-04-04 15:29:49.312615291 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/HasEncoding.java 2013-04-04 15:29:49.256615290 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/HeaderTokenizer.java 2013-04-04 15:29:49.604615295 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/HeaderTokenizer.java 2013-04-04 15:29:49.552615295 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ImageDataContentHandler.java 2013-04-04 15:29:49.880615299 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ImageDataContentHandler.java 2013-04-04 15:29:49.820615299 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MIMEPartStreamingDataHandler.java 2013-04-04 15:29:50.128615304 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MIMEPartStreamingDataHandler.java 2013-04-04 15:29:50.072615302 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -62,14 +62,17 @@ ds = (StreamingDataSource)getDataSource(); } + @Override public InputStream readOnce() throws IOException { return ds.readOnce(); } + @Override public void moveTo(File file) throws IOException { ds.moveTo(file); } + @Override public void close() throws IOException { ds.close(); } @@ -81,6 +84,7 @@ this.part = part; } + @Override public InputStream getInputStream() throws IOException { return part.read(); //readOnce() ?? } @@ -97,14 +101,17 @@ part.moveTo(file); } + @Override public OutputStream getOutputStream() throws IOException { return null; } + @Override public String getContentType() { return part.getContentType(); } + @Override public String getName() { return ""; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MimeCodec.java 2013-04-04 15:29:50.448615309 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MimeCodec.java 2013-04-04 15:29:50.384615308 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -92,12 +92,8 @@ public static final String MULTIPART_RELATED_MIME_TYPE = "multipart/related"; - private String boundary; - private String messageContentType; - private boolean hasAttachments; - protected Codec rootCodec; + protected Codec mimeRootCodec; protected final SOAPVersion version; -// protected final WSBinding binding; protected final WSFeatureList features; protected MimeCodec(SOAPVersion version, WSFeatureList f) { @@ -109,6 +105,10 @@ return MULTIPART_RELATED_MIME_TYPE; } + protected Codec getMimeRootCodec(Packet packet) { + return mimeRootCodec; + } + // TODO: preencode String literals to byte[] so that they don't have to // go through char[]->byte[] conversion at runtime. public ContentType encode(Packet packet, OutputStream out) throws IOException { @@ -116,7 +116,10 @@ if (msg == null) { return null; } - + ContentTypeImpl ctImpl = (ContentTypeImpl)getStaticContentType(packet); + String boundary = ctImpl.getBoundary(); + boolean hasAttachments = (boundary != null); + Codec rootCodec = getMimeRootCodec(packet); if (hasAttachments) { writeln("--"+boundary, out); ContentType ct = rootCodec.getStaticContentType(packet); @@ -148,7 +151,7 @@ writeAsAscii("--", out); } // TODO not returing correct multipart/related type(no boundary) - return hasAttachments ? new ContentTypeImpl(messageContentType, packet.soapAction, null) : primaryCt; + return hasAttachments ? ctImpl : primaryCt; } private void writeCustomMimeHeaders(Attachment att, OutputStream out) throws IOException { @@ -166,19 +169,28 @@ } public ContentType getStaticContentType(Packet packet) { + ContentType ct = (ContentType) packet.getInternalContentType(); + if ( ct != null ) return ct; Message msg = packet.getMessage(); - hasAttachments = !msg.getAttachments().isEmpty(); + boolean hasAttachments = !msg.getAttachments().isEmpty(); + Codec rootCodec = getMimeRootCodec(packet); if (hasAttachments) { - boundary = "uuid:" + UUID.randomUUID().toString(); + String boundary = "uuid:" + UUID.randomUUID().toString(); String boundaryParameter = "boundary=\"" + boundary + "\""; // TODO use primaryEncoder to get type - messageContentType = MULTIPART_RELATED_MIME_TYPE + + String messageContentType = MULTIPART_RELATED_MIME_TYPE + "; type=\"" + rootCodec.getMimeType() + "\"; " + boundaryParameter; - return new ContentTypeImpl(messageContentType, packet.soapAction, null); + ContentTypeImpl impl = new ContentTypeImpl(messageContentType, packet.soapAction, null); + impl.setBoundary(boundary); + impl.setBoundaryParameter(boundaryParameter); + packet.setContentType(impl); + return impl; } else { - return rootCodec.getStaticContentType(packet); + ct = rootCodec.getStaticContentType(packet); + packet.setContentType(ct); + return ct; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java 2013-04-04 15:29:50.752615313 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java 2013-04-04 15:29:50.692615312 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,6 @@ package com.sun.xml.internal.ws.encoding; - import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.message.Attachment; @@ -53,6 +52,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Parses Mime multipart message into primary part and attachment parts. It @@ -66,15 +67,18 @@ private final String start; private final MIMEMessage message; private Attachment root; + private ContentTypeImpl contentType; // Attachments without root part private final Map attachments = new HashMap(); private boolean gotAll; - public MimeMultipartParser(InputStream in, String contentType, StreamingAttachmentFeature feature) { - ContentType ct = new ContentType(contentType); - String boundary = ct.getParameter("boundary"); + public MimeMultipartParser(InputStream in, String cType, StreamingAttachmentFeature feature) { + this.contentType = new ContentTypeImpl(cType); +// ContentType ct = new ContentType(cType); +// String boundary = ct.getParameter("boundary"); + String boundary = contentType.getBoundary(); if (boundary == null || boundary.equals("")) { throw new WebServiceException("MIME boundary parameter not found" + contentType); } @@ -82,7 +86,8 @@ ? new MIMEMessage(in, boundary, feature.getConfig()) : new MIMEMessage(in, boundary); // Strip <...> from root part's Content-ID - String st = ct.getParameter("start"); +// String st = ct.getParameter("start"); + String st = contentType.getRootId(); if (st != null && st.length() > 2 && st.charAt(0) == '<' && st.charAt(st.length()-1) == '>') { st = st.substring(1, st.length()-1); } @@ -116,8 +121,11 @@ List parts = message.getAttachments(); for(MIMEPart part : parts) { if (part != rootPart) { - PartAttachment attach = new PartAttachment(part); - attachments.put(attach.getContentId(), attach); + String cid = part.getContentId(); + if (!attachments.containsKey(cid)) { + PartAttachment attach = new PartAttachment(part); + attachments.put(attach.getContentId(), attach); + } } } gotAll = true; @@ -147,19 +155,21 @@ final MIMEPart part; byte[] buf; + private StreamingDataHandler streamingDataHandler; PartAttachment(MIMEPart part) { this.part = part; } - public @NotNull String getContentId() { + public @NotNull @Override String getContentId() { return part.getContentId(); } - public @NotNull String getContentType() { + public @NotNull @Override String getContentType() { return part.getContentType(); } + @Override public byte[] asByteArray() { if (buf == null) { ByteArrayBuffer baf = new ByteArrayBuffer(); @@ -167,29 +177,44 @@ baf.write(part.readOnce()); } catch(IOException ioe) { throw new WebServiceException(ioe); + } finally { + if (baf != null) { + try { + baf.close(); + } catch (IOException ex) { + Logger.getLogger(MimeMultipartParser.class.getName()).log(Level.FINE, null, ex); + } + } } buf = baf.toByteArray(); } return buf; } + @Override public DataHandler asDataHandler() { - return (buf != null) - ? new DataSourceStreamingDataHandler(new ByteArrayDataSource(buf,getContentType())) - : new MIMEPartStreamingDataHandler(part); + if (streamingDataHandler == null) { + streamingDataHandler = (buf != null) + ? new DataSourceStreamingDataHandler(new ByteArrayDataSource(buf,getContentType())) + : new MIMEPartStreamingDataHandler(part); + } + return streamingDataHandler; } + @Override public Source asSource() { return (buf != null) ? new StreamSource(new ByteArrayInputStream(buf)) : new StreamSource(part.read()); } + @Override public InputStream asInputStream() { return (buf != null) ? new ByteArrayInputStream(buf) : part.read(); } + @Override public void writeTo(OutputStream os) throws IOException { if (buf != null) { os.write(buf); @@ -204,31 +229,38 @@ } } + @Override public void writeTo(SOAPMessage saaj) throws SOAPException { saaj.createAttachmentPart().setDataHandler(asDataHandler()); } // AttachmentEx methods begin here + @Override public Iterator getMimeHeaders() { final Iterator ih = part.getAllHeaders() .iterator(); return new Iterator() { + @Override public boolean hasNext() { return ih.hasNext(); } + @Override public MimeHeader next() { final Header hdr = ih.next(); return new AttachmentEx.MimeHeader() { + @Override public String getValue() { return hdr.getValue(); } + @Override public String getName() { return hdr.getName(); } }; } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -236,4 +268,8 @@ } } + public ContentTypeImpl getContentType() { + return contentType; + } + } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java 2013-04-04 15:29:51.052615317 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java 2013-04-04 15:29:50.996615317 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -37,6 +37,7 @@ import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory; import com.sun.xml.internal.ws.developer.SerializationFeature; +import com.sun.xml.internal.ws.developer.StreamingDataHandler; import com.sun.xml.internal.ws.message.MimeAttachmentSet; import com.sun.xml.internal.ws.streaming.XMLStreamWriterUtil; import com.sun.xml.internal.ws.util.ByteArrayDataSource; @@ -45,7 +46,6 @@ import com.sun.xml.internal.ws.streaming.MtomStreamWriter; import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; import com.sun.xml.internal.ws.server.UnsupportedMediaException; -import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.getFeature; import com.sun.xml.internal.org.jvnet.staxex.Base64Data; import com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx; import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx; @@ -58,7 +58,6 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; import javax.xml.ws.soap.MTOMFeature; import javax.xml.bind.attachment.AttachmentMarshaller; import java.io.IOException; @@ -74,7 +73,7 @@ import java.util.UUID; /** - * Mtom messge Codec. It can be used even for non-soap message's mtom encoding. + * Mtom message Codec. It can be used even for non-soap message's mtom encoding. * * @author Vivek Pandey * @author Jitendra Kotamraju @@ -86,10 +85,6 @@ private static final String XOP_NAMESPACEURI = "http://www.w3.org/2004/08/xop/include"; private final StreamSOAPCodec codec; - - // encoding related parameters - private String boundary; - private String rootId; private final MTOMFeature mtomFeature; private final SerializationFeature sf; private final static String DECODED_MESSAGE_CHARSET = "decodedMessageCharset"; @@ -97,7 +92,6 @@ MtomCodec(SOAPVersion version, StreamSOAPCodec codec, WSFeatureList features){ super(version, features); this.codec = codec; - createConteTypeHeader(); sf = features.get(SerializationFeature.class); MTOMFeature mtom = features.get(MTOMFeature.class); if(mtom == null) @@ -106,74 +100,68 @@ this.mtomFeature = mtom; } - private void createConteTypeHeader(){ - String uuid = UUID.randomUUID().toString(); - boundary = "uuid:" + uuid; - rootId = ""; + /** + * Return the soap 1.1 and soap 1.2 specific XOP packaged ContentType + * + * @return A non-null content type for soap11 or soap 1.2 content type + */ + @Override + public ContentType getStaticContentType(Packet packet) { + return getStaticContentTypeStatic(packet, version); } - private String createMessageContentType() { - return createMessageContentType(null); - } + public static ContentType getStaticContentTypeStatic(Packet packet, SOAPVersion version) { + ContentType ct = (ContentType) packet.getInternalContentType(); + if ( ct != null ) return ct; + + String uuid = UUID.randomUUID().toString(); + String boundary = "uuid:" + uuid; + String rootId = ""; + String soapActionParameter = SOAPVersion.SOAP_11.equals(version) ? null : createActionParameter(packet); - private String createMessageContentType(String soapActionParameter) { String boundaryParameter = "boundary=\"" + boundary +"\""; - return MULTIPART_RELATED_MIME_TYPE + + String messageContentType = MULTIPART_RELATED_MIME_TYPE + ";start=\""+rootId +"\"" + ";type=\"" + XOP_XML_MIME_TYPE + "\";" + boundaryParameter + ";start-info=\"" + version.contentType + (soapActionParameter == null? "" : soapActionParameter) + "\""; - } - - - /** - * Return the soap 1.1 and soap 1.2 specific XOP packaged ContentType - * - * @return A non-null content type for soap11 or soap 1.2 content type - */ - public ContentType getStaticContentType(Packet packet) { - return getContentType(packet); - } - private ContentType getContentType(Packet packet){ - switch(version){ - case SOAP_11: - return new ContentTypeImpl(createMessageContentType(), (packet.soapAction == null)?"":packet.soapAction, null); - case SOAP_12: - return new ContentTypeImpl(createMessageContentType(createActionParameter(packet)), null, null); - } - //never happens - return null; + ContentTypeImpl ctImpl = SOAPVersion.SOAP_11.equals(version) ? + new ContentTypeImpl(messageContentType, (packet.soapAction == null)?"":packet.soapAction, null) : + new ContentTypeImpl(messageContentType, null, null); + ctImpl.setBoundary(boundary); + ctImpl.setRootId(rootId); + packet.setContentType(ctImpl); + return ctImpl; } - private String createActionParameter(Packet packet) { + private static String createActionParameter(Packet packet) { return packet.soapAction != null? ";action=\\\""+packet.soapAction+"\\\"" : ""; } + @Override public ContentType encode(Packet packet, OutputStream out) throws IOException { - //get the current boundary thaat will be reaturned from this method - ContentType contentType = getContentType(packet); + ContentTypeImpl ctImpl = (ContentTypeImpl) this.getStaticContentType(packet); + String boundary = ctImpl.getBoundary(); + String rootId = ctImpl.getRootId(); if(packet.getMessage() != null){ try { String encoding = getPacketEncoding(packet); packet.invocationProperties.remove(DECODED_MESSAGE_CHARSET); - String actionParameter = version == SOAPVersion.SOAP_11? "" : createActionParameter(packet); - String soapXopContentType = XOP_XML_MIME_TYPE +";charset="+encoding+";type=\""+version.contentType+ actionParameter + "\""; + String actionParameter = getActionParameter(packet, version); + String soapXopContentType = getSOAPXopContentType(encoding, version, actionParameter); writeln("--"+boundary, out); - writeln("Content-Id: " + rootId, out); - writeln("Content-Type: "+ soapXopContentType, out); - writeln("Content-Transfer-Encoding: binary", out); - writeln(out); + writeMimeHeaders(soapXopContentType, rootId, out); //mtom attachments that need to be written after the root part List mtomAttachments = new ArrayList(); MtomStreamWriterImpl writer = new MtomStreamWriterImpl( - XMLStreamWriterFactory.create(out, encoding), mtomAttachments); + XMLStreamWriterFactory.create(out, encoding), mtomAttachments, boundary, mtomFeature); packet.getMessage().writeTo(writer); XMLStreamWriterFactory.recycle(writer); @@ -184,7 +172,7 @@ } //now write out the attachments in the message - writeAttachments(packet.getMessage().getAttachments(),out); + writeAttachments(packet.getMessage().getAttachments(),out, boundary); //write out the end boundary writeAsAscii("--"+boundary, out); @@ -195,21 +183,32 @@ } } //now create the boundary for next encode() call - createConteTypeHeader(); - return contentType; +// createConteTypeHeader(); + return ctImpl; + } + + public static String getSOAPXopContentType(String encoding, SOAPVersion version, + String actionParameter) { + return XOP_XML_MIME_TYPE +";charset="+encoding+";type=\""+version.contentType+ actionParameter + "\""; + } + + public static String getActionParameter(Packet packet, SOAPVersion version) { + return (version == SOAPVersion.SOAP_11) ? "" : createActionParameter(packet); } - private class ByteArrayBuffer{ + public static class ByteArrayBuffer{ final String contentId; - private DataHandler dh; + private final DataHandler dh; + private final String boundary; - ByteArrayBuffer(@NotNull DataHandler dh) { + ByteArrayBuffer(@NotNull DataHandler dh, String b) { this.dh = dh; this.contentId = encodeCid(); + boundary = b; } - void write(OutputStream os) throws IOException { + public void write(OutputStream os) throws IOException { //build attachment frame writeln("--"+boundary, os); writeMimeHeaders(dh.getContentType(), contentId, os); @@ -218,7 +217,7 @@ } } - private void writeMimeHeaders(String contentType, String contentId, OutputStream out) throws IOException { + public static void writeMimeHeaders(String contentType, String contentId, OutputStream out) throws IOException { String cid = contentId; if(cid != null && cid.length() >0 && cid.charAt(0) != '<') cid = '<' + cid + '>'; @@ -228,7 +227,7 @@ writeln(out); } - private void writeAttachments(AttachmentSet attachments, OutputStream out) throws IOException { + private void writeAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for(Attachment att : attachments){ //build attachment frame writeln("--"+boundary, out); @@ -238,15 +237,17 @@ } } + @Override public ContentType encode(Packet packet, WritableByteChannel buffer) { throw new UnsupportedOperationException(); } + @Override public MtomCodec copy() { return new MtomCodec(version, (StreamSOAPCodec)codec.copy(), features); } - private String encodeCid(){ + private static String encodeCid(){ String cid="example.jaxws.sun.com"; String name = UUID.randomUUID()+"@"; return name + cid; @@ -278,7 +279,8 @@ ); packet.setMessage(codec.decode(mtomReader, new MimeAttachmentSet(mpp))); - + packet.setMtomFeature(mtomFeature); + packet.setContentType(mpp.getContentType()); } private String getPacketEncoding(Packet packet) { @@ -286,7 +288,10 @@ if (sf != null && sf.getEncoding() != null) { return sf.getEncoding().equals("") ? SOAPBindingCodec.DEFAULT_ENCODING : sf.getEncoding(); } + return determinePacketEncoding(packet); + } + public static String determinePacketEncoding(Packet packet) { if (packet != null && packet.endpoint != null) { // Use request message's encoding for Server-side response messages String charset = (String)packet.invocationProperties.get(DECODED_MESSAGE_CHARSET); @@ -298,34 +303,41 @@ return SOAPBindingCodec.DEFAULT_ENCODING; } - private class MtomStreamWriterImpl extends XMLStreamWriterFilter implements XMLStreamWriterEx, + public static class MtomStreamWriterImpl extends XMLStreamWriterFilter implements XMLStreamWriterEx, MtomStreamWriter, HasEncoding { private final List mtomAttachments; - - public MtomStreamWriterImpl(XMLStreamWriter w, List mtomAttachments) { + private final String boundary; + private final MTOMFeature myMtomFeature; + public MtomStreamWriterImpl(XMLStreamWriter w, List mtomAttachments, String b, MTOMFeature myMtomFeature) { super(w); this.mtomAttachments = mtomAttachments; + this.boundary = b; + this.myMtomFeature = myMtomFeature; } + @Override public void writeBinary(byte[] data, int start, int len, String contentType) throws XMLStreamException { //check threshold and if less write as base64encoded value - if(mtomFeature.getThreshold() > len){ + if(myMtomFeature.getThreshold() > len){ writeCharacters(DatatypeConverterImpl._printBase64Binary(data, start, len)); return; } - ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, start, len, contentType))); + ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, start, len, contentType)), boundary); writeBinary(bab); } + @Override public void writeBinary(DataHandler dataHandler) throws XMLStreamException { // TODO how do we check threshold and if less inline the data - writeBinary(new ByteArrayBuffer(dataHandler)); + writeBinary(new ByteArrayBuffer(dataHandler, boundary)); } + @Override public OutputStream writeBinary(String contentType) throws XMLStreamException { throw new UnsupportedOperationException(); } + @Override public void writePCDATA(CharSequence data) throws XMLStreamException { if(data == null) return; @@ -368,29 +380,33 @@ * While writing, it calls the AttachmentMarshaller methods for adding attachments. * JAXB writes xop:Include in this case. */ + @Override public AttachmentMarshaller getAttachmentMarshaller() { return new AttachmentMarshaller() { + @Override public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) { // Should we do the threshold processing on DataHandler ? But that would be // expensive as DataHolder need to read the data again from its source - ByteArrayBuffer bab = new ByteArrayBuffer(data); + ByteArrayBuffer bab = new ByteArrayBuffer(data, boundary); mtomAttachments.add(bab); return "cid:"+bab.contentId; } + @Override public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) { // inline the data based on the threshold - if (mtomFeature.getThreshold() > length) { + if (myMtomFeature.getThreshold() > length) { return null; // JAXB inlines the attachment data } - ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, offset, length, mimeType))); + ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, offset, length, mimeType)), boundary); mtomAttachments.add(bab); return "cid:"+bab.contentId; } + @Override public String addSwaRefAttachment(DataHandler data) { - ByteArrayBuffer bab = new ByteArrayBuffer(data); + ByteArrayBuffer bab = new ByteArrayBuffer(data, boundary); mtomAttachments.add(bab); return "cid:"+bab.contentId; } @@ -402,29 +418,38 @@ }; } + public List getMtomAttachments() { + return this.mtomAttachments; + } + + @Override public String getEncoding() { return XMLStreamWriterUtil.getEncoding(writer); } - private class MtomNamespaceContextEx implements NamespaceContextEx { - private NamespaceContext nsContext; + private static class MtomNamespaceContextEx implements NamespaceContextEx { + private final NamespaceContext nsContext; public MtomNamespaceContextEx(NamespaceContext nsContext) { this.nsContext = nsContext; } + @Override public Iterator iterator() { throw new UnsupportedOperationException(); } + @Override public String getNamespaceURI(String prefix) { return nsContext.getNamespaceURI(prefix); } + @Override public String getPrefix(String namespaceURI) { return nsContext.getPrefix(namespaceURI); } + @Override public Iterator getPrefixes(String namespaceURI) { return nsContext.getPrefixes(namespaceURI); } @@ -437,7 +462,7 @@ } } - private static class MtomXMLStreamReaderEx extends XMLStreamReaderFilter implements XMLStreamReaderEx { + public static class MtomXMLStreamReaderEx extends XMLStreamReaderFilter implements XMLStreamReaderEx { /** * The parser for the outer MIME 'shell'. */ @@ -449,11 +474,14 @@ //To be used with #getTextCharacters private char[] base64EncodedText; + private String xopHref; + public MtomXMLStreamReaderEx(MimeMultipartParser mimeMP, XMLStreamReader reader) { super(reader); this.mimeMP = mimeMP; } + @Override public CharSequence getPCDATA() throws XMLStreamException { if(xopReferencePresent){ return base64AttData; @@ -461,40 +489,47 @@ return reader.getText(); } + @Override public NamespaceContextEx getNamespaceContext() { NamespaceContext nsContext = reader.getNamespaceContext(); return new MtomNamespaceContextEx(nsContext); } + @Override public String getElementTextTrim() throws XMLStreamException { throw new UnsupportedOperationException(); } private static class MtomNamespaceContextEx implements NamespaceContextEx { - private NamespaceContext nsContext; + private final NamespaceContext nsContext; public MtomNamespaceContextEx(NamespaceContext nsContext) { this.nsContext = nsContext; } + @Override public Iterator iterator() { throw new UnsupportedOperationException(); } + @Override public String getNamespaceURI(String prefix) { return nsContext.getNamespaceURI(prefix); } + @Override public String getPrefix(String namespaceURI) { return nsContext.getPrefix(namespaceURI); } + @Override public Iterator getPrefixes(String namespaceURI) { return nsContext.getPrefixes(namespaceURI); } } + @Override public int getTextLength() { if (xopReferencePresent) { return base64AttData.length(); @@ -502,6 +537,7 @@ return reader.getTextLength(); } + @Override public int getTextStart() { if (xopReferencePresent) { return 0; @@ -509,22 +545,29 @@ return reader.getTextStart(); } + @Override public int getEventType() { if(xopReferencePresent) return XMLStreamConstants.CHARACTERS; return super.getEventType(); } + @Override public int next() throws XMLStreamException { int event = reader.next(); if (event == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI)) { //its xop reference, take the URI reference String href = reader.getAttributeValue(null, "href"); try { + xopHref = href; Attachment att = getAttachment(href); if(att != null){ + DataHandler dh = att.asDataHandler(); + if (dh instanceof StreamingDataHandler) { + ((StreamingDataHandler)dh).setHrefCid(att.getContentId()); + } base64AttData = new Base64Data(); - base64AttData.set(att.asDataHandler()); + base64AttData.set(dh); } xopReferencePresent = true; } catch (IOException e) { @@ -537,6 +580,7 @@ if(xopReferencePresent){ xopReferencePresent = false; base64EncodedText = null; + xopHref = null; } return event; } @@ -560,6 +604,7 @@ return mimeMP.getAttachmentPart(cid); } + @Override public char[] getTextCharacters() { if (xopReferencePresent) { char[] chars = new char[base64AttData.length()]; @@ -569,6 +614,7 @@ return reader.getTextCharacters(); } + @Override public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException { if(xopReferencePresent){ if(target == null){ @@ -596,12 +642,25 @@ return reader.getTextCharacters(sourceStart, target, targetStart, length); } + @Override public String getText() { if (xopReferencePresent) { return base64AttData.toString(); } return reader.getText(); } + + protected boolean isXopReference() throws XMLStreamException { + return xopReferencePresent; + } + + protected String getXopHref() { + return xopHref; + } + + public MimeMultipartParser getMimeMultipartParser() { + return mimeMP; + } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ParameterList.java 2013-04-04 15:29:51.372615323 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/ParameterList.java 2013-04-04 15:29:51.312615322 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/RootOnlyCodec.java 2013-04-04 15:29:51.700615328 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/RootOnlyCodec.java 2013-04-04 15:29:51.636615327 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java 2013-04-04 15:29:52.000615332 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java 2013-04-04 15:29:51.940615332 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -51,7 +51,7 @@ import java.lang.reflect.Method; import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; -import java.util.StringTokenizer; +//import java.util.StringTokenizer; /** * SOAP binding {@link Codec} that can handle MTOM, SwA, and SOAP messages @@ -74,28 +74,6 @@ public static final String UTF8_ENCODING = "utf-8"; public static final String DEFAULT_ENCODING = UTF8_ENCODING; - /** - * Based on request's Accept header this is set. - * Currently only set if MTOMFeature is enabled. - * - * Should be used on server-side, for encoding the response. - */ - private boolean acceptMtomMessages; - - /** - * If the request's Content-Type is multipart/related; type=application/xop+xml, then this set to to true - * - * Used on server-side, for encoding the repsonse. - */ - private boolean isRequestMtomMessage; - - private enum TriState {UNSET,TRUE,FALSE} - - /** - * This captures is decode is called before encode, - * if true, infers that this is being used on Server-side - */ - private TriState decodeFirst = TriState.UNSET; /** * True if Fast Infoset functionality has been @@ -132,9 +110,6 @@ // The Fast Infoset SWA codec private final MimeCodec fiSwaCodec; -// private final SOAPBindingImpl binding; -// private final WebServiceFeature[] feature; - /** * The XML SOAP MIME type */ @@ -159,35 +134,17 @@ return xmlSoapCodec; } - private class AcceptContentType implements ContentType { - private ContentType _c; - private String _accept; - - public AcceptContentType set(Packet p, ContentType c) { - if (!ignoreContentNegotiationProperty && p.contentNegotiation != ContentNegotiation.none) { - _accept = connegXmlAccept; - } else { - _accept = xmlAccept; - } - _c = c; - return this; - } - - public String getContentType() { - return _c.getContentType(); - } - - public String getSOAPActionHeader() { - return _c.getSOAPActionHeader(); - } - - public String getAcceptHeader() { - return _accept; + private ContentTypeImpl setAcceptHeader(Packet p, ContentTypeImpl c) { + String _accept; + if (!ignoreContentNegotiationProperty && p.contentNegotiation != ContentNegotiation.none) { + _accept = connegXmlAccept; + } else { + _accept = xmlAccept; } + c.setAcceptHeader(_accept); + return c; } - private AcceptContentType _adaptingContentType = new AcceptContentType(); - public SOAPBindingCodec(WSFeatureList features) { this(features, Codecs.createSOAPEnvelopeXmlCodec(features)); } @@ -252,10 +209,8 @@ xmlAccept = clientAcceptedContentTypes; -// if(!(binding instanceof SOAPBindingImpl)) if(getSoapVersion(features) == null) throw new WebServiceException("Expecting a SOAP binding but found "); -// this.binding = (SOAPBindingImpl)binding; } public String getMimeType() { @@ -264,19 +219,21 @@ public ContentType getStaticContentType(Packet packet) { ContentType toAdapt = getEncoder(packet).getStaticContentType(packet); - return (toAdapt != null) ? _adaptingContentType.set(packet, toAdapt) : null; + return setAcceptHeader(packet, (ContentTypeImpl)toAdapt); } public ContentType encode(Packet packet, OutputStream out) throws IOException { preEncode(packet); - ContentType ct = _adaptingContentType.set(packet, getEncoder(packet).encode(packet, out)); + ContentType ct = getEncoder(packet).encode(packet, out); + ct = setAcceptHeader(packet, (ContentTypeImpl)ct); postEncode(); return ct; } public ContentType encode(Packet packet, WritableByteChannel buffer) { preEncode(packet); - ContentType ct = _adaptingContentType.set(packet, getEncoder(packet).encode(packet, buffer)); + ContentType ct = getEncoder(packet).encode(packet, buffer); + ct = setAcceptHeader(packet, (ContentTypeImpl)ct); postEncode(); return ct; } @@ -286,8 +243,6 @@ * Set the state so that such state is used by encode process. */ private void preEncode(Packet p) { - if (decodeFirst == TriState.UNSET) - decodeFirst = TriState.FALSE; } /** @@ -295,9 +250,6 @@ * Reset the encoding state. */ private void postEncode() { - decodeFirst = TriState.UNSET; - acceptMtomMessages = false; - isRequestMtomMessage = false; } /** @@ -314,25 +266,24 @@ * Set the state so that such state is used by encode(). */ private void postDecode(Packet p) { - if(decodeFirst == TriState.UNSET) - decodeFirst = TriState.TRUE; - if(features.isEnabled(MTOMFeature.class)) - acceptMtomMessages =isMtomAcceptable(p.acceptableMimeTypes); + p.setFastInfosetDisabled(isFastInfosetDisabled); + if(features.isEnabled(MTOMFeature.class)) p.checkMtomAcceptable(); +// p.setMtomAcceptable( isMtomAcceptable(p.acceptableMimeTypes) ); + MTOMFeature mtomFeature = features.get(MTOMFeature.class); + if (mtomFeature != null) { + p.setMtomFeature(mtomFeature); + } if (!useFastInfosetForEncoding) { - useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes); + useFastInfosetForEncoding = p.getFastInfosetAcceptable(fiMimeType); +// useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes); } } - - private boolean isServerSide() { - return decodeFirst == TriState.TRUE; - } - public void decode(InputStream in, String contentType, Packet packet) throws IOException { if (contentType == null) { contentType = xmlMimeType; } - + packet.setContentType(new ContentTypeImpl(contentType)); preDecode(packet); try { if(isMultipartRelated(contentType)) @@ -391,9 +342,9 @@ protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException { // is this SwA or XOP? final String rootContentType = mpp.getRootPart().getContentType(); - - if(isApplicationXopXml(rootContentType)) { - isRequestMtomMessage = true; + boolean isMTOM = isApplicationXopXml(rootContentType); + packet.setMtomRequest(isMTOM); + if(isMTOM) { xmlMtomCodec.decode(mpp,packet); } else if (isFastInfoset(rootContentType)) { if (packet.contentNegotiation == ContentNegotiation.none) @@ -435,35 +386,34 @@ b.length())); } - private boolean isFastInfosetAcceptable(String accept) { - if (accept == null || isFastInfosetDisabled) return false; - - StringTokenizer st = new StringTokenizer(accept, ","); - while (st.hasMoreTokens()) { - final String token = st.nextToken().trim(); - if (token.equalsIgnoreCase(fiMimeType)) { - return true; - } - } - return false; - } +// private boolean isFastInfosetAcceptable(String accept) { +// if (accept == null || isFastInfosetDisabled) return false; +// +// StringTokenizer st = new StringTokenizer(accept, ","); +// while (st.hasMoreTokens()) { +// final String token = st.nextToken().trim(); +// if (token.equalsIgnoreCase(fiMimeType)) { +// return true; +// } +// } +// return false; +// } /* * Just check if the Accept header contains application/xop+xml, * no need to worry about q values. */ - private boolean isMtomAcceptable(String accept) { - if (accept == null || isFastInfosetDisabled) return false; - - StringTokenizer st = new StringTokenizer(accept, ","); - while (st.hasMoreTokens()) { - final String token = st.nextToken().trim(); - if (token.toLowerCase().contains(MtomCodec.XOP_XML_MIME_TYPE)) { - return true; - } - } - return false; - } +// private boolean isMtomAcceptable(String accept) { +// if (accept == null || isFastInfosetDisabled) return false; +// StringTokenizer st = new StringTokenizer(accept, ","); +// while (st.hasMoreTokens()) { +// final String token = st.nextToken().trim(); +// if (token.toLowerCase().contains(MtomCodec.XOP_XML_MIME_TYPE)) { +// return true; +// } +// } +// return false; +// } /** * Determines the encoding codec. @@ -495,11 +445,16 @@ return fiSwaCodec; } - if(features.isEnabled(MTOMFeature.class)) { - //On client, always use XOP encoding if MTOM is enabled - // On Server, use XOP encoding if either request is XOP encoded or client accepts XOP encoding - if(!isServerSide() || isRequestMtomMessage || acceptMtomMessages) - return xmlMtomCodec; + //If the packet does not have a binding, explicitly set the MTOMFeature + //on the packet so that it has a way to determine whether to use MTOM + if (p.getBinding() == null) { + if (features != null) { + p.setMtomFeature(features.get(MTOMFeature.class)); + } + } + + if (p.shouldUseMtom()) { + return xmlMtomCodec; } Message m = p.getMessage(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java 2013-04-04 15:29:52.320615337 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java 2013-04-04 15:29:52.260615337 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,9 +29,9 @@ import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.WSFeatureList; +import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.ContentType; -import com.sun.xml.internal.ws.message.stream.StreamHeader; import com.sun.xml.internal.ws.message.stream.StreamHeader11; import javax.xml.stream.XMLStreamReader; @@ -44,6 +44,13 @@ * @author Paul.Sandoz@Sun.Com */ final class StreamSOAP11Codec extends StreamSOAPCodec { + static final StreamHeaderDecoder SOAP11StreamHeaderDecoder = new StreamHeaderDecoder() { + @Override + public Header decodeHeader(XMLStreamReader reader, XMLStreamBuffer mark) { + return new StreamHeader11(reader, mark); + } + }; + public static final String SOAP11_MIME_TYPE = "text/xml"; public static final String DEFAULT_SOAP11_CONTENT_TYPE = SOAP11_MIME_TYPE+"; charset="+SOAPBindingCodec.DEFAULT_ENCODING; @@ -67,11 +74,6 @@ } @Override - protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) { - return new StreamHeader11(reader, mark); - } - - @Override protected ContentType getContentType(Packet packet) { ContentTypeImpl.Builder b = getContenTypeBuilder(packet); b.soapAction = packet.soapAction; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java 2013-04-04 15:29:52.620615342 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java 2013-04-04 15:29:52.568615342 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,10 +29,10 @@ import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.WSFeatureList; +import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.message.AttachmentSet; import com.sun.xml.internal.ws.api.pipe.ContentType; -import com.sun.xml.internal.ws.message.stream.StreamHeader; import com.sun.xml.internal.ws.message.stream.StreamHeader12; import javax.xml.stream.XMLStreamReader; @@ -47,6 +47,13 @@ * @author Paul.Sandoz@Sun.Com */ final class StreamSOAP12Codec extends StreamSOAPCodec { + static final StreamHeaderDecoder SOAP12StreamHeaderDecoder = new StreamHeaderDecoder() { + @Override + public Header decodeHeader(XMLStreamReader reader, XMLStreamBuffer mark) { + return new StreamHeader12(reader, mark); + } + }; + public static final String SOAP12_MIME_TYPE = "application/soap+xml"; public static final String DEFAULT_SOAP12_CONTENT_TYPE = SOAP12_MIME_TYPE+"; charset="+SOAPBindingCodec.DEFAULT_ENCODING; @@ -69,11 +76,6 @@ } @Override - protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) { - return new StreamHeader12(reader, mark); - } - - @Override protected ContentType getContentType(Packet packet) { ContentTypeImpl.Builder b = getContenTypeBuilder(packet); // TODO: set accept header --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java 2013-04-04 15:29:52.916615347 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java 2013-04-04 15:29:52.860615346 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,6 +27,8 @@ import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.getSoapVersion; +import com.oracle.webservices.internal.impl.encoding.StreamDecoderImpl; +import com.oracle.webservices.internal.impl.internalspi.encoding.StreamDecoder; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer; @@ -37,20 +39,19 @@ import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.WSFeatureList; import com.sun.xml.internal.ws.api.message.AttachmentSet; +import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.ContentType; -import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory; import com.sun.xml.internal.ws.developer.SerializationFeature; import com.sun.xml.internal.ws.message.AttachmentSetImpl; -import com.sun.xml.internal.ws.message.stream.StreamHeader; import com.sun.xml.internal.ws.message.stream.StreamMessage; import com.sun.xml.internal.ws.protocol.soap.VersionMismatchException; import com.sun.xml.internal.ws.server.UnsupportedMediaException; import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; -import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader; +import com.sun.xml.internal.ws.util.ServiceFinder; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; @@ -79,10 +80,11 @@ private static final String SOAP_HEADER = "Header"; private static final String SOAP_BODY = "Body"; - private final String SOAP_NAMESPACE_URI; private final SOAPVersion soapVersion; protected final SerializationFeature serializationFeature; + private final StreamDecoder streamDecoder; + // charset of last decoded message. Will be used for encoding server's // response messages with the request message's encoding // it will stored in the packet.invocationProperties @@ -102,8 +104,16 @@ private StreamSOAPCodec(SOAPVersion soapVersion, @Nullable SerializationFeature sf) { this.soapVersion = soapVersion; - SOAP_NAMESPACE_URI = soapVersion.nsUri; this.serializationFeature = sf; + this.streamDecoder = selectStreamDecoder(); + } + + private StreamDecoder selectStreamDecoder() { + for (StreamDecoder sd : ServiceFinder.find(StreamDecoder.class)) { + return sd; + } + + return new StreamDecoderImpl(); } public ContentType getStaticContentType(Packet packet) { @@ -181,15 +191,20 @@ * (like MIME multipart codec.) */ public final Message decode(XMLStreamReader reader, @NotNull AttachmentSet attachmentSet) { + return decode(soapVersion, reader, attachmentSet); + } + + public static final Message decode(SOAPVersion soapVersion, XMLStreamReader reader, + @NotNull AttachmentSet attachmentSet) { // Move to soap:Envelope and verify if(reader.getEventType()!=XMLStreamConstants.START_ELEMENT) XMLStreamReaderUtil.nextElementContent(reader); XMLStreamReaderUtil.verifyReaderState(reader,XMLStreamConstants.START_ELEMENT); - if (SOAP_ENVELOPE.equals(reader.getLocalName()) && !SOAP_NAMESPACE_URI.equals(reader.getNamespaceURI())) { - throw new VersionMismatchException(soapVersion, SOAP_NAMESPACE_URI, reader.getNamespaceURI()); + if (SOAP_ENVELOPE.equals(reader.getLocalName()) && !soapVersion.nsUri.equals(reader.getNamespaceURI())) { + throw new VersionMismatchException(soapVersion, soapVersion.nsUri, reader.getNamespaceURI()); } - XMLStreamReaderUtil.verifyTag(reader, SOAP_NAMESPACE_URI, SOAP_ENVELOPE); + XMLStreamReaderUtil.verifyTag(reader, soapVersion.nsUri, SOAP_ENVELOPE); TagInfoset envelopeTag = new TagInfoset(reader); @@ -208,7 +223,7 @@ TagInfoset headerTag = null; if (reader.getLocalName().equals(SOAP_HEADER) - && reader.getNamespaceURI().equals(SOAP_NAMESPACE_URI)) { + && reader.getNamespaceURI().equals(soapVersion.nsUri)) { headerTag = new TagInfoset(reader); // Collect namespaces on soap:Header @@ -220,11 +235,12 @@ // If SOAP header blocks are present (i.e. not ) if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) { - headers = new HeaderList(); + headers = new HeaderList(soapVersion); try { // Cache SOAP header blocks - cacheHeaders(reader, namespaces, headers); + StreamHeaderDecoder headerDecoder = SOAPVersion.SOAP_11.equals(soapVersion) ? StreamSOAP11Codec.SOAP11StreamHeaderDecoder : StreamSOAP12Codec.SOAP12StreamHeaderDecoder; + cacheHeaders(reader, namespaces, headers, headerDecoder); } catch (XMLStreamException e) { // TODO need to throw more meaningful exception throw new WebServiceException(e); @@ -236,7 +252,7 @@ } // Verify that is present - XMLStreamReaderUtil.verifyTag(reader, SOAP_NAMESPACE_URI, SOAP_BODY); + XMLStreamReaderUtil.verifyTag(reader, soapVersion.nsUri, SOAP_BODY); TagInfoset bodyTag = new TagInfoset(reader); String bodyPrologue = XMLStreamReaderUtil.nextWhiteSpaceContent(reader); @@ -254,8 +270,9 @@ return this; } - private XMLStreamBuffer cacheHeaders(XMLStreamReader reader, - Map namespaces, HeaderList headers) throws XMLStreamException { + private static XMLStreamBuffer cacheHeaders(XMLStreamReader reader, + Map namespaces, HeaderList headers, + StreamHeaderDecoder headerDecoder) throws XMLStreamException { MutableXMLStreamBuffer buffer = createXMLStreamBuffer(); StreamReaderBufferCreator creator = new StreamReaderBufferCreator(); creator.setXMLStreamBuffer(buffer); @@ -275,7 +292,7 @@ // Mark XMLStreamBuffer mark = new XMLStreamBufferMark(headerBlockNamespaces, creator); // Create Header - headers.add(createHeader(reader, mark)); + headers.add(headerDecoder.decodeHeader(reader, mark)); // Cache the header block @@ -291,9 +308,11 @@ return buffer; } - protected abstract StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark); + protected interface StreamHeaderDecoder { + public Header decodeHeader(XMLStreamReader reader, XMLStreamBuffer mark); + } - private MutableXMLStreamBuffer createXMLStreamBuffer() { + private static MutableXMLStreamBuffer createXMLStreamBuffer() { // TODO: Decode should own one MutableXMLStreamBuffer for reuse // since it is more efficient. ISSUE: possible issue with // lifetime of information in the buffer if accessed beyond @@ -306,7 +325,10 @@ if (contentType != null && !isContentTypeSupported(contentType,expectedContentTypes)) { throw new UnsupportedMediaException(contentType, expectedContentTypes); } - String charset = new ContentTypeImpl(contentType).getCharSet(); + com.oracle.webservices.internal.api.message.ContentType pct = packet.getInternalContentType(); + ContentTypeImpl cti = (pct != null && pct instanceof ContentTypeImpl) ? + (ContentTypeImpl)pct : new ContentTypeImpl(contentType); + String charset = cti.getCharSet(); if (charset != null && !Charset.isSupported(charset)) { throw new UnsupportedMediaException(charset); } @@ -315,9 +337,7 @@ } else { packet.invocationProperties.remove(DECODED_MESSAGE_CHARSET); } - XMLStreamReader reader = XMLStreamReaderFactory.create(null, in, charset, true); - reader = new TidyXMLStreamReader(reader, in); - packet.setMessage(decode(reader, att)); + packet.setMessage(streamDecoder.decode(in, charset, att, soapVersion)); } public void decode(ReadableByteChannel in, String contentType, Packet response, AttachmentSet att ) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StringDataContentHandler.java 2013-04-04 15:29:53.232615351 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/StringDataContentHandler.java 2013-04-04 15:29:53.180615351 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/SwACodec.java 2013-04-04 15:29:53.512615356 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/SwACodec.java 2013-04-04 15:29:53.456615355 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,18 +48,19 @@ public SwACodec(SOAPVersion version, WSFeatureList f, Codec rootCodec) { super(version, f); - this.rootCodec = rootCodec; + this.mimeRootCodec = rootCodec; } private SwACodec(SwACodec that) { super(that); - this.rootCodec = that.rootCodec.copy(); + this.mimeRootCodec = that.mimeRootCodec.copy(); } @Override protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException { // TODO: handle attachments correctly Attachment root = mpp.getRootPart(); + Codec rootCodec = getMimeRootCodec(packet); if (rootCodec instanceof RootOnlyCodec) { ((RootOnlyCodec)rootCodec).decode(root.asInputStream(),root.getContentType(),packet, new MimeAttachmentSet(mpp)); } else { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/TagInfoset.java 2013-04-04 15:29:53.800615360 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/TagInfoset.java 2013-04-04 15:29:53.736615359 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java 2013-04-04 15:29:54.092615365 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java 2013-04-04 15:29:54.032615364 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -41,7 +41,6 @@ import javax.activation.DataSource; import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; import java.io.IOException; import java.io.InputStream; @@ -96,37 +95,18 @@ */ private static final String fiXmlAccept = APPLICATION_FAST_INFOSET_MIME_TYPE + ", " + BASE_ACCEPT_VALUE; - private class AcceptContentType implements ContentType { - private ContentType _c; - private String _accept; - - public AcceptContentType set(Packet p, ContentType c) { - // TODO: need to compose based on underlying codecs - if (p.contentNegotiation == ContentNegotiation.optimistic - || p.contentNegotiation == ContentNegotiation.pessimistic) { - _accept = fiXmlAccept; - } else { - _accept = xmlAccept; - } - _c = c; - return this; - } - - public String getContentType() { - return _c.getContentType(); - } - - public String getSOAPActionHeader() { - return _c.getSOAPActionHeader(); - } - - public String getAcceptHeader() { - return _accept; + private ContentTypeImpl setAcceptHeader(Packet p, ContentType c) { + ContentTypeImpl ctImpl = (ContentTypeImpl)c; + if (p.contentNegotiation == ContentNegotiation.optimistic + || p.contentNegotiation == ContentNegotiation.pessimistic) { + ctImpl.setAcceptHeader(fiXmlAccept); + } else { + ctImpl.setAcceptHeader(xmlAccept); } + p.setContentType(ctImpl); + return ctImpl; } - private AcceptContentType _adaptingContentType = new AcceptContentType(); - public XMLHTTPBindingCodec(WSFeatureList f) { super(SOAPVersion.SOAP_11, f); @@ -135,44 +115,42 @@ fiCodec = getFICodec(); } + @Override public String getMimeType() { return null; } @Override public ContentType getStaticContentType(Packet packet) { - setRootCodec(packet); - - ContentType ct = null; - if (packet.getMessage() instanceof MessageDataSource) { - final MessageDataSource mds = (MessageDataSource)packet.getMessage(); + ContentType ct; + if (packet.getInternalMessage() instanceof MessageDataSource) { + final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage(); if (mds.hasUnconsumedDataSource()) { ct = getStaticContentType(mds); return (ct != null) - ? _adaptingContentType.set(packet, ct) + ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct) : null; } } ct = super.getStaticContentType(packet); return (ct != null) - ? _adaptingContentType.set(packet, ct) + ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct) : null; } @Override public ContentType encode(Packet packet, OutputStream out) throws IOException { - setRootCodec(packet); - - if (packet.getMessage() instanceof MessageDataSource) { - final MessageDataSource mds = (MessageDataSource)packet.getMessage(); + if (packet.getInternalMessage() instanceof MessageDataSource) { + final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage(); if (mds.hasUnconsumedDataSource()) - return _adaptingContentType.set(packet, encode(mds, out)); + return setAcceptHeader(packet, encode(mds, out)); } - return _adaptingContentType.set(packet, super.encode(packet, out)); + return setAcceptHeader(packet, super.encode(packet, out)); } + @Override public ContentType encode(Packet packet, WritableByteChannel buffer) { throw new UnsupportedOperationException(); } @@ -208,10 +186,12 @@ } } + @Override protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException { // This method will never be invoked } + @Override public MimeCodec copy() { return new XMLHTTPBindingCodec(features); } @@ -220,10 +200,6 @@ return compareStrings(contentType, MimeCodec.MULTIPART_RELATED_MIME_TYPE); } - private boolean isApplicationXopXml(String contentType) { - return compareStrings(contentType, MtomCodec.XOP_XML_MIME_TYPE); - } - private boolean isXml(String contentType) { return compareStrings(contentType, XMLCodec.XML_APPLICATION_MIME_TYPE) || compareStrings(contentType, XMLCodec.XML_TEXT_MIME_TYPE) @@ -285,7 +261,8 @@ } } - private void setRootCodec(Packet p) { + @Override + protected Codec getMimeRootCodec(Packet p) { /** * The following logic is only for outbound packets * to be encoded by client. @@ -300,8 +277,7 @@ useFastInfosetForEncoding = true; } - rootCodec = (useFastInfosetForEncoding && fiCodec != null) - ? fiCodec : xmlCodec; + return (useFastInfosetForEncoding && fiCodec != null)? fiCodec : xmlCodec; } public static boolean requiresTransformationOfDataSource( --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/XmlDataContentHandler.java 2013-04-04 15:29:54.400615370 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/XmlDataContentHandler.java 2013-04-04 15:29:54.340615369 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java 2013-04-04 15:29:54.712615375 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java 2013-04-04 15:29:54.656615374 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -40,7 +40,6 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import javax.xml.stream.XMLStreamReader; import javax.xml.ws.WebServiceException; import java.io.OutputStream; import java.io.InputStream; @@ -110,7 +109,7 @@ public void decode(InputStream in, String contentType, Packet packet) throws IOException { /* Implements similar logic as the XMLMessage.create(String, InputStream). * But it's faster, as we know the InputStream has FastInfoset content*/ - Message message = null; + Message message; in = hasSomeData(in); if (in != null) { message = Messages.createUsingPayload(new FastInfosetSource(in), @@ -135,15 +134,6 @@ } } - private XMLStreamReader getXMLStreamReader(InputStream in) { - if (_parser != null) { - _parser.setInputStream(in); - return _parser; - } else { - return _parser = createNewStreamReader(in, _retainState); - } - } - /** * Creates a new {@link FastInfosetCodec} instance. * --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java 2013-04-04 15:29:54.996615379 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java 2013-04-04 15:29:54.936615378 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java 2013-04-04 15:29:55.300615384 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java 2013-04-04 15:29:55.244615383 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java 2013-04-04 15:29:55.600615388 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java 2013-04-04 15:29:55.544615387 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java 2013-04-04 15:29:55.864615393 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java 2013-04-04 15:29:55.816615392 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java 2013-04-04 15:29:56.120615397 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java 2013-04-04 15:29:56.060615396 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java 2013-04-04 15:29:56.392615401 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java 2013-04-04 15:29:56.340615400 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/EncodingConstants.java 2013-04-04 15:29:56.664615405 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/EncodingConstants.java 2013-04-04 15:29:56.612615404 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/EncodingPolicyValidator.java 2013-04-04 15:29:56.912615409 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/EncodingPolicyValidator.java 2013-04-04 15:29:56.856615408 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/EncodingPrefixMapper.java 2013-04-04 15:29:57.220615413 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/EncodingPrefixMapper.java 2013-04-04 15:29:57.172615413 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/FastInfosetFeatureConfigurator.java 2013-04-04 15:29:57.540615418 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/FastInfosetFeatureConfigurator.java 2013-04-04 15:29:57.480615418 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/MtomFeatureConfigurator.java 2013-04-04 15:29:57.844615423 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/MtomFeatureConfigurator.java 2013-04-04 15:29:57.788615423 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.encoding.policy; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; import com.sun.xml.internal.ws.policy.AssertionSet; import com.sun.xml.internal.ws.policy.Policy; import com.sun.xml.internal.ws.policy.PolicyAssertion; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/MtomPolicyMapConfigurator.java 2013-04-04 15:29:58.132615428 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/MtomPolicyMapConfigurator.java 2013-04-04 15:29:58.068615427 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/SelectOptimalEncodingFeatureConfigurator.java 2013-04-04 15:29:58.444615433 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/policy/SelectOptimalEncodingFeatureConfigurator.java 2013-04-04 15:29:58.384615432 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java 2013-04-04 15:29:58.740615438 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java 2013-04-04 15:29:58.680615436 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.encoding.soap; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * DeserializationException represents an exception that occurred while --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java 2013-04-04 15:29:59.012615442 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java 2013-04-04 15:29:58.956615441 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SOAPConstants.java 2013-04-04 15:29:59.252615446 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SOAPConstants.java 2013-04-04 15:29:59.200615445 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java 2013-04-04 15:29:59.448615448 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java 2013-04-04 15:29:59.400615447 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -24,8 +24,9 @@ */ package com.sun.xml.internal.ws.encoding.soap; + +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * SerializationException represents an exception that occurred while --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SerializerConstants.java 2013-04-04 15:29:59.648615452 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/SerializerConstants.java 2013-04-04 15:29:59.596615450 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java 2013-04-04 15:29:59.864615455 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java 2013-04-04 15:29:59.812615454 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java 2013-04-04 15:30:00.072615458 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java 2013-04-04 15:30:00.020615458 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java 2013-04-04 15:30:00.284615461 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java 2013-04-04 15:30:00.232615461 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLConstants.java 2013-04-04 15:30:00.488615465 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLConstants.java 2013-04-04 15:30:00.436615464 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java 2013-04-04 15:30:00.784615469 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java 2013-04-04 15:30:00.728615469 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,6 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.bind.api.Bridge; import com.sun.xml.internal.ws.api.SOAPVersion; -import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.WSFeatureList; import com.sun.xml.internal.ws.api.message.*; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; @@ -44,7 +43,6 @@ import com.sun.xml.internal.ws.message.source.PayloadSourceMessage; import com.sun.xml.internal.ws.util.ByteArrayBuffer; import com.sun.xml.internal.ws.util.StreamUtils; -import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.getFeature; import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; @@ -60,7 +58,6 @@ import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; import java.io.IOException; import java.io.InputStream; @@ -75,7 +72,6 @@ private static final int PLAIN_XML_FLAG = 1; // 00001 private static final int MIME_MULTIPART_FLAG = 2; // 00010 private static final int FI_ENCODED_FLAG = 16; // 10000 - private WebServiceFeature[] features; /* * Construct a message given a content type and an input stream. @@ -240,7 +236,7 @@ public XmlContent(String ct, InputStream in, WSFeatureList f) { super(SOAPVersion.SOAP_11); dataSource = new XmlDataSource(ct, in); - this.headerList = new HeaderList(); + this.headerList = new HeaderList(SOAPVersion.SOAP_11); // this.binding = binding; features = f; } @@ -268,7 +264,7 @@ return false; } - public @NotNull HeaderList getHeaders() { + public @NotNull MessageHeaders getHeaders() { return headerList; } @@ -351,12 +347,13 @@ private final DataSource dataSource; private final StreamingAttachmentFeature feature; private Message delegate; - private final HeaderList headerList = new HeaderList(); + private HeaderList headerList;// = new HeaderList(); // private final WSBinding binding; private final WSFeatureList features; public XMLMultiPart(final String contentType, final InputStream is, WSFeatureList f) { super(SOAPVersion.SOAP_11); + headerList = new HeaderList(SOAPVersion.SOAP_11); dataSource = createDataSource(contentType, is); this.feature = f.get(StreamingAttachmentFeature.class); this.features = f; @@ -391,7 +388,7 @@ return false; } - public @NotNull HeaderList getHeaders() { + public @NotNull MessageHeaders getHeaders() { return headerList; } @@ -500,7 +497,7 @@ public UnknownContent(DataSource ds) { super(SOAPVersion.SOAP_11); this.ds = ds; - this.headerList = new HeaderList(); + this.headerList = new HeaderList(SOAPVersion.SOAP_11); } /* @@ -534,7 +531,7 @@ return false; } - public HeaderList getHeaders() { + public MessageHeaders getHeaders() { return headerList; } @@ -579,8 +576,9 @@ final ByteArrayBuffer bos = new ByteArrayBuffer(); try { Codec codec = new XMLHTTPBindingCodec(f); - com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.getStaticContentType(new Packet(msg)); - codec.encode(new Packet(msg), bos); + Packet packet = new Packet(msg); + com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.getStaticContentType(packet); + codec.encode(packet, bos); return createDataSource(ct.getContentType(), bos.newInputStream()); } catch(IOException ioe) { throw new WebServiceException(ioe); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLPropertyBag.java 2013-04-04 15:30:01.116615475 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLPropertyBag.java 2013-04-04 15:30:01.052615474 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +25,10 @@ package com.sun.xml.internal.ws.encoding.xml; -import com.sun.xml.internal.ws.api.PropertySet; +import com.oracle.webservices.internal.api.message.BasePropertySet; +import com.oracle.webservices.internal.api.message.PropertySet; -public class XMLPropertyBag extends PropertySet { +public class XMLPropertyBag extends BasePropertySet { private String contentType; protected PropertyMap getPropertyMap() { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/CodeType.java 2013-04-04 15:30:01.404615479 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/CodeType.java 2013-04-04 15:30:01.352615478 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/DetailType.java 2013-04-04 15:30:01.680615483 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/DetailType.java 2013-04-04 15:30:01.624615483 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/ExceptionBean.java 2013-04-04 15:30:01.980615488 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/ExceptionBean.java 2013-04-04 15:30:01.924615487 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -152,7 +152,9 @@ try { return Integer.parseInt(v); } catch (NumberFormatException e) { - if(v.equals("native")) return -2; + if ("native".equals(v)) { + return -2; + } return -1; } } @@ -166,7 +168,7 @@ * Checks if the given element is the XML representation of {@link ExceptionBean}. */ public static boolean isStackTraceXml(Element n) { - return n.getLocalName().equals(LOCAL_NAME) && n.getNamespaceURI().equals(NS); + return LOCAL_NAME.equals(n.getLocalName()) && NS.equals(n.getNamespaceURI()); } private static final JAXBContext JAXB_CONTEXT; @@ -189,7 +191,9 @@ private static final NamespacePrefixMapper nsp = new NamespacePrefixMapper() { public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { - if(namespaceUri.equals(NS)) return ""; + if (NS.equals(namespaceUri)) { + return ""; + } return suggestion; } }; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/ReasonType.java 2013-04-04 15:30:02.284615493 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/ReasonType.java 2013-04-04 15:30:02.224615492 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java 2013-04-04 15:30:02.612615497 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java 2013-04-04 15:30:02.544615497 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +36,6 @@ import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPFault; import javax.xml.ws.WebServiceException; -import javax.xml.ws.soap.SOAPFaultException; import java.util.Iterator; /** @@ -102,12 +101,13 @@ this.faultstring = reason; this.faultactor = actor; if (detailObject != null) { - if("".equals(detailObject.getNamespaceURI()) && "detail".equals(detailObject.getLocalName())){ + if ((detailObject.getNamespaceURI() == null || + "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) { detail = new DetailType(); - for(Element detailEntry : DOMUtil.getChildElements(detailObject)){ + for(Element detailEntry : DOMUtil.getChildElements(detailObject)) { detail.getDetails().add(detailEntry); } - }else{ + } else { detail = new DetailType(detailObject); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java 2013-04-04 15:30:02.916615502 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java 2013-04-04 15:30:02.852615501 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java 2013-04-04 15:30:03.216615507 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java 2013-04-04 15:30:03.152615506 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +29,6 @@ import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.message.Message; -import com.sun.xml.internal.ws.api.model.CheckedException; import com.sun.xml.internal.ws.api.model.ExceptionType; import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants; import com.sun.xml.internal.ws.encoding.soap.SOAPConstants; @@ -170,7 +169,18 @@ * @param soapVersion non-null */ public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex) { - return createSOAPFaultMessage(soapVersion, ceModel, ex, null); + // Sometimes InvocationTargetException.getCause() is null + // but InvocationTargetException.getTargetException() contains the real exception + // even though they are supposed to be equivalent. + // If we only look at .getCause this results in the real exception being lost. + // Looks like a JDK bug. + final Throwable t = + ex instanceof java.lang.reflect.InvocationTargetException + ? + ((java.lang.reflect.InvocationTargetException)ex).getTargetException() + : + ex; + return createSOAPFaultMessage(soapVersion, ceModel, t, null); } /** @@ -491,7 +501,6 @@ } catch (JAXBException e1) { //Should we throw Internal Server Error??? faultString = e.getMessage(); - faultCode = getDefaultFaultCode(soapVersion); } } @@ -535,16 +544,18 @@ /** * Set to false if you don't want the generated faults to have stack trace in it. */ - public static boolean captureStackTrace; + public static final boolean captureStackTrace; /*package*/ static final String CAPTURE_STACK_TRACE_PROPERTY = SOAPFaultBuilder.class.getName()+".captureStackTrace"; static { + boolean tmpVal = false; try { - captureStackTrace = Boolean.getBoolean(CAPTURE_STACK_TRACE_PROPERTY); + tmpVal = Boolean.getBoolean(CAPTURE_STACK_TRACE_PROPERTY); } catch (SecurityException e) { // ignore } + captureStackTrace = tmpVal; try { JAXB_CONTEXT = JAXBContext.newInstance(SOAP11Fault.class, SOAP12Fault.class); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/ServerSOAPFaultException.java 2013-04-04 15:30:03.520615512 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/ServerSOAPFaultException.java 2013-04-04 15:30:03.464615511 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SubcodeType.java 2013-04-04 15:30:03.816615516 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/SubcodeType.java 2013-04-04 15:30:03.760615516 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/TextType.java 2013-04-04 15:30:04.144615521 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/fault/TextType.java 2013-04-04 15:30:04.072615521 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java 2013-04-04 15:30:04.472615527 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java 2013-04-04 15:30:04.404615526 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ClientMessageHandlerTube.java 2013-04-04 15:30:04.760615531 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ClientMessageHandlerTube.java 2013-04-04 15:30:04.712615531 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +45,7 @@ import javax.xml.ws.handler.MessageContext; import javax.xml.ws.handler.Handler; import java.util.*; +import java.util.Map.Entry; /** * @author Rama Pulavarthi @@ -92,7 +93,8 @@ //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message Map atts = (Map) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS); AttachmentSet attSet = context.packet.getMessage().getAttachments(); - for(String cid : atts.keySet()){ + for (Entry entry : atts.entrySet()) { + String cid = entry.getKey(); if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice Attachment att = new DataHandlerAttachment(cid, atts.get(cid)); attSet.add(att); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java 2013-04-04 15:30:05.068615536 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java 2013-04-04 15:30:05.016615535 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ import javax.xml.ws.WebServiceException; import javax.activation.DataHandler; import java.util.*; +import java.util.Map.Entry; /** * @@ -113,7 +114,8 @@ //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message Map atts = (Map) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS); AttachmentSet attSet = context.packet.getMessage().getAttachments(); - for(String cid : atts.keySet()){ + for (Entry entry : atts.entrySet()) { + String cid = entry.getKey(); if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice Attachment att = new DataHandlerAttachment(cid, atts.get(cid)); attSet.add(att); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java 2013-04-04 15:30:05.392615541 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java 2013-04-04 15:30:05.332615540 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerException.java 2013-04-04 15:30:05.716615546 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerException.java 2013-04-04 15:30:05.660615545 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.handler; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * Exception thrown by handler-related code. Extends --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java 2013-04-04 15:30:06.040615551 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java 2013-04-04 15:30:05.980615550 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerTube.java 2013-04-04 15:30:06.360615556 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/HandlerTube.java 2013-04-04 15:30:06.300615555 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -293,7 +293,7 @@ } else { /* otherwise use this value as an approximation, since this carries - the appliation's intention --- whether it was invokeOneway vs invoke,etc. + the application's intention --- whether it was invokeOneway vs invoke,etc. */ return !(packet.expectReply != null && packet.expectReply); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/LogicalMessageContextImpl.java 2013-04-04 15:30:06.648615560 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/LogicalMessageContextImpl.java 2013-04-04 15:30:06.592615560 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,21 +25,13 @@ package com.sun.xml.internal.ws.handler; -import com.sun.xml.internal.ws.api.message.AttachmentSet; -import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.model.SEIModel; -import com.sun.xml.internal.ws.message.EmptyMessageImpl; -import com.sun.xml.internal.ws.message.source.PayloadSourceMessage; import com.sun.xml.internal.ws.spi.db.BindingContext; -import javax.xml.transform.Source; - import javax.xml.ws.LogicalMessage; import javax.xml.ws.handler.LogicalMessageContext; -import javax.xml.bind.JAXBContext; /** * Implementation of LogicalMessageContext. This class is used at runtime --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java 2013-04-04 15:30:06.900615564 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java 2013-04-04 15:30:06.836615563 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,9 +25,9 @@ package com.sun.xml.internal.ws.handler; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.message.Message; -import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.AttachmentSet; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.spi.db.BindingContext; @@ -184,7 +184,7 @@ * @param binding * @return */ - public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) { + public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) { assert isPayloadModifed(); if(isPayloadModifed()) { return lm.getMessage(headers,attachments,binding); @@ -199,7 +199,7 @@ public abstract Source getPayload(); public abstract Object getPayload(BindingContext context); public abstract Object getPayload(JAXBContext context); - public abstract Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding); + public abstract Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding); } @@ -216,12 +216,12 @@ return dom; } - public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) { + public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) { Node n = dom.getNode(); if(n.getNodeType()== Node.DOCUMENT_NODE) { n = ((Document)n).getDocumentElement(); } - return new DOMMessage(binding.getSOAPVersion(),headers, (Element)n, attachments); + return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments); } } @@ -245,7 +245,7 @@ return null; } - public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) { + public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) { return new EmptyMessageImpl(headers,attachments,binding.getSOAPVersion()); } } @@ -303,7 +303,7 @@ } } - public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) { + public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) { return JAXBMessage.create(BindingContextFactory.create(ctxt), o,binding.getSOAPVersion(), headers,attachments); } } @@ -356,7 +356,7 @@ } - public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) { + public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) { assert (payloadSrc!=null); return new PayloadSourceMessage(headers, payloadSrc, attachments,binding.getSOAPVersion()); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/MessageContextImpl.java 2013-04-04 15:30:07.192615569 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/MessageContextImpl.java 2013-04-04 15:30:07.132615568 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,6 @@ import com.sun.xml.internal.ws.api.message.Attachment; import com.sun.xml.internal.ws.api.message.AttachmentSet; import com.sun.xml.internal.ws.api.message.Packet; -import com.sun.xml.internal.ws.util.ReadOnlyPropertyException; import javax.activation.DataHandler; import javax.xml.ws.handler.MessageContext; @@ -37,29 +36,24 @@ import java.util.Map; import java.util.Set; + /** * * @author WS Development Team */ class MessageContextImpl implements MessageContext { - private Map fallbackMap = null; - private Set handlerScopeProps; - Packet packet; - + private final Set handlerScopeProps; + private final Packet packet; + private final Map asMapIncludingInvocationProperties; - void fallback() { - if(fallbackMap == null) { - fallbackMap = new HashMap(); - fallbackMap.putAll(packet.createMapView()); - fallbackMap.putAll(packet.invocationProperties); - } - } /** Creates a new instance of MessageContextImpl */ public MessageContextImpl(Packet packet) { this.packet = packet; - handlerScopeProps = packet.getHandlerScopePropertyNames(false); + this.asMapIncludingInvocationProperties = packet.asMapIncludingInvocationProperties(); + this.handlerScopeProps = packet.getHandlerScopePropertyNames(false); } + protected void updatePacket() { throw new UnsupportedOperationException("wrong call"); } @@ -86,65 +80,32 @@ } public int size() { - fallback(); - return fallbackMap.size(); + return asMapIncludingInvocationProperties.size(); } public boolean isEmpty() { - fallback(); - return fallbackMap.isEmpty(); + return asMapIncludingInvocationProperties.isEmpty(); } public boolean containsKey(Object key) { - if(fallbackMap == null) { - if(packet.supports(key)) - return true; - return packet.invocationProperties.containsKey(key); - } else { - fallback(); - return fallbackMap.containsKey(key); - } + return asMapIncludingInvocationProperties.containsKey(key); } public boolean containsValue(Object value) { - fallback(); - return fallbackMap.containsValue(value); + return asMapIncludingInvocationProperties.containsValue(value); } public Object put(String key, Object value) { - if (fallbackMap == null) { - if (packet.supports(key)) { - return packet.put(key, value); // strongly typed - } - if (!packet.invocationProperties.containsKey(key)) { - //New property, default to Scope.HANDLER - handlerScopeProps.add(key); - } - return packet.invocationProperties.put(key, value); - - } else { - fallback(); - if (!fallbackMap.containsKey(key)) { - //new property, default to Scope.HANDLER - handlerScopeProps.add(key); - } - return fallbackMap.put(key, value); + if (!asMapIncludingInvocationProperties.containsKey(key)) { + //new property, default to Scope.HANDLER + handlerScopeProps.add(key); } + return asMapIncludingInvocationProperties.put(key, value); } public Object get(Object key) { if(key == null) return null; - Object value; - if(fallbackMap == null) { - if (packet.supports(key)) { - value = packet.get(key); // strongly typed - } else { - value = packet.invocationProperties.get(key); - } - } else { - fallback(); - value = fallbackMap.get(key); - } + Object value = asMapIncludingInvocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ @@ -153,7 +114,16 @@ atts = new HashMap(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ - atts.put(att.getContentId(), att.asDataHandler()); + String cid = att.getContentId(); + if (cid.indexOf("@jaxws.sun.com") == -1) { + Object a = atts.get(cid); + if (a == null) { + a = atts.get("<" + cid + ">"); + if (a == null) atts.put(att.getContentId(), att.asDataHandler()); + } + } else { + atts.put(att.getContentId(), att.asDataHandler()); + } } return atts; } @@ -161,61 +131,29 @@ } public void putAll(Map t) { - fallback(); for(String key: t.keySet()) { - if(!fallbackMap.containsKey(key)) { + if(!asMapIncludingInvocationProperties.containsKey(key)) { //new property, default to Scope.HANDLER handlerScopeProps.add(key); } } - fallbackMap.putAll(t); + asMapIncludingInvocationProperties.putAll(t); } public void clear() { - fallback(); - fallbackMap.clear(); + asMapIncludingInvocationProperties.clear(); } public Object remove(Object key){ - fallback(); handlerScopeProps.remove(key); - return fallbackMap.remove(key); + return asMapIncludingInvocationProperties.remove(key); } public Set keySet() { - fallback(); - return fallbackMap.keySet(); + return asMapIncludingInvocationProperties.keySet(); } public Set> entrySet(){ - fallback(); - return fallbackMap.entrySet(); + return asMapIncludingInvocationProperties.entrySet(); } public Collection values() { - fallback(); - return fallbackMap.values(); + return asMapIncludingInvocationProperties.values(); } - - - /** - * Fill a {@link Packet} with values of this {@link MessageContext}. - */ - void fill(Packet packet) { - if(fallbackMap != null) { - for (Entry entry : fallbackMap.entrySet()) { - String key = entry.getKey(); - if (packet.supports(key)) { - try { - packet.put(key, entry.getValue()); - } catch (ReadOnlyPropertyException e) { - // Nothing to do - } - } else { - packet.invocationProperties.put(key, entry.getValue()); - } - } - - //Remove properties which are removed by user. - packet.createMapView().keySet().retainAll(fallbackMap.keySet()); - packet.invocationProperties.keySet().retainAll(fallbackMap.keySet()); - } - } - } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/MessageHandlerContextImpl.java 2013-04-04 15:30:07.456615573 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/MessageHandlerContextImpl.java 2013-04-04 15:30:07.400615572 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java 2013-04-04 15:30:07.724615577 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java 2013-04-04 15:30:07.672615576 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -48,12 +48,6 @@ } /** - * Fill a {@link Packet} with values of this {@link MessageContext}. - */ - private void fill(Packet packet) { - ctxt.fill(packet); - } - /** * Updates Message in the packet with user modifications */ abstract void updateMessage(); @@ -79,7 +73,6 @@ */ public final void updatePacket() { updateMessage(); - fill(packet); } MessageContextImpl getMessageContext() { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java 2013-04-04 15:30:08.048615583 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java 2013-04-04 15:30:07.980615581 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java 2013-04-04 15:30:08.360615587 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java 2013-04-04 15:30:08.308615587 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java 2013-04-04 15:30:08.668615592 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java 2013-04-04 15:30:08.608615591 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,6 @@ import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.SOAPVersion; -import com.sun.xml.internal.ws.message.saaj.SAAJMessage; import javax.xml.bind.JAXBContext; import javax.xml.namespace.QName; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java 2013-04-04 15:30:08.960615596 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java 2013-04-04 15:30:08.900615596 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +47,7 @@ import java.util.List; import java.util.ArrayList; import java.util.Map; +import java.util.Map.Entry; /** * @@ -156,7 +157,8 @@ //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message Map atts = (Map) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS); AttachmentSet attSet = context.packet.getMessage().getAttachments(); - for(String cid : atts.keySet()){ + for (Entry entry : atts.entrySet()) { + String cid = entry.getKey(); Attachment att = new DataHandlerAttachment(cid, atts.get(cid)); attSet.add(att); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ServerMessageHandlerTube.java 2013-04-04 15:30:09.256615601 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ServerMessageHandlerTube.java 2013-04-04 15:30:09.208615601 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ import javax.xml.ws.handler.MessageContext; import javax.xml.ws.handler.Handler; import java.util.*; +import java.util.Map.Entry; /** * @author Rama Pulavarthi @@ -82,7 +83,8 @@ //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message Map atts = (Map) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS); AttachmentSet attSet = context.packet.getMessage().getAttachments(); - for(String cid : atts.keySet()){ + for (Entry entry : atts.entrySet()) { + String cid = entry.getKey(); if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice Attachment att = new DataHandlerAttachment(cid, atts.get(cid)); attSet.add(att); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java 2013-04-04 15:30:09.576615606 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java 2013-04-04 15:30:09.516615605 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -138,7 +138,8 @@ //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message Map atts = (Map) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS); AttachmentSet attSet = context.packet.getMessage().getAttachments(); - for(String cid : atts.keySet()){ + for (Map.Entry entry : atts.entrySet()) { + String cid = entry.getKey(); if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice Attachment att = new DataHandlerAttachment(cid, atts.get(cid)); attSet.add(att); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java 2013-04-04 15:30:09.884615611 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java 2013-04-04 15:30:09.824615610 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AbstractHeaderImpl.java 2013-04-04 15:30:10.176615615 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AbstractHeaderImpl.java 2013-04-04 15:30:10.120615615 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -104,6 +104,8 @@ String v = getAttribute(soapVersion.nsUri, "mustUnderstand"); if(v==null || !parseBool(v)) return true; + if (roles == null) return true; + // now role return !roles.contains(getRole(soapVersion)); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java 2013-04-04 15:30:10.416615619 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java 2013-04-04 15:30:10.360615618 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,13 @@ import com.sun.xml.internal.bind.api.Bridge; import com.sun.xml.internal.ws.api.SOAPVersion; -import com.sun.xml.internal.ws.api.message.HeaderList; +import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; +import com.sun.xml.internal.ws.api.message.MessageWritable; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; +import com.sun.xml.internal.ws.message.saaj.SAAJMessage; import com.sun.xml.internal.ws.spi.db.XMLBridge; import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; @@ -46,6 +49,7 @@ import javax.xml.stream.XMLStreamWriter; import javax.xml.transform.Source; import javax.xml.transform.sax.SAXSource; + import java.util.List; import java.util.Map; @@ -80,6 +84,9 @@ this.soapVersion = soapVersion; } + public SOAPVersion getSOAPVersion() { + return soapVersion; + } /** * Copy constructor. */ @@ -121,10 +128,9 @@ w.writeNamespace("S",soapNsUri); if(hasHeaders()) { w.writeStartElement("S","Header",soapNsUri); - HeaderList headers = getHeaders(); - int len = headers.size(); - for( int i=0; i> headers = null; - String key = inbound ? Packet.INBOUND_TRANSPORT_HEADERS : Packet.OUTBOUND_TRANSPORT_HEADERS; - if (packet.supports(key)) { - headers = (Map>)packet.get(key); - } - if (headers != null) { - for(Map.Entry> e : headers.entrySet()) { - if (!e.getKey().equalsIgnoreCase("Content-Type")) { - for(String value : e.getValue()) { - msg.getMimeHeaders().addHeader(e.getKey(), value); - } - } - } - } - - if (msg.saveRequired()) - msg.saveChanges(); + SOAPMessage msg = SAAJFactory.read(soapVersion, this, packet); + transportHeaders(packet, inbound, msg); return msg; } + private void transportHeaders(Packet packet, boolean inbound, SOAPMessage msg) throws SOAPException { + Map> headers = getTransportHeaders(packet, inbound); + if (headers != null) { + addSOAPMimeHeaders(msg.getMimeHeaders(), headers); + } + if (msg.saveRequired()) msg.saveChanges(); + } protected static final AttributesImpl EMPTY_ATTS = new AttributesImpl(); protected static final LocatorImpl NULL_LOCATOR = new LocatorImpl(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java 2013-04-04 15:30:10.628615622 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java 2013-04-04 15:30:10.576615622 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java 2013-04-04 15:30:10.840615626 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java 2013-04-04 15:30:10.792615625 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java 2013-04-04 15:30:11.060615629 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java 2013-04-04 15:30:11.000615628 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/DOMHeader.java 2013-04-04 15:30:11.260615633 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/DOMHeader.java 2013-04-04 15:30:11.212615632 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -118,4 +118,26 @@ public String getStringContent() { return node.getTextContent(); } + + public N getWrappedNode() { + return node; + } + + + @Override + public int hashCode() { + return getWrappedNode().hashCode(); + } + + + @Override + public boolean equals(Object obj) { + if (obj instanceof DOMHeader) { + return getWrappedNode().equals(((DOMHeader) obj).getWrappedNode()); + } else { + return false; + } + } + + } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/DOMMessage.java 2013-04-04 15:30:11.456615636 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/DOMMessage.java 2013-04-04 15:30:11.404615635 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,6 +32,7 @@ import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.AttachmentSet; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.streaming.DOMStreamReader; import com.sun.xml.internal.ws.util.DOMUtil; import org.w3c.dom.Element; @@ -54,18 +55,18 @@ * @author Kohsuke Kawaguchi */ public final class DOMMessage extends AbstractMessageImpl { - private HeaderList headers; + private MessageHeaders headers; private final Element payload; public DOMMessage(SOAPVersion ver, Element payload) { this(ver,null,payload); } - public DOMMessage(SOAPVersion ver, HeaderList headers, Element payload) { + public DOMMessage(SOAPVersion ver, MessageHeaders headers, Element payload) { this(ver,headers,payload,null); } - public DOMMessage(SOAPVersion ver, HeaderList headers, Element payload, AttachmentSet attachments) { + public DOMMessage(SOAPVersion ver, MessageHeaders headers, Element payload, AttachmentSet attachments) { super(ver); this.headers = headers; this.payload = payload; @@ -82,12 +83,12 @@ } public boolean hasHeaders() { - return getHeaders().size() > 0; + return getHeaders().hasHeaders(); } - public HeaderList getHeaders() { + public MessageHeaders getHeaders() { if (headers == null) - headers = new HeaderList(); + headers = new HeaderList(getSOAPVersion()); return headers; } @@ -151,4 +152,5 @@ public Message copy() { return new DOMMessage(this); } + } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java 2013-04-04 15:30:11.652615639 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java 2013-04-04 15:30:11.604615638 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +48,10 @@ private final DataHandler dh; private final String contentId; + String contentIdNoAngleBracket; /** - * This will be constructed by {@link AttachmentMarshallerImpl} + * This will be constructed by {@link com.sun.xml.internal.ws.message.jaxb.AttachmentMarshallerImpl} */ public DataHandlerAttachment(@NotNull String contentId, @NotNull DataHandler dh) { this.dh = dh; @@ -58,7 +59,13 @@ } public String getContentId() { - return contentId; +// return contentId; + if (contentIdNoAngleBracket == null) { + contentIdNoAngleBracket = contentId; + if (contentIdNoAngleBracket != null && contentIdNoAngleBracket.charAt(0) == '<') + contentIdNoAngleBracket = contentIdNoAngleBracket.substring(1, contentIdNoAngleBracket.length()-1); + } + return contentIdNoAngleBracket; } public String getContentType() { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java 2013-04-04 15:30:11.860615642 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java 2013-04-04 15:30:11.804615641 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,15 +28,14 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.message.AttachmentSet; -import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; + import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; @@ -53,19 +52,19 @@ * If a message has no payload, it's more likely to have * some header, so we create it eagerly here. */ - private final HeaderList headers; + private final MessageHeaders headers; private final AttachmentSet attachmentSet; public EmptyMessageImpl(SOAPVersion version) { super(version); - this.headers = new HeaderList(); + this.headers = new HeaderList(version); this.attachmentSet = new AttachmentSetImpl(); } - public EmptyMessageImpl(HeaderList headers, @NotNull AttachmentSet attachmentSet, SOAPVersion version){ + public EmptyMessageImpl(MessageHeaders headers, @NotNull AttachmentSet attachmentSet, SOAPVersion version){ super(version); if(headers==null) - headers = new HeaderList(); + headers = new HeaderList(version); this.attachmentSet = attachmentSet; this.headers = headers; } @@ -80,10 +79,10 @@ } public boolean hasHeaders() { - return !headers.isEmpty(); + return headers.hasHeaders(); } - public HeaderList getHeaders() { + public MessageHeaders getHeaders() { return headers; } @@ -118,4 +117,5 @@ public Message copy() { return new EmptyMessageImpl(this); } + } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/FaultDetailHeader.java 2013-04-04 15:30:12.160615647 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/FaultDetailHeader.java 2013-04-04 15:30:12.108615645 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/FaultMessage.java 2013-04-04 15:30:12.464615651 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/FaultMessage.java 2013-04-04 15:30:12.400615650 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/JAXBAttachment.java 2013-04-04 15:30:12.772615656 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/JAXBAttachment.java 2013-04-04 15:30:12.712615655 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,7 +28,6 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.message.Attachment; import com.sun.xml.internal.ws.spi.db.XMLBridge; -import com.sun.xml.internal.ws.util.ASCIIUtility; import com.sun.xml.internal.ws.util.ByteArrayBuffer; import com.sun.xml.internal.ws.encoding.DataSourceStreamingDataHandler; @@ -62,14 +61,17 @@ this.mimeType = mimeType; } + @Override public String getContentId() { return contentId; } + @Override public String getContentType() { return mimeType; } + @Override public byte[] asByteArray() { ByteArrayBuffer bab = new ByteArrayBuffer(); try { @@ -80,14 +82,17 @@ return bab.getRawData(); } + @Override public DataHandler asDataHandler() { return new DataSourceStreamingDataHandler(this); } + @Override public Source asSource() { return new StreamSource(asInputStream()); } + @Override public InputStream asInputStream() { ByteArrayBuffer bab = new ByteArrayBuffer(); try { @@ -98,6 +103,7 @@ return bab.newInputStream(); } + @Override public void writeTo(OutputStream os) throws IOException { try { bridge.marshal(jaxbObject, os, null, null); @@ -106,6 +112,7 @@ } } + @Override public void writeTo(SOAPMessage saaj) throws SOAPException { AttachmentPart part = saaj.createAttachmentPart(); part.setDataHandler(asDataHandler()); @@ -113,14 +120,17 @@ saaj.addAttachmentPart(part); } + @Override public InputStream getInputStream() throws IOException { return asInputStream(); } + @Override public OutputStream getOutputStream() throws IOException { throw new UnsupportedOperationException(); } + @Override public String getName() { return null; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java 2013-04-04 15:30:13.080615661 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java 2013-04-04 15:30:13.020615659 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/PayloadElementSniffer.java 2013-04-04 15:30:13.392615665 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/PayloadElementSniffer.java 2013-04-04 15:30:13.344615664 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/ProblemActionHeader.java 2013-04-04 15:30:13.676615670 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/ProblemActionHeader.java 2013-04-04 15:30:13.624615669 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/RelatesToHeader.java 2013-04-04 15:30:13.988615675 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/RelatesToHeader.java 2013-04-04 15:30:13.928615674 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/RootElementSniffer.java 2013-04-04 15:30:14.260615679 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/RootElementSniffer.java 2013-04-04 15:30:14.204615678 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/StringHeader.java 2013-04-04 15:30:14.572615684 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/StringHeader.java 2013-04-04 15:30:14.512615683 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/Util.java 2013-04-04 15:30:14.860615689 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/Util.java 2013-04-04 15:30:14.804615687 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/XMLReaderImpl.java 2013-04-04 15:30:15.164615693 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/XMLReaderImpl.java 2013-04-04 15:30:15.108615692 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java 2013-04-04 15:30:15.484615698 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java 2013-04-04 15:30:15.420615697 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,9 +25,9 @@ package com.sun.xml.internal.ws.message.jaxb; +import com.sun.istack.internal.logging.Logger; import com.sun.xml.internal.ws.api.message.Attachment; import com.sun.xml.internal.ws.api.message.AttachmentSet; -import com.sun.xml.internal.ws.message.AttachmentSetImpl; import com.sun.xml.internal.ws.message.DataHandlerAttachment; import javax.activation.DataHandler; @@ -39,6 +39,7 @@ import java.net.URISyntaxException; import java.net.URLEncoder; import java.util.UUID; +import java.util.logging.Level; /** * Implementation of {@link AttachmentMarshaller}, its used from JAXBMessage to marshall swaref type @@ -47,6 +48,9 @@ * @see JAXBMessage */ final class AttachmentMarshallerImpl extends AttachmentMarshaller { + + private static final Logger LOGGER = Logger.getLogger(AttachmentMarshallerImpl.class); + private AttachmentSet attachments; public AttachmentMarshallerImpl(AttachmentSet attachemnts) { @@ -60,16 +64,19 @@ attachments = null; } + @Override public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) { // We don't use JAXB for handling XOP throw new IllegalStateException(); } + @Override public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) { // We don't use JAXB for handling XOP throw new IllegalStateException(); } + @Override public String addSwaRefAttachment(DataHandler data) { String cid = encodeCid(null); Attachment att = new DataHandlerAttachment(cid, data); @@ -86,7 +93,9 @@ URI uri = new URI(ns); cid = uri.toURL().getHost(); } catch (URISyntaxException e) { - e.printStackTrace(); + if (LOGGER.isLoggable(Level.INFO)) { + LOGGER.log(Level.INFO, null, e); + } return null; } catch (MalformedURLException e) { try { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBBridgeSource.java 2013-04-04 15:30:15.772615702 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBBridgeSource.java 2013-04-04 15:30:15.716615702 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBDispatchMessage.java 2013-04-04 15:30:16.008615706 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBDispatchMessage.java 2013-04-04 15:30:15.956615706 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,8 +26,8 @@ package com.sun.xml.internal.ws.message.jaxb; import com.sun.xml.internal.ws.api.SOAPVersion; -import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.encoding.SOAPBindingCodec; import com.sun.xml.internal.ws.message.AbstractMessageImpl; import com.sun.xml.internal.ws.message.PayloadElementSniffer; @@ -114,7 +114,7 @@ } @Override - public HeaderList getHeaders() { + public MessageHeaders getHeaders() { return null; } @@ -194,7 +194,7 @@ String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer - OutputStream os = XMLStreamWriterUtil.getOutputStream(sw); + OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); @@ -207,7 +207,7 @@ } else { - if (os != null && bridge.supportOutputStream() && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { + if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java 2013-04-04 15:30:16.256615710 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java 2013-04-04 15:30:16.208615710 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -181,8 +181,8 @@ String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer - OutputStream os = XMLStreamWriterUtil.getOutputStream(sw); - if (os != null && bridge.supportOutputStream() && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { + OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; + if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null); } else { bridge.marshal(jaxbObject,sw, null); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java 2013-04-04 15:30:16.504615714 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java 2013-04-04 15:30:16.456615713 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -33,6 +33,7 @@ import com.sun.xml.internal.ws.api.message.AttachmentSet; import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.encoding.SOAPBindingCodec; import com.sun.xml.internal.ws.message.AbstractMessageImpl; import com.sun.xml.internal.ws.message.AttachmentSetImpl; @@ -71,7 +72,7 @@ * @author Kohsuke Kawaguchi */ public final class JAXBMessage extends AbstractMessageImpl { - private HeaderList headers; + private MessageHeaders headers; /** * The JAXB object that represents the payload. @@ -99,7 +100,7 @@ */ private XMLStreamBuffer infoset; - public static Message create(BindingContext context, Object jaxbObject, SOAPVersion soapVersion, HeaderList headers, AttachmentSet attachments) { + public static Message create(BindingContext context, Object jaxbObject, SOAPVersion soapVersion, MessageHeaders headers, AttachmentSet attachments) { if(!context.hasSwaRef()) { return new JAXBMessage(context,jaxbObject,soapVersion,headers,attachments); } @@ -155,7 +156,7 @@ return new JAXBMessage(context,jaxbObject,soapVersion,null,null); } - private JAXBMessage( BindingContext context, Object jaxbObject, SOAPVersion soapVer, HeaderList headers, AttachmentSet attachments ) { + private JAXBMessage( BindingContext context, Object jaxbObject, SOAPVersion soapVer, MessageHeaders headers, AttachmentSet attachments ) { super(soapVer); // this.bridge = new MarshallerBridge(context); this.bridge = context.createFragmentBridge(); @@ -165,7 +166,7 @@ this.attachmentSet = attachments; } - private JAXBMessage( JAXBContext rawContext, Object jaxbObject, SOAPVersion soapVer, HeaderList headers, AttachmentSet attachments ) { + private JAXBMessage( JAXBContext rawContext, Object jaxbObject, SOAPVersion soapVer, MessageHeaders headers, AttachmentSet attachments ) { super(soapVer); // this.bridge = new MarshallerBridge(context); this.rawContext = rawContext; @@ -235,28 +236,33 @@ this.rawContext = that.rawContext; } + @Override public boolean hasHeaders() { - return headers!=null && !headers.isEmpty(); + return headers!=null && headers.hasHeaders(); } - public HeaderList getHeaders() { + @Override + public MessageHeaders getHeaders() { if(headers==null) - headers = new HeaderList(); + headers = new HeaderList(getSOAPVersion()); return headers; } + @Override public String getPayloadLocalPart() { if(localName==null) sniff(); return localName; } + @Override public String getPayloadNamespaceURI() { if(nsUri==null) sniff(); return nsUri; } + @Override public boolean hasPayload() { return true; } @@ -285,10 +291,12 @@ } } + @Override public Source readPayloadAsSource() { return new JAXBBridgeSource(bridge,jaxbObject); } + @Override public T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException { JAXBResult out = new JAXBResult(unmarshaller); // since the bridge only produces fragments, we need to fire start/end document. @@ -307,6 +315,7 @@ return (T)out.getResult(); } + @Override public XMLStreamReader readPayload() throws XMLStreamException { try { if(infoset==null) { @@ -332,6 +341,7 @@ /** * Writes the payload as SAX events. */ + @Override protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException { try { if(fragment) @@ -353,6 +363,7 @@ } } + @Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller @@ -364,7 +375,7 @@ String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer - OutputStream os = XMLStreamWriterUtil.getOutputStream(sw); + OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); @@ -374,7 +385,7 @@ else m.marshal(jaxbObject, sw); } else { - if (os != null && bridge.supportOutputStream() && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { + if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); @@ -388,6 +399,7 @@ } } + @Override public Message copy() { return new JAXBMessage(this); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java 2013-04-04 15:30:16.788615719 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java 2013-04-04 15:30:16.736615717 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/package-info.java 2013-04-04 15:30:17.044615723 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/jaxb/package-info.java 2013-04-04 15:30:16.988615721 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/package-info.java 2013-04-04 15:30:17.348615727 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/package-info.java 2013-04-04 15:30:17.292615726 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -24,7 +24,7 @@ */ /** - * {@link Message} implementations. + * {@link com.sun.xml.internal.ws.api.message.Message} implementations. */ package com.sun.xml.internal.ws.message; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/saaj/SAAJHeader.java 2013-04-04 15:30:17.652615732 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/saaj/SAAJHeader.java 2013-04-04 15:30:17.592615731 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java 2013-04-04 15:30:17.952615736 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java 2013-04-04 15:30:17.888615735 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,10 @@ package com.sun.xml.internal.ws.message.saaj; +import com.sun.istack.internal.FragmentContentHandler; import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.XMLStreamException2; import com.sun.istack.internal.Nullable; -import com.sun.istack.internal.FragmentContentHandler; +import com.sun.istack.internal.XMLStreamException2; import com.sun.xml.internal.bind.api.Bridge; import com.sun.xml.internal.bind.unmarshaller.DOMScanner; import com.sun.xml.internal.ws.api.SOAPVersion; @@ -36,11 +36,12 @@ import com.sun.xml.internal.ws.message.AttachmentUnmarshallerImpl; import com.sun.xml.internal.ws.spi.db.XMLBridge; import com.sun.xml.internal.ws.streaming.DOMStreamReader; +import com.sun.xml.internal.ws.util.ASCIIUtility; import com.sun.xml.internal.ws.util.DOMUtil; +import org.w3c.dom.Attr; import org.w3c.dom.Element; -import org.w3c.dom.Node; import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Attr; +import org.w3c.dom.Node; import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; @@ -50,13 +51,7 @@ import javax.activation.DataHandler; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; -import javax.xml.soap.AttachmentPart; -import javax.xml.soap.SOAPBody; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPHeader; -import javax.xml.soap.SOAPHeaderElement; -import javax.xml.soap.SOAPMessage; +import javax.xml.soap.*; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; @@ -85,7 +80,7 @@ private boolean accessedMessage; private final SOAPMessage sm; - private HeaderList headers; + private MessageHeaders headers; private List bodyParts; private Element payload; @@ -107,11 +102,11 @@ * @param headers * @param sm */ - private SAAJMessage(HeaderList headers, AttachmentSet as, SOAPMessage sm) { + private SAAJMessage(MessageHeaders headers, AttachmentSet as, SOAPMessage sm, SOAPVersion version) { this.sm = sm; this.parse(); if(headers == null) - headers = new HeaderList(); + headers = new HeaderList(version); this.headers = headers; this.attachmentSet = as; } @@ -121,7 +116,7 @@ try { access(); if (headers == null) - headers = new HeaderList(); + headers = new HeaderList(getSOAPVersion()); SOAPHeader header = sm.getSOAPHeader(); if (header != null) { headerAttrs = header.getAttributes(); @@ -139,7 +134,7 @@ } } - private void access() { + protected void access() { if (!accessedMessage) { try { envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes(); @@ -166,13 +161,14 @@ public boolean hasHeaders() { parse(); - return headers.size() > 0; + return headers.hasHeaders(); } - public @NotNull HeaderList getHeaders() { + public @NotNull MessageHeaders getHeaders() { parse(); return headers; } + /** * Gets the attachments of this message * (attachments live outside a message.) @@ -247,7 +243,7 @@ newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); - for (Header header : headers) { + for (Header header : headers.asList()) { header.writeTo(msg); } SOAPEnvelope se = msg.getSOAPPart().getEnvelope(); @@ -271,7 +267,7 @@ newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); - for (Header header : headers) { + for (Header header : headers.asList()) { header.writeTo(msg); } for (Attachment att : getAttachments()) { @@ -366,9 +362,8 @@ } else { writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI()); } - int len = headers.size(); - for (int i = 0; i < len; i++) { - headers.get(i).writeTo(writer); + for (Header h : headers.asList()) { + h.writeTo(writer); } writer.writeEndElement(); } @@ -399,11 +394,9 @@ if (hasHeaders()) { startPrefixMapping(contentHandler, headerAttrs,"S"); contentHandler.startElement(soapNsUri, "Header", "S:Header", getAttributes(headerAttrs)); - HeaderList headers = getHeaders(); - int len = headers.size(); - for (int i = 0; i < len; i++) { - // shouldn't JDK be smart enough to use array-style indexing for this foreach!? - headers.get(i).writeTo(contentHandler, errorHandler); + MessageHeaders headers = getHeaders(); + for (Header h : headers.asList()) { + h.writeTo(contentHandler, errorHandler); } endPrefixMapping(contentHandler, headerAttrs,"S"); contentHandler.endElement(soapNsUri, "Header", "S:Header"); @@ -520,7 +513,7 @@ newBody.appendChild(n); } addAttributes(newBody, bodyAttrs); - return new SAAJMessage(getHeaders(), getAttachments(), msg); + return new SAAJMessage(getHeaders(), getAttachments(), msg, soapVersion); } } catch (SOAPException e) { throw new WebServiceException(e); @@ -529,10 +522,12 @@ private static final AttributesImpl EMPTY_ATTS = new AttributesImpl(); private static final LocatorImpl NULL_LOCATOR = new LocatorImpl(); - private class SAAJAttachment implements AttachmentEx { + private static class SAAJAttachment implements AttachmentEx { final AttachmentPart ap; + String contentIdNoAngleBracket; + public SAAJAttachment(AttachmentPart part) { this.ap = part; } @@ -541,7 +536,12 @@ * Content ID of the attachment. Uniquely identifies an attachment. */ public String getContentId() { - return ap.getContentId(); + if (contentIdNoAngleBracket == null) { + contentIdNoAngleBracket = ap.getContentId(); + if (contentIdNoAngleBracket != null && contentIdNoAngleBracket.charAt(0) == '<') + contentIdNoAngleBracket = contentIdNoAngleBracket.substring(1, contentIdNoAngleBracket.length()-1); + } + return contentIdNoAngleBracket; } /** @@ -600,7 +600,11 @@ * Writes the contents of the attachment into the given stream. */ public void writeTo(OutputStream os) throws IOException { - os.write(asByteArray()); + try { + ASCIIUtility.copyStream(ap.getRawContent(), os); + } catch (SOAPException e) { + throw new WebServiceException(e); + } } /** @@ -647,7 +651,7 @@ * SAAJ wants '<' and '>' for the content ID, but {@link AttachmentSet} * doesn't. S this class also does the conversion between them. */ - private class SAAJAttachmentSet implements AttachmentSet { + private static class SAAJAttachmentSet implements AttachmentSet { private Map attMap; private Iterator attIter; @@ -708,4 +712,7 @@ } } + public SOAPVersion getSOAPVersion() { + return soapVersion; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java 2013-04-04 15:30:18.268615742 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java 2013-04-04 15:30:18.212615740 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,6 +31,7 @@ import com.sun.xml.internal.ws.api.message.AttachmentSet; import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.message.AttachmentSetImpl; import com.sun.xml.internal.ws.message.stream.PayloadStreamReaderMessage; import com.sun.xml.internal.ws.streaming.SourceReaderFactory; @@ -44,7 +45,7 @@ */ public class PayloadSourceMessage extends PayloadStreamReaderMessage { - public PayloadSourceMessage(@Nullable HeaderList headers, + public PayloadSourceMessage(@Nullable MessageHeaders headers, @NotNull Source payload, @NotNull AttachmentSet attSet, @NotNull SOAPVersion soapVersion) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/source/ProtocolSourceMessage.java 2013-04-04 15:30:18.576615746 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/source/ProtocolSourceMessage.java 2013-04-04 15:30:18.516615745 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,8 +29,8 @@ import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.pipe.Codecs; import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec; -import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.spi.db.XMLBridge; import com.sun.xml.internal.ws.streaming.SourceReaderFactory; @@ -69,10 +69,6 @@ return sm.hasHeaders(); } - public HeaderList getHeaders() { - return sm.getHeaders(); - } - public String getPayloadLocalPart() { return sm.getPayloadLocalPart(); } @@ -131,4 +127,13 @@ public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException { sm.writeTo(contentHandler, errorHandler); } + + public SOAPVersion getSOAPVersion() { + return sm.getSOAPVersion(); + } + + @Override + public MessageHeaders getHeaders() { + return sm.getHeaders(); + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/source/SourceUtils.java 2013-04-04 15:30:18.880615751 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/source/SourceUtils.java 2013-04-04 15:30:18.824615750 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 @@ int srcType; - private final int domSource = 1; - private final int streamSource = 2; - private final int saxSource=4; + private static final int domSource = 1; + private static final int streamSource = 2; + private static final int saxSource=4; public SourceUtils(Source src) { if(src instanceof StreamSource){ @@ -95,8 +95,8 @@ String namespaceUri = null; if(isDOMSource()){ - DOMSource domSource = (DOMSource)src; - Node n = domSource.getNode(); + DOMSource domSrc = (DOMSource)src; + Node n = domSrc.getNode(); if(n.getNodeType()== Node.DOCUMENT_NODE) { n = ((Document)n).getDocumentElement(); } @@ -146,15 +146,16 @@ writer.writeStartElement(uri, localName); } } else { - assert uri != null; +// assert uri != null; if(prefix.length() > 0){ /** * Before we write the */ String writerURI = null; - if (writer.getNamespaceContext() != null) + if (writer.getNamespaceContext() != null) { writerURI = writer.getNamespaceContext().getNamespaceURI(prefix); + } String writerPrefix = writer.getPrefix(uri); if(declarePrefix(prefix, uri, writerPrefix, writerURI)){ writer.writeStartElement(prefix, localName, uri); @@ -172,11 +173,14 @@ // Write namespace declarations for (int i = 0; i < n; i++) { String nsPrefix = reader.getNamespacePrefix(i); - if (nsPrefix == null) nsPrefix = ""; + if (nsPrefix == null) { + nsPrefix = ""; + } // StAX returns null for default ns String writerURI = null; - if (writer.getNamespaceContext() != null) + if (writer.getNamespaceContext() != null) { writerURI = writer.getNamespaceContext().getNamespaceURI(nsPrefix); + } // Zephyr: Why is this returning null? // Compare nsPrefix with prefix because of [1] (above) @@ -215,6 +219,9 @@ break; case XMLStreamConstants.CHARACTERS: writer.writeCharacters(reader.getText()); + break; + default: + break; } } while (state != XMLStreamConstants.END_DOCUMENT); reader.close(); @@ -228,8 +235,9 @@ */ private static void setUndeclaredPrefix(String prefix, String readerURI, XMLStreamWriter writer) throws XMLStreamException { String writerURI = null; - if (writer.getNamespaceContext() != null) + if (writer.getNamespaceContext() != null) { writerURI = writer.getNamespaceContext().getNamespaceURI(prefix); + } if (writerURI == null) { writer.setPrefix(prefix, readerURI != null ? readerURI : ""); @@ -246,8 +254,9 @@ */ private static boolean declarePrefix(String rPrefix, String rUri, String wPrefix, String wUri){ if (wUri == null ||((wPrefix != null) && !rPrefix.equals(wPrefix))|| - (rUri != null && !wUri.equals(rUri))) + (rUri != null && !wUri.equals(rUri))) { return true; + } return false; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/OutboundStreamHeader.java 2013-04-04 15:30:19.204615756 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/OutboundStreamHeader.java 2013-04-04 15:30:19.144615755 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java 2013-04-04 15:30:19.480615760 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java 2013-04-04 15:30:19.424615760 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,8 +27,8 @@ import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.message.AttachmentSet; -import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.message.AbstractMessageImpl; import com.sun.xml.internal.ws.message.AttachmentSetImpl; import com.sun.istack.internal.Nullable; @@ -56,7 +56,7 @@ this(null, reader,new AttachmentSetImpl(), soapVer); } - public PayloadStreamReaderMessage(@Nullable HeaderList headers, @NotNull XMLStreamReader reader, + public PayloadStreamReaderMessage(@Nullable MessageHeaders headers, @NotNull XMLStreamReader reader, @NotNull AttachmentSet attSet, @NotNull SOAPVersion soapVersion) { super(soapVersion); message = new StreamMessage(headers, attSet, reader, soapVersion); @@ -66,10 +66,6 @@ return message.hasHeaders(); } - public HeaderList getHeaders() { - return message.getHeaders(); - } - public AttachmentSet getAttachments() { return message.getAttachments(); } @@ -113,4 +109,9 @@ public Message copy() { return message.copy(); } + + @Override + public @NotNull MessageHeaders getHeaders() { + return message.getHeaders(); + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java 2013-04-04 15:30:19.772615765 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java 2013-04-04 15:30:19.720615764 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java 2013-04-04 15:30:20.064615770 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java 2013-04-04 15:30:20.004615769 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -34,6 +34,7 @@ import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.message.AbstractHeaderImpl; +import com.sun.xml.internal.ws.util.xml.XmlUtil; import org.w3c.dom.Node; import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; @@ -193,7 +194,7 @@ // TODO what about in-scope namespaces // Not very efficient consider implementing a stream buffer // processor that produces a DOM node from the buffer. - TransformerFactory tf = TransformerFactory.newInstance(); + TransformerFactory tf = XmlUtil.newTransformerFactory(); Transformer t = tf.newTransformer(); XMLStreamBufferSource source = new XMLStreamBufferSource(_mark); DOMResult result = new DOMResult(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java 2013-04-04 15:30:20.356615774 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java 2013-04-04 15:30:20.300615773 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java 2013-04-04 15:30:20.668615778 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java 2013-04-04 15:30:20.608615778 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java 2013-04-04 15:30:20.980615784 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java 2013-04-04 15:30:20.920615782 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -36,6 +36,7 @@ import com.sun.xml.internal.ws.api.message.Header; import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.encoding.TagInfoset; import com.sun.xml.internal.ws.message.AbstractMessageImpl; @@ -69,7 +70,7 @@ * TODO: we need another message class that keeps {@link XMLStreamReader} that points * at the start of the envelope element. */ -public final class StreamMessage extends AbstractMessageImpl { +public class StreamMessage extends AbstractMessageImpl { /** * The reader will be positioned at * the first child of the SOAP body @@ -77,7 +78,7 @@ private @NotNull XMLStreamReader reader; // lazily created - private @Nullable HeaderList headers; + private @Nullable MessageHeaders headers; /** * Because the StreamMessage leaves out the white spaces around payload @@ -123,12 +124,17 @@ create(SOAPVersion.SOAP_12); } + public StreamMessage(SOAPVersion v) { + super(v); + payloadLocalName = null; + payloadNamespaceURI = null; + } /** * Creates a {@link StreamMessage} from a {@link XMLStreamReader} * that points at the start element of the payload, and headers. * *

    - * This method creaets a {@link Message} from a payload. + * This method creates a {@link Message} from a payload. * * @param headers * if null, it means no headers. if non-null, @@ -137,7 +143,7 @@ * points at the start element/document of the payload (or the end element of the <s:Body> * if there's no payload) */ - public StreamMessage(@Nullable HeaderList headers, @NotNull AttachmentSet attachmentSet, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) { + public StreamMessage(@Nullable MessageHeaders headers, @NotNull AttachmentSet attachmentSet, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) { super(soapVersion); this.headers = headers; this.attachmentSet = attachmentSet; @@ -177,18 +183,18 @@ * and the complete infoset of the SOAP envelope. * *

    - * See {@link #StreamMessage(HeaderList, AttachmentSet, XMLStreamReader, SOAPVersion)} for + * See {@link #StreamMessage(MessageHeaders, AttachmentSet, XMLStreamReader, SOAPVersion)} for * the description of the basic parameters. * * @param headerTag * Null if the message didn't have a header tag. * */ - public StreamMessage(@NotNull TagInfoset envelopeTag, @Nullable TagInfoset headerTag, @NotNull AttachmentSet attachmentSet, @Nullable HeaderList headers, @NotNull TagInfoset bodyTag, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) { + public StreamMessage(@NotNull TagInfoset envelopeTag, @Nullable TagInfoset headerTag, @NotNull AttachmentSet attachmentSet, @Nullable MessageHeaders headers, @NotNull TagInfoset bodyTag, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) { this(envelopeTag, headerTag, attachmentSet, headers, null, bodyTag, null, reader, soapVersion); } - public StreamMessage(@NotNull TagInfoset envelopeTag, @Nullable TagInfoset headerTag, @NotNull AttachmentSet attachmentSet, @Nullable HeaderList headers, @Nullable String bodyPrologue, @NotNull TagInfoset bodyTag, @Nullable String bodyEpilogue, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) { + public StreamMessage(@NotNull TagInfoset envelopeTag, @Nullable TagInfoset headerTag, @NotNull AttachmentSet attachmentSet, @Nullable MessageHeaders headers, @Nullable String bodyPrologue, @NotNull TagInfoset bodyTag, @Nullable String bodyEpilogue, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) { this(headers,attachmentSet,reader,soapVersion); if(envelopeTag == null ) { throw new IllegalArgumentException("EnvelopeTag TagInfoset cannot be null"); @@ -205,12 +211,12 @@ } public boolean hasHeaders() { - return headers!=null && !headers.isEmpty(); + return headers!=null && headers.hasHeaders(); } - public HeaderList getHeaders() { + public MessageHeaders getHeaders() { if (headers == null) { - headers = new HeaderList(); + headers = new HeaderList(getSOAPVersion()); } return headers; } @@ -384,10 +390,10 @@ envelopeTag.writeStart(writer); //write headers - HeaderList hl = getHeaders(); - if(hl.size() > 0){ + MessageHeaders hl = getHeaders(); + if(hl.hasHeaders()){ headerTag.writeStart(writer); - for(Header h:hl){ + for(Header h : hl.asList()){ h.writeTo(writer); } writer.writeEndElement(); @@ -523,11 +529,10 @@ envelopeTag.writeStart(contentHandler); headerTag.writeStart(contentHandler); if(hasHeaders()) { - HeaderList headers = getHeaders(); - int len = headers.size(); - for( int i=0; iJAXBRIContext * @deprecated */ + @Override public JAXBContext getJAXBContext() { JAXBContext jc = bindingContext.getJAXBContext(); - if (jc != null) return jc; - if (jaxbContext == null && jc instanceof JAXBRIContext) jaxbContext = (JAXBRIContext) bindingContext.getJAXBContext(); + if (jc != null) { + return jc; + } return jaxbContext; } @@ -162,8 +166,9 @@ final List cls = new ArrayList(types.size() + additionalClasses.size()); cls.addAll(additionalClasses); - for (TypeInfo type : types) + for (TypeInfo type : types) { cls.add((Class) type.type); + } try { //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false); @@ -171,21 +176,21 @@ bindingContext = AccessController.doPrivileged(new PrivilegedExceptionAction() { public BindingContext run() throws Exception { if(LOGGER.isLoggable(Level.FINEST)) { - LOGGER.log(Level.FINEST,"Creating JAXBContext with classes="+cls+" and types="+types); + LOGGER.log(Level.FINEST, "Creating JAXBContext with classes={0} and types={1}", new Object[]{cls, types}); } UsesJAXBContextFeature f = features.get(UsesJAXBContextFeature.class); - DatabindingModeFeature dbf = features.get(DatabindingModeFeature.class); + com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf = + features.get(com.oracle.webservices.internal.api.databinding.DatabindingModeFeature.class); JAXBContextFactory factory = f!=null ? f.getFactory() : null; if(factory==null) factory=JAXBContextFactory.DEFAULT; // return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types); databindingInfo.properties().put(JAXBContextFactory.class.getName(), factory); - if (dbf != null) { + if (dmf != null) { if (LOGGER.isLoggable(Level.FINE)) - LOGGER.fine("DatabindingModeFeature in SEI specifies mode: " - + dbf.getMode()); - databindingInfo.setDatabindingMode(dbf + LOGGER.log(Level.FINE, "DatabindingModeFeature in SEI specifies mode: {0}", dmf.getMode()); + databindingInfo.setDatabindingMode(dmf .getMode()); } @@ -194,7 +199,7 @@ databindingInfo.contentClasses().addAll(cls); databindingInfo.typeInfos().addAll(types); databindingInfo.properties().put("c14nSupport", Boolean.FALSE); - databindingInfo.setDefaultNamespace(AbstractSEIModelImpl.this.getTargetNamespace()); + databindingInfo.setDefaultNamespace(AbstractSEIModelImpl.this.getDefaultSchemaNamespace()); BindingContext bc = BindingContextFactory.create(databindingInfo); if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, @@ -325,7 +330,7 @@ } /** - * Applies binding related information to the RpcLitPayload. The payload map is populated correctl + * Applies binding related information to the RpcLitPayload. The payload map is populated correctly * @return * Returns attachment parameters if/any. */ @@ -443,6 +448,15 @@ return targetNamespace; } + String getDefaultSchemaNamespace() { + String defaultNamespace = getTargetNamespace(); + if (defaultSchemaNamespaceSuffix == null) return defaultNamespace; + if (!defaultNamespace.endsWith("/")) { + defaultNamespace += "/"; + } + return (defaultNamespace + defaultSchemaNamespaceSuffix); + } + @NotNull public QName getBoundPortTypeName() { assert portName != null; @@ -515,5 +529,6 @@ protected ClassLoader classLoader = null; protected WSBinding wsBinding; protected BindingInfo databindingInfo; + protected String defaultSchemaNamespaceSuffix; private static final Logger LOGGER = Logger.getLogger(AbstractSEIModelImpl.class.getName()); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/AbstractWrapperBeanGenerator.java 2013-04-04 15:30:21.536615792 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/AbstractWrapperBeanGenerator.java 2013-04-04 15:30:21.484615791 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -298,8 +298,29 @@ * @return list of properties in the correct order for an exception bean */ public Collection collectExceptionBeanMembers(C exception) { + return collectExceptionBeanMembers(exception, true); + } + + /** + * Computes and sorts exception bean members for a given exception as per + * the 3.7 section of the spec. It takes all getter properties in the + * exception and its superclasses(except getCause, getLocalizedMessage, + * getStackTrace, getClass). The returned collection is sorted based + * on the property names. + * + *

    + * But if the exception has @XmlType its values are honored. Only the + * propOrder properties are considered. The returned collection is sorted + * as per the given propOrder. + * + * @param exception + * @param decapitalize if true, all the property names are decapitalized + * + * @return list of properties in the correct order for an exception bean + */ + public Collection collectExceptionBeanMembers(C exception, boolean decapitalize ) { TreeMap fields = new TreeMap(); - getExceptionProperties(exception, fields); + getExceptionProperties(exception, fields, decapitalize); // Consider only the @XmlType(propOrder) properties XmlType xmlType = annReader.getClassAnnotation(XmlType.class, exception, null); @@ -325,10 +346,10 @@ } - private void getExceptionProperties(C exception, TreeMap fields) { + private void getExceptionProperties(C exception, TreeMap fields, boolean decapitalize) { C sc = nav.getSuperClass(exception); if (sc != null) { - getExceptionProperties(sc, fields); + getExceptionProperties(sc, fields, decapitalize); } Collection methods = nav.getDeclaredMethods(exception); @@ -355,9 +376,8 @@ T returnType = getSafeType(nav.getReturnType(method)); if (nav.getMethodParameters(method).length == 0) { - String fieldName = name.startsWith("get") - ? StringUtils.decapitalize(name.substring(3)) - : StringUtils.decapitalize(name.substring(2)); + String fieldName = name.startsWith("get") ? name.substring(3) : name.substring(2); + if (decapitalize) fieldName = StringUtils.decapitalize(fieldName); fields.put(fieldName, factory.createWrapperBeanMember(returnType, fieldName, Collections.emptyList())); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java 2013-04-04 15:30:21.816615797 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java 2013-04-04 15:30:21.752615796 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/FieldSignature.java 2013-04-04 15:30:22.044615800 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/FieldSignature.java 2013-04-04 15:30:21.996615800 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 +112,11 @@ } private static String args(ParameterizedType p) { - String sig = "<"; + StringBuilder sig = new StringBuilder("<"); for(Type t : p.getActualTypeArguments()) { - sig += vms(t); + sig.append(vms(t)); } - return sig+">"; + return sig.append(">").toString(); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Injector.java 2013-04-04 15:30:22.244615803 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Injector.java 2013-04-04 15:30:22.192615802 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java 2013-04-04 15:30:22.460615807 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java 2013-04-04 15:30:22.412615806 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -106,7 +106,8 @@ inputAction = soapAction; else if(!inputAction.equals(soapAction)){ //both are explicitly set via annotations, make sure @Action == @WebMethod.action - throw new WebServiceException("@Action and @WebMethod(action=\"\" does not match on operation "+ method.getName()); + //http://java.net/jira/browse/JAX_WS-1108 + //throw new WebServiceException("@Action and @WebMethod(action=\"\" does not match on operation "+ method.getName()); } } } @@ -122,7 +123,7 @@ } /** - * @see {@link JavaMethod} + * @see JavaMethod * * @return Returns the method. */ @@ -131,7 +132,7 @@ } /** - * @see {@link JavaMethod} + * @see JavaMethod * * @return Returns the SEI method where annotations are present */ @@ -171,7 +172,7 @@ } /** - * Returns the {@link WSDLBoundOperation} Operation associated with {@link this} + * Returns the {@link WSDLBoundOperation} Operation associated with {@link JavaMethodImpl} * operation. * @deprecated * @return the WSDLBoundOperation for this JavaMethod --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ParameterImpl.java 2013-04-04 15:30:22.708615810 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ParameterImpl.java 2013-04-04 15:30:22.652615810 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +30,8 @@ import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.Parameter; import com.sun.xml.internal.ws.api.model.ParameterBinding; +import com.sun.xml.internal.ws.spi.db.RepeatedElementBridge; +import com.sun.xml.internal.ws.spi.db.WrapperComposite; import com.sun.xml.internal.ws.spi.db.XMLBridge; import com.sun.xml.internal.ws.spi.db.TypeInfo; @@ -65,6 +67,9 @@ private QName name; private final JavaMethodImpl parent; + WrapperParameter wrapper; + TypeInfo itemTypeInfo; + public ParameterImpl(JavaMethodImpl parent, TypeInfo type, Mode mode, int index) { assert type != null; @@ -94,6 +99,26 @@ return getOwner().getXMLBridge(typeInfo); } + public XMLBridge getInlinedRepeatedElementBridge() { + TypeInfo itemType = getItemType(); + if (itemType != null) { + XMLBridge xb = getOwner().getXMLBridge(itemType); + if (xb != null) return new RepeatedElementBridge(typeInfo, xb); + } + return null; + } + + public TypeInfo getItemType() { + if (itemTypeInfo != null) return itemTypeInfo; + //RpcLit cannot inline repeated element in wrapper + if (parent.getBinding().isRpcLit() || wrapper == null) return null; + //InlinedRepeatedElementBridge is only used for dynamic wrapper (no wrapper class) + if (!WrapperComposite.class.equals(wrapper.getTypeInfo().type)) return null; + if (!getBinding().isBody()) return null; + itemTypeInfo = typeInfo.getItemType(); + return itemTypeInfo; + } + /** @deprecated */ public Bridge getBridge() { return getOwner().getBridge(typeReference); @@ -118,7 +143,7 @@ /** * Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit - * @see AbstractSEIModelImpl#applyParameterBinding(com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl) + * @see AbstractSEIModelImpl#applyRpcLitParamBinding(JavaMethodImpl, WrapperParameter, WSDLBoundPortType, WebParam.Mode) * @deprecated */ void setTypeReference(TypeReference type){ @@ -229,6 +254,7 @@ } void fillTypes(List types) { - types.add(getTypeInfo()); + TypeInfo itemType = getItemType(); + types.add((itemType != null) ? itemType : getTypeInfo()); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ReflectAnnotationReader.java 2013-04-04 15:30:22.912615813 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ReflectAnnotationReader.java 2013-04-04 15:30:22.864615813 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModeler.java 2013-04-04 15:30:23.112615817 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModeler.java 2013-04-04 15:30:23.060615816 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,6 +26,7 @@ package com.sun.xml.internal.ws.model; import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; @@ -47,8 +48,8 @@ import com.sun.xml.internal.ws.spi.db.BindingHelper; import com.sun.xml.internal.ws.spi.db.TypeInfo; import com.sun.xml.internal.ws.spi.db.WrapperComposite; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.org.jvnet.ws.databinding.DatabindingMode; + +import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.getSoapVersion; import javax.jws.*; import javax.jws.WebParam.Mode; @@ -117,6 +118,9 @@ public static final Class REMOTE_EXCEPTION_CLASS = RemoteException.class; public static final Class RUNTIME_EXCEPTION_CLASS = RuntimeException.class; public static final Class EXCEPTION_CLASS = Exception.class; + public static final String DecapitalizeExceptionBeanProperties = "com.sun.xml.internal.ws.api.model.DecapitalizeExceptionBeanProperties"; + public static final String SuppressDocLitWrapperGeneration = "com.sun.xml.internal.ws.api.model.SuppressDocLitWrapperGeneration"; + public static final String DocWrappeeNamespapceQualified = "com.sun.xml.internal.ws.api.model.DocWrappeeNamespapceQualified"; /*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull BindingID bindingId, @NotNull WebServiceFeature... features) { this(portClass, serviceName, null, bindingId, features); @@ -151,6 +155,7 @@ this.config = config; this.wsBinding = config.getWSBinding(); metadataReader = config.getMetadataReader(); + targetNamespace = config.getMappingInfo().getTargetNamespace(); if (metadataReader == null) metadataReader = new ReflectAnnotationReader(); if (wsBinding != null) { this.bindingId = wsBinding.getBindingId(); @@ -159,21 +164,31 @@ this.features = WebServiceFeatureList.toList(wsBinding.getFeatures()); } else { this.bindingId = config.getMappingInfo().getBindingID(); + this.features = WebServiceFeatureList.toList(config.getFeatures()); if (binding != null) bindingId = binding.getBinding().getBindingId(); if (bindingId == null) bindingId = getDefaultBindingID(); - this.features = WebServiceFeatureList.toList(config.getFeatures()); if (!features.contains(MTOMFeature.class)) { MTOM mtomAn = getAnnotation(portClass, MTOM.class); if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn)); } + if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) { + com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class); + if (es != null) features.add(WebServiceFeatureList.getFeature(es)); + } this.wsBinding = bindingId.createBinding(features); } } private BindingID getDefaultBindingID() { BindingType bt = getAnnotation(portClass, BindingType.class); - String id = (bt != null) ? bt.value() : javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING; - return BindingID.parse(id); + if (bt != null) return BindingID.parse(bt.value()); + SOAPVersion ver = getSoapVersion(features); + boolean mtomEnabled = features.isEnabled(MTOMFeature.class); + if (SOAPVersion.SOAP_12.equals(ver)) { + return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP; + } else { + return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP; + } } /** @@ -295,12 +310,12 @@ // serviceName, portName); // } - if (portName == null) portName = getPortName(portClass, serviceName.getNamespaceURI(), metadataReader); + if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. - DatabindingMode dbm = getAnnotation(portClass, DatabindingMode.class); - if (dbm != null) model.databindingInfo.setDatabindingMode(dbm.value()); + com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); + if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) @@ -345,11 +360,17 @@ } } + private boolean noWrapperGen() { + Object o = config.properties().get(SuppressDocLitWrapperGeneration); + return (o!= null && o instanceof Boolean) ? ((Boolean) o) : false; + } + private Class getRequestWrapperClass(String className, Method method, QName reqElemName) { ClassLoader loader = (classLoader == null) ? Thread.currentThread().getContextClassLoader() : classLoader; try { return loader.loadClass(className); } catch (ClassNotFoundException e) { + if (noWrapperGen()) return WrapperComposite.class; logger.fine("Dynamically creating request wrapper Class " + className); return WrapperBeanGenerator.createRequestWrapperBean(className, method, reqElemName, loader); } @@ -360,6 +381,7 @@ try { return loader.loadClass(className); } catch (ClassNotFoundException e) { + if (noWrapperGen()) return WrapperComposite.class; logger.fine("Dynamically creating response wrapper bean Class " + className); return WrapperBeanGenerator.createResponseWrapperBean(className, method, resElemName, loader); } @@ -367,12 +389,15 @@ private Class getExceptionBeanClass(String className, Class exception, String name, String namespace) { + boolean decapitalizeExceptionBeanProperties = true; + Object o = config.properties().get(DecapitalizeExceptionBeanProperties); + if (o!= null && o instanceof Boolean) decapitalizeExceptionBeanProperties = (Boolean) o; ClassLoader loader = (classLoader == null) ? Thread.currentThread().getContextClassLoader() : classLoader; try { return loader.loadClass(className); } catch (ClassNotFoundException e) { logger.fine("Dynamically creating exception bean Class " + className); - return WrapperBeanGenerator.createExceptionBean(className, exception, targetNamespace, name, namespace, loader); + return WrapperBeanGenerator.createExceptionBean(className, exception, targetNamespace, name, namespace, loader, decapitalizeExceptionBeanProperties); } } @@ -417,6 +442,7 @@ targetNamespace = portTypeName.getNamespaceURI(); model.setPortTypeName(portTypeName); model.setTargetNamespace(targetNamespace); + model.defaultSchemaNamespaceSuffix = config.getMappingInfo().getDefaultSchemaNamespaceSuffix(); model.setWSDLLocation(webService.wsdlLocation()); SOAPBinding soapBinding = getAnnotation(clazz, SOAPBinding.class); @@ -580,8 +606,9 @@ * @param method the method to model */ private void processMethod(Method method) { - int mods = method.getModifiers(); +// int mods = method.getModifiers(); WebMethod webMethod = getAnnotation(method, WebMethod.class); + if (webMethod != null && webMethod.exclude()) return; /* validations are already done @@ -733,8 +760,9 @@ RequestWrapper reqWrapper = getAnnotation(method,RequestWrapper.class); ResponseWrapper resWrapper = getAnnotation(method,ResponseWrapper.class); String beanPackage = packageName + PD_JAXWS_PACKAGE_PD; - if (packageName == null || (packageName != null && packageName.length() == 0)) + if (packageName == null || packageName.length() == 0) { beanPackage = JAXWS_PACKAGE_PD; + } String requestClassName; if(reqWrapper != null && reqWrapper.className().length()>0){ requestClassName = reqWrapper.className(); @@ -834,12 +862,13 @@ returnType = getAsyncReturnType(method, returnType); resultQName = new QName(RETURN); } - + resultQName = qualifyWrappeeIfNeeded(resultQName, resNamespace); if (!isOneway && (returnType != null) && (!returnType.getName().equals("void"))) { Annotation[] rann = getAnnotations(method); if (resultQName.getLocalPart() != null) { TypeInfo rTypeReference = new TypeInfo(resultQName, returnType, rann); metadataReader.getProperties(rTypeReference.properties(), method); + rTypeReference.setGenericType(method.getGenericReturnType()); ParameterImpl returnParameter = new ParameterImpl(javaMethod, rTypeReference, Mode.OUT, -1); if (isResultHeader) { returnParameter.setBinding(ParameterBinding.HEADER); @@ -901,9 +930,11 @@ if (isHolder && paramMode == Mode.IN) paramMode = Mode.INOUT; } + paramQName = qualifyWrappeeIfNeeded(paramQName, reqNamespace); typeRef = new TypeInfo(paramQName, clazzType, pannotations[pos]); metadataReader.getProperties(typeRef.properties(), method, pos); + typeRef.setGenericType(genericParameterTypes[pos]); ParameterImpl param = new ParameterImpl(javaMethod, typeRef, paramMode, pos++); if (isHeader) { @@ -936,6 +967,16 @@ processExceptions(javaMethod, method); } + private QName qualifyWrappeeIfNeeded(QName resultQName, String ns) { + Object o = config.properties().get(DocWrappeeNamespapceQualified); + boolean qualified = (o!= null && o instanceof Boolean) ? ((Boolean) o) : false; + if (qualified) { + if (resultQName.getNamespaceURI() == null || "".equals(resultQName.getNamespaceURI())) { + return new QName(ns, resultQName.getLocalPart()); + } + } + return resultQName; + } /** * models a rpc/literal method @@ -1345,7 +1386,7 @@ } QName requestQName = new QName(requestNamespace, paramName); - if (!isHeader) javaMethod.setRequestPayloadName(requestQName); + if (!isHeader && paramMode != Mode.OUT) javaMethod.setRequestPayloadName(requestQName); //doclit/wrapped TypeInfo typeRef = //operationName with upper 1 char new TypeInfo(requestQName, clazzType, @@ -1492,18 +1533,18 @@ * @return the wsdl:portName for the implClass */ public static QName getPortName(Class implClass, String targetNamespace) { - return getPortName(implClass, targetNamespace, null); + return getPortName(implClass, null, targetNamespace); } public static QName getPortName(Class implClass, String targetNamespace, boolean isStandard) { - return getPortName(implClass, targetNamespace, null, isStandard); + return getPortName(implClass, null, targetNamespace, isStandard); } - public static QName getPortName(Class implClass, String targetNamespace, MetadataReader reader) { - return getPortName(implClass, targetNamespace, reader, true); + public static QName getPortName(Class implClass, MetadataReader reader, String targetNamespace) { + return getPortName(implClass, reader, targetNamespace, true); } - public static QName getPortName(Class implClass, String targetNamespace, MetadataReader reader, boolean isStandard) { + public static QName getPortName(Class implClass, MetadataReader reader, String targetNamespace, boolean isStandard) { WebService webService = getAnnotation(WebService.class, implClass, reader); if (isStandard && webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", @@ -1526,7 +1567,9 @@ if (implClass.getPackage() != null) { packageName = implClass.getPackage().getName(); } - targetNamespace = getNamespace(packageName); + if (packageName != null) { + targetNamespace = getNamespace(packageName); + } if (targetNamespace == null) { throw new RuntimeModelerException("runtime.modeler.no.package", implClass.getName()); @@ -1550,6 +1593,11 @@ public static QName getPortTypeName(Class implOrSeiClass){ return getPortTypeName(implOrSeiClass, null, null); } + + public static QName getPortTypeName(Class implOrSeiClass, MetadataReader metadataReader){ + return getPortTypeName(implOrSeiClass, null, metadataReader); + } + public static QName getPortTypeName(Class implOrSeiClass, String tns, MetadataReader reader){ assert(implOrSeiClass != null); WebService webService = getAnnotation(WebService.class, implOrSeiClass, reader); @@ -1566,7 +1614,8 @@ } catch (ClassNotFoundException e) { throw new RuntimeModelerException("runtime.modeler.class.not.found", epi); } - if (!clazz.isAnnotationPresent(javax.jws.WebService.class)) { + WebService ws = getAnnotation(WebService.class, clazz, reader); + if (ws == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } @@ -1578,7 +1627,6 @@ if(name.length() == 0){ name = clazz.getSimpleName(); } - tns = webService.targetNamespace(); if (tns == null || "".equals(tns.trim())) tns = webService.targetNamespace(); if (tns.length() == 0) tns = getNamespace(clazz.getPackage().getName()); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java 2013-04-04 15:30:23.404615822 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java 2013-04-04 15:30:23.348615820 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -24,8 +24,8 @@ */ package com.sun.xml.internal.ws.model; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * RuntimeModelerException represents an exception that occurred while --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java 2013-04-04 15:30:23.708615826 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java 2013-04-04 15:30:23.652615825 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 @@ import javax.jws.WebParam.Mode; import javax.xml.namespace.QName; -import javax.xml.ws.WebServiceFeature; import java.util.HashSet; import java.util.Iterator; import java.util.Set; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java 2013-04-04 15:30:23.956615830 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java 2013-04-04 15:30:23.908615829 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -257,7 +257,7 @@ static Class createRequestWrapperBean(String className, Method method, QName reqElemName, ClassLoader cl) { - LOGGER.fine("Request Wrapper Class : "+className); + LOGGER.log(Level.FINE, "Request Wrapper Class : {0}", className); List requestMembers = RUNTIME_GENERATOR.collectRequestBeanMembers( method); @@ -276,7 +276,7 @@ static Class createResponseWrapperBean(String className, Method method, QName resElemName, ClassLoader cl) { - LOGGER.fine("Response Wrapper Class : "+className); + LOGGER.log(Level.FINE, "Response Wrapper Class : {0}", className); List responseMembers = RUNTIME_GENERATOR.collectResponseBeanMembers(method); @@ -327,8 +327,12 @@ static Class createExceptionBean(String className, Class exception, String typeNS, String elemName, String elemNS, ClassLoader cl) { + return createExceptionBean(className, exception, typeNS, elemName, elemNS, cl, true); + } + + static Class createExceptionBean(String className, Class exception, String typeNS, String elemName, String elemNS, ClassLoader cl, boolean decapitalizeExceptionBeanProperties) { - Collection fields = RUNTIME_GENERATOR.collectExceptionBeanMembers(exception); + Collection fields = RUNTIME_GENERATOR.collectExceptionBeanMembers(exception, decapitalizeExceptionBeanProperties); byte[] image; try { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperParameter.java 2013-04-04 15:30:24.172615833 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperParameter.java 2013-04-04 15:30:24.120615832 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,6 +28,7 @@ import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.spi.db.TypeInfo; +import com.sun.xml.internal.ws.spi.db.WrapperComposite; import javax.jws.WebParam.Mode; import java.util.ArrayList; @@ -84,6 +85,7 @@ */ public void addWrapperChild(ParameterImpl wrapperChild) { wrapperChildren.add(wrapperChild); + wrapperChild.wrapper = this; // must bind to body. see class javadoc assert wrapperChild.getBinding()== ParameterBinding.BODY; } @@ -95,12 +97,15 @@ @Override void fillTypes(List types) { super.fillTypes(types); - if(getParent().getBinding().isRpcLit()) { - // for rpc/lit, we need to individually marshal/unmarshal wrapped values, - // so their TypeReference needs to be collected -// assert getTypeReference().type==CompositeStructure.class; - for (ParameterImpl p : wrapperChildren) - p.fillTypes(types); + if(WrapperComposite.class.equals(getTypeInfo().type)) { + for (ParameterImpl p : wrapperChildren) p.fillTypes(types); } +// if(getParent().getBinding().isRpcLit()) { +// // for rpc/lit, we need to individually marshal/unmarshal wrapped values, +// // so their TypeReference needs to be collected +//// assert getTypeReference().type==CompositeStructure.class; +// for (ParameterImpl p : wrapperChildren) +// p.fillTypes(types); +// } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/soap/SOAPBindingImpl.java 2013-04-04 15:30:24.372615837 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/soap/SOAPBindingImpl.java 2013-04-04 15:30:24.324615836 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java 2013-04-04 15:30:24.664615841 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java 2013-04-04 15:30:24.600615840 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractFeaturedObjectImpl.java 2013-04-04 15:30:24.940615845 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractFeaturedObjectImpl.java 2013-04-04 15:30:24.872615844 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractObjectImpl.java 2013-04-04 15:30:25.176615849 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractObjectImpl.java 2013-04-04 15:30:25.116615848 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java 2013-04-04 15:30:25.392615852 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java 2013-04-04 15:30:25.340615851 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java 2013-04-04 15:30:25.588615856 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java 2013-04-04 15:30:25.544615855 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +29,7 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.model.RuntimeModeler; import javax.jws.WebParam.Mode; import javax.jws.soap.SOAPBinding.Style; @@ -382,7 +383,7 @@ * For rpclit gives namespace value on soapbinding:body@namespace * * @return non-null for rpclit and null for doclit - * @see com.sun.xml.internal.ws.model.RuntimeModeler#processRpcMethod(com.sun.xml.internal.ws.model.JavaMethodImpl, String, javax.jws.WebMethod, String, java.lang.reflect.Method, javax.jws.WebService) + * @see RuntimeModeler#processRpcMethod(JavaMethodImpl, String, String, Method) */ public String getRequestNamespace(){ return (reqNamespace != null)?reqNamespace:name.getNamespaceURI(); @@ -397,7 +398,7 @@ * For rpclit gives namespace value on soapbinding:body@namespace * * @return non-null for rpclit and null for doclit - * * @see com.sun.xml.internal.ws.modeler.RuntimeModeler#processRpcMethod(com.sun.xml.internal.ws.model.JavaMethod, String, javax.jws.WebMethod, String, java.lang.reflect.Method, javax.jws.WebService) + * @see RuntimeModeler#processRpcMethod(JavaMethodImpl, String, String, Method) */ public String getResponseNamespace(){ return (respNamespace!=null)?respNamespace:name.getNamespaceURI(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java 2013-04-04 15:30:25.788615858 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java 2013-04-04 15:30:25.736615858 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -145,7 +145,7 @@ * * @param operation wsdl:operation@name value. Must be non-null. * @param part wsdl:part@name such as value of soap:header@part. Must be non-null. - * @param mode {@link Mode#IN} or {@link Mode@OUT}. Must be non-null. + * @param mode {@link Mode#IN} or {@link Mode#OUT}. Must be non-null. * @return null if the binding could not be resolved for the part. */ public ParameterBinding getBinding(QName operation, String part, Mode mode) { @@ -165,7 +165,7 @@ * * @param operation wsdl:operation@name value. Must be non-null. * @param part wsdl:part@name such as value of soap:header@part. Must be non-null. - * @param mode {@link Mode#IN} or {@link Mode@OUT}. Must be non-null. + * @param mode {@link Mode#IN} or {@link Mode#OUT}. Must be non-null. * @return null if the binding could not be resolved for the part. */ public String getMimeType(QName operation, String part, Mode mode) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLDirectProperties.java 2013-04-04 15:30:26.112615863 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLDirectProperties.java 2013-04-04 15:30:26.052615863 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java 2013-04-04 15:30:26.420615868 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java 2013-04-04 15:30:26.368615867 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java 2013-04-04 15:30:26.712615873 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java 2013-04-04 15:30:26.660615872 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java 2013-04-04 15:30:27.016615878 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java 2013-04-04 15:30:26.960615876 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java 2013-04-04 15:30:27.340615883 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java 2013-04-04 15:30:27.280615881 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java 2013-04-04 15:30:27.652615887 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java 2013-04-04 15:30:27.596615887 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java 2013-04-04 15:30:27.972615892 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java 2013-04-04 15:30:27.904615892 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartDescriptorImpl.java 2013-04-04 15:30:28.260615897 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartDescriptorImpl.java 2013-04-04 15:30:28.200615896 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java 2013-04-04 15:30:28.520615901 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java 2013-04-04 15:30:28.460615900 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java 2013-04-04 15:30:28.824615906 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java 2013-04-04 15:30:28.772615905 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortProperties.java 2013-04-04 15:30:29.128615910 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortProperties.java 2013-04-04 15:30:29.056615910 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java 2013-04-04 15:30:29.440615915 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java 2013-04-04 15:30:29.384615915 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java 2013-04-04 15:30:29.764615921 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java 2013-04-04 15:30:29.704615920 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,14 +25,16 @@ package com.sun.xml.internal.ws.model.wsdl; +import com.oracle.webservices.internal.api.message.BasePropertySet; +import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import javax.xml.namespace.QName; import javax.xml.ws.handler.MessageContext; + import org.xml.sax.InputSource; /** @@ -41,7 +43,7 @@ * * @author Jitendra Kotamraju */ -public abstract class WSDLProperties extends PropertySet { +public abstract class WSDLProperties extends BasePropertySet { private static final PropertyMap model; static { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java 2013-04-04 15:30:30.008615924 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java 2013-04-04 15:30:29.940615923 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/package-info.java 2013-04-04 15:30:30.256615928 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/package-info.java 2013-04-04 15:30:30.200615927 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandler.java 2013-04-04 15:30:30.576615933 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandler.java 2013-04-04 15:30:30.516615932 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerEndpointScope.java 2013-04-04 15:30:30.832615937 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerEndpointScope.java 2013-04-04 15:30:30.772615936 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerMessageScope.java 2013-04-04 15:30:31.136615941 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerMessageScope.java 2013-04-04 15:30:31.080615941 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerOperationScope.java 2013-04-04 15:30:31.448615947 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerOperationScope.java 2013-04-04 15:30:31.380615945 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerServiceScope.java 2013-04-04 15:30:31.724615951 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/BuilderHandlerServiceScope.java 2013-04-04 15:30:31.676615950 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/DefaultPolicyResolver.java 2013-04-04 15:30:32.000615955 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/DefaultPolicyResolver.java 2013-04-04 15:30:31.940615954 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyMapBuilder.java 2013-04-04 15:30:32.256615959 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyMapBuilder.java 2013-04-04 15:30:32.196615958 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyUtil.java 2013-04-04 15:30:32.528615964 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyUtil.java 2013-04-04 15:30:32.460615963 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLGeneratorExtension.java 2013-04-04 15:30:32.800615968 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLGeneratorExtension.java 2013-04-04 15:30:32.748615967 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java 2013-04-04 15:30:33.016615971 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java 2013-04-04 15:30:32.964615970 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -40,6 +40,7 @@ import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; import com.sun.xml.internal.ws.policy.PolicyException; import com.sun.xml.internal.ws.policy.PolicyMap; +import com.sun.xml.internal.ws.util.xml.XmlUtil; import java.io.IOException; import java.io.InputStream; @@ -58,6 +59,7 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLInputFactory; import javax.xml.ws.WebServiceException; +import javax.xml.xpath.XPathFactoryConfigurationException; /** * This class parses the Policy Attachments in the WSDL and creates a PolicyMap thaty captures the policies configured on @@ -622,7 +624,7 @@ try { final URL xmlURL = new URL(fileUrl); ios = xmlURL.openStream(); - reader = XMLInputFactory.newInstance().createXMLStreamReader(ios); + reader = XmlUtil.newXMLInputFactory(true).createXMLStreamReader(ios); while (reader.hasNext()) { if (reader.isStartElement() && NamespaceVersion.resolveAsToken(reader.getName()) == XmlToken.Policy) { readSinglePolicy(policyReader.readPolicyElement(reader, fileUrl), false); @@ -872,6 +874,14 @@ for (WSDLBoundFault boundFault : boundOperation.getFaults()) { final WSDLFault fault = boundFault.getFault(); + + // this shouldn't happen ususally, + // but since this scenario tested in lagacy tests, dont' fail here + if (fault == null) { + LOGGER.warning(PolicyMessages.WSP_1021_FAULT_NOT_BOUND(boundFault.getName())); + continue; + } + final WSDLMessage faultMessage = fault.getMessage(); final QName faultName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundFault.getName()); // We store the message and portType/fault under the same namespace as the binding/fault so that we can match them up later --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/SafePolicyReader.java 2013-04-04 15:30:33.256615974 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/SafePolicyReader.java 2013-04-04 15:30:33.208615974 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/WSDLBoundFaultContainer.java 2013-04-04 15:30:33.488615979 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/WSDLBoundFaultContainer.java 2013-04-04 15:30:33.440615978 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/spi/PolicyFeatureConfigurator.java 2013-04-04 15:30:33.716615982 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/spi/PolicyFeatureConfigurator.java 2013-04-04 15:30:33.652615981 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/spi/PolicyMapConfigurator.java 2013-04-04 15:30:34.012615986 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/spi/PolicyMapConfigurator.java 2013-04-04 15:30:33.932615985 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/ClientMUTube.java 2013-04-04 15:30:34.284615990 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/ClientMUTube.java 2013-04-04 15:30:34.228615990 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,7 +35,6 @@ import javax.xml.namespace.QName; import javax.xml.ws.soap.SOAPFaultException; -import java.util.HashSet; import java.util.Set; /** @@ -74,7 +73,7 @@ //may have been changed from the time of invocation, it ok as its only fallback case. handlerConfig = binding.getHandlerConfig(); } - Set misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),handlerConfig.getHandlerKnownHeaders()); + Set misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders()); if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) { return super.processResponse(response); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java 2013-04-04 15:30:34.488615994 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java 2013-04-04 15:30:34.436615993 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,14 +29,12 @@ import static com.sun.xml.internal.ws.api.SOAPVersion.SOAP_11; import static com.sun.xml.internal.ws.api.SOAPVersion.SOAP_12; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.message.Header; -import com.sun.xml.internal.ws.api.message.HeaderList; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.TubeCloner; import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl; -import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.binding.SOAPBindingImpl; import com.sun.xml.internal.ws.message.DOMHeader; import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; @@ -49,7 +47,6 @@ import javax.xml.ws.WebServiceException; import javax.xml.ws.soap.SOAPBinding; import javax.xml.ws.soap.SOAPFaultException; -import java.util.HashSet; import java.util.Set; import java.util.logging.Logger; @@ -95,27 +92,10 @@ * @return returns the headers that have mustUnderstand attribute and are not understood * by the binding. */ - public final Set getMisUnderstoodHeaders(HeaderList headers, Set roles, + public final Set getMisUnderstoodHeaders(MessageHeaders headers, Set roles, Set handlerKnownHeaders) { - Set notUnderstoodHeaders = null; - for (int i = 0; i < headers.size(); i++) { - if (!headers.isUnderstood(i)) { - Header header = headers.get(i); - if (!header.isIgnorable(soapVersion, roles)) { - QName qName = new QName(header.getNamespaceURI(), header.getLocalPart()); - // see if the binding can understand it - if (!binding.understandsHeader(qName)) { - if (!handlerKnownHeaders.contains(qName)) { - logger.info("Element not understood=" + qName); - if (notUnderstoodHeaders == null) - notUnderstoodHeaders = new HashSet(); - notUnderstoodHeaders.add(qName); - } - } - } - } - } - return notUnderstoodHeaders; + return headers.getNotUnderstoodHeaders(roles, handlerKnownHeaders, binding); + } /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/MessageCreationException.java 2013-04-04 15:30:34.716615998 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/MessageCreationException.java 2013-04-04 15:30:34.664615997 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java 2013-04-04 15:30:34.944616001 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java 2013-04-04 15:30:34.888616000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,9 @@ package com.sun.xml.internal.ws.protocol.soap; -import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.*; import com.sun.xml.internal.ws.client.HandlerConfiguration; -import com.sun.xml.internal.ws.binding.BindingImpl; import javax.xml.namespace.QName; import java.util.Set; @@ -51,7 +49,7 @@ //On Server, HandlerConfiguration does n't change after publish, so store locally HandlerConfiguration handlerConfig = binding.getHandlerConfig(); roles = handlerConfig.getRoles(); - handlerKnownHeaders = handlerConfig.getHandlerKnownHeaders(); + handlerKnownHeaders = binding.getKnownHeaders(); } protected ServerMUTube(ServerMUTube that, TubeCloner cloner) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/VersionMismatchException.java 2013-04-04 15:30:35.200616005 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/soap/VersionMismatchException.java 2013-04-04 15:30:35.140616004 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/xml/XMLMessageException.java 2013-04-04 15:30:35.468616009 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/protocol/xml/XMLMessageException.java 2013-04-04 15:30:35.408616008 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.protocol.xml; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * @author WS Development Team --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/AddressingMessages.java 2013-04-04 15:30:35.704616013 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/AddressingMessages.java 2013-04-04 15:30:35.644616012 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/BindingApiMessages.java 2013-04-04 15:30:35.924616016 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/BindingApiMessages.java 2013-04-04 15:30:35.872616016 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ClientMessages.java 2013-04-04 15:30:36.136616019 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ClientMessages.java 2013-04-04 15:30:36.080616019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/DispatchMessages.java 2013-04-04 15:30:36.372616023 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/DispatchMessages.java 2013-04-04 15:30:36.316616023 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/EncodingMessages.java 2013-04-04 15:30:36.600616026 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/EncodingMessages.java 2013-04-04 15:30:36.552616026 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/HandlerMessages.java 2013-04-04 15:30:36.824616030 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/HandlerMessages.java 2013-04-04 15:30:36.764616030 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java 2013-04-04 15:30:37.076616034 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java 2013-04-04 15:30:37.012616033 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ManagementMessages.java 2013-04-04 15:30:37.328616038 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ManagementMessages.java 2013-04-04 15:30:37.276616037 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ModelerMessages.java 2013-04-04 15:30:37.556616042 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ModelerMessages.java 2013-04-04 15:30:37.496616040 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** @@ -64,6 +63,18 @@ return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(arg0, arg1)); } + public static Localizable localizableRUNTIME_MODELER_EXTERNAL_METADATA_UNABLE_TO_READ(Object arg0) { + return messageFactory.getMessage("runtime.modeler.external.metadata.unable.to.read", arg0); + } + + /** + * Unable to read metadata file {0}. Check configuration/deployment. + * + */ + public static String RUNTIME_MODELER_EXTERNAL_METADATA_UNABLE_TO_READ(Object arg0) { + return localizer.localize(localizableRUNTIME_MODELER_EXTERNAL_METADATA_UNABLE_TO_READ(arg0)); + } + public static Localizable localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(Object arg0) { return messageFactory.getMessage("runtime.modeler.webmethod.must.be.public", arg0); } @@ -100,6 +111,18 @@ return localizer.localize(localizableRUNTIME_MODELER_MTOM_CONFLICT(arg0, arg1)); } + public static Localizable localizableRUNTIME_MODELER_EXTERNAL_METADATA_GENERIC(Object arg0) { + return messageFactory.getMessage("runtime.modeler.external.metadata.generic", arg0); + } + + /** + * An error occurred while processing external WS metadata; check configuration/deployment. Nested error: {0}. + * + */ + public static String RUNTIME_MODELER_EXTERNAL_METADATA_GENERIC(Object arg0) { + return localizer.localize(localizableRUNTIME_MODELER_EXTERNAL_METADATA_GENERIC(arg0)); + } + public static Localizable localizableRUNTIME_MODELER_FEATURE_CONFLICT(Object arg0, Object arg1) { return messageFactory.getMessage("runtime.modeler.feature.conflict", arg0, arg1); } @@ -184,6 +207,18 @@ return localizer.localize(localizableRUNTIME_MODELER_ADDRESSING_RESPONSES_NOSUCHMETHOD(arg0)); } + public static Localizable localizableRUNTIME_MODELER_EXTERNAL_METADATA_WRONG_FORMAT(Object arg0) { + return messageFactory.getMessage("runtime.modeler.external.metadata.wrong.format", arg0); + } + + /** + * Unable to read metadata from {0}. Is the format correct? + * + */ + public static String RUNTIME_MODELER_EXTERNAL_METADATA_WRONG_FORMAT(Object arg0) { + return localizer.localize(localizableRUNTIME_MODELER_EXTERNAL_METADATA_WRONG_FORMAT(arg0)); + } + public static Localizable localizableRUNTIME_MODELER_ONEWAY_OPERATION_NO_OUT_PARAMETERS(Object arg0, Object arg1) { return messageFactory.getMessage("runtime.modeler.oneway.operation.no.out.parameters", arg0, arg1); } @@ -304,6 +339,18 @@ return localizer.localize(localizableRUNTIME_MODELER_ENDPOINT_INTERFACE_NO_WEBSERVICE(arg0)); } + public static Localizable localizableRUNTIME_MODELER_EXTERNAL_METADATA_UNSUPPORTED_SCHEMA(Object arg0, Object arg1) { + return messageFactory.getMessage("runtime.modeler.external.metadata.unsupported.schema", arg0, arg1); + } + + /** + * Unsupported metadata file schema {0}. Supported schemes are {1}. + * + */ + public static String RUNTIME_MODELER_EXTERNAL_METADATA_UNSUPPORTED_SCHEMA(Object arg0, Object arg1) { + return localizer.localize(localizableRUNTIME_MODELER_EXTERNAL_METADATA_UNSUPPORTED_SCHEMA(arg0, arg1)); + } + public static Localizable localizableRUNTIMEMODELER_INVALID_SOAPBINDING_ON_METHOD(Object arg0, Object arg1, Object arg2) { return messageFactory.getMessage("runtimemodeler.invalid.soapbindingOnMethod", arg0, arg1, arg2); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/PolicyMessages.java 2013-04-04 15:30:37.828616046 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/PolicyMessages.java 2013-04-04 15:30:37.776616045 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** @@ -232,6 +231,18 @@ return localizer.localize(localizableWSP_1012_FAILED_CONFIGURE_WSDL_MODEL()); } + public static Localizable localizableWSP_1021_FAULT_NOT_BOUND(Object arg0) { + return messageFactory.getMessage("WSP_1021_FAULT_NOT_BOUND", arg0); + } + + /** + * WSP1021: Fault "{0}" not bound. Check names in port and binding definitions. + * + */ + public static String WSP_1021_FAULT_NOT_BOUND(Object arg0) { + return localizer.localize(localizableWSP_1021_FAULT_NOT_BOUND(arg0)); + } + public static Localizable localizableWSP_1011_FAILED_TO_RETRIEVE_EFFECTIVE_POLICY_FOR_SUBJECT(Object arg0) { return messageFactory.getMessage("WSP_1011_FAILED_TO_RETRIEVE_EFFECTIVE_POLICY_FOR_SUBJECT", arg0); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java 2013-04-04 15:30:38.084616050 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java 2013-04-04 15:30:38.032616049 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/SenderMessages.java 2013-04-04 15:30:38.336616054 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/SenderMessages.java 2013-04-04 15:30:38.276616053 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ServerMessages.java 2013-04-04 15:30:38.572616057 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/ServerMessages.java 2013-04-04 15:30:38.524616056 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/SoapMessages.java 2013-04-04 15:30:38.844616061 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/SoapMessages.java 2013-04-04 15:30:38.780616060 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/StreamingMessages.java 2013-04-04 15:30:39.112616066 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/StreamingMessages.java 2013-04-04 15:30:39.044616065 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/UtilMessages.java 2013-04-04 15:30:39.336616070 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/UtilMessages.java 2013-04-04 15:30:39.288616069 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java 2013-04-04 15:30:39.564616073 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java 2013-04-04 15:30:39.516616072 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsservletMessages.java 2013-04-04 15:30:39.820616077 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsservletMessages.java 2013-04-04 15:30:39.764616076 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java 2013-04-04 15:30:40.076616081 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java 2013-04-04 15:30:40.016616080 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +23,11 @@ * questions. */ - package com.sun.xml.internal.ws.resources; -import com.sun.xml.internal.ws.util.localization.Localizable; -import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory; -import com.sun.xml.internal.ws.util.localization.Localizer; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/addressing.properties 2013-04-04 15:30:40.336616085 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/addressing.properties 2013-04-04 15:30:40.284616084 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/bindingApi.properties 2013-04-04 15:30:40.588616089 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/bindingApi.properties 2013-04-04 15:30:40.532616088 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/client.properties 2013-04-04 15:30:40.832616093 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/client.properties 2013-04-04 15:30:40.780616092 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/dispatch.properties 2013-04-04 15:30:41.104616097 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/dispatch.properties 2013-04-04 15:30:41.044616096 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/encoding.properties 2013-04-04 15:30:41.348616101 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/encoding.properties 2013-04-04 15:30:41.300616100 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/handler.properties 2013-04-04 15:30:41.592616104 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/handler.properties 2013-04-04 15:30:41.544616104 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/httpserver.properties 2013-04-04 15:30:41.880616109 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/httpserver.properties 2013-04-04 15:30:41.824616108 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/management.properties 2013-04-04 15:30:42.160616113 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/management.properties 2013-04-04 15:30:42.096616112 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/modeler.properties 2013-04-04 15:30:42.436616118 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/modeler.properties 2013-04-04 15:30:42.380616117 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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,10 @@ # Wrapped into an Exception. {0} - localizable exception message of another exception nestedModelerError=runtime modeler error: {0} +runtime.modeler.external.metadata.generic=An error occurred while processing external WS metadata; check configuration/deployment. Nested error: {0}. +runtime.modeler.external.metadata.unable.to.read=Unable to read metadata file {0}. Check configuration/deployment. +runtime.modeler.external.metadata.unsupported.schema=Unsupported metadata file schema {0}. Supported schemes are {1}. +runtime.modeler.external.metadata.wrong.format=Unable to read metadata from {0}. Is the format correct? runtime.modeler.no.webservice.annotation=A WebService annotation is not present on class: {0} runtime.modeler.endpoint.interface.no.webservice=The Endpoint Interface: {0} does not have WebService Annotation # Wrapped into an Exception. Not concatenated with any other string. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/policy.properties 2013-04-04 15:30:42.688616121 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/policy.properties 2013-04-04 15:30:42.624616120 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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,3 +45,4 @@ WSP_1018_FAILED_TO_MARSHALL_POLICY=WSP1018: Failed to marshal policy "{0}". WSP_1019_CREATE_EMPTY_POLICY_MAP=WSP1019: Failed to find any configuration file. Creating new empty policy map. WSP_1020_DUPLICATE_ID=WSP1020: Found two policies in one document with the same id: "{0}". +WSP_1021_FAULT_NOT_BOUND=WSP1021: Fault "{0}" not bound. Check names in port and binding definitions. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/providerApi.properties 2013-04-04 15:30:42.964616126 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/providerApi.properties 2013-04-04 15:30:42.908616125 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/sender.properties 2013-04-04 15:30:43.232616130 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/sender.properties 2013-04-04 15:30:43.180616129 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/server.properties 2013-04-04 15:30:43.484616134 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/server.properties 2013-04-04 15:30:43.424616133 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/soap.properties 2013-04-04 15:30:43.756616138 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/soap.properties 2013-04-04 15:30:43.696616137 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/streaming.properties 2013-04-04 15:30:44.032616142 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/streaming.properties 2013-04-04 15:30:43.980616142 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/util.properties 2013-04-04 15:30:44.312616147 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/util.properties 2013-04-04 15:30:44.256616146 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties 2013-04-04 15:30:44.568616151 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties 2013-04-04 15:30:44.516616150 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsservlet.properties 2013-04-04 15:30:44.796616155 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsservlet.properties 2013-04-04 15:30:44.736616154 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/xmlmessage.properties 2013-04-04 15:30:45.012616157 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/xmlmessage.properties 2013-04-04 15:30:44.964616157 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/AbstractMultiInstanceResolver.java 2013-04-04 15:30:45.244616161 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/AbstractMultiInstanceResolver.java 2013-04-04 15:30:45.192616160 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java 2013-04-04 15:30:45.488616165 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java 2013-04-04 15:30:45.432616164 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,6 +28,7 @@ import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.api.server.WSWebServiceContext; +import com.sun.xml.internal.ws.server.provider.AsyncProviderInvokerTube; import com.sun.istack.internal.NotNull; import org.w3c.dom.Element; @@ -41,7 +42,8 @@ * {@link Packet} and concrete implementations provide it via * {@link #getRequestPacket()}. * - * @see InvokerTube, AsyncProviderInvokerTube + * @see InvokerTube, + * @see AsyncProviderInvokerTube * * @author Jitendra Kotamraju */ @@ -91,7 +93,7 @@ if(endpoint.getServiceDefinition() != null) { wsdlAddress = packet.webServiceContextDelegate.getWSDLAddress(packet,endpoint); } - return clazz.cast(((WSEndpointImpl)endpoint).getEndpointReference(clazz,address,wsdlAddress, referenceParameters)); + return clazz.cast(endpoint.getEndpointReference(clazz,address,wsdlAddress, referenceParameters)); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java 2013-04-04 15:30:45.696616169 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java 2013-04-04 15:30:45.648616168 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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.server; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.server.AbstractInstanceResolver; import com.sun.xml.internal.ws.api.server.ResourceInjector; import com.sun.xml.internal.ws.api.server.WSWebServiceContext; +import com.sun.xml.internal.ws.util.InjectionPlan; import javax.xml.ws.WebServiceContext; @@ -40,7 +40,7 @@ */ public final class DefaultResourceInjector extends ResourceInjector { public void inject(@NotNull WSWebServiceContext context, @NotNull Object instance) { - AbstractInstanceResolver.buildInjectionPlan( + InjectionPlan.buildInjectionPlan( instance.getClass(),WebServiceContext.class,false).inject(instance,context); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DraconianValidationErrorHandler.java 2013-04-04 15:30:45.896616171 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DraconianValidationErrorHandler.java 2013-04-04 15:30:45.848616170 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointAwareTube.java 2013-04-04 15:30:46.164616176 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointAwareTube.java 2013-04-04 15:30:46.108616174 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java 2013-04-04 15:30:46.424616180 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java 2013-04-04 15:30:46.376616179 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,17 +27,27 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.policy.PolicyResolverFactory; -import com.sun.xml.internal.ws.api.policy.PolicyResolver; -import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; -import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; +import com.sun.xml.internal.ws.api.WSFeatureList; import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; +import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; +import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.api.pipe.Tube; -import com.sun.xml.internal.ws.api.server.*; +import com.sun.xml.internal.ws.api.policy.PolicyResolver; +import com.sun.xml.internal.ws.api.policy.PolicyResolverFactory; +import com.sun.xml.internal.ws.api.server.AsyncProvider; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ContainerResolver; +import com.sun.xml.internal.ws.api.server.InstanceResolver; +import com.sun.xml.internal.ws.api.server.Invoker; +import com.sun.xml.internal.ws.api.server.SDDocument; +import com.sun.xml.internal.ws.api.server.SDDocumentSource; +import com.sun.xml.internal.ws.api.server.WSEndpoint; +import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver; import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver.Parser; @@ -46,11 +56,14 @@ import com.sun.xml.internal.ws.binding.SOAPBindingImpl; import com.sun.xml.internal.ws.binding.WebServiceFeatureList; import com.sun.xml.internal.ws.model.AbstractSEIModelImpl; +import com.sun.xml.internal.ws.model.ReflectAnnotationReader; import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.model.SOAPSEIModel; import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl; +import com.sun.xml.internal.ws.policy.PolicyMap; +import com.sun.xml.internal.ws.policy.jaxws.PolicyUtil; import com.sun.xml.internal.ws.resources.ServerMessages; import com.sun.xml.internal.ws.server.provider.ProviderInvokerTube; import com.sun.xml.internal.ws.server.sei.SEIInvokerTube; @@ -58,20 +71,20 @@ import com.sun.xml.internal.ws.util.HandlerAnnotationProcessor; import com.sun.xml.internal.ws.util.ServiceConfigurationError; import com.sun.xml.internal.ws.util.ServiceFinder; +import com.sun.xml.internal.ws.util.xml.XmlUtil; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; -import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator; -import com.sun.xml.internal.ws.policy.PolicyMap; -import com.sun.xml.internal.ws.policy.jaxws.PolicyUtil; import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; import org.xml.sax.SAXException; import javax.jws.WebService; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; import javax.xml.ws.Provider; import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceProvider; import javax.xml.ws.WebServiceFeature; +import javax.xml.ws.WebServiceProvider; import javax.xml.ws.soap.SOAPBinding; import java.io.IOException; import java.net.URL; @@ -165,8 +178,10 @@ if(implType ==null) throw new IllegalArgumentException(); + MetadataReader metadataReader = getExternalMetadatReader(implType, binding); + if (isStandard) { - verifyImplementorClass(implType); + verifyImplementorClass(implType, metadataReader); } if (invoker == null) { @@ -184,10 +199,10 @@ container = ContainerResolver.getInstance().getContainer(); if(serviceName==null) - serviceName = getDefaultServiceName(implType); + serviceName = getDefaultServiceName(implType, metadataReader); if(portName==null) - portName = getDefaultPortName(serviceName,implType); + portName = getDefaultPortName(serviceName,implType, metadataReader); {// error check String serviceNS = serviceName.getNamespaceURI(); @@ -207,21 +222,21 @@ QName portTypeName = null; if (isStandard && implType.getAnnotation(WebServiceProvider.class)==null) { - portTypeName = RuntimeModeler.getPortTypeName(implType); + portTypeName = RuntimeModeler.getPortTypeName(implType, metadataReader); } // Categorises the documents as WSDL, Schema etc List docList = categoriseMetadata(md, serviceName, portTypeName); // Finds the primary WSDL and makes sure that metadata doesn't have // two concrete or abstract WSDLs - SDDocumentImpl primaryDoc = findPrimary(docList); + SDDocumentImpl primaryDoc = primaryWsdl != null ? SDDocumentImpl.create(primaryWsdl,serviceName,portTypeName) : findPrimary(docList); EndpointAwareTube terminal; WSDLPortImpl wsdlPort = null; AbstractSEIModelImpl seiModel = null; // create WSDL model if (primaryDoc != null) { - wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container); + wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container, resolver); } WebServiceFeatureList features=((BindingImpl)binding).getFeatures(); @@ -247,7 +262,7 @@ configFtrs = PolicyUtil.getPortScopedFeatures(policyMap,serviceName,portName); } features.mergeFeatures(configFtrs, true); - terminal = createProviderInvokerTube(implType,binding,invoker); + terminal = createProviderInvokerTube(implType, binding, invoker, container); } else { // Create runtime model for non Provider endpoints seiModel = createSEIModel(wsdlPort, implType, serviceName, portName, binding); @@ -260,7 +275,7 @@ if (primaryDoc == null) { primaryDoc = generateWSDL(binding, seiModel, docList, container, implType); // create WSDL model - wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container); + wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container, resolver); seiModel.freeze(wsdlPort); } policyMap = wsdlPort.getOwner().getParent().getPolicyMap(); @@ -277,8 +292,9 @@ } // Selects only required metadata for this endpoint from the passed-in metadata if (primaryDoc != null) { - docList = findMetadataClosure(primaryDoc, docList); + docList = findMetadataClosure(primaryDoc, docList, resolver); } + ServiceDefinitionImpl serviceDefiniton = (primaryDoc != null) ? new ServiceDefinitionImpl(docList, primaryDoc) : null; return create(serviceName, portName, binding, container, seiModel, wsdlPort, implType, serviceDefiniton, @@ -298,10 +314,10 @@ return new SEIInvokerTube(seiModel,invoker,binding); } - protected EndpointAwareTube createProviderInvokerTube(Class implType, WSBinding binding, Invoker invoker) { - return ProviderInvokerTube.create(implType, binding, invoker); + protected EndpointAwareTube createProviderInvokerTube(final Class implType, final WSBinding binding, + final Invoker invoker, final Container container) { + return ProviderInvokerTube.create(implType, binding, invoker, container); } - /** * Goes through the original metadata documents and collects the required ones. * This done traversing from primary WSDL and its imports until it builds a @@ -311,7 +327,7 @@ * @param docList complete metadata * @return new metadata that doesn't contain extraneous documnets. */ - private static List findMetadataClosure(SDDocumentImpl primaryDoc, List docList) { + private static List findMetadataClosure(SDDocumentImpl primaryDoc, List docList, EntityResolver resolver) { // create a map for old metadata Map oldMap = new HashMap(); for(SDDocumentImpl doc : docList) { @@ -328,10 +344,24 @@ SDDocumentImpl doc = oldMap.get(url); if (doc == null) { // old metadata doesn't have this imported doc, may be external - continue; + if (resolver != null) { + try { + InputSource source = resolver.resolveEntity(null, url); + if (source != null) { + MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer(); + XMLStreamReader reader = XmlUtil.newXMLInputFactory(true).createXMLStreamReader(source.getByteStream()); + xsb.createFromXMLStreamReader(reader); + + SDDocumentSource sdocSource = SDDocumentImpl.create(new URL(url), xsb); + doc = SDDocumentImpl.create(sdocSource, null, null); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } } // Check if new metadata already contains this doc - if (!newMap.containsKey(url)) { + if (doc != null && !newMap.containsKey(url)) { newMap.put(url, doc); remaining.addAll(doc.getImports()); } @@ -366,8 +396,29 @@ * If it has both @WebService and @WebServiceProvider annotations */ public static boolean verifyImplementorClass(Class clz) { - WebServiceProvider wsProvider = clz.getAnnotation(WebServiceProvider.class); - WebService ws = clz.getAnnotation(WebService.class); + return verifyImplementorClass(clz, null); + } + + /** + * Verifies if the endpoint implementor class has @WebService or @WebServiceProvider + * annotation; passing MetadataReader instance allows to read annotations from + * xml descriptor instead of class's annotations + * + * @return + * true if it is a Provider or AsyncProvider endpoint + * false otherwise + * @throws java.lang.IllegalArgumentException + * If it doesn't have any one of @WebService or @WebServiceProvider + * If it has both @WebService and @WebServiceProvider annotations + */ + public static boolean verifyImplementorClass(Class clz, MetadataReader metadataReader) { + + if (metadataReader == null) { + metadataReader = new ReflectAnnotationReader(); + } + + WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, clz); + WebService ws = metadataReader.getAnnotation(WebService.class, clz); if (wsProvider == null && ws == null) { throw new IllegalArgumentException(clz +" has neither @WebService nor @WebServiceProvider annotation"); } @@ -415,10 +466,22 @@ // config.getMappingInfo().setBindingID(binding.getBindingId()); config.setClassLoader(implType.getClassLoader()); config.getMappingInfo().setPortName(portName); + + config.setMetadataReader(getExternalMetadatReader(implType, binding)); + com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config); return (AbstractSEIModelImpl) rt.getModel(); } + public static MetadataReader getExternalMetadatReader(Class implType, WSBinding binding) { + com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef = binding.getFeature( + com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class); + // TODO-Miran: would it be necessary to disable secure xml processing? + if (ef != null) + return ef.getMetadataReader(implType.getClassLoader(), false); + return null; + } + /** *Set the mtom enable setting from wsdl model (mtom policy assertion) on to @link WSBinding} if DD has * not already set it on BindingID. Also check conflicts. @@ -443,18 +506,29 @@ * @return non-null service name */ public static @NotNull QName getDefaultServiceName(Class implType) { - return getDefaultServiceName(implType, true); + return getDefaultServiceName(implType, null); + } + + public static @NotNull QName getDefaultServiceName(Class implType, MetadataReader metadataReader) { + return getDefaultServiceName(implType, true, metadataReader); } public static @NotNull QName getDefaultServiceName(Class implType, boolean isStandard) { + return getDefaultServiceName(implType, isStandard, null); + } + + public static @NotNull QName getDefaultServiceName(Class implType, boolean isStandard, MetadataReader metadataReader) { + if (metadataReader == null) { + metadataReader = new ReflectAnnotationReader(); + } QName serviceName; - WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class); + WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType); if (wsProvider!=null) { String tns = wsProvider.targetNamespace(); String local = wsProvider.serviceName(); serviceName = new QName(tns, local); } else { - serviceName = RuntimeModeler.getServiceName(implType, isStandard); + serviceName = RuntimeModeler.getServiceName(implType, metadataReader, isStandard); } assert serviceName != null; return serviceName; @@ -467,18 +541,29 @@ * @return non-null port name */ public static @NotNull QName getDefaultPortName(QName serviceName, Class implType) { - return getDefaultPortName(serviceName, implType, true); + return getDefaultPortName(serviceName, implType, null); + } + + public static @NotNull QName getDefaultPortName(QName serviceName, Class implType, MetadataReader metadataReader) { + return getDefaultPortName(serviceName, implType, true, metadataReader); } public static @NotNull QName getDefaultPortName(QName serviceName, Class implType, boolean isStandard) { + return getDefaultPortName(serviceName, implType, isStandard, null); + } + + public static @NotNull QName getDefaultPortName(QName serviceName, Class implType, boolean isStandard, MetadataReader metadataReader) { + if (metadataReader == null) { + metadataReader = new ReflectAnnotationReader(); + } QName portName; - WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class); + WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType); if (wsProvider!=null) { String tns = wsProvider.targetNamespace(); String local = wsProvider.portName(); portName = new QName(tns, local); } else { - portName = RuntimeModeler.getPortName(implType, serviceName.getNamespaceURI(), isStandard); + portName = RuntimeModeler.getPortName(implType, metadataReader, serviceName.getNamespaceURI(), isStandard); } assert portName != null; return portName; @@ -494,19 +579,39 @@ * @return wsdl if there is wsdlLocation, else null */ public static @Nullable String getWsdlLocation(Class implType) { - String wsdl; - WebService ws = implType.getAnnotation(WebService.class); + return getWsdlLocation(implType, new ReflectAnnotationReader()); + } + + /** + * Returns the wsdl from @WebService, or @WebServiceProvider annotation using + * wsdlLocation element. + * + * @param implType + * endpoint implementation class + * make sure that you called {@link #verifyImplementorClass} on it. + * @return wsdl if there is wsdlLocation, else null + */ + public static @Nullable String getWsdlLocation(Class implType, MetadataReader metadataReader) { + + if (metadataReader == null) { + metadataReader = new ReflectAnnotationReader(); + } + + WebService ws = metadataReader.getAnnotation(WebService.class, implType); if (ws != null) { - wsdl = ws.wsdlLocation(); + return nullIfEmpty(ws.wsdlLocation()); } else { WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class); assert wsProvider != null; - wsdl = wsProvider.wsdlLocation(); + return nullIfEmpty(wsProvider.wsdlLocation()); } - if (wsdl.length() < 1) { - wsdl = null; + } + + private static String nullIfEmpty(String string) { + if (string.length() < 1) { + string = null; } - return wsdl; + return string; } /** @@ -532,6 +637,7 @@ wsdlGenInfo.setContainer(container); wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray()); wsdlGenInfo.setInlineSchemas(false); + wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures())); seiModel.getDatabinding().generateWSDL(wsdlGenInfo); // WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false, // ServiceFinder.find(WSDLGeneratorExtension.class).toArray()); @@ -539,6 +645,11 @@ return wsdlResolver.updateDocs(); } + private static boolean isSecureXmlProcessingDisabled(WSFeatureList featureList) { + // TODO-Miran: would it be necessary to disable secure xml processing? + return false; + } + /** * Builds {@link SDDocumentImpl} from {@link SDDocumentSource}. */ @@ -619,12 +730,13 @@ * @return non-null wsdl port object */ private static @NotNull WSDLPortImpl getWSDLPort(SDDocumentSource primaryWsdl, List metadata, - @NotNull QName serviceName, @NotNull QName portName, Container container) { + @NotNull QName serviceName, @NotNull QName portName, Container container, + EntityResolver resolver) { URL wsdlUrl = primaryWsdl.getSystemId(); try { // TODO: delegate to another entity resolver WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse( - new Parser(primaryWsdl), new EntityResolverImpl(metadata), + new Parser(primaryWsdl), new EntityResolverImpl(metadata, resolver), false, container, ServiceFinder.find(WSDLParserExtension.class).toArray()); if(wsdlDoc.getServices().size() == 0) { throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_NOSERVICE_IN_WSDLMODEL(wsdlUrl)); @@ -654,11 +766,13 @@ */ private static final class EntityResolverImpl implements XMLEntityResolver { private Map metadata = new HashMap(); + private EntityResolver resolver; - public EntityResolverImpl(List metadata) { + public EntityResolverImpl(List metadata, EntityResolver resolver) { for (SDDocumentSource doc : metadata) { this.metadata.put(doc.getSystemId().toExternalForm(),doc); } + this.resolver = resolver; } public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException { @@ -667,6 +781,17 @@ if (doc != null) return new Parser(doc); } + if (resolver != null) { + try { + InputSource source = resolver.resolveEntity(publicId, systemId); + if (source != null) { + Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true)); + return p; + } + } catch (SAXException e) { + throw new XMLStreamException(e); + } + } return null; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointMessageContextImpl.java 2013-04-04 15:30:46.708616184 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointMessageContextImpl.java 2013-04-04 15:30:46.652616183 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -51,7 +51,6 @@ * * @author Jitendra Kotamraju */ -@SuppressWarnings({"SuspiciousMethodCalls"}) public final class EndpointMessageContextImpl extends AbstractMap implements MessageContext { /** @@ -69,6 +68,7 @@ } @Override + @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed @@ -113,6 +113,7 @@ } @Override + @SuppressWarnings("element-type-mismatch") public Object remove(Object key) { if (packet.supports(key)) { return packet.remove(key); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/InvokerTube.java 2013-04-04 15:30:46.960616188 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/InvokerTube.java 2013-04-04 15:30:46.908616187 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/MonitorBase.java 2013-04-04 15:30:47.224616192 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/MonitorBase.java 2013-04-04 15:30:47.164616191 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,14 +26,11 @@ package com.sun.xml.internal.ws.server; import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.config.management.policy.ManagedClientAssertion; import com.sun.xml.internal.ws.api.config.management.policy.ManagedServiceAssertion; import com.sun.xml.internal.ws.api.config.management.policy.ManagementAssertion.Setting; -import com.sun.xml.internal.ws.api.server.BoundEndpoint; import com.sun.xml.internal.ws.api.server.Container; -import com.sun.xml.internal.ws.api.server.Module; import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.client.Stub; import com.sun.org.glassfish.external.amx.AMXGlassfish; @@ -45,16 +42,11 @@ import com.sun.org.glassfish.gmbal.ManagedObjectManagerFactory; import java.io.IOException; import java.lang.reflect.*; -import java.net.URL; -import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; -import javax.management.ObjectName; -import javax.xml.namespace.QName; // BEGIN IMPORTS FOR RewritingMOM import java.util.ResourceBundle ; -import java.io.Closeable ; import java.lang.reflect.AnnotatedElement ; import java.lang.annotation.Annotation ; import javax.management.ObjectName ; @@ -276,7 +268,7 @@ ObjectName ignoredName = mom.getObjectName(mom.getRoot()); // The name is null when the MOM is a NOOP. if (ignoredName != null) { - logger.log(Level.INFO, "Metro monitoring rootname successfully set to: " + ignoredName); + logger.log(Level.INFO, "Metro monitoring rootname successfully set to: {0}", ignoredName); } return mom; } @@ -300,19 +292,6 @@ } } - public static void closeMOM(ManagedObjectManager mom) { - try { - final ObjectName name = mom.getObjectName(mom.getRoot()); - // The name is null when the MOM is a NOOP. - if (name != null) { - logger.log(Level.INFO, "Closing Metro monitoring root: " + name); - } - mom.close(); - } catch (java.io.IOException e) { - logger.log(Level.WARNING, "Ignoring error when closing Managed Object Manager", e); - } - } - private static Setting clientMonitoring = Setting.NOT_SET; private static Setting endpointMonitoring = Setting.NOT_SET; private static int typelibDebug = -1; @@ -382,7 +361,6 @@ private final ManagedObjectManager mom; private final static String gmbalQuotingCharsRegex = "\n|\\|\"|\\*|\\?|:|=|,"; - private final static String jmxQuotingCharsRegex = ",|=|:|\""; private final static String replacementChar = "-"; RewritingMOM(final ManagedObjectManager mom) { this.mom = mom; } @@ -393,42 +371,42 @@ // The interface - public void suspendJMXRegistration() { mom.suspendJMXRegistration(); } - public void resumeJMXRegistration() { mom.resumeJMXRegistration(); } - public GmbalMBean createRoot() { return mom.createRoot(); } - public GmbalMBean createRoot(Object root) { return mom.createRoot(root); } - public GmbalMBean createRoot(Object root, String name) { + @Override public void suspendJMXRegistration() { mom.suspendJMXRegistration(); } + @Override public void resumeJMXRegistration() { mom.resumeJMXRegistration(); } + @Override public GmbalMBean createRoot() { return mom.createRoot(); } + @Override public GmbalMBean createRoot(Object root) { return mom.createRoot(root); } + @Override public GmbalMBean createRoot(Object root, String name) { return mom.createRoot(root, rewrite(name)); } - public Object getRoot() { return mom.getRoot(); } - public GmbalMBean register(Object parent, Object obj, String name) { + @Override public Object getRoot() { return mom.getRoot(); } + @Override public GmbalMBean register(Object parent, Object obj, String name) { return mom.register(parent, obj, rewrite(name)); } - public GmbalMBean register(Object parent, Object obj) { return mom.register(parent, obj);} - public GmbalMBean registerAtRoot(Object obj, String name) { + @Override public GmbalMBean register(Object parent, Object obj) { return mom.register(parent, obj);} + @Override public GmbalMBean registerAtRoot(Object obj, String name) { return mom.registerAtRoot(obj, rewrite(name)); } - public GmbalMBean registerAtRoot(Object obj) { return mom.registerAtRoot(obj); } - public void unregister(Object obj) { mom.unregister(obj); } - public ObjectName getObjectName(Object obj) { return mom.getObjectName(obj); } - public AMXClient getAMXClient(Object obj) { return mom.getAMXClient(obj); } - public Object getObject(ObjectName oname) { return mom.getObject(oname); } - public void stripPrefix(String... str) { mom.stripPrefix(str); } - public void stripPackagePrefix() { mom.stripPackagePrefix(); } - public String getDomain() { return mom.getDomain(); } - public void setMBeanServer(MBeanServer server){mom.setMBeanServer(server); } - public MBeanServer getMBeanServer() { return mom.getMBeanServer(); } - public void setResourceBundle(ResourceBundle rb) { mom.setResourceBundle(rb); } - public ResourceBundle getResourceBundle() { return mom.getResourceBundle(); } - public void addAnnotation(AnnotatedElement element, Annotation annotation) { mom.addAnnotation(element, annotation); } - public void setRegistrationDebug(RegistrationDebugLevel level) { mom.setRegistrationDebug(level); } - public void setRuntimeDebug(boolean flag) { mom.setRuntimeDebug(flag); } - public void setTypelibDebug(int level) { mom.setTypelibDebug(level); } - public String dumpSkeleton(Object obj) { return mom.dumpSkeleton(obj); } - public void suppressDuplicateRootReport(boolean suppressReport) { mom.suppressDuplicateRootReport(suppressReport); } - public void close() throws IOException { mom.close(); } - public void setJMXRegistrationDebug(boolean x) { mom.setJMXRegistrationDebug(x); } - public boolean isManagedObject(Object x) { return mom.isManagedObject(x); } + @Override public GmbalMBean registerAtRoot(Object obj) { return mom.registerAtRoot(obj); } + @Override public void unregister(Object obj) { mom.unregister(obj); } + @Override public ObjectName getObjectName(Object obj) { return mom.getObjectName(obj); } + @Override public AMXClient getAMXClient(Object obj) { return mom.getAMXClient(obj); } + @Override public Object getObject(ObjectName oname) { return mom.getObject(oname); } + @Override public void stripPrefix(String... str) { mom.stripPrefix(str); } + @Override public void stripPackagePrefix() { mom.stripPackagePrefix(); } + @Override public String getDomain() { return mom.getDomain(); } + @Override public void setMBeanServer(MBeanServer server){mom.setMBeanServer(server); } + @Override public MBeanServer getMBeanServer() { return mom.getMBeanServer(); } + @Override public void setResourceBundle(ResourceBundle rb) { mom.setResourceBundle(rb); } + @Override public ResourceBundle getResourceBundle() { return mom.getResourceBundle(); } + @Override public void addAnnotation(AnnotatedElement element, Annotation annotation) { mom.addAnnotation(element, annotation); } + @Override public void setRegistrationDebug(RegistrationDebugLevel level) { mom.setRegistrationDebug(level); } + @Override public void setRuntimeDebug(boolean flag) { mom.setRuntimeDebug(flag); } + @Override public void setTypelibDebug(int level) { mom.setTypelibDebug(level); } + @Override public String dumpSkeleton(Object obj) { return mom.dumpSkeleton(obj); } + @Override public void suppressDuplicateRootReport(boolean suppressReport) { mom.suppressDuplicateRootReport(suppressReport); } + @Override public void close() throws IOException { mom.close(); } + @Override public void setJMXRegistrationDebug(boolean x) { mom.setJMXRegistrationDebug(x); } + @Override public boolean isManagedObject(Object x) { return mom.isManagedObject(x); } } // End of file. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/MonitorRootService.java 2013-04-04 15:30:47.480616196 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/MonitorRootService.java 2013-04-04 15:30:47.432616196 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,63 +26,20 @@ package com.sun.xml.internal.ws.server; import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.WSFeatureList; -import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; -import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; -import com.sun.xml.internal.ws.api.message.Message; -import com.sun.xml.internal.ws.api.message.Packet; -import com.sun.xml.internal.ws.api.model.SEIModel; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; -import com.sun.xml.internal.ws.api.pipe.Codec; -import com.sun.xml.internal.ws.api.pipe.Engine; -import com.sun.xml.internal.ws.api.pipe.Fiber; -import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; -import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext; -import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; -import com.sun.xml.internal.ws.api.pipe.Tube; -import com.sun.xml.internal.ws.api.pipe.TubeCloner; -import com.sun.xml.internal.ws.api.pipe.TubelineAssembler; -import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory; import com.sun.xml.internal.ws.api.server.*; -import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; -import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; -import com.sun.xml.internal.ws.resources.HandlerMessages; import com.sun.xml.internal.ws.transport.http.HttpAdapter; import com.sun.xml.internal.ws.util.RuntimeVersion; -import com.sun.org.glassfish.external.amx.AMXGlassfish; import com.sun.org.glassfish.gmbal.AMXMetadata; import com.sun.org.glassfish.gmbal.Description; -import com.sun.org.glassfish.gmbal.InheritedAttribute; -import com.sun.org.glassfish.gmbal.InheritedAttributes; import com.sun.org.glassfish.gmbal.ManagedAttribute; -import com.sun.org.glassfish.gmbal.ManagedData; import com.sun.org.glassfish.gmbal.ManagedObject; -import com.sun.org.glassfish.gmbal.ManagedObjectManager; -import com.sun.org.glassfish.gmbal.ManagedObjectManagerFactory; import java.net.URL; -import javax.management.ObjectName; - - -import javax.annotation.PreDestroy; import javax.xml.namespace.QName; -import javax.xml.ws.EndpointReference; -import javax.xml.ws.WebServiceException; -import javax.xml.ws.handler.Handler; -import javax.xml.stream.XMLStreamException; -import javax.management.InstanceAlreadyExistsException; -import java.lang.reflect.Method; import java.util.*; -import java.util.concurrent.Executor; -import java.util.logging.Level; -import java.util.logging.Logger; /** * @author Harold Carr @@ -129,28 +86,6 @@ } // - // Items from assembler context - // - /* NOTE: These are not ready when the AMX Validator runs so NPE. - @ManagedAttribute - @Description("The last tube in the dispatch chain") - public @NotNull Tube terminalTube() { - return endpoint.getAssemblerContext().getTerminalTube(); - } - - @ManagedAttribute - @Description("True if tubeline is known to be used for serving synchronous transport") - public boolean synchronous() { - return endpoint.getAssemblerContext().isSynchronous(); - } - - @ManagedAttribute - @Description("") - public String codecMimeType() { - return endpoint.getAssemblerContext().getCodec().getMimeType(); - } - */ - // // Items from WSBinding // @@ -246,7 +181,7 @@ @ManagedAttribute @Description("Show what goes across HTTP transport") - public void dumpHTTPMessages(final boolean x) { HttpAdapter.dump = x; } + public void dumpHTTPMessages(final boolean x) { HttpAdapter.setDump(x); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java 2013-04-04 15:30:47.756616201 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java 2013-04-04 15:30:47.692616200 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServerPropertyConstants.java 2013-04-04 15:30:48.040616205 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServerPropertyConstants.java 2013-04-04 15:30:47.988616204 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServerRtException.java 2013-04-04 15:30:48.268616209 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServerRtException.java 2013-04-04 15:30:48.216616208 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.server; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** */ --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServerSchemaValidationTube.java 2013-04-04 15:30:48.476616212 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServerSchemaValidationTube.java 2013-04-04 15:30:48.428616211 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServiceDefinitionImpl.java 2013-04-04 15:30:48.732616216 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/ServiceDefinitionImpl.java 2013-04-04 15:30:48.680616215 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/SingletonResolver.java 2013-04-04 15:30:48.964616219 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/SingletonResolver.java 2013-04-04 15:30:48.912616219 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java 2013-04-04 15:30:49.188616222 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java 2013-04-04 15:30:49.128616221 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java 2013-04-04 15:30:49.432616226 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java 2013-04-04 15:30:49.384616225 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 @@ import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; import com.sun.xml.internal.ws.api.server.SDDocument; import com.sun.xml.internal.ws.api.server.SDDocumentSource; -import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver; import javax.xml.namespace.QName; import javax.xml.transform.Result; @@ -49,7 +48,7 @@ * * @author Jitendra Kotamraju */ -final class WSDLGenResolver implements WSDLResolver { +final class WSDLGenResolver implements com.oracle.webservices.internal.api.databinding.WSDLResolver { private final List docs; private final List newDocs = new ArrayList(); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java 2013-04-04 15:30:49.632616230 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java 2013-04-04 15:30:49.584616229 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,6 +32,7 @@ import com.sun.xml.internal.ws.addressing.WSEPRExtension; import com.sun.xml.internal.ws.api.Component; import com.sun.xml.internal.ws.api.ComponentFeature; +import com.sun.xml.internal.ws.api.ComponentsFeature; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; @@ -40,25 +41,8 @@ import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.api.pipe.Codec; -import com.sun.xml.internal.ws.api.pipe.Engine; -import com.sun.xml.internal.ws.api.pipe.Fiber; -import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; -import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext; -import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; -import com.sun.xml.internal.ws.api.pipe.SyncStartForAsyncFeature; -import com.sun.xml.internal.ws.api.pipe.Tube; -import com.sun.xml.internal.ws.api.pipe.TubeCloner; -import com.sun.xml.internal.ws.api.pipe.TubelineAssembler; -import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory; -import com.sun.xml.internal.ws.api.server.Container; -import com.sun.xml.internal.ws.api.server.EndpointAwareCodec; -import com.sun.xml.internal.ws.api.server.EndpointComponent; -import com.sun.xml.internal.ws.api.server.EndpointReferenceExtensionContributor; -import com.sun.xml.internal.ws.api.server.LazyMOMProvider; -import com.sun.xml.internal.ws.api.server.TransportBackChannel; -import com.sun.xml.internal.ws.api.server.WSEndpoint; -import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate; +import com.sun.xml.internal.ws.api.pipe.*; +import com.sun.xml.internal.ws.api.server.*; import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties; @@ -81,18 +65,12 @@ import javax.xml.ws.WebServiceException; import javax.xml.ws.handler.Handler; import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.Executor; import java.util.logging.Level; import java.util.logging.Logger; +import javax.management.ObjectName; /** * {@link WSEndpoint} implementation. @@ -101,41 +79,42 @@ * @author Jitendra Kotamraju */ public /*final*/ class WSEndpointImpl extends WSEndpoint implements LazyMOMProvider.WSEndpointScopeChangeListener { - private static final Logger LOGGER = Logger.getLogger(WSEndpointImpl.class.getName()); + + private static final Logger logger = Logger.getLogger(com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.endpoint"); private final @NotNull QName serviceName; private final @NotNull QName portName; - protected final WSBinding binding; - private final SEIModel seiModel; + protected final WSBinding binding; + private final SEIModel seiModel; private final @NotNull Container container; - private final WSDLPort port; + private final WSDLPort port; - protected final Tube masterTubeline; - private final ServiceDefinitionImpl serviceDef; - private final SOAPVersion soapVersion; - private final Engine engine; + protected final Tube masterTubeline; + private final ServiceDefinitionImpl serviceDef; + private final SOAPVersion soapVersion; + private final Engine engine; private final @NotNull Codec masterCodec; private final @NotNull PolicyMap endpointPolicy; - private final Pool tubePool; + private final Pool tubePool; private final OperationDispatcher operationDispatcher; - private @NotNull ManagedObjectManager managedObjectManager; - private boolean managedObjectManagerClosed = false; - private Object managedObjectManagerLock = new Object(); - private LazyMOMProvider.Scope lazyMOMProviderScope = LazyMOMProvider.Scope.STANDALONE; + private @NotNull ManagedObjectManager managedObjectManager; + private boolean managedObjectManagerClosed = false; + private final Object managedObjectManagerLock = new Object(); + private LazyMOMProvider.Scope lazyMOMProviderScope = LazyMOMProvider.Scope.STANDALONE; private final @NotNull ServerTubeAssemblerContext context; private Map endpointReferenceExtensions = new HashMap(); - /** - * Set to true once we start shutting down this endpoint. - * Used to avoid running the clean up processing twice. - * - * @see #dispose() - */ - private boolean disposed; - - private final Class implementationClass; - private final @NotNull WSDLProperties wsdlProperties; - private final Set componentRegistry = new CopyOnWriteArraySet(); + /** + * Set to true once we start shutting down this endpoint. Used to avoid + * running the clean up processing twice. + * + * @see #dispose() + */ + private boolean disposed; + private final Class implementationClass; + private final @NotNull + WSDLProperties wsdlProperties; + private final Set componentRegistry = new CopyOnWriteArraySet(); protected WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding, Container container, SEIModel seiModel, WSDLPort port, @@ -157,44 +136,60 @@ LazyMOMProvider.INSTANCE.registerEndpoint(this); initManagedObjectManager(); - if (serviceDef != null) { - serviceDef.setOwner(this); - } + if (serviceDef != null) { + serviceDef.setOwner(this); + } - ComponentFeature cf = binding.getFeature(ComponentFeature.class); - if (cf != null) { - switch(cf.getTarget()) { - case ENDPOINT: - componentRegistry.add(cf.getComponent()); - break; - case CONTAINER: - container.getComponents().add(cf.getComponent()); - default: - throw new IllegalArgumentException(); - } + ComponentFeature cf = binding.getFeature(ComponentFeature.class); + if (cf != null) { + switch (cf.getTarget()) { + case ENDPOINT: + componentRegistry.add(cf.getComponent()); + break; + case CONTAINER: + container.getComponents().add(cf.getComponent()); + break; + default: + throw new IllegalArgumentException(); + } + } + ComponentsFeature csf = binding.getFeature(ComponentsFeature.class); + if (csf != null) { + for (ComponentFeature cfi : csf.getComponentFeatures()) { + switch (cfi.getTarget()) { + case ENDPOINT: + componentRegistry.add(cfi.getComponent()); + break; + case CONTAINER: + container.getComponents().add(cfi.getComponent()); + break; + default: + throw new IllegalArgumentException(); } + } + } TubelineAssembler assembler = TubelineAssemblerFactory.create( Thread.currentThread().getContextClassLoader(), binding.getBindingId(), container); - assert assembler != null; + assert assembler != null; this.operationDispatcher = (port == null) ? null : new OperationDispatcher(port, binding, seiModel); context = createServerTubeAssemblerContext(terminalTube, isSynchronous); - this.masterTubeline = assembler.createServer(context); + this.masterTubeline = assembler.createServer(context); - Codec c = context.getCodec(); - if (c instanceof EndpointAwareCodec) { + Codec c = context.getCodec(); + if (c instanceof EndpointAwareCodec) { // create a copy to avoid sharing the codec between multiple endpoints - c = c.copy(); - ((EndpointAwareCodec) c).setEndpoint(this); - } - this.masterCodec = c; + c = c.copy(); + ((EndpointAwareCodec) c).setEndpoint(this); + } + this.masterCodec = c; - tubePool = new TubePool(masterTubeline); - terminalTube.setEndpoint(this); - engine = new Engine(toString()); - wsdlProperties = (port == null) ? new WSDLDirectProperties(serviceName, portName, seiModel) : new WSDLPortProperties(port, seiModel); + tubePool = new TubePool(masterTubeline); + terminalTube.setEndpoint(this); + engine = new Engine(toString(), container); + wsdlProperties = (port == null) ? new WSDLDirectProperties(serviceName, portName, seiModel) : new WSDLPortProperties(port, seiModel); Map eprExtensions = new HashMap(); try { @@ -230,9 +225,9 @@ protected ServerTubeAssemblerContext createServerTubeAssemblerContext( EndpointAwareTube terminalTube, boolean isSynchronous) { - ServerTubeAssemblerContext context = new ServerPipeAssemblerContext( + ServerTubeAssemblerContext ctx = new ServerPipeAssemblerContext( seiModel, port, this, terminalTube, isSynchronous); - return context; + return ctx; } protected WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding, Container container, @@ -259,7 +254,7 @@ seiModel, port, this, null /* not known */, false); tubePool = new TubePool(masterTubeline); - engine = new Engine(toString()); + engine = new Engine(toString(), container); wsdlProperties = (port == null) ? new WSDLDirectProperties(serviceName, portName, seiModel) : new WSDLPortProperties(port, seiModel); } @@ -313,96 +308,143 @@ processAsync(request, callback, interceptor, true); } - private void processAsync(final Packet request, final CompletionCallback callback, FiberContextSwitchInterceptor interceptor, boolean schedule) { - request.endpoint = WSEndpointImpl.this; - request.addSatellite(wsdlProperties); - - Fiber fiber = engine.createFiber(); - if (interceptor != null) { - fiber.addInterceptor(interceptor); - } - final Tube tube = tubePool.take(); - Fiber.CompletionCallback cbak = new Fiber.CompletionCallback() { - public void onCompletion(@NotNull Packet response) { - tubePool.recycle(tube); - if (callback != null) { - callback.onCompletion(response); - } - } + private void processAsync(final Packet request, + final CompletionCallback callback, + FiberContextSwitchInterceptor interceptor, boolean schedule) { + Container old = ContainerResolver.getDefault().enterContainer(container); + try { + request.endpoint = WSEndpointImpl.this; + request.addSatellite(wsdlProperties); - public void onCompletion(@NotNull Throwable error) { - // let's not reuse tubes as they might be in a wrong state, so not - // calling tubePool.recycle() - // Convert all runtime exceptions to Packet so that transport doesn't - // have to worry about converting to wire message - // TODO XML/HTTP binding - Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage( - soapVersion, null, error); - Packet response = request.createServerResponse(faultMsg, request.endpoint.getPort(), null, - request.endpoint.getBinding()); - if (callback != null) { - callback.onCompletion(response); - } + Fiber fiber = engine.createFiber(); + fiber.setDeliverThrowableInPacket(true); + if (interceptor != null) { + fiber.addInterceptor(interceptor); + } + final Tube tube = tubePool.take(); + Fiber.CompletionCallback cbak = new Fiber.CompletionCallback() { + public void onCompletion(@NotNull Packet response) { + ThrowableContainerPropertySet tc = response.getSatellite(ThrowableContainerPropertySet.class); + if (tc == null) { + // Only recycle tubes in non-exception path as some Tubes may be + // in invalid state following exception + tubePool.recycle(tube); + } + + if (callback != null) { + if (tc != null) { + response = createServiceResponseForException(tc, + response, + soapVersion, + request.endpoint.getPort(), + null, + request.endpoint.getBinding()); } - }; + callback.onCompletion(response); + } + } - fiber.start(tube, request, cbak, - binding.isFeatureEnabled(SyncStartForAsyncFeature.class) || !schedule); + public void onCompletion(@NotNull Throwable error) { + // will never be called now that we are using + // fiber.setDeliverThrowableInPacket(true); + throw new IllegalStateException(); + } + }; + + fiber.start(tube, request, cbak, + binding.isFeatureEnabled(SyncStartForAsyncFeature.class) + || !schedule); + } finally { + ContainerResolver.getDefault().exitContainer(old); } + } + + @Override + public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc, + final Packet responsePacket, + final SOAPVersion soapVersion, + final WSDLPort wsdlPort, + final SEIModel seiModel, + final WSBinding binding) + { + // This will happen in addressing if it is enabled. + if (tc.isFaultCreated()) return responsePacket; + + final Message faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, tc.getThrowable()); + final Packet result = responsePacket.createServerResponse(faultMessage, wsdlPort, seiModel, binding); + // Pass info to upper layers + tc.setFaultMessage(faultMessage); + tc.setResponsePacket(responsePacket); + tc.setFaultCreated(true); + return result; + } @Override public void process(final Packet request, final CompletionCallback callback, FiberContextSwitchInterceptor interceptor) { processAsync(request, callback, interceptor, false); } - public @NotNull PipeHead createPipeHead() { - return new PipeHead() { - private final Tube tube = TubeCloner.clone(masterTubeline); - - public @NotNull Packet process(Packet request, WebServiceContextDelegate wscd, TransportBackChannel tbc) { - request.webServiceContextDelegate = wscd; - request.transportBackChannel = tbc; - request.endpoint = WSEndpointImpl.this; - request.addSatellite(wsdlProperties); - - Fiber fiber = engine.createFiber(); - Packet response; - try { - response = fiber.runSync(tube, request); - } catch (RuntimeException re) { - // Catch all runtime exceptions so that transport doesn't - // have to worry about converting to wire message - // TODO XML/HTTP binding - Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage( - soapVersion, null, re); - response = request.createServerResponse(faultMsg, request.endpoint.getPort(), null, request.endpoint.getBinding()); - } - return response; - } - }; - } + public @NotNull + PipeHead createPipeHead() { + return new PipeHead() { + private final Tube tube = TubeCloner.clone(masterTubeline); + + public @NotNull + Packet process(Packet request, WebServiceContextDelegate wscd, + TransportBackChannel tbc) { + Container old = ContainerResolver.getDefault().enterContainer(container); + try { + request.webServiceContextDelegate = wscd; + request.transportBackChannel = tbc; + request.endpoint = WSEndpointImpl.this; + request.addSatellite(wsdlProperties); + + Fiber fiber = engine.createFiber(); + Packet response; + try { + response = fiber.runSync(tube, request); + } catch (RuntimeException re) { + // Catch all runtime exceptions so that transport + // doesn't + // have to worry about converting to wire message + // TODO XML/HTTP binding + Message faultMsg = SOAPFaultBuilder + .createSOAPFaultMessage(soapVersion, null, re); + response = request.createServerResponse(faultMsg, + request.endpoint.getPort(), null, + request.endpoint.getBinding()); + } + return response; + } finally { + ContainerResolver.getDefault().exitContainer(old); + } + } + }; + } public synchronized void dispose() { - if (disposed) - return; - disposed = true; - - masterTubeline.preDestroy(); - - for (Handler handler : binding.getHandlerChain()) { - for (Method method : handler.getClass().getMethods()) { - if (method.getAnnotation(PreDestroy.class) == null) { - continue; - } - try { - method.invoke(handler); - } catch (Exception e) { - logger.log(Level.WARNING, HandlerMessages.HANDLER_PREDESTROY_IGNORE(e.getMessage()), e); - } - break; - } + if (disposed) { + return; + } + disposed = true; + + masterTubeline.preDestroy(); + + for (Handler handler : binding.getHandlerChain()) { + for (Method method : handler.getClass().getMethods()) { + if (method.getAnnotation(PreDestroy.class) == null) { + continue; + } + try { + method.invoke(handler); + } catch (Exception e) { + logger.log(Level.WARNING, HandlerMessages.HANDLER_PREDESTROY_IGNORE(e.getMessage()), e); + } + break; } - closeManagedObjectManager(); + } + closeManagedObjectManager(); + LazyMOMProvider.INSTANCE.unregisterEndpoint(this); } public ServiceDefinitionImpl getServiceDefinition() { @@ -488,7 +530,7 @@ @Override public boolean equals(Object obj) { - return component.equals(obj); + return component.equals(obj); } } @@ -514,34 +556,32 @@ } } + @Override public @NotNull Set getComponents() { return componentRegistry; } - private static final Logger logger = Logger.getLogger( - com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.endpoint"); - - public T getEndpointReference(Class - clazz, String address, String wsdlAddress, Element... referenceParameters) { + public T getEndpointReference(Class clazz, String address, String wsdlAddress, Element... referenceParameters) { List refParams = null; if (referenceParameters != null) { refParams = Arrays.asList(referenceParameters); } return getEndpointReference(clazz, address, wsdlAddress, null, refParams); } + public T getEndpointReference(Class clazz, - String address, String wsdlAddress, List metadata, - List referenceParameters) { - QName portType = null; - if (port != null) { - portType = port.getBinding().getPortTypeName(); - } + String address, String wsdlAddress, List metadata, + List referenceParameters) { + QName portType = null; + if (port != null) { + portType = port.getBinding().getPortTypeName(); + } AddressingVersion av = AddressingVersion.fromSpecClass(clazz); return new WSEndpointReference( - av, address, serviceName, portName, portType, metadata, wsdlAddress, referenceParameters,endpointReferenceExtensions.values(), null).toSpec(clazz); + av, address, serviceName, portName, portType, metadata, wsdlAddress, referenceParameters, endpointReferenceExtensions.values(), null).toSpec(clazz); - } + } public @NotNull QName getPortName() { return portName; @@ -583,12 +623,12 @@ */ @NotNull ManagedObjectManager obtainManagedObjectManager() { final MonitorRootService monitorRootService = new MonitorRootService(this); - final ManagedObjectManager managedObjectManager = monitorRootService.createManagedObjectManager(this); + final ManagedObjectManager mOM = monitorRootService.createManagedObjectManager(this); // ManagedObjectManager was suspended due to root creation (see MonitorBase#initMOM) - managedObjectManager.resumeJMXRegistration(); + mOM.resumeJMXRegistration(); - return managedObjectManager; + return mOM; } public void scopeChanged(LazyMOMProvider.Scope scope) { @@ -617,8 +657,11 @@ } } + private static final Logger monitoringLogger = Logger.getLogger(com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".monitoring"); + // This can be called independently of WSEndpoint.dispose. // Example: the WSCM framework calls this before dispose. + @Override public void closeManagedObjectManager() { synchronized (managedObjectManagerLock) { if (managedObjectManagerClosed == true) { @@ -634,16 +677,23 @@ } if (close) { - // no further notification on scope change - LazyMOMProvider.INSTANCE.unregisterEndpoint(this); - MonitorBase.closeMOM(managedObjectManager); + try { + final ObjectName name = managedObjectManager.getObjectName(managedObjectManager.getRoot()); + // The name is null when the MOM is a NOOP. + if (name != null) { + monitoringLogger.log(Level.INFO, "Closing Metro monitoring root: {0}", name); + } + managedObjectManager.close(); + } catch (java.io.IOException e) { + monitoringLogger.log(Level.WARNING, "Ignoring error when closing Managed Object Manager", e); + } } } managedObjectManagerClosed = true; } } - public @NotNull ServerTubeAssemblerContext getAssemblerContext() { + public @NotNull @Override ServerTubeAssemblerContext getAssemblerContext() { return context; } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointMOMProxy.java 2013-04-04 15:30:49.896616234 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointMOMProxy.java 2013-04-04 15:30:49.840616233 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,6 +26,20 @@ package com.sun.xml.internal.ws.server; import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.SOAPVersion; +import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.api.message.Packet; +import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; +import com.sun.xml.internal.ws.api.pipe.Codec; +import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; +import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; +import com.sun.xml.internal.ws.api.pipe.ThrowableContainerPropertySet; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.ServiceDefinition; +import com.sun.xml.internal.ws.api.server.WSEndpoint; +import com.sun.xml.internal.ws.policy.PolicyMap; +import com.sun.xml.internal.ws.wsdl.OperationDispatcher; import com.sun.org.glassfish.gmbal.AMXClient; import com.sun.org.glassfish.gmbal.GmbalMBean; import com.sun.org.glassfish.gmbal.ManagedObjectManager; @@ -35,7 +49,13 @@ import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; +import java.util.List; import java.util.ResourceBundle; +import java.util.Set; +import java.util.concurrent.Executor; +import javax.xml.namespace.QName; +import javax.xml.ws.EndpointReference; +import org.w3c.dom.Element; /** * {@link ManagedObjectManager} proxy class for {@link WSEndpointImpl} instances that could be used when Gmbal API calls @@ -43,7 +63,7 @@ * method from {@link ManagedObjectManager} is invoked on it. In this case a real instance of ManagedObjectManager is * obtained from WSEndpointImpl and the method is rather invoked on this object. */ -public class WSEndpointMOMProxy implements ManagedObjectManager { +public class WSEndpointMOMProxy extends WSEndpoint implements ManagedObjectManager { private final @NotNull WSEndpointImpl wsEndpoint; @@ -58,7 +78,8 @@ * * @return an ManagedObjectManager instance */ - private ManagedObjectManager getManagedObjectManager() { + @Override + public ManagedObjectManager getManagedObjectManager() { if (managedObjectManager == null) { managedObjectManager = wsEndpoint.obtainManagedObjectManager(); } @@ -83,124 +104,275 @@ return wsEndpoint; } + @Override public void suspendJMXRegistration() { getManagedObjectManager().suspendJMXRegistration(); } + @Override public void resumeJMXRegistration() { getManagedObjectManager().resumeJMXRegistration(); } + @Override public boolean isManagedObject(Object obj) { return getManagedObjectManager().isManagedObject(obj); } + @Override public GmbalMBean createRoot() { return getManagedObjectManager().createRoot(); } + @Override public GmbalMBean createRoot(Object root) { return getManagedObjectManager().createRoot(root); } + @Override public GmbalMBean createRoot(Object root, String name) { return getManagedObjectManager().createRoot(root, name); } + @Override public Object getRoot() { return getManagedObjectManager().getRoot(); } + @Override public GmbalMBean register(Object parent, Object obj, String name) { return getManagedObjectManager().register(parent, obj, name); } + @Override public GmbalMBean register(Object parent, Object obj) { return getManagedObjectManager().register(parent, obj); } + @Override public GmbalMBean registerAtRoot(Object obj, String name) { return getManagedObjectManager().registerAtRoot(obj, name); } + @Override public GmbalMBean registerAtRoot(Object obj) { return getManagedObjectManager().registerAtRoot(obj); } + @Override public void unregister(Object obj) { getManagedObjectManager().unregister(obj); } + @Override public ObjectName getObjectName(Object obj) { return getManagedObjectManager().getObjectName(obj); } + @Override public AMXClient getAMXClient(Object obj) { return getManagedObjectManager().getAMXClient(obj); } + @Override public Object getObject(ObjectName oname) { return getManagedObjectManager().getObject(oname); } + @Override public void stripPrefix(String... str) { getManagedObjectManager().stripPrefix(str); } + @Override public void stripPackagePrefix() { getManagedObjectManager().stripPackagePrefix(); } + @Override public String getDomain() { return getManagedObjectManager().getDomain(); } + @Override public void setMBeanServer(MBeanServer server) { getManagedObjectManager().setMBeanServer(server); } + @Override public MBeanServer getMBeanServer() { return getManagedObjectManager().getMBeanServer(); } + @Override public void setResourceBundle(ResourceBundle rb) { getManagedObjectManager().setResourceBundle(rb); } + @Override public ResourceBundle getResourceBundle() { return getManagedObjectManager().getResourceBundle(); } + @Override public void addAnnotation(AnnotatedElement element, Annotation annotation) { getManagedObjectManager().addAnnotation(element, annotation); } + @Override public void setRegistrationDebug(RegistrationDebugLevel level) { getManagedObjectManager().setRegistrationDebug(level); } + @Override public void setRuntimeDebug(boolean flag) { getManagedObjectManager().setRuntimeDebug(flag); } + @Override public void setTypelibDebug(int level) { getManagedObjectManager().setTypelibDebug(level); } + @Override public void setJMXRegistrationDebug(boolean flag) { getManagedObjectManager().setJMXRegistrationDebug(flag); } + @Override public String dumpSkeleton(Object obj) { return getManagedObjectManager().dumpSkeleton(obj); } + @Override public void suppressDuplicateRootReport(boolean suppressReport) { getManagedObjectManager().suppressDuplicateRootReport(suppressReport); } + @Override public void close() throws IOException { getManagedObjectManager().close(); } + @Override + public boolean equalsProxiedInstance(WSEndpoint endpoint) { + if (wsEndpoint == null) { + return (endpoint == null); + } + return wsEndpoint.equals(endpoint); + } + + @Override + public Codec createCodec() { + return this.wsEndpoint.createCodec(); + } + + @Override + public QName getServiceName() { + return this.wsEndpoint.getServiceName(); + } + + @Override + public QName getPortName() { + return this.wsEndpoint.getPortName(); + } + + @Override + public Class getImplementationClass() { + return this.wsEndpoint.getImplementationClass(); + } + + @Override + public WSBinding getBinding() { + return this.wsEndpoint.getBinding(); + } + + @Override + public Container getContainer() { + return this.wsEndpoint.getContainer(); + } + + @Override + public WSDLPort getPort() { + return this.wsEndpoint.getPort(); + } + + @Override + public void setExecutor(Executor exec) { + this.wsEndpoint.setExecutor(exec); + } + + @Override + public void schedule(Packet request, CompletionCallback callback, FiberContextSwitchInterceptor interceptor) { + this.wsEndpoint.schedule(request, callback, interceptor); + } + + @Override + public PipeHead createPipeHead() { + return this.wsEndpoint.createPipeHead(); + } + + @Override + public void dispose() { + if (this.wsEndpoint != null) { + this.wsEndpoint.dispose(); + } + } + + @Override + public ServiceDefinition getServiceDefinition() { + return this.wsEndpoint.getServiceDefinition(); + } + + @Override + public Set getComponentRegistry() { + return this.wsEndpoint.getComponentRegistry(); + } + + @Override + public SEIModel getSEIModel() { + return this.wsEndpoint.getSEIModel(); + } + + @Override + public PolicyMap getPolicyMap() { + return this.wsEndpoint.getPolicyMap(); + } + + @Override + public void closeManagedObjectManager() { + this.wsEndpoint.closeManagedObjectManager(); + } + + @Override + public ServerTubeAssemblerContext getAssemblerContext() { + return this.wsEndpoint.getAssemblerContext(); + } + + @Override + public EndpointReference getEndpointReference(Class clazz, String address, String wsdlAddress, Element... referenceParameters) { + return wsEndpoint.getEndpointReference(clazz, address, wsdlAddress, referenceParameters); + } + + @Override + public EndpointReference getEndpointReference(Class clazz, String address, String wsdlAddress, List metadata, List referenceParameters) { + return wsEndpoint.getEndpointReference(clazz, address, wsdlAddress, metadata, referenceParameters); + } + + @Override + public OperationDispatcher getOperationDispatcher() { + return wsEndpoint.getOperationDispatcher(); + } + + @Override + public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc, + final Packet responsePacket, + final SOAPVersion soapVersion, + final WSDLPort wsdlPort, + final SEIModel seiModel, + final WSBinding binding) + { + return wsEndpoint.createServiceResponseForException(tc, responsePacket, soapVersion, + wsdlPort, seiModel, binding); + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/package-info.java 2013-04-04 15:30:50.144616238 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/package-info.java 2013-04-04 15:30:50.084616237 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/AsyncProviderInvokerTube.java 2013-04-04 15:30:50.396616241 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/AsyncProviderInvokerTube.java 2013-04-04 15:30:50.348616240 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +30,7 @@ import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.Fiber; import com.sun.xml.internal.ws.api.pipe.NextAction; +import com.sun.xml.internal.ws.api.pipe.ThrowableContainerPropertySet; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.server.AsyncProvider; import com.sun.xml.internal.ws.api.server.AsyncProviderCallback; @@ -45,6 +46,7 @@ * * @author Jitendra Kotamraju */ +public // TODO needed by factory class AsyncProviderInvokerTube extends ProviderInvokerTube { private static final Logger LOGGER = Logger.getLogger( @@ -76,8 +78,14 @@ } synchronized(callback) { - if (resumer.response != null) - return doReturnWith(resumer.response); + if (resumer.response != null) { + // Only used by AsyncProvider + // Implementation may pass Packet containing throwable; use both + ThrowableContainerPropertySet tc = resumer.response.getSatellite(ThrowableContainerPropertySet.class); + Throwable t = (tc != null) ? tc.getThrowable() : null; + + return t != null ? doThrow(resumer.response, t) : doReturnWith(resumer.response); + } // Suspend the Fiber. AsyncProviderCallback will resume the Fiber after // it receives response. @@ -90,7 +98,7 @@ public void onResume(Packet response); } - private class FiberResumer implements Resumer { + /*private*/ public class FiberResumer implements Resumer { // TODO public for DISI private final Fiber fiber; public FiberResumer() { @@ -98,7 +106,11 @@ } public void onResume(Packet response) { - fiber.resume(response); + // Only used by AsyncProvider + // Implementation may pass Packet containing throwable; use both + ThrowableContainerPropertySet tc = response.getSatellite(ThrowableContainerPropertySet.class); + Throwable t = (tc != null) ? tc.getThrowable() : null; + fiber.resume(t, response); } } @@ -110,7 +122,7 @@ } } - private class AsyncProviderCallbackImpl implements AsyncProviderCallback { + /*private*/ public class AsyncProviderCallbackImpl implements AsyncProviderCallback { // TODO public for DISI private final Packet request; private Resumer resumer; @@ -133,8 +145,8 @@ public void sendError(@NotNull Throwable t) { Exception e; - if (t instanceof RuntimeException) { - e = (RuntimeException)t; + if (t instanceof Exception) { + e = (Exception) t; } else { e = new RuntimeException(t); } @@ -148,10 +160,10 @@ /** * The single {@link javax.xml.ws.WebServiceContext} instance injected into application. */ - private static final class AsyncWebServiceContext extends AbstractWebServiceContext { + /*private static final*/ public class AsyncWebServiceContext extends AbstractWebServiceContext { // TODO public for DISI final Packet packet; - AsyncWebServiceContext(WSEndpoint endpoint, Packet packet) { + public AsyncWebServiceContext(WSEndpoint endpoint, Packet packet) { // TODO public for DISI super(endpoint); this.packet = packet; } @@ -166,7 +178,7 @@ } public @NotNull NextAction processException(@NotNull Throwable t) { - throw new IllegalStateException("AsyncProviderInvokerTube's processException shouldn't be called."); + return doThrow(t); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/MessageProviderArgumentBuilder.java 2013-04-04 15:30:50.620616245 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/MessageProviderArgumentBuilder.java 2013-04-04 15:30:50.572616244 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +41,7 @@ } @Override - protected Message getParameter(Packet packet) { + /*protected*/ public Message getParameter(Packet packet) { return packet.getMessage(); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java 2013-04-04 15:30:50.872616249 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java 2013-04-04 15:30:50.816616248 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,10 +26,12 @@ package com.sun.xml.internal.ws.server.provider; import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; +import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import javax.xml.ws.soap.SOAPBinding; @@ -37,6 +39,7 @@ * @author Jitendra Kotamraju */ +public // TODO need this in the factory abstract class ProviderArgumentsBuilder { /** @@ -57,7 +60,7 @@ * Binds {@link com.sun.xml.internal.ws.api.message.Message} to method invocation parameter * @param packet */ - protected abstract T getParameter(Packet packet); + /*protected*/ public abstract T getParameter(Packet packet); // TODO public for DISI pluggable Provider protected abstract Message getResponseMessage(T returnValue); @@ -75,21 +78,26 @@ public static ProviderArgumentsBuilder create(ProviderEndpointModel model, WSBinding binding) { if (model.datatype == Packet.class) - return new PacketProviderArgumentsBuilder(); + return new PacketProviderArgumentsBuilder(binding.getSOAPVersion()); return (binding instanceof SOAPBinding) ? SOAPProviderArgumentBuilder.create(model, binding.getSOAPVersion()) : XMLProviderArgumentBuilder.createBuilder(model, binding); } private static class PacketProviderArgumentsBuilder extends ProviderArgumentsBuilder { + private final SOAPVersion soapVersion; + + public PacketProviderArgumentsBuilder(SOAPVersion soapVersion) { + this.soapVersion = soapVersion; + } @Override protected Message getResponseMessage(Exception e) { - // Should never be called - throw new IllegalStateException(); + // Will be called by AsyncProviderCallbackImpl.sendError + return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e); } @Override - protected Packet getParameter(Packet packet) { + /*protected*/ public Packet getParameter(Packet packet) { return packet; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/ProviderEndpointModel.java 2013-04-04 15:30:51.152616253 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/ProviderEndpointModel.java 2013-04-04 15:30:51.092616253 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/ProviderInvokerTube.java 2013-04-04 15:30:51.400616257 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/ProviderInvokerTube.java 2013-04-04 15:30:51.348616257 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,7 +28,9 @@ import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.server.AsyncProvider; +import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.Invoker; +import com.sun.xml.internal.ws.api.server.ProviderInvokerTubeFactory; import com.sun.xml.internal.ws.binding.SOAPBindingImpl; import com.sun.xml.internal.ws.server.InvokerTube; @@ -49,16 +51,15 @@ } public static ProviderInvokerTube - create(Class implType, WSBinding binding, Invoker invoker) { + create(final Class implType, final WSBinding binding, final Invoker invoker, final Container container) { - ProviderEndpointModel model = new ProviderEndpointModel(implType, binding); - ProviderArgumentsBuilder argsBuilder = ProviderArgumentsBuilder.create(model, binding); + final ProviderEndpointModel model = new ProviderEndpointModel(implType, binding); + final ProviderArgumentsBuilder argsBuilder = ProviderArgumentsBuilder.create(model, binding); if (binding instanceof SOAPBindingImpl) { //set portKnownHeaders on Binding, so that they can be used for MU processing ((SOAPBindingImpl) binding).setMode(model.mode); } - return model.isAsync ? new AsyncProviderInvokerTube(invoker, argsBuilder) - : new SyncProviderInvokerTube(invoker, argsBuilder); + return ProviderInvokerTubeFactory.create(null, container, implType, invoker, argsBuilder, model.isAsync); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/SOAPProviderArgumentBuilder.java 2013-04-04 15:30:51.640616261 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/SOAPProviderArgumentBuilder.java 2013-04-04 15:30:51.588616260 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -77,7 +77,7 @@ super(soapVersion); } - protected Source getParameter(Packet packet) { + /*protected*/ public Source getParameter(Packet packet) { return packet.getMessage().readPayloadAsSource(); } @@ -96,7 +96,7 @@ super(soapVersion); } - protected Source getParameter(Packet packet) { + /*protected*/ public Source getParameter(Packet packet) { return packet.getMessage().readEnvelopeAsSource(); } @@ -114,7 +114,7 @@ super(soapVersion); } - protected SOAPMessage getParameter(Packet packet) { + /*protected*/ public SOAPMessage getParameter(Packet packet) { try { return packet.getMessage().readAsSOAPMessage(packet, true); } catch (SOAPException se) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/SyncProviderInvokerTube.java 2013-04-04 15:30:51.888616265 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/SyncProviderInvokerTube.java 2013-04-04 15:30:51.840616264 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +30,7 @@ import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.pipe.NextAction; +import com.sun.xml.internal.ws.api.pipe.ThrowableContainerPropertySet; import com.sun.xml.internal.ws.api.server.Invoker; import javax.xml.ws.Provider; @@ -41,6 +42,7 @@ * * @author Jitendra Kotamraju */ +public // TODO needed by factory class SyncProviderInvokerTube extends ProviderInvokerTube { private static final Logger LOGGER = Logger.getLogger( @@ -79,15 +81,21 @@ } } Packet response = argsBuilder.getResponse(request,returnValue,port,binding); - return doReturnWith(response); + + // Only used by Provider + // Implementation may pass Packet containing throwable; use both + ThrowableContainerPropertySet tc = response.getSatellite(ThrowableContainerPropertySet.class); + Throwable t = (tc != null) ? tc.getThrowable() : null; + + return t != null ? doThrow(response, t) : doReturnWith(response); } - public NextAction processResponse(Packet response) { - throw new IllegalStateException("InovkerPipe's processResponse shouldn't be called."); + public @NotNull NextAction processResponse(@NotNull Packet response) { + return doReturnWith(response); } - public NextAction processException(@NotNull Throwable t) { - throw new IllegalStateException("InovkerPipe's processException shouldn't be called."); + public @NotNull NextAction processException(@NotNull Throwable t) { + return doThrow(t); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java 2013-04-04 15:30:52.160616269 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java 2013-04-04 15:30:52.096616268 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -90,7 +90,7 @@ this.binding = binding; } public DataSource getParameter(Packet packet) { - Message msg = packet.getMessage(); + Message msg = packet.getInternalMessage(); return (msg instanceof XMLMessage.MessageDataSource) ? ((XMLMessage.MessageDataSource) msg).getDataSource() : XMLMessage.getDataSource(msg, binding.getFeatures()); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java 2013-04-04 15:30:52.396616273 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java 2013-04-04 15:30:52.344616272 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,6 +35,7 @@ import com.sun.xml.internal.ws.model.ParameterImpl; import com.sun.xml.internal.ws.model.WrapperParameter; import com.sun.xml.internal.ws.resources.ServerMessages; +import com.sun.xml.internal.ws.spi.db.RepeatedElementBridge; import com.sun.xml.internal.ws.spi.db.XMLBridge; import com.sun.xml.internal.ws.spi.db.DatabindingException; import com.sun.xml.internal.ws.spi.db.PropertyAccessor; @@ -52,7 +53,6 @@ import javax.xml.soap.SOAPFault; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamConstants; import javax.xml.transform.Source; import javax.xml.ws.Holder; import javax.xml.ws.WebServiceException; @@ -96,6 +96,7 @@ static final class None extends EndpointArgumentsBuilder { private None(){ } + @Override public void readRequest(Message msg, Object[] args) { msg.consume(); } @@ -105,7 +106,7 @@ * The singleton instance that produces null return value. * Used for operations that doesn't have any output. */ - public static EndpointArgumentsBuilder NONE = new None(); + public final static EndpointArgumentsBuilder NONE = new None(); /** * Returns the 'uninitialized' value for the given type. @@ -113,6 +114,7 @@ *

    * For primitive types, it's '0', and for reference types, it's null. */ + @SuppressWarnings("element-type-mismatch") public static Object getVMUninitializedValue(Type type) { // if this map returns null, that means the 'type' is a reference type, // in which case 'null' is the correct null value, so this code is correct. @@ -132,6 +134,70 @@ m.put(double.class,(double)0); } + protected QName wrapperName; + + static final class WrappedPartBuilder { + private final XMLBridge bridge; + private final EndpointValueSetter setter; + + /** + * @param bridge + * specifies how the part is unmarshalled. + * @param setter + * specifies how the obtained value is returned to the endpoint. + */ + public WrappedPartBuilder(XMLBridge bridge, EndpointValueSetter setter) { + this.bridge = bridge; + this.setter = setter; + } + + void readRequest( Object[] args, XMLStreamReader r, AttachmentSet att) throws JAXBException { + Object obj = null; + AttachmentUnmarshallerImpl au = (att != null)?new AttachmentUnmarshallerImpl(att):null; + if (bridge instanceof RepeatedElementBridge) { + RepeatedElementBridge rbridge = (RepeatedElementBridge)bridge; + ArrayList list = new ArrayList(); + QName name = r.getName(); + while (r.getEventType()==XMLStreamReader.START_ELEMENT && name.equals(r.getName())) { + list.add(rbridge.unmarshal(r, au)); + XMLStreamReaderUtil.toNextTag(r, name); + } + obj = rbridge.collectionHandler().convert(list); + } else { + obj = bridge.unmarshal(r, au); + } + setter.put(obj,args); + } + } + + protected Map wrappedParts = null; + + protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { + if (!msg.hasPayload()) { + throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); + } + XMLStreamReader reader = msg.readPayload(); + XMLStreamReaderUtil.verifyTag(reader,wrapperName); + reader.nextTag(); + while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { + // TODO: QName has a performance issue + QName name = reader.getName(); + WrappedPartBuilder part = wrappedParts.get(name); + if(part==null) { + // no corresponding part found. ignore + XMLStreamReaderUtil.skipElement(reader); + reader.nextTag(); + } else { + part.readRequest(args,reader, msg.getAttachments()); + } + XMLStreamReaderUtil.toNextTag(reader, name); + } + + // we are done with the body + reader.close(); + XMLStreamReaderFactory.recycle(reader); + } + /** * {@link EndpointArgumentsBuilder} that sets the VM uninitialized value to the type. */ @@ -489,15 +555,14 @@ private final PartBuilder[] parts; private final XMLBridge wrapper; - private final QName wrapperName; + private boolean dynamicWrapper; public DocLit(WrapperParameter wp, Mode skipMode) { wrapperName = wp.getName(); wrapper = wp.getXMLBridge(); Class wrapperType = (Class) wrapper.getTypeInfo().type; - + dynamicWrapper = WrapperComposite.class.equals(wrapperType); List parts = new ArrayList(); - List children = wp.getWrapperChildren(); for (ParameterImpl p : children) { if (p.getMode() == skipMode) { @@ -509,16 +574,23 @@ */ QName name = p.getName(); try { - parts.add( new PartBuilder( - wp.getOwner().getBindingContext().getElementPropertyAccessor( - wrapperType, - name.getNamespaceURI(), - p.getName().getLocalPart()), - EndpointValueSetter.get(p) - )); + if (dynamicWrapper) { + if (wrappedParts == null) wrappedParts = new HashMap(); + XMLBridge xmlBridge = p.getInlinedRepeatedElementBridge(); + if (xmlBridge == null) xmlBridge = p.getXMLBridge(); + wrappedParts.put( p.getName(), new WrappedPartBuilder(xmlBridge, EndpointValueSetter.get(p))); + } else { + parts.add( new PartBuilder( + wp.getOwner().getBindingContext().getElementPropertyAccessor( + wrapperType, + name.getNamespaceURI(), + p.getName().getLocalPart()), + EndpointValueSetter.get(p) + ) ); // wrapper parameter itself always bind to body, and // so do all its children - assert p.getBinding()== ParameterBinding.BODY; + assert p.getBinding()== ParameterBinding.BODY; + } } catch (JAXBException e) { throw new WebServiceException( // TODO: i18n wrapperType+" do not have a property of the name "+name,e); @@ -529,30 +601,33 @@ } public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { + if (dynamicWrapper) { + readWrappedRequest(msg, args); + } else { + if (parts.length>0) { + if (!msg.hasPayload()) { + throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); + } + XMLStreamReader reader = msg.readPayload(); + XMLStreamReaderUtil.verifyTag(reader, wrapperName); + Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? + new AttachmentUnmarshallerImpl(msg.getAttachments()): null); - if (parts.length>0) { - if (!msg.hasPayload()) { - throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); - } - XMLStreamReader reader = msg.readPayload(); - XMLStreamReaderUtil.verifyTag(reader, wrapperName); - Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? - new AttachmentUnmarshallerImpl(msg.getAttachments()): null); - - try { - for (PartBuilder part : parts) { - part.readRequest(args,wrapperBean); + try { + for (PartBuilder part : parts) { + part.readRequest(args,wrapperBean); + } + } catch (DatabindingException e) { + // this can happen when the set method throw a checked exception or something like that + throw new WebServiceException(e); // TODO:i18n } - } catch (DatabindingException e) { - // this can happen when the set method throw a checked exception or something like that - throw new WebServiceException(e); // TODO:i18n - } - // we are done with the body - reader.close(); - XMLStreamReaderFactory.recycle(reader); - } else { - msg.consume(); + // we are done with the body + reader.close(); + XMLStreamReaderFactory.recycle(reader); + } else { + msg.consume(); + } } } @@ -590,20 +665,14 @@ * and processes all such wrapped parts. */ public static final class RpcLit extends EndpointArgumentsBuilder { - /** - * {@link PartBuilder} keyed by the element name (inside the wrapper element.) - */ - private final Map parts = new HashMap(); - - private QName wrapperName; - public RpcLit(WrapperParameter wp) { assert wp.getTypeInfo().type== WrapperComposite.class; wrapperName = wp.getName(); + wrappedParts = new HashMap(); List children = wp.getWrapperChildren(); for (ParameterImpl p : children) { - parts.put( p.getName(), new PartBuilder( + wrappedParts.put( p.getName(), new WrappedPartBuilder( p.getXMLBridge(), EndpointValueSetter.get(p) )); // wrapper parameter itself always bind to body, and @@ -613,62 +682,7 @@ } public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { - if (!msg.hasPayload()) { - throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); - } - XMLStreamReader reader = msg.readPayload(); - XMLStreamReaderUtil.verifyTag(reader,wrapperName); - reader.nextTag(); - - while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { - // TODO: QName has a performance issue - QName name = reader.getName(); - PartBuilder part = parts.get(name); - if(part==null) { - // no corresponding part found. ignore - XMLStreamReaderUtil.skipElement(reader); - reader.nextTag(); - } else { - part.readRequest(args,reader, msg.getAttachments()); - } - // skip any whitespace - if (reader.getEventType() != XMLStreamConstants.START_ELEMENT && - reader.getEventType() != XMLStreamConstants.END_ELEMENT) { - XMLStreamReaderUtil.nextElementContent(reader); - } - if(reader.getEventType() == XMLStreamConstants.END_ELEMENT && name.equals(reader.getName())) { - XMLStreamReaderUtil.nextElementContent(reader); - } - } - - // we are done with the body - reader.close(); - XMLStreamReaderFactory.recycle(reader); - } - - /** - * Unmarshals each wrapped part into a JAXB object and moves it - * to the expected place. - */ - static final class PartBuilder { - private final XMLBridge bridge; - private final EndpointValueSetter setter; - - /** - * @param bridge - * specifies how the part is unmarshalled. - * @param setter - * specifies how the obtained value is returned to the endpoint. - */ - public PartBuilder(XMLBridge bridge, EndpointValueSetter setter) { - this.bridge = bridge; - this.setter = setter; - } - - final void readRequest( Object[] args, XMLStreamReader r, AttachmentSet att) throws JAXBException { - Object obj = bridge.unmarshal(r, (att != null)?new AttachmentUnmarshallerImpl(att):null); - setter.put(obj,args); - } + readWrappedRequest(msg, args); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java 2013-04-04 15:30:52.644616276 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java 2013-04-04 15:30:52.592616275 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -143,10 +143,20 @@ */ protected final ValueGetter[] getters; + /** + * How does each wrapped parameter binds to XML? + */ + protected XMLBridge[] parameterBridges; + + /** + * Used for error diagnostics. + */ + protected List children; + protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion) { super(wp.getXMLBridge(), soapVersion); - List children = wp.getWrapperChildren(); + children = wp.getWrapperChildren(); indices = new int[children.size()]; getters = new ValueGetter[children.size()]; @@ -156,6 +166,32 @@ getters[i] = ValueGetter.get(p); } } + + /** + * Packs a bunch of arguments intoa {@link WrapperComposite}. + */ + WrapperComposite buildWrapperComposite(Object[] methodArgs, Object returnValue) { + WrapperComposite cs = new WrapperComposite(); + cs.bridges = parameterBridges; + cs.values = new Object[parameterBridges.length]; + + // fill in wrapped parameters from methodArgs + for( int i=indices.length-1; i>=0; i-- ) { + Object v; + if (indices[i] == -1) { + v = getters[i].get(returnValue); + } else { + v = getters[i].get(methodArgs[indices[i]]); + } + if(v==null) { + throw new WebServiceException("Method Parameter: "+ + children.get(i).getName() +" cannot be null. This is BP 1.1 R2211 violation."); + } + cs.values[i] = v; + } + + return cs; + } } /** @@ -174,6 +210,7 @@ * Wrapper bean. */ private final Class wrapper; + private boolean dynamicWrapper; /** * Needed to get wrapper instantiation method. @@ -186,21 +223,26 @@ public DocLit(WrapperParameter wp, SOAPVersion soapVersion) { super(wp, soapVersion); bindingContext = wp.getOwner().getBindingContext(); - wrapper = (Class)wp.getXMLBridge().getTypeInfo().type; - - List children = wp.getWrapperChildren(); - + dynamicWrapper = WrapperComposite.class.equals(wrapper); + children = wp.getWrapperChildren(); + parameterBridges = new XMLBridge[children.size()]; accessors = new PropertyAccessor[children.size()]; for( int i=0; i children; /** * Creates a {@link EndpointResponseMessageBuilder} from a {@link WrapperParameter}. @@ -269,8 +303,6 @@ // we'll use CompositeStructure to pack requests assert wp.getTypeInfo().type==WrapperComposite.class; - this.children = wp.getWrapperChildren(); - parameterBridges = new XMLBridge[children.size()]; for( int i=0; i=0; i-- ) { - Object v; - if (indices[i] == -1) { - v = getters[i].get(returnValue); - } else { - v = getters[i].get(methodArgs[indices[i]]); - } - if(v==null) { - throw new WebServiceException("Method Parameter: "+ - children.get(i).getName() +" cannot be null. This is BP 1.1 R2211 violation."); - } - cs.values[i] = v; - } - - return cs; + Object build(Object[] methodArgs, Object returnValue) { + return buildWrapperComposite(methodArgs, returnValue); } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java 2013-04-04 15:30:52.908616281 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java 2013-04-04 15:30:52.852616280 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/Invoker.java 2013-04-04 15:30:53.172616285 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/Invoker.java 2013-04-04 15:30:53.112616284 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/InvokerSource.java 2013-04-04 15:30:53.412616288 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/InvokerSource.java 2013-04-04 15:30:53.356616288 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/InvokerTube.java 2013-04-04 15:30:53.664616293 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/InvokerTube.java 2013-04-04 15:30:53.612616292 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java 2013-04-04 15:30:53.892616296 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java 2013-04-04 15:30:53.832616295 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java 2013-04-04 15:30:54.144616300 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java 2013-04-04 15:30:54.092616299 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 @@ package com.sun.xml.internal.ws.server.sei; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.databinding.EndpointCallBridge; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.NextAction; @@ -36,13 +35,8 @@ import com.sun.xml.internal.ws.client.sei.MethodHandler; import com.sun.xml.internal.ws.model.AbstractSEIModelImpl; import com.sun.xml.internal.ws.server.InvokerTube; -import com.sun.xml.internal.ws.resources.ServerMessages; -import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import com.sun.xml.internal.ws.wsdl.DispatchException; -import com.sun.xml.internal.org.jvnet.ws.databinding.JavaCallInfo; -import java.util.List; import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; /** * This pipe is used to invoke SEI based endpoints. @@ -87,18 +81,18 @@ DispatchException e = (DispatchException)call.getException(); return doReturnWith(req.createServerResponse(e.fault, model.getPort(), null, binding)); } - Packet res = (Packet) model.getDatabinding().serializeResponse(call); + Packet res = (Packet) model.getDatabinding().serializeResponse(call); res = req.relateServerResponse(res, req.endpoint.getPort(), model, req.endpoint.getBinding()); assert res != null; return doReturnWith(res); } public @NotNull NextAction processResponse(@NotNull Packet response) { - throw new IllegalStateException("InovkerPipe's processResponse shouldn't be called."); + return doReturnWith(response); } public @NotNull NextAction processException(@NotNull Throwable t) { - throw new IllegalStateException("InovkerPipe's processException shouldn't be called."); + return doThrow(t); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/TieHandler.java 2013-04-04 15:30:54.384616304 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/TieHandler.java 2013-04-04 15:30:54.332616302 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 +25,12 @@ package com.sun.xml.internal.ws.server.sei; +import com.oracle.webservices.internal.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.databinding.EndpointCallBridge; -import com.sun.xml.internal.ws.api.databinding.JavaCallInfo; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageContextFactory; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; @@ -57,7 +58,7 @@ *

    * This class mainly performs the following two tasks: *

      - *
    1. Takes a {@link Message] that represents a request, + *
    2. Takes a {@link Message} that represents a request, * and extracts the arguments (and updates {@link Holder}s.) *
    3. Accepts return value and {@link Holder} arguments for a Java method, * and creates {@link JAXBMessage} that represents a response message. @@ -90,8 +91,9 @@ // these objects together create a response message from method parameters private final EndpointResponseMessageBuilder bodyBuilder; private final MessageFiller[] outFillers; + protected MessageContextFactory packetFactory; - public TieHandler(JavaMethodImpl method, WSBinding binding) { + public TieHandler(JavaMethodImpl method, WSBinding binding, MessageContextFactory mcf) { this.soapVersion = binding.getSOAPVersion(); this.method = method.getMethod(); this.javaMethodModel = method; @@ -101,6 +103,7 @@ this.outFillers = fillers.toArray(new MessageFiller[fillers.size()]); this.isOneWay = method.getMEP().isOneWay(); this.noOfArgs = this.method.getParameterTypes().length; + packetFactory = mcf; } /** @@ -178,7 +181,7 @@ */ private EndpointResponseMessageBuilder createResponseMessageBuilder(List fillers) { - EndpointResponseMessageBuilder bodyBuilder = null; + EndpointResponseMessageBuilder tmpBodyBuilder = null; List rp = javaMethodModel.getResponseParameters(); for (ParameterImpl param : rp) { @@ -188,14 +191,14 @@ case BODY: if(param.isWrapperStyle()) { if(param.getParent().getBinding().isRpcLit()) { - bodyBuilder = new EndpointResponseMessageBuilder.RpcLit((WrapperParameter)param, + tmpBodyBuilder = new EndpointResponseMessageBuilder.RpcLit((WrapperParameter)param, soapVersion); } else { - bodyBuilder = new EndpointResponseMessageBuilder.DocLit((WrapperParameter)param, + tmpBodyBuilder = new EndpointResponseMessageBuilder.DocLit((WrapperParameter)param, soapVersion); } } else { - bodyBuilder = new EndpointResponseMessageBuilder.Bare(param, soapVersion); + tmpBodyBuilder = new EndpointResponseMessageBuilder.Bare(param, soapVersion); } break; case HEADER: @@ -211,20 +214,20 @@ } } - if (bodyBuilder == null) { + if (tmpBodyBuilder == null) { // no parameter binds to body. we create an empty message switch(soapVersion) { case SOAP_11: - bodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP11; + tmpBodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP11; break; case SOAP_12: - bodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP12; + tmpBodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP12; break; default: throw new AssertionError(); } } - return bodyBuilder; + return tmpBodyBuilder; } public Object[] readRequest(Message reqMsg) { @@ -241,7 +244,6 @@ public Message createResponse(JavaCallInfo call) { Message responseMessage; - Object ret = call.getReturnValue(); if (call.getException() == null) { responseMessage = isOneWay ? null : createResponseMessage(call.getParameters(), call.getReturnValue()); } else { @@ -310,21 +312,24 @@ private static final Logger LOGGER = Logger.getLogger(TieHandler.class.getName()); + @Override public JavaCallInfo deserializeRequest(Packet req) { - JavaCallInfo call = new JavaCallInfo(); + com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(); call.setMethod(this.getMethod()); Object[] args = this.readRequest(req.getMessage()); call.setParameters(args); return call; } + @Override public Packet serializeResponse(JavaCallInfo call) { - Message msg = this.createResponse(call); - Packet response = new Packet(); - response.setMessage(msg); - return response; + Message msg = this.createResponse(call); + Packet p = (msg == null) ? (Packet)packetFactory.createContext() : (Packet)packetFactory.createContext(msg); + p.setState(Packet.State.ServerResponse); + return p; } + @Override public JavaMethod getOperationModel() { return javaMethodModel; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/ValueGetter.java 2013-04-04 15:30:54.632616307 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/server/sei/ValueGetter.java 2013-04-04 15:30:54.580616307 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java 2013-04-04 15:30:54.884616312 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java 2013-04-04 15:30:54.828616310 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingContext.java 2013-04-04 15:30:55.156616316 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingContext.java 2013-04-04 15:30:55.088616314 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -103,7 +103,7 @@ * Creates a mini-marshaller/unmarshaller that can process a {@link TypeInfo}. * * @return - * null if the specified reference is not given to {@link BindingContext#newInstance}. + * null if the specified reference is not given to {@link BindingContext#newWrapperInstace(Class)}. * * @since 2.0 EA1 */ @@ -205,7 +205,7 @@ * * @throws IllegalArgumentException * if the parameter is null or not a part of the {@link TypeInfo}s specified - * in the {@link BindingContext#newInstance} method. + * in the {@link BindingContext#newWrapperInstace(Class)} method. * * @return null * if the referenced type is an anonymous and therefore doesn't have a name. --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingContextFactory.java 2013-04-04 15:30:55.392616319 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingContextFactory.java 2013-04-04 15:30:55.332616319 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,10 +33,10 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; -import com.sun.xml.internal.org.jvnet.ws.databinding.DatabindingModeFeature; +import com.oracle.webservices.internal.api.databinding.DatabindingModeFeature; import com.sun.xml.internal.ws.db.glassfish.JAXBRIContextFactory; -import com.sun.xml.internal.ws.policy.privateutil.ServiceConfigurationError; +import com.sun.xml.internal.ws.util.ServiceConfigurationError; import com.sun.xml.internal.ws.util.ServiceFinder; /** @@ -115,7 +115,7 @@ * @param databinding mode/flavor or the package name of the JAXBContext implementation. * @return */ - abstract protected boolean isFor(String str); + abstract protected boolean isFor(String databinding); /** * @deprecated - Does jaxws need this? --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java 2013-04-04 15:30:55.640616323 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java 2013-04-04 15:30:55.588616323 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingInfo.java 2013-04-04 15:30:55.880616327 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingInfo.java 2013-04-04 15:30:55.824616326 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/DatabindingException.java 2013-04-04 15:30:56.120616331 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/DatabindingException.java 2013-04-04 15:30:56.048616329 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/DatabindingProvider.java 2013-04-04 15:30:56.352616334 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/DatabindingProvider.java 2013-04-04 15:30:56.300616334 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +27,9 @@ import java.util.Map; -import com.sun.xml.internal.org.jvnet.ws.databinding.Databinding; +import com.oracle.webservices.internal.api.databinding.Databinding; +import com.oracle.webservices.internal.api.databinding.WSDLGenerator; + import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; public interface DatabindingProvider { @@ -35,5 +37,5 @@ boolean isFor(String databindingMode); void init(Map properties); Databinding create(DatabindingConfig config); - Databinding.WSDLGenerator wsdlGen(DatabindingConfig config); + WSDLGenerator wsdlGen(DatabindingConfig config); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/FieldGetter.java 2013-04-04 15:30:56.584616338 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/FieldGetter.java 2013-04-04 15:30:56.528616337 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/FieldSetter.java 2013-04-04 15:30:56.848616342 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/FieldSetter.java 2013-04-04 15:30:56.784616341 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/JAXBWrapperAccessor.java 2013-04-04 15:30:57.056616345 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/JAXBWrapperAccessor.java 2013-04-04 15:30:57.004616345 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,6 +35,7 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -112,7 +113,6 @@ QName qname = new QName(namespace, localName); if (field.getType().equals(JAXBElement.class)) { - Class elementDeclaredType = Object.class; if (field.getGenericType() instanceof ParameterizedType) { Type arg = ((ParameterizedType) field.getGenericType()) .getActualTypeArguments()[0]; @@ -161,7 +161,7 @@ static protected List getAllFields(Class clz) { List list = new ArrayList(); while (!Object.class.equals(clz)) { - for (Field f : getDeclaredFields(clz)) list.add(f); + list.addAll(Arrays.asList(getDeclaredFields(clz))); clz = clz.getSuperclass(); } return list; @@ -171,6 +171,7 @@ try { return (System.getSecurityManager() == null) ? clz .getDeclaredFields() : AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override public Field[] run() throws IllegalAccessException { return clz.getDeclaredFields(); } @@ -186,9 +187,7 @@ if (!field.isAccessible()) { if (getMethod != null) { MethodGetter methodGetter = new MethodGetter(getMethod); - if (!methodGetter.getType().toString().equals(field.getType().toString())) { - methodGetter = null; - } else { + if (methodGetter.getType().toString().equals(field.getType().toString())) { return methodGetter; } } @@ -201,9 +200,7 @@ if (!field.isAccessible()) { if (setter != null) { MethodSetter injection = new MethodSetter(setter); - if (!injection.getType().toString().equals(field.getType().toString())) { - injection = null; - } else { + if (injection.getType().toString().equals(field.getType().toString())) { return injection; } } @@ -217,6 +214,7 @@ return elementDeclaredTypes.get(key); } + @Override public PropertyAccessor getPropertyAccessor(String ns, String name) { final QName n = new QName(ns, name); final PropertySetter setter = getPropertySetter(n); @@ -228,8 +226,9 @@ final Class elementDeclaredType = isJAXBElement ? getElementDeclaredType(n) : null; return new PropertyAccessor() { + @Override public Object get(Object bean) throws DatabindingException { - Object val = null; + Object val; if (isJAXBElement) { JAXBElement jaxbElement = (JAXBElement) getter.get(bean); val = (jaxbElement == null) ? null : jaxbElement.getValue(); @@ -243,6 +242,7 @@ return val; } + @Override public void set(Object bean, Object value) throws DatabindingException { if (isJAXBElement) { JAXBElement jaxbElement = new JAXBElement( --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/MethodGetter.java 2013-04-04 15:30:57.280616349 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/MethodGetter.java 2013-04-04 15:30:57.220616348 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/MethodSetter.java 2013-04-04 15:30:57.540616352 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/MethodSetter.java 2013-04-04 15:30:57.484616352 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/OldBridge.java 2013-04-04 15:30:57.800616356 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/OldBridge.java 2013-04-04 15:30:57.744616356 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyAccessor.java 2013-04-04 15:30:58.088616361 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyAccessor.java 2013-04-04 15:30:58.024616360 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyGetter.java 2013-04-04 15:30:58.352616366 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyGetter.java 2013-04-04 15:30:58.300616364 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyGetterBase.java 2013-04-04 15:30:58.636616369 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyGetterBase.java 2013-04-04 15:30:58.584616369 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertySetter.java 2013-04-04 15:30:58.900616374 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertySetter.java 2013-04-04 15:30:58.844616373 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertySetterBase.java 2013-04-04 15:30:59.156616378 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertySetterBase.java 2013-04-04 15:30:59.096616377 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/TypeInfo.java 2013-04-04 15:30:59.424616382 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/TypeInfo.java 2013-04-04 15:30:59.364616381 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.spi.db; import java.lang.annotation.Annotation; +import java.lang.reflect.GenericArrayType; import java.lang.reflect.Type; import java.util.Collection; import java.util.HashMap; @@ -117,8 +118,8 @@ public TypeInfo toItemType() { // if we are to reinstitute this check, check JAXB annotations only // assert annotations.length==0; // not designed to work with adapters. - - Type base = Navigator.REFLECTION.getBaseClass(type, Collection.class); + Type t = (genericType != null)? genericType : type; + Type base = Navigator.REFLECTION.getBaseClass(t, Collection.class); if(base==null) return this; // not a collection @@ -170,4 +171,27 @@ return new StringBuilder("TypeInfo: Type = ").append(type) .append(", tag = ").append(tagName).toString(); } + + public TypeInfo getItemType() { +// System.out.println("????? TypeInfo " + type); + if (type instanceof Class && ((Class)type).isArray() && !byte[].class.equals(type)) { + Type componentType = ((Class)type).getComponentType(); + Type genericComponentType = null; + if (genericType!= null && genericType instanceof GenericArrayType) { + GenericArrayType arrayType = (GenericArrayType) type; + genericComponentType = arrayType.getGenericComponentType(); + componentType = arrayType.getGenericComponentType(); + } + TypeInfo ti =new TypeInfo(tagName, componentType, annotations); + if (genericComponentType != null) ti.setGenericType(genericComponentType); + return ti; + } +// if (type instanceof Class && java.util.Collection.class.isAssignableFrom((Class)type)) { + Type t = (genericType != null)? genericType : type; + Type base = Navigator.REFLECTION.getBaseClass(t, Collection.class); + if ( base != null) { + return new TypeInfo(tagName, Navigator.REFLECTION.getTypeArgument(base,0), annotations); + } + return null; + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/WrapperAccessor.java 2013-04-04 15:30:59.688616386 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/WrapperAccessor.java 2013-04-04 15:30:59.636616386 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/WrapperComposite.java 2013-04-04 15:30:59.904616389 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/WrapperComposite.java 2013-04-04 15:30:59.856616388 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +40,7 @@ * *

      * The binding of this class is always known to {@link BindingContext}, so it can be - * used without passing anything to {@link BindingContext#newInstance}. + * used without passing anything to {@link BindingContext#newWrapperInstace(Class)}. * This object can be only used for marshalling, not for unmarshalling. * * @author Kohsuke Kawaguchi --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/XMLBridge.java 2013-04-04 15:31:00.108616393 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/XMLBridge.java 2013-04-04 15:31:00.056616392 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/Attributes.java 2013-04-04 15:31:00.348616397 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/Attributes.java 2013-04-04 15:31:00.292616395 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java 2013-04-04 15:31:00.552616400 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java 2013-04-04 15:31:00.500616399 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,12 +70,12 @@ * @author Santiago.PericasGeertsen@sun.com * @author Kohsuke Kawaguchi */ -public final class DOMStreamReader implements XMLStreamReader, NamespaceContext { +public class DOMStreamReader implements XMLStreamReader, NamespaceContext { /** * Current DOM node being traversed. */ - private Node _current; + protected Node _current; /** * Starting node of the subtree being traversed. @@ -96,7 +96,7 @@ * but when a large binary data sent as base64 text, this could get very much * non-trivial. */ - private String wholeText; + protected String wholeText; /** * List of attributes extracted from _namedNodeMap. @@ -106,26 +106,26 @@ /** * {@link Scope} buffer. */ - private Scope[] scopes = new Scope[8]; + protected Scope[] scopes = new Scope[8]; /** * Depth of the current element. The first element gets depth==0. * Also used as the index to {@link #scopes}. */ - private int depth = 0; + protected int depth = 0; /** * State of this reader. Any of the valid states defined in StAX' * XMLStreamConstants class. */ - int _state; + protected int _state; /** * Namespace declarations on one element. * * Instances are reused. */ - private static final class Scope { + protected static final class Scope { /** * Scope for the parent element. */ @@ -247,7 +247,7 @@ * (which contains both ns decl and attributes in DOM) and split them * to attributes-proper and namespace decls. */ - private void splitAttributes() { + protected void splitAttributes() { // Clear attribute and namespace lists _currentAttributes.clear(); @@ -756,7 +756,7 @@ } } - private int _next() throws XMLStreamException { + protected int _next() throws XMLStreamException { Node child; switch (_state) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/MtomStreamWriter.java 2013-04-04 15:31:00.772616403 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/MtomStreamWriter.java 2013-04-04 15:31:00.716616402 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/PrefixFactory.java 2013-04-04 15:31:00.992616406 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/PrefixFactory.java 2013-04-04 15:31:00.936616406 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/PrefixFactoryImpl.java 2013-04-04 15:31:01.240616410 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/PrefixFactoryImpl.java 2013-04-04 15:31:01.180616410 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java 2013-04-04 15:31:01.500616415 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java 2013-04-04 15:31:01.444616413 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/TidyXMLStreamReader.java 2013-04-04 15:31:01.760616419 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/TidyXMLStreamReader.java 2013-04-04 15:31:01.704616417 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java 2013-04-04 15:31:02.032616423 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java 2013-04-04 15:31:01.980616422 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.streaming; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** *

      XMLReaderException represents an exception that occurred while reading an --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java 2013-04-04 15:31:02.280616426 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java 2013-04-04 15:31:02.228616426 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.streaming; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** *

      XMLStream ReaderException represents an exception that occurred while reading an --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java 2013-04-04 15:31:02.552616431 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java 2013-04-04 15:31:02.488616430 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +94,17 @@ return state; } + public static void toNextTag(XMLStreamReader reader, QName name) { + // skip any whitespace + if (reader.getEventType() != XMLStreamConstants.START_ELEMENT && + reader.getEventType() != XMLStreamConstants.END_ELEMENT) { + XMLStreamReaderUtil.nextElementContent(reader); + } + if(reader.getEventType() == XMLStreamConstants.END_ELEMENT && name.equals(reader.getName())) { + XMLStreamReaderUtil.nextElementContent(reader); + } + } + /** * Moves next and read spaces from the reader as long as to the next element. * Comments are ignored --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java 2013-04-04 15:31:02.832616435 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java 2013-04-04 15:31:02.768616434 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.streaming; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** *

      XMLWriterException represents an exception that occurred while writing --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java 2013-04-04 15:31:03.080616439 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java 2013-04-04 15:31:03.032616438 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/DeferredTransportPipe.java 2013-04-04 15:31:03.352616443 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/DeferredTransportPipe.java 2013-04-04 15:31:03.300616443 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/Headers.java 2013-04-04 15:31:03.616616447 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/Headers.java 2013-04-04 15:31:03.556616447 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 @@ package com.sun.xml.internal.ws.transport; +import java.io.Serializable; import java.util.Comparator; import java.util.LinkedList; import java.util.List; @@ -74,7 +75,7 @@ private static final InsensitiveComparator INSTANCE = new InsensitiveComparator(); // case-insensitive string comparison of HTTP header names. - private static final class InsensitiveComparator implements Comparator { + private static final class InsensitiveComparator implements Comparator, Serializable { public int compare(String o1, String o2) { if (o1 == null && o2 == null) return 0; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java 2013-04-04 15:31:03.872616451 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java 2013-04-04 15:31:03.812616451 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,15 +25,18 @@ package com.sun.xml.internal.ws.transport.http; +import com.oracle.webservices.internal.api.databinding.DatabindingModeFeature; +import com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature; import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.WSBinding; -import com.sun.xml.internal.ws.api.message.Packet; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.SDDocumentSource; import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.binding.WebServiceFeatureList; + import com.sun.xml.internal.ws.handler.HandlerChainsModel; import com.sun.xml.internal.ws.resources.ServerMessages; import com.sun.xml.internal.ws.resources.WsservletMessages; @@ -45,8 +48,6 @@ import com.sun.xml.internal.ws.util.HandlerAnnotationInfo; import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException; import com.sun.xml.internal.ws.util.xml.XmlUtil; - -import com.sun.xml.internal.org.jvnet.ws.databinding.DatabindingModeFeature; import org.xml.sax.EntityResolver; import javax.xml.namespace.QName; @@ -54,6 +55,7 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; import javax.xml.ws.http.HTTPBinding; import javax.xml.ws.soap.MTOMFeature; import javax.xml.ws.soap.SOAPBinding; @@ -64,6 +66,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -74,13 +77,13 @@ /** * Parses {@code sun-jaxws.xml} into {@link WSEndpoint}. - * - *

      + *

      + *

      * Since {@code sun-jaxws.xml} captures more information than what {@link WSEndpoint} * represents (in particular URL pattern and name), this class * takes a parameterization 'A' so that the user of this parser can choose to * create another type that wraps {@link WSEndpoint}. - * + *

      * {@link HttpAdapter} and its derived type is used for this often, * but it can be anything. * @@ -88,6 +91,33 @@ * @author Kohsuke Kawaguchi */ public class DeploymentDescriptorParser { + + public static final String NS_RUNTIME = "http://java.sun.com/xml/ns/jax-ws/ri/runtime"; + public static final String JAXWS_WSDL_DD_DIR = "WEB-INF/wsdl"; + + public static final QName QNAME_ENDPOINTS = new QName(NS_RUNTIME, "endpoints"); + public static final QName QNAME_ENDPOINT = new QName(NS_RUNTIME, "endpoint"); + public static final QName QNAME_EXT_METADA = new QName(NS_RUNTIME, "external-metadata"); + + public static final String ATTR_FILE = "file"; + public static final String ATTR_RESOURCE = "resource"; + + public static final String ATTR_VERSION = "version"; + public static final String ATTR_NAME = "name"; + public static final String ATTR_IMPLEMENTATION = "implementation"; + public static final String ATTR_WSDL = "wsdl"; + public static final String ATTR_SERVICE = "service"; + public static final String ATTR_PORT = "port"; + public static final String ATTR_URL_PATTERN = "url-pattern"; + public static final String ATTR_ENABLE_MTOM = "enable-mtom"; + public static final String ATTR_MTOM_THRESHOLD_VALUE = "mtom-threshold-value"; + public static final String ATTR_BINDING = "binding"; + public static final String ATTR_DATABINDING = "databinding"; + + public static final List ATTRVALUE_SUPPORTED_VERSIONS = Arrays.asList("2.0", "2.1"); + + private static final Logger logger = Logger.getLogger(com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http"); + private final Container container; private final ClassLoader classLoader; private final ResourceLoader loader; @@ -102,27 +132,23 @@ /** * WSDL/schema documents collected from /WEB-INF/wsdl. Keyed by the system ID. */ - private final Map docs = new HashMap(); + private final Map docs = new HashMap(); /** - * - * @param cl - * Used to load service implementations. - * @param loader - * Used to locate resources, in particular WSDL. - * @param container - * Optional {@link Container} that {@link WSEndpoint}s receive. - * @param adapterFactory - * Creates {@link HttpAdapter} (or its derived class.) + * @param cl Used to load service implementations. + * @param loader Used to locate resources, in particular WSDL. + * @param container Optional {@link Container} that {@link WSEndpoint}s receive. + * @param adapterFactory Creates {@link HttpAdapter} (or its derived class.) */ - public DeploymentDescriptorParser(ClassLoader cl, ResourceLoader loader, Container container, AdapterFactory adapterFactory) throws MalformedURLException { + public DeploymentDescriptorParser(ClassLoader cl, ResourceLoader loader, Container container, + AdapterFactory adapterFactory) throws MalformedURLException { classLoader = cl; this.loader = loader; this.container = container; this.adapterFactory = adapterFactory; collectDocs("/WEB-INF/wsdl/"); - logger.fine("war metadata="+docs); + logger.log(Level.FINE, "war metadata={0}", docs); } /** @@ -133,7 +159,7 @@ XMLStreamReader reader = null; try { reader = new TidyXMLStreamReader( - XMLStreamReaderFactory.create(systemId,is,true), is); + XMLStreamReaderFactory.create(systemId, is, true), is); XMLStreamReaderUtil.nextElementContent(reader); return parseAdapters(reader); } finally { @@ -141,7 +167,7 @@ try { reader.close(); } catch (XMLStreamException e) { - throw new ServerRtException("runtime.parser.xmlReader",e); + throw new ServerRtException("runtime.parser.xmlReader", e); } } try { @@ -173,12 +199,13 @@ if (paths != null) { for (String path : paths) { if (path.endsWith("/")) { - if(path.endsWith("/CVS/") || path.endsWith("/.svn/")) + if (path.endsWith("/CVS/") || path.endsWith("/.svn/")) { continue; + } collectDocs(path); } else { URL res = loader.getResource(path); - docs.put(res.toString(),SDDocumentSource.create(res)); + docs.put(res.toString(), SDDocumentSource.create(res)); } } } @@ -194,92 +221,104 @@ Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); - if (!version.equals(ATTRVALUE_VERSION_1_0)) { - failWithLocalName("runtime.parser.invalidVersionNumber", - reader, version); - } - - while (XMLStreamReaderUtil.nextElementContent(reader) != - XMLStreamConstants.END_ELEMENT) if (reader.getName().equals(QNAME_ENDPOINT)) { - - attrs = XMLStreamReaderUtil.getAttributes(reader); - String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); - if (!names.add(name)) { - logger.warning( - WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); - } - - String implementationName = - getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); - Class implementorClass = getImplementorClass(implementationName,reader); - EndpointFactory.verifyImplementorClass(implementorClass); - - SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass); - - QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); - if (serviceName == null) - serviceName = EndpointFactory.getDefaultServiceName(implementorClass); - - QName portName = getQNameAttribute(attrs, ATTR_PORT); - if (portName == null) - portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass); - - //get enable-mtom attribute value - String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); - String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); - String dbMode = getAttribute(attrs, ATTR_DATABINDING); - String bindingId = getAttribute(attrs, ATTR_BINDING); - if (bindingId != null) - // Convert short-form tokens to API's binding ids - bindingId = getBindingIdForToken(bindingId); - WSBinding binding = createBinding(bindingId,implementorClass, - enable_mtom, mtomThreshold, dbMode); - String urlPattern = - getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); - - - // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. - - boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); - - ensureNoContent(reader); - WSEndpoint endpoint = WSEndpoint.create( - implementorClass, !handlersSetInDD, - null, - serviceName, portName, container, binding, - primaryWSDL, docs.values(), createEntityResolver(),false - ); - adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); - } else { - failWithLocalName("runtime.parser.invalidElement", reader); + if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { + failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); + } + + while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { + + if (reader.getName().equals(QNAME_ENDPOINT)) { + attrs = XMLStreamReaderUtil.getAttributes(reader); + + String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); + if (!names.add(name)) { + logger.warning( + WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); + } + + String implementationName = + getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); + Class implementorClass = getImplementorClass(implementationName, reader); + + MetadataReader metadataReader = null; + ExternalMetadataFeature externalMetadataFeature = null; + + // parse subelements to instantiate externalMetadataReader, if necessary ... + XMLStreamReaderUtil.nextElementContent(reader); + if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { + externalMetadataFeature = configureExternalMetadataReader(reader); + if (externalMetadataFeature != null) { + metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); + } + } + + QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); + if (serviceName == null) { + serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); + } + + QName portName = getQNameAttribute(attrs, ATTR_PORT); + if (portName == null) { + portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); + } + + //get enable-mtom attribute value + String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); + String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); + String dbMode = getAttribute(attrs, ATTR_DATABINDING); + String bindingId = getAttribute(attrs, ATTR_BINDING); + if (bindingId != null) { + // Convert short-form tokens to API's binding ids + bindingId = getBindingIdForToken(bindingId); + } + WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); + if (externalMetadataFeature != null) { + binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, + true); + } + + String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); + + // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. + boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); + + EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); + SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); + + WSEndpoint endpoint = WSEndpoint.create( + implementorClass, !handlersSetInDD, + null, + serviceName, portName, container, binding, + primaryWSDL, docs.values(), createEntityResolver(), false + ); + adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); + } else { + failWithLocalName("runtime.parser.invalidElement", reader); + } } return adapters; } /** - * @param ddBindingId - * binding id explicitlyspecified in the DeploymentDescriptor or parameter - * @param implClass - * Endpoint Implementation class - * @param mtomEnabled - * represents mtom-enabled attribute in DD - * @param mtomThreshold - * threshold value specified in DD - * @return - * is returned with only MTOMFeature set resolving the various precendece rules + * @param ddBindingId binding id explicitlyspecified in the DeploymentDescriptor or parameter + * @param implClass Endpoint Implementation class + * @param mtomEnabled represents mtom-enabled attribute in DD + * @param mtomThreshold threshold value specified in DD + * @return is returned with only MTOMFeature set resolving the various precendece rules */ - private static WSBinding createBinding(String ddBindingId,Class implClass, - String mtomEnabled, String mtomThreshold, String dataBindingMode) { + private static WSBinding createBinding(String ddBindingId, Class implClass, + String mtomEnabled, String mtomThreshold, String dataBindingMode) { // Features specified through DD WebServiceFeatureList features; MTOMFeature mtomfeature = null; if (mtomEnabled != null) { - if (mtomThreshold != null) + if (mtomThreshold != null) { mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled), Integer.valueOf(mtomThreshold)); - else + } else { mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled)); + } } BindingID bindingID; @@ -287,7 +326,7 @@ bindingID = BindingID.parse(ddBindingId); features = bindingID.createBuiltinFeatureList(); - if(checkMtomConflict(features.get(MTOMFeature.class),mtomfeature)) { + if (checkMtomConflict(features.get(MTOMFeature.class), mtomfeature)) { throw new ServerRtException(ServerMessages.DD_MTOM_CONFLICT(ddBindingId, mtomEnabled)); } } else { @@ -296,8 +335,9 @@ // mtom through Feature annotation or DD takes precendece features = new WebServiceFeatureList(); - if(mtomfeature != null) - features.add(mtomfeature); // this wins over MTOM setting in bindingID + if (mtomfeature != null) { // this wins over MTOM setting in bindingID + features.add(mtomfeature); + } features.addAll(bindingID.createBuiltinFeatureList()); } @@ -309,7 +349,9 @@ } private static boolean checkMtomConflict(MTOMFeature lhs, MTOMFeature rhs) { - if(lhs==null || rhs==null) return false; + if (lhs == null || rhs == null) { + return false; + } return lhs.isEnabled() ^ rhs.isEnabled(); } @@ -320,7 +362,6 @@ * binding ids * * @param lexical binding attribute value from DD. Always not null - * * @return returns corresponding API's binding ID or the same lexical */ public static @NotNull String getBindingIdForToken(@NotNull String lexical) { @@ -340,8 +381,7 @@ /** * Creates a new "Adapter". - * - *

      + *

      * Normally 'A' would be {@link HttpAdapter} or some derived class. * But the parser doesn't require that to be of any particular type. */ @@ -353,34 +393,31 @@ * Checks the deployment descriptor or {@link @WebServiceProvider} annotation * to see if it points to any WSDL. If so, returns the {@link SDDocumentSource}. * - * @return - * The pointed WSDL, if any. Otherwise null. + * @return The pointed WSDL, if any. Otherwise null. */ - private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class implementorClass) { + private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class implementorClass, MetadataReader metadataReader) { String wsdlFile = getAttribute(attrs, ATTR_WSDL); if (wsdlFile == null) { - wsdlFile = EndpointFactory.getWsdlLocation(implementorClass); + wsdlFile = EndpointFactory.getWsdlLocation(implementorClass, metadataReader); } - if (wsdlFile!=null) { + if (wsdlFile != null) { if (!wsdlFile.startsWith(JAXWS_WSDL_DD_DIR)) { - logger.warning("Ignoring wrong wsdl="+wsdlFile+". It should start with " - +JAXWS_WSDL_DD_DIR - +". Going to generate and publish a new WSDL."); + logger.log(Level.WARNING, "Ignoring wrong wsdl={0}. It should start with {1}. Going to generate and publish a new WSDL.", new Object[]{wsdlFile, JAXWS_WSDL_DD_DIR}); return null; } URL wsdl; try { - wsdl = loader.getResource('/'+wsdlFile); + wsdl = loader.getResource('/' + wsdlFile); } catch (MalformedURLException e) { throw new LocatableWebServiceException( - ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr ); + ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr); } if (wsdl == null) { throw new LocatableWebServiceException( - ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr ); + ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr); } SDDocumentSource docInfo = docs.get(wsdl.toExternalForm()); assert docInfo != null; @@ -396,7 +433,7 @@ private EntityResolver createEntityResolver() { try { return XmlUtil.createEntityResolver(loader.getCatalogFile()); - } catch(MalformedURLException e) { + } catch (MalformedURLException e) { throw new WebServiceException(e); } } @@ -422,9 +459,9 @@ String value = getAttribute(attrs, name); if (value != null && value.equals("")) { failWithLocalName( - "runtime.parser.invalidAttributeValue", - reader, - name); + "runtime.parser.invalidAttributeValue", + reader, + name); } return value; } @@ -444,9 +481,9 @@ failWithLocalName("runtime.parser.missing.attribute", reader, name); } else if (value.equals("")) { failWithLocalName( - "runtime.parser.invalidAttributeValue", - reader, - name); + "runtime.parser.invalidAttributeValue", + reader, + name); } return value; } @@ -454,25 +491,23 @@ /** * Parses the handler and role information and sets it * on the {@link WSBinding}. + * * @return true if element present in DD * false otherwise. */ protected boolean setHandlersAndRoles(WSBinding binding, XMLStreamReader reader, QName serviceName, QName portName) { - if (XMLStreamReaderUtil.nextElementContent(reader) == - XMLStreamConstants.END_ELEMENT || - !reader.getName().equals( - HandlerChainsModel.QNAME_HANDLER_CHAINS)) { - + if (reader.getEventType() == XMLStreamConstants.END_ELEMENT || + !reader.getName().equals(HandlerChainsModel.QNAME_HANDLER_CHAINS)) { return false; } HandlerAnnotationInfo handlerInfo = HandlerChainsModel.parseHandlerFile( - reader, classLoader,serviceName, portName, binding); + reader, classLoader, serviceName, portName, binding); binding.setHandlerChain(handlerInfo.getHandlers()); if (binding instanceof SOAPBinding) { - ((SOAPBinding)binding).setRoles(handlerInfo.getRoles()); + ((SOAPBinding) binding).setRoles(handlerInfo.getRoles()); } // move past @@ -480,42 +515,67 @@ return true; } - protected static void ensureNoContent(XMLStreamReader reader) { - if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { - fail("runtime.parser.unexpectedContent", reader); + protected ExternalMetadataFeature configureExternalMetadataReader(XMLStreamReader reader) { + + ExternalMetadataFeature.Builder featureBuilder = null; + while (QNAME_EXT_METADA.equals(reader.getName())) { + + if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) { + Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); + String file = getAttribute(attrs, ATTR_FILE); + if (file != null) { + if (featureBuilder == null) { + featureBuilder = ExternalMetadataFeature.builder(); + } + featureBuilder.addFiles(new File(file)); + } + + String res = getAttribute(attrs, ATTR_RESOURCE); + if (res != null) { + if (featureBuilder == null) { + featureBuilder = ExternalMetadataFeature.builder(); + } + featureBuilder.addResources(res); + } + } + + XMLStreamReaderUtil.nextElementContent(reader); } + + return buildFeature(featureBuilder); + } + + private ExternalMetadataFeature buildFeature(ExternalMetadataFeature.Builder builder) { + return builder != null ? builder.build() : null; } protected static void fail(String key, XMLStreamReader reader) { - logger.log(Level.SEVERE, key + reader.getLocation().getLineNumber()); + logger.log(Level.SEVERE, "{0}{1}", new Object[]{key, reader.getLocation().getLineNumber()}); throw new ServerRtException( - key, - Integer.toString(reader.getLocation().getLineNumber())); + key, + Integer.toString(reader.getLocation().getLineNumber())); } protected static void failWithFullName(String key, XMLStreamReader reader) { throw new ServerRtException( - key, - reader.getLocation().getLineNumber(), - reader.getName()); + key, + reader.getLocation().getLineNumber(), + reader.getName()); } protected static void failWithLocalName(String key, XMLStreamReader reader) { throw new ServerRtException( - key, - reader.getLocation().getLineNumber(), - reader.getLocalName()); + key, + reader.getLocation().getLineNumber(), + reader.getLocalName()); } - protected static void failWithLocalName( - String key, - XMLStreamReader reader, - String arg) { + protected static void failWithLocalName(String key, XMLStreamReader reader, String arg) { throw new ServerRtException( - key, - reader.getLocation().getLineNumber(), - reader.getLocalName(), - arg); + key, + reader.getLocation().getLineNumber(), + reader.getLocalName(), + arg); } protected Class loadClass(String name) { @@ -524,8 +584,8 @@ } catch (ClassNotFoundException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new ServerRtException( - "runtime.parser.classNotFound", - name); + "runtime.parser.classNotFound", + name); } } @@ -533,8 +593,7 @@ /** * Loads the class of the given name. * - * @param xsr - * Used to report the source location information if there's any error. + * @param xsr Used to report the source location information if there's any error. */ private Class getImplementorClass(String name, XMLStreamReader xsr) { try { @@ -542,34 +601,8 @@ } catch (ClassNotFoundException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new LocatableWebServiceException( - ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr ); + ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr); } } - public static final String NS_RUNTIME = - "http://java.sun.com/xml/ns/jax-ws/ri/runtime"; - - public static final String JAXWS_WSDL_DD_DIR = "WEB-INF/wsdl"; - - public static final QName QNAME_ENDPOINTS = - new QName(NS_RUNTIME, "endpoints"); - public static final QName QNAME_ENDPOINT = - new QName(NS_RUNTIME, "endpoint"); - - public static final String ATTR_VERSION = "version"; - public static final String ATTR_NAME = "name"; - public static final String ATTR_IMPLEMENTATION = "implementation"; - public static final String ATTR_WSDL = "wsdl"; - public static final String ATTR_SERVICE = "service"; - public static final String ATTR_PORT = "port"; - public static final String ATTR_URL_PATTERN = "url-pattern"; - public static final String ATTR_ENABLE_MTOM = "enable-mtom"; - public static final String ATTR_MTOM_THRESHOLD_VALUE = "mtom-threshold-value"; - public static final String ATTR_BINDING = "binding"; - public static final String ATTR_DATABINDING = "databinding"; - - public static final String ATTRVALUE_VERSION_1_0 = "2.0"; - private static final Logger logger = - Logger.getLogger( - com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http"); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java 2013-04-04 15:31:04.160616455 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java 2013-04-04 15:31:04.096616454 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,14 +25,15 @@ package com.sun.xml.internal.ws.transport.http; - +import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.addressing.NonAnonymousResponseProcessor; +import com.sun.xml.internal.ws.api.addressing.AddressingVersion; +import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.Component; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.api.ha.HaInfo; -import com.sun.xml.internal.ws.api.ha.StickyFeature; import com.sun.xml.internal.ws.api.message.ExceptionHasMessage; import com.sun.xml.internal.ws.api.message.Message; import com.sun.xml.internal.ws.api.message.Packet; @@ -49,6 +50,7 @@ import com.sun.xml.internal.ws.api.server.TransportBackChannel; import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate; +import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import com.sun.xml.internal.ws.resources.WsservletMessages; import com.sun.xml.internal.ws.server.UnsupportedMediaException; import com.sun.xml.internal.ws.util.ByteArrayBuffer; @@ -56,7 +58,6 @@ import javax.xml.ws.Binding; import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; import javax.xml.ws.http.HTTPBinding; import java.io.ByteArrayOutputStream; @@ -71,6 +72,7 @@ import java.util.logging.Level; import java.util.logging.Logger; + /** * {@link Adapter} that receives messages in HTTP. * @@ -161,7 +163,7 @@ * * @param sdef service definition */ - public void initWSDLMap(ServiceDefinition sdef) { + public final void initWSDLMap(ServiceDefinition sdef) { this.serviceDefinition = sdef; if(sdef==null) { wsdls = Collections.emptyMap(); @@ -213,6 +215,7 @@ } } + @Override protected HttpToolkit createToolkit() { return new HttpToolkit(); } @@ -229,7 +232,7 @@ * *

      * To populate a request {@link Packet} with more info, - * define {@link PropertySet.Property properties} on + * define {@link com.oracle.webservices.internal.api.message.PropertySet.Property properties} on * {@link WSHTTPConnection}. * * @param connection to receive/send HTTP messages for web service endpoints @@ -256,8 +259,9 @@ // metadata query. let the interceptor run for (Component c : endpoint.getComponents()) { HttpMetadataPublisher spi = c.getSPI(HttpMetadataPublisher.class); - if (spi != null && spi.handleMetadataRequest(this, connection)) - return true; // handled + if (spi != null && spi.handleMetadataRequest(this, connection)) { + return true; + } // handled } if (isMetadataQuery(connection.getQueryString())) { @@ -317,7 +321,7 @@ packet.component = this; packet.transportBackChannel = new Oneway(con); packet.webServiceContextDelegate = con.getWebServiceContextDelegate(); - + packet.setState(Packet.State.ServerRequest); if (dump || LOGGER.isLoggable(Level.FINER)) { ByteArrayBuffer buf = new ByteArrayBuffer(); buf.write(in); @@ -333,20 +337,24 @@ } /** - * Some stacks may send non WS-I BP 1.2 conformant SoapAction. - * Make sure SOAPAction is quoted as {@link Packet#soapAction} expectsa quoted soapAction value. + * Some stacks may send non WS-I BP 1.2 conforming SoapAction. + * Make sure SOAPAction is quoted as {@link Packet#soapAction} expects quoted soapAction value. * * @param soapAction SoapAction HTTP Header * @return quoted SOAPAction value */ - private String fixQuotesAroundSoapAction(String soapAction) { + static public String fixQuotesAroundSoapAction(String soapAction) { if(soapAction != null && (!soapAction.startsWith("\"") || !soapAction.endsWith("\"")) ) { - LOGGER.info("Received WS-I BP non-conformant Unquoted SoapAction HTTP header: "+ soapAction); + if (LOGGER.isLoggable(Level.INFO)) { + LOGGER.log(Level.INFO, "Received WS-I BP non-conformant Unquoted SoapAction HTTP header: {0}", soapAction); + } String fixedSoapAction = soapAction; - if(!soapAction.startsWith("\"")) + if(!soapAction.startsWith("\"")) { fixedSoapAction = "\"" + fixedSoapAction; - if(!soapAction.endsWith("\"")) + } + if(!soapAction.endsWith("\"")) { fixedSoapAction = fixedSoapAction + "\""; + } return fixedSoapAction; } return soapAction; @@ -356,13 +364,40 @@ return NonAnonymousResponseProcessor.getDefault(); } + /** + * This method is added for the case of the sub-class wants to override the method to + * print details. E.g. convert soapfault as HTML msg for 403 error connstatus. + * @param os + */ + protected void writeClientError(int connStatus, @NotNull OutputStream os, @NotNull Packet packet) throws IOException { + //do nothing + } + + private boolean isClientErrorStatus(int connStatus) + { + return (connStatus == HttpURLConnection.HTTP_FORBIDDEN); // add more for future. + } + + private boolean isNonAnonymousUri(EndpointAddress addr){ + return (addr != null) && !addr.toString().equals(AddressingVersion.W3C.anonymousUri) && + !addr.toString().equals(AddressingVersion.MEMBER.anonymousUri); + } + private void encodePacket(@NotNull Packet packet, @NotNull WSHTTPConnection con, @NotNull Codec codec) throws IOException { - if (packet.endpointAddress != null) { + if (isNonAnonymousUri(packet.endpointAddress) && packet.getMessage() != null) { + try { // Message is targeted to non-anonymous response endpoint. // After call to non-anonymous processor, typically, packet.getMessage() will be null // however, processors could use this pattern to modify the response sent on the back-channel, // e.g. send custom HTTP headers with the HTTP 202 - packet = getNonAnonymousResponseProcessor().process(packet); + packet = getNonAnonymousResponseProcessor().process(packet); + } catch (RuntimeException re) { + // if processing by NonAnonymousResponseProcessor fails, new SOAPFaultMessage is created to be sent + // to back-channel client + SOAPVersion soapVersion = packet.getBinding().getSOAPVersion(); + Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, re); + packet = packet.createServerResponse(faultMsg, packet.endpoint.getPort(), null, packet.endpoint.getBinding()); + } } if (con.isClosed()) { @@ -375,8 +410,9 @@ if (!con.isClosed()) { // set the response code if not already set // for example, 415 may have been set earlier for Unsupported Content-Type - if (con.getStatus() == 0) + if (con.getStatus() == 0) { con.setStatus(WSHTTPConnection.ONEWAY); + } // close the response channel now try { con.getOutput().close(); // no payload @@ -393,6 +429,13 @@ : HttpURLConnection.HTTP_OK); } + if (isClientErrorStatus(con.getStatus())) { + OutputStream os = con.getOutput(); + writeClientError(con.getStatus(), os, packet); + os.close(); + return; + } + ContentType contentType = codec.getStaticContentType(packet); if (contentType != null) { con.setContentTypeResponseHeader(contentType.getContentType()); @@ -502,6 +545,7 @@ } endpoint.process(request, new WSEndpoint.CompletionCallback() { + @Override public void onCompletion(@NotNull Packet response) { try { try { @@ -522,6 +566,7 @@ public static final CompletionCallback NO_OP_COMPLETION_CALLBACK = new CompletionCallback() { + @Override public void onCompletion() { //NO-OP } @@ -541,35 +586,37 @@ super.handle(con); } + @Override protected void encodePacket(WSHTTPConnection con, @NotNull Packet packet, @NotNull Codec codec) throws IOException { HttpAdapter.this.encodePacket(packet, con, codec); } - protected @Nullable String getAcceptableMimeTypes(WSHTTPConnection con) { + protected @Override @Nullable String getAcceptableMimeTypes(WSHTTPConnection con) { return null; } - protected @Nullable TransportBackChannel getTransportBackChannel(WSHTTPConnection con) { + protected @Override @Nullable TransportBackChannel getTransportBackChannel(WSHTTPConnection con) { return new Oneway(con); } - protected @NotNull + protected @Override @NotNull PropertySet getPropertySet(WSHTTPConnection con) { return con; } - protected @NotNull WebServiceContextDelegate getWebServiceContextDelegate(WSHTTPConnection con) { + protected @Override @NotNull WebServiceContextDelegate getWebServiceContextDelegate(WSHTTPConnection con) { return con.getWebServiceContextDelegate(); } } - final class Oneway implements TransportBackChannel { + static final class Oneway implements TransportBackChannel { WSHTTPConnection con; boolean closed; Oneway(WSHTTPConnection con) { this.con = con; } + @Override public void close() { if (!closed) { closed = true; @@ -687,7 +734,7 @@ } public PortAddressResolver getPortAddressResolver(String baseAddress) { - return owner.createPortAddressResolver(baseAddress); + return owner.createPortAddressResolver(baseAddress, endpoint.getImplementationClass()); } public DocumentAddressResolver getDocumentAddressResolver( @@ -695,6 +742,7 @@ final String address = portAddressResolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart()); assert address != null; return new DocumentAddressResolver() { + @Override public String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced) { // the map on endpoint should account for all SDDocument assert revWsdls.containsKey(referenced); @@ -785,7 +833,9 @@ * Generates the listing of all services. */ private void writeWebServicesHtmlPage(WSHTTPConnection con) throws IOException { - if (!publishStatusPage) return; + if (!publishStatusPage) { + return; + } // TODO: resurrect the ability to localize according to the current request. @@ -859,9 +909,13 @@ /** * Dumps what goes across HTTP transport. */ - public static boolean dump = false; + public static volatile boolean dump = false; - public static boolean publishStatusPage = true; + public static volatile boolean publishStatusPage = true; + + public static synchronized void setPublishStatus(boolean publish) { + publishStatusPage = publish; + } static { try { @@ -870,11 +924,14 @@ // OK to ignore this } try { - publishStatusPage = System.getProperty(HttpAdapter.class.getName()+".publishStatusPage").equals("true"); + setPublishStatus(System.getProperty(HttpAdapter.class.getName()+".publishStatusPage").equals("true")); } catch( Throwable t ) { // OK to ignore this } } + public static void setDump(boolean dumpMessages) { + HttpAdapter.dump = dumpMessages; + } private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName()); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapterList.java 2013-04-04 15:31:04.432616460 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapterList.java 2013-04-04 15:31:04.376616459 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +37,7 @@ import java.util.Map; import java.util.HashMap; import java.util.AbstractList; +import java.util.Map.Entry; /** * List of {@link HttpAdapter}s created together. @@ -58,12 +59,13 @@ private final Map addressMap = new HashMap(); // TODO: documented because it's used by AS + @Override public T createAdapter(String name, String urlPattern, WSEndpoint endpoint) { T t = createHttpAdapter(name, urlPattern, endpoint); adapters.add(t); WSDLPort port = endpoint.getPort(); if (port != null) { - PortInfo portInfo = new PortInfo(port.getOwner().getName(),port.getName().getLocalPart()); + PortInfo portInfo = new PortInfo(port.getOwner().getName(),port.getName().getLocalPart(), endpoint.getImplementationClass()); addressMap.put(portInfo, getValidPath(urlPattern)); } return t; @@ -88,21 +90,36 @@ /** * Creates a PortAddressResolver that maps portname to its address + * + * @param endpointImpl application endpoint Class that eventually serves the request. */ - public PortAddressResolver createPortAddressResolver(final String baseAddress) { + public PortAddressResolver createPortAddressResolver(final String baseAddress, final Class endpointImpl) { return new PortAddressResolver() { + @Override public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) { - String urlPattern = addressMap.get(new PortInfo(serviceName,portName)); + String urlPattern = addressMap.get(new PortInfo(serviceName,portName, endpointImpl)); + if (urlPattern == null) { + //if a WSDL defines more ports, urlpattern is null (portName does not match endpointImpl) + //so fallback to the default behaviour where only serviceName/portName is checked + for (Entry e : addressMap.entrySet()) { + if (serviceName.equals(e.getKey().serviceName) && portName.equals(e.getKey().portName)) { + urlPattern = e.getValue(); + break; + } + } + } return (urlPattern == null) ? null : baseAddress+urlPattern; } }; } + @Override public T get(int index) { return adapters.get(index); } + @Override public int size() { return adapters.size(); } @@ -110,24 +127,30 @@ private static class PortInfo { private final QName serviceName; private final String portName; + private final Class implClass; - PortInfo(@NotNull QName serviceName, @NotNull String portName) { + PortInfo(@NotNull QName serviceName, @NotNull String portName, Class implClass) { this.serviceName = serviceName; this.portName = portName; + this.implClass = implClass; } @Override public boolean equals(Object portInfo) { if (portInfo instanceof PortInfo) { PortInfo that = (PortInfo)portInfo; - return this.serviceName.equals(that.serviceName) && this.portName.equals(that.portName); + if (this.implClass == null) { + return this.serviceName.equals(that.serviceName) && this.portName.equals(that.portName) && that.implClass == null; + } + return this.serviceName.equals(that.serviceName) && this.portName.equals(that.portName) && this.implClass.equals(that.implClass); } return false; } @Override public int hashCode() { - return serviceName.hashCode()+portName.hashCode(); + int retVal = serviceName.hashCode()+portName.hashCode(); + return implClass != null ? retVal + implClass.hashCode() : retVal; } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpMetadataPublisher.java 2013-04-04 15:31:04.684616464 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpMetadataPublisher.java 2013-04-04 15:31:04.636616463 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/ResourceLoader.java 2013-04-04 15:31:04.952616468 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/ResourceLoader.java 2013-04-04 15:31:04.884616467 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -66,7 +66,7 @@ * null if the path is invalid. empty if the path didn't contain * any entry in it. * - * @see javax.servlet.http.ServletContext#getResourcePaths(String) + * @see javax.servlet.ServletContext#getResourcePaths(String) */ Set getResourcePaths(String path); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java 2013-04-04 15:31:05.208616472 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java 2013-04-04 15:31:05.156616471 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,9 +25,10 @@ package com.sun.xml.internal.ws.transport.http; +import com.oracle.webservices.internal.api.message.BasePropertySet; +import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate; @@ -54,12 +55,12 @@ * *

      * This class extends {@link PropertySet} so that a transport can - * expose its properties to the appliation and pipes. (This object + * expose its properties to the application and pipes. (This object * will be added to {@link Packet#addSatellite(PropertySet)}.) * * @author Jitendra Kotamraju */ -public abstract class WSHTTPConnection extends PropertySet { +public abstract class WSHTTPConnection extends BasePropertySet { public static final int OK=200; public static final int ONEWAY=202; @@ -111,7 +112,7 @@ * the previously set value. If not, this method adds it. * *

      - * Note that this method and {@link #setResponseHeaders(Map<String,List<String>>)} + * Note that this method and {@link #setResponseHeaders(java.util.Map)} * may be invoked in any arbitrary order. * * @param value @@ -347,7 +348,7 @@ /** * Subclasses are expected to override * - * @return + * @return a {@link String} containing the protocol name and version number */ public String getProtocol() { return "HTTP/1.1"; @@ -357,7 +358,7 @@ * Subclasses are expected to override * * @since JAX-WS RI 2.2.2 - * @return + * @return value of given cookie */ public String getCookie(String name) { return null; @@ -374,8 +375,6 @@ /** * Subclasses are expected to override - * - * @return */ public void setContentLengthResponseHeader(int value) { } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java 2013-04-04 15:31:05.476616476 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java 2013-04-04 15:31:05.412616475 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java 2013-04-04 15:31:05.756616481 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java 2013-04-04 15:31:05.692616480 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,20 +25,22 @@ package com.sun.xml.internal.ws.transport.http.client; +import com.oracle.webservices.internal.api.message.BasePropertySet; +import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.PropertySet; import com.sun.xml.internal.ws.client.ResponseContext; import javax.xml.ws.handler.MessageContext; import java.util.List; import java.util.Map; + /** * Properties exposed from {@link HttpTransportPipe} for {@link ResponseContext}. * * @author Kohsuke Kawaguchi */ -final class HttpResponseProperties extends PropertySet { +final class HttpResponseProperties extends BasePropertySet { private final HttpClientTransport deferedCon; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java 2013-04-04 15:31:06.008616484 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java 2013-04-04 15:31:05.956616483 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,36 +32,27 @@ import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.pipe.*; import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl; +import com.sun.xml.internal.ws.client.ClientTransportException; import com.sun.xml.internal.ws.developer.HttpConfigFeature; +import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.transport.Headers; import com.sun.xml.internal.ws.util.ByteArrayBuffer; -import com.sun.xml.internal.ws.client.ClientTransportException; -import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.util.RuntimeVersion; import com.sun.xml.internal.ws.util.StreamUtils; import javax.xml.bind.DatatypeConverter; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; import javax.xml.ws.BindingProvider; import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; -import javax.xml.ws.soap.SOAPBinding; import javax.xml.ws.handler.MessageContext; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; +import javax.xml.ws.soap.SOAPBinding; +import java.io.*; import java.net.CookieHandler; -import java.util.Collections; -import java.util.List; -import java.util.logging.Logger; -import java.util.logging.Level; -import java.util.Map; -import java.util.Map.Entry; import java.net.HttpURLConnection; +import java.util.*; +import java.util.Map.Entry; +import java.util.logging.Level; +import java.util.logging.Logger; /** * {@link Tube} that sends a request to a remote HTTP server. @@ -72,21 +63,28 @@ * @author Jitendra Kotamraju */ public class HttpTransportPipe extends AbstractTubeImpl { - private static final Logger LOGGER = Logger.getLogger(HttpTransportPipe.class.getName()); + + private static final List USER_AGENT = Collections.singletonList(RuntimeVersion.VERSION.toString()); + private static final Logger LOGGER = Logger.getLogger(HttpTransportPipe.class.getName()); + + /** + * Dumps what goes across HTTP transport. + */ + public static boolean dump; private final Codec codec; private final WSBinding binding; - private static final List USER_AGENT = Collections.singletonList(RuntimeVersion.VERSION.toString()); private final CookieHandler cookieJar; // shared object among the tubes private final boolean sticky; - // Need to use JAXB first to register DatatypeConverter static { + boolean b; try { - JAXBContext.newInstance().createUnmarshaller(); - } catch(JAXBException je) { - // Nothing much can be done. Intentionally left empty + b = Boolean.getBoolean(HttpTransportPipe.class.getName()+".dump"); + } catch( Throwable t ) { + b = false; } + dump = b; } public HttpTransportPipe(Codec codec, WSBinding binding) { @@ -120,14 +118,17 @@ cloner.add(that,this); } + @Override public NextAction processException(@NotNull Throwable t) { return doThrow(t); } + @Override public NextAction processRequest(@NotNull Packet request) { return doReturnWith(process(request)); } + @Override public NextAction processResponse(@NotNull Packet response) { return doReturnWith(response); } @@ -178,8 +179,9 @@ writeSOAPAction(reqHeaders, ct.getSOAPActionHeader()); } - if(dump || LOGGER.isLoggable(Level.FINER)) + if (dump || LOGGER.isLoggable(Level.FINER)) { dump(buf, "HTTP request", reqHeaders); + } buf.writeTo(con.getOutput()); } else { @@ -315,26 +317,50 @@ private void addCookies(Packet context, Map> reqHeaders) throws IOException { Boolean shouldMaintainSessionProperty = - (Boolean) context.invocationProperties.get(BindingProvider.SESSION_MAINTAIN_PROPERTY); + (Boolean) context.invocationProperties.get(BindingProvider.SESSION_MAINTAIN_PROPERTY); if (shouldMaintainSessionProperty != null && !shouldMaintainSessionProperty) { return; // explicitly turned off } if (sticky || (shouldMaintainSessionProperty != null && shouldMaintainSessionProperty)) { - Map> cookies = cookieJar.get(context.endpointAddress.getURI(),reqHeaders); - List cookieList = cookies.get("Cookie"); - if (cookieList != null && !cookieList.isEmpty()) { - reqHeaders.put("Cookie", cookieList); - } - cookieList = cookies.get("Cookie2"); - if (cookieList != null && !cookieList.isEmpty()) { - reqHeaders.put("Cookie2", cookieList); - } + Map> rememberedCookies = cookieJar.get(context.endpointAddress.getURI(), reqHeaders); + processCookieHeaders(reqHeaders, rememberedCookies, "Cookie"); + processCookieHeaders(reqHeaders, rememberedCookies, "Cookie2"); + } + } + + private void processCookieHeaders(Map> requestHeaders, Map> rememberedCookies, String cookieHeader) { + List jarCookies = rememberedCookies.get(cookieHeader); + if (jarCookies != null && !jarCookies.isEmpty()) { + List resultCookies = mergeUserCookies(jarCookies, requestHeaders.get(cookieHeader)); + requestHeaders.put(cookieHeader, resultCookies); + } + } + + private List mergeUserCookies(List rememberedCookies, List userCookies) { + + // nothing to merge + if (userCookies == null || userCookies.isEmpty()) { + return rememberedCookies; + } + + Map map = new HashMap(); + cookieListToMap(rememberedCookies, map); + cookieListToMap(userCookies, map); + + return new ArrayList(map.values()); + } + + private void cookieListToMap(List cookieList, Map targetMap) { + for(String cookie : cookieList) { + int index = cookie.indexOf("="); + String cookieName = cookie.substring(0, index); + targetMap.put(cookieName, cookie); } } private void recordCookies(Packet context, HttpClientTransport con) throws IOException { Boolean shouldMaintainSessionProperty = - (Boolean) context.invocationProperties.get(BindingProvider.SESSION_MAINTAIN_PROPERTY); + (Boolean) context.invocationProperties.get(BindingProvider.SESSION_MAINTAIN_PROPERTY); if (shouldMaintainSessionProperty != null && !shouldMaintainSessionProperty) { return; // explicitly turned off } @@ -348,7 +374,7 @@ if (user != null) { String pw = (String) context.invocationProperties.get(BindingProvider.PASSWORD_PROPERTY); if (pw != null) { - StringBuffer buf = new StringBuffer(user); + StringBuilder buf = new StringBuilder(user); buf.append(":"); buf.append(pw); String creds = DatatypeConverter.printBase64Binary(buf.toString().getBytes()); @@ -363,18 +389,22 @@ */ private void writeSOAPAction(Map> reqHeaders, String soapAction) { //dont write SOAPAction HTTP header for SOAP 1.2 messages. - if(SOAPVersion.SOAP_12.equals(binding.getSOAPVersion())) + if(SOAPVersion.SOAP_12.equals(binding.getSOAPVersion())) { return; - if (soapAction != null) + } + if (soapAction != null) { reqHeaders.put("SOAPAction", Collections.singletonList(soapAction)); - else + } else { reqHeaders.put("SOAPAction", Collections.singletonList("\"\"")); + } } + @Override public void preDestroy() { // nothing to do. Intentionally left empty. } + @Override public HttpTransportPipe copy(TubeCloner cloner) { return new HttpTransportPipe(this,cloner); } @@ -401,25 +431,11 @@ String msg = baos.toString(); if (dump) { - System.out.println(msg); + System.out.println(msg); } if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.log(Level.FINER, msg); + LOGGER.log(Level.FINER, msg); } } - /** - * Dumps what goes across HTTP transport. - */ - public static boolean dump; - - static { - boolean b; - try { - b = Boolean.getBoolean(HttpTransportPipe.class.getName()+".dump"); - } catch( Throwable t ) { - b = false; - } - dump = b; - } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java 2013-04-04 15:31:06.272616489 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java 2013-04-04 15:31:06.212616487 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +30,7 @@ import com.sun.xml.internal.ws.api.Component; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.BindingID; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.api.server.*; @@ -303,6 +304,7 @@ throw new UnsupportedOperationException("Couldn't load light weight http server", e); } container = getContainer(); + MetadataReader metadataReader = EndpointFactory.getExternalMetadatReader(implClass, binding); WSEndpoint wse = WSEndpoint.create( implClass, true, invoker, @@ -310,7 +312,7 @@ getProperty(QName.class, Endpoint.WSDL_PORT), container, binding, - getPrimaryWsdl(), + getPrimaryWsdl(metadataReader), buildDocList(), (EntityResolver) null, false @@ -360,10 +362,10 @@ /** * Gets wsdl from @WebService or @WebServiceProvider */ - private @Nullable SDDocumentSource getPrimaryWsdl() { + private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation - EndpointFactory.verifyImplementorClass(implClass); - String wsdlLocation = EndpointFactory.getWsdlLocation(implClass); + EndpointFactory.verifyImplementorClass(implClass, metadataReader); + String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java 2013-04-04 15:31:06.528616493 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java 2013-04-04 15:31:06.472616492 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +29,6 @@ import com.sun.xml.internal.ws.transport.http.HttpAdapter; import com.sun.xml.internal.ws.transport.http.HttpAdapterList; import com.sun.xml.internal.ws.server.ServerRtException; -import com.sun.xml.internal.ws.server.WSEndpointImpl; import com.sun.xml.internal.ws.resources.ServerMessages; import javax.xml.ws.EndpointReference; @@ -127,9 +126,8 @@ } public T getEndpointReference(Class clazz, Element...referenceParameters) { - WSEndpointImpl endpointImpl = (WSEndpointImpl) adapter.getEndpoint(); String eprAddress = getEPRAddress(); - return clazz.cast(endpointImpl.getEndpointReference(clazz, eprAddress,eprAddress+"?wsdl", referenceParameters)); + return clazz.cast(adapter.getEndpoint().getEndpointReference(clazz, eprAddress,eprAddress+"?wsdl", referenceParameters)); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableConnectionImpl.java 2013-04-04 15:31:06.776616496 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableConnectionImpl.java 2013-04-04 15:31:06.716616495 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -91,19 +91,19 @@ } @Override - public void setResponseHeader(String key, List value) { - httpExchange.getResponseHeaders().put(key, value); - } + public void setResponseHeader(String key, List value) { + httpExchange.getResponseHeaders().put(key, value); + } - @Override - public Set getRequestHeaderNames() { + @Override + public Set getRequestHeaderNames() { return httpExchange.getRequestHeaders().keySet(); - } + } - @Override - public List getRequestHeaderValues(String headerName) { - return httpExchange.getRequestHeaders().get(headerName); - } + @Override + public List getRequestHeaderValues(String headerName) { + return httpExchange.getRequestHeaders().get(headerName); + } @Override @Property({MessageContext.HTTP_RESPONSE_HEADERS,Packet.OUTBOUND_TRANSPORT_HEADERS}) @@ -127,11 +127,11 @@ return status; } - public @NotNull InputStream getInput() throws IOException { + public @Override @NotNull InputStream getInput() throws IOException { return httpExchange.getRequestBody(); } - public @NotNull OutputStream getOutput() throws IOException { + public @Override @NotNull OutputStream getOutput() throws IOException { assert !outputWritten; outputWritten = true; @@ -139,23 +139,26 @@ return httpExchange.getResponseBody(); } - public @NotNull WebServiceContextDelegate getWebServiceContextDelegate() { + public @Override @NotNull WebServiceContextDelegate getWebServiceContextDelegate() { return this; } + @Override public Principal getUserPrincipal(Packet request) { return httpExchange.getUserPrincipal(); } + @Override public boolean isUserInRole(Packet request, String role) { return httpExchange.isUserInRole(role); } - public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) { - PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress()); + public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) { + PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass()); String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart()); - if(address==null) + if(address==null) { throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName())); + } return address; } @@ -174,12 +177,14 @@ return httpExchange.getAttribute(MessageContext.SERVLET_REQUEST); } + @Override public String getWSDLAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint) { String eprAddress = getEPRAddress(request,endpoint); - if(adapter.getEndpoint().getPort() != null) + if(adapter.getEndpoint().getPort() != null) { return eprAddress+"?wsdl"; - else + } else { return null; + } } @Override @@ -232,26 +237,27 @@ httpExchange.addResponseHeader("Content-Length", ""+value); } - @Override - public String getRequestURI() { - return httpExchange.getRequestURI().toString(); - } + @Override + public String getRequestURI() { + return httpExchange.getRequestURI().toString(); + } - @Override - public String getRequestScheme() { - return httpExchange.getScheme(); - } + @Override + public String getRequestScheme() { + return httpExchange.getScheme(); + } - @Override - public String getServerName() { - return httpExchange.getLocalAddress().getHostName(); - } + @Override + public String getServerName() { + return httpExchange.getLocalAddress().getHostName(); + } - @Override - public int getServerPort() { - return httpExchange.getLocalAddress().getPort(); - } + @Override + public int getServerPort() { + return httpExchange.getLocalAddress().getPort(); + } + @Override protected PropertyMap getPropertyMap() { return model; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableHttpHandler.java 2013-04-04 15:31:07.028616501 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableHttpHandler.java 2013-04-04 15:31:06.964616500 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,6 +35,7 @@ import javax.xml.ws.spi.http.HttpExchange; import java.io.IOException; import java.util.concurrent.Executor; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -66,9 +67,12 @@ /** * Called by HttpServer when there is a matching request for the context */ + @Override public void handle(HttpExchange msg) { try { - logger.fine("Received HTTP request:"+msg.getRequestURI()); + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, "Received HTTP request:{0}", msg.getRequestURI()); + } if (executor != null) { // Use application's Executor to handle request. Application may // have set an executor using Endpoint.setExecutor(). @@ -76,16 +80,18 @@ } else { handleExchange(msg); } - } catch(Throwable e) { + } catch (Throwable e) { // Dont't propagate the exception otherwise it kills the httpserver - e.printStackTrace(); + logger.log(Level.SEVERE, null, e); } } public void handleExchange(HttpExchange msg) throws IOException { WSHTTPConnection con = new PortableConnectionImpl(adapter,msg); try { - logger.fine("Received HTTP request:"+msg.getRequestURI()); + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, "Received HTTP request:{0}", msg.getRequestURI()); + } String method = msg.getRequestMethod(); if(method.equals(GET_METHOD) || method.equals(POST_METHOD) || method.equals(HEAD_METHOD) || method.equals(PUT_METHOD) || method.equals(DELETE_METHOD)) { @@ -109,6 +115,8 @@ this.msg = msg; } + @Override + @SuppressWarnings("CallToThreadDumpStack") public void run() { try { handleExchange(msg); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerAdapter.java 2013-04-04 15:31:07.244616503 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerAdapter.java 2013-04-04 15:31:07.184616503 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,6 +35,7 @@ import javax.xml.ws.WebServiceException; import java.net.URI; import java.net.URISyntaxException; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -60,7 +61,8 @@ // registers itself with the container Module module = endpoint.getContainer().getSPI(Module.class); if(module==null) - LOGGER.warning("Container "+endpoint.getContainer()+" doesn't support "+Module.class); + LOGGER.log(Level.WARNING, "Container {0} doesn''t support {1}", + new Object[]{endpoint.getContainer(), Module.class}); else { module.getBoundEndpoints().add(this); } @@ -75,8 +77,8 @@ } - @NotNull - public URI getAddress() { + @Override + public @NotNull URI getAddress() { WebModule webModule = endpoint.getContainer().getSPI(WebModule.class); if(webModule==null) // this is really a bug in the container implementation @@ -85,6 +87,7 @@ return getAddress(webModule.getContextPath()); } + @Override public @NotNull URI getAddress(String baseAddress) { String adrs = baseAddress+getValidPath(); try { @@ -103,6 +106,7 @@ return urlPattern; } + @Override public String toString() { return super.toString()+"[name="+name+']'; } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerAdapterList.java 2013-04-04 15:31:07.464616507 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerAdapterList.java 2013-04-04 15:31:07.408616507 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java 2013-04-04 15:31:07.696616511 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java 2013-04-04 15:31:07.632616510 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -227,7 +227,7 @@ public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) { //return WSHttpHandler.getRequestAddress(httpExchange); - PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress()); + PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass()); String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart()); if(address==null) throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName())); --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerContainer.java 2013-04-04 15:31:07.908616514 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerContainer.java 2013-04-04 15:31:07.856616513 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +48,9 @@ }; public T getSPI(Class spiType) { + T t = super.getSPI(spiType); + if (t != null) + return t; if (spiType == Module.class) { return spiType.cast(module); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java 2013-04-04 15:31:08.148616518 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java 2013-04-04 15:31:08.092616517 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java 2013-04-04 15:31:08.364616521 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java 2013-04-04 15:31:08.300616520 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -72,7 +72,7 @@ public void handle(HttpExchange msg) { try { if (fineTraceEnabled) { - LOGGER.fine("Received HTTP request:"+msg.getRequestURI()); + LOGGER.log(Level.FINE, "Received HTTP request:{0}", msg.getRequestURI()); } if (executor != null) { // Use application's Executor to handle request. Application may @@ -90,7 +90,7 @@ WSHTTPConnection con = new ServerConnectionImpl(adapter,msg); try { if (fineTraceEnabled) { - LOGGER.fine("Received HTTP request:"+msg.getRequestURI()); + LOGGER.log(Level.FINE, "Received HTTP request:{0}", msg.getRequestURI()); } String method = msg.getRequestMethod(); if(method.equals(GET_METHOD) || method.equals(POST_METHOD) || method.equals(HEAD_METHOD) --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ASCIIUtility.java 2013-04-04 15:31:08.564616524 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ASCIIUtility.java 2013-04-04 15:31:08.516616523 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 @@ import java.io.InputStream; import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.OutputStream; /** @@ -121,22 +119,6 @@ return new String(theChars); } - public static byte[] getBytes(String s) { - char [] chars= s.toCharArray(); - int size = chars.length; - byte[] bytes = new byte[size]; - - for (int i = 0; i < size;) - bytes[i] = (byte) chars[i++]; - return bytes; - } - - public static byte[] getBytes(InputStream is) throws IOException { - ByteArrayBuffer bab = new ByteArrayBuffer(); - bab.write(is); - return bab.toByteArray(); - } - public static void copyStream(InputStream is, OutputStream out) throws IOException { int size = 1024; byte[] buf = new byte[size]; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java 2013-04-04 15:31:08.832616528 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java 2013-04-04 15:31:08.780616528 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java 2013-04-04 15:31:09.080616533 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java 2013-04-04 15:31:09.024616531 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/CompletedFuture.java 2013-04-04 15:31:09.360616536 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/CompletedFuture.java 2013-04-04 15:31:09.296616535 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/Constants.java 2013-04-04 15:31:09.632616541 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/Constants.java 2013-04-04 15:31:09.584616540 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/DOMUtil.java 2013-04-04 15:31:09.884616545 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/DOMUtil.java 2013-04-04 15:31:09.832616544 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,32 +25,25 @@ package com.sun.xml.internal.ws.util; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; +import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.util.xml.XmlUtil; +import org.w3c.dom.*; +import javax.xml.XMLConstants; +import javax.xml.namespace.NamespaceContext; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import javax.xml.XMLConstants; -import javax.xml.namespace.NamespaceContext; -import java.io.IOException; -import java.io.InputStream; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.ArrayList; - -import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; /** - * @author: JAXWS Development Team + * @author JAXWS Development Team */ public class DOMUtil { @@ -63,7 +56,7 @@ synchronized (DOMUtil.class) { if (db == null) { try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(); dbf.setNamespaceAware(true); db = dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { @@ -74,28 +67,6 @@ } } - public static Node createDOMNode(InputStream inputStream) { - - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - dbf.setValidating(false); - try { - DocumentBuilder builder = dbf.newDocumentBuilder(); - try { - return builder.parse(inputStream); - } catch (SAXException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } catch (IOException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - } catch (ParserConfigurationException pce) { - IllegalArgumentException iae = new IllegalArgumentException(pce.getMessage()); - iae.initCause(pce); - throw iae; - } - return null; - } - /** * Traverses a DOM node and writes out on a streaming writer. * @@ -112,6 +83,7 @@ switch (child.getNodeType()) { case Node.PROCESSING_INSTRUCTION_NODE: writer.writeProcessingInstruction(child.getNodeValue()); + break; case Node.DOCUMENT_TYPE_NODE: break; case Node.CDATA_SECTION_NODE: @@ -126,6 +98,7 @@ case Node.ELEMENT_NODE: serializeNode((Element) child, writer); break; + default: break; } } } @@ -222,8 +195,9 @@ for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) { if (n.getNodeType() == Node.ELEMENT_NODE) { Element c = (Element) n; - if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri)) + if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri)) { return c; + } } } return null; @@ -232,8 +206,11 @@ private static @NotNull String fixNull(@Nullable String s) { - if (s == null) return ""; - else return s; + if (s == null) { + return ""; + } else { + return s; + } } /** --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java 2013-04-04 15:31:10.124616549 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java 2013-04-04 15:31:10.072616548 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/FastInfosetUtil.java 2013-04-04 15:31:10.368616553 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/FastInfosetUtil.java 2013-04-04 15:31:10.316616552 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java 2013-04-04 15:31:10.628616557 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java 2013-04-04 15:31:10.580616555 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java 2013-04-04 15:31:10.892616560 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java 2013-04-04 15:31:10.840616560 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,11 @@ package com.sun.xml.internal.ws.util; import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.server.AsyncProvider; import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.handler.HandlerChainsModel; +import com.sun.xml.internal.ws.model.ReflectAnnotationReader; import com.sun.xml.internal.ws.server.EndpointFactory; import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; import com.sun.istack.internal.NotNull; @@ -89,14 +91,17 @@ public static HandlerAnnotationInfo buildHandlerInfo(@NotNull Class clazz, QName serviceName, QName portName, WSBinding binding) { + MetadataReader metadataReader = EndpointFactory.getExternalMetadatReader(clazz, binding); + if (metadataReader == null) { + metadataReader = new ReflectAnnotationReader(); + } + // clazz = checkClass(clazz); - HandlerChain handlerChain = - clazz.getAnnotation(HandlerChain.class); + HandlerChain handlerChain = metadataReader.getAnnotation(HandlerChain.class, clazz); if (handlerChain == null) { - clazz = getSEI(clazz); + clazz = getSEI(clazz, metadataReader); if (clazz != null) - handlerChain = - clazz.getAnnotation(HandlerChain.class); + handlerChain = metadataReader.getAnnotation(HandlerChain.class, clazz); if (handlerChain == null) return null; } @@ -160,7 +165,11 @@ } } - static Class getSEI(Class clazz) { + static Class getSEI(Class clazz, MetadataReader metadataReader) { + if (metadataReader == null) { + metadataReader = new ReflectAnnotationReader(); + } + if (Provider.class.isAssignableFrom(clazz) || AsyncProvider.class.isAssignableFrom(clazz)) { //No SEI for Provider Implementation return null; @@ -169,17 +178,17 @@ //No SEI for Service class return null; } - if (!clazz.isAnnotationPresent(WebService.class)) { - throw new UtilException("util.handler.no.webservice.annotation", - clazz.getCanonicalName()); - } - WebService webService = clazz.getAnnotation(WebService.class); + WebService webService = metadataReader.getAnnotation(WebService.class, clazz); + if (webService == null) { + throw new UtilException("util.handler.no.webservice.annotation", clazz.getCanonicalName()); + } String ei = webService.endpointInterface(); if (ei.length() > 0) { clazz = getClass(webService.endpointInterface()); - if (!clazz.isAnnotationPresent(WebService.class)) { + WebService ws = metadataReader.getAnnotation(WebService.class, clazz); + if (ws == null) { throw new UtilException("util.handler.endpoint.interface.no.webservice", webService.endpointInterface()); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/JAXWSUtils.java 2013-04-04 15:31:11.144616564 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/JAXWSUtils.java 2013-04-04 15:31:11.088616564 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -92,7 +92,7 @@ private static String escapeSpace( String url ) { // URLEncoder didn't work. - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0; i < url.length(); i++) { // TODO: not sure if this is the only character that needs to be escaped. if (url.charAt(i) == ' ') @@ -109,8 +109,8 @@ try { URL baseURL = new File(".").getCanonicalFile().toURL(); return new URL(baseURL, name).toExternalForm(); - } catch( IOException e ) { - ; // ignore + } catch( IOException e) { + //ignore } return name; } @@ -118,6 +118,7 @@ /** * Checks if the system ID is absolute. */ + @SuppressWarnings("ResultOfObjectAllocationIgnored") public static void checkAbsoluteness(String systemId) { // we need to be able to handle system IDs like "urn:foo", which java.net.URL can't process, // but OTOH we also need to be able to process system IDs like "file://a b c/def.xsd", @@ -125,10 +126,10 @@ // eventually we need a proper URI class that works for us. try { new URL(systemId); - } catch( MalformedURLException _ ) { + } catch( MalformedURLException mue) { try { new URI(systemId); - } catch (URISyntaxException e ) { + } catch (URISyntaxException e) { throw new IllegalArgumentException("system ID '"+systemId+"' isn't absolute",e); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/MetadataUtil.java 2013-04-04 15:31:11.380616568 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/MetadataUtil.java 2013-04-04 15:31:11.324616567 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/NamespaceSupport.java 2013-04-04 15:31:11.632616572 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/NamespaceSupport.java 2013-04-04 15:31:11.584616572 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -82,7 +82,7 @@ * @author David Megginson * @author WS Development Team */ -public class NamespaceSupport { +public final class NamespaceSupport { /* added two new methods, slideContextUp() and slideContextDown() * needed to implement the revised streaming parser class (Parser2) --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/NoCloseInputStream.java 2013-04-04 15:31:11.904616576 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/NoCloseInputStream.java 2013-04-04 15:31:11.844616576 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java 2013-04-04 15:31:12.160616580 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java 2013-04-04 15:31:12.096616579 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/Pool.java 2013-04-04 15:31:12.428616584 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/Pool.java 2013-04-04 15:31:12.376616584 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -114,6 +114,7 @@ this.context = context; } + @Override protected javax.xml.bind.Marshaller create() { try { return context.createMarshaller(); @@ -134,6 +135,7 @@ this.context = context; } + @Override protected javax.xml.bind.Unmarshaller create() { try { return context.createUnmarshaller(); @@ -155,8 +157,21 @@ recycle(master); // we'll use master as a part of the pool, too. } + @Override protected Tube create() { return TubeCloner.clone(master); } + + /** + * + * @return master tubeline from pool + * @deprecated Expected to be used in rare cases where access to master + * tubeline is required and safe, such as Stub.close()." + */ + @Deprecated() + public final Tube takeMaster() { + return master; + } + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/QNameMap.java 2013-04-04 15:31:12.644616588 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/QNameMap.java 2013-04-04 15:31:12.596616587 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ReadAllStream.java 2013-04-04 15:31:12.892616592 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ReadAllStream.java 2013-04-04 15:31:12.840616591 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, 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.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Reads a input stream completely and creates a new stream @@ -48,6 +50,8 @@ private boolean readAll; private boolean closed; + private static final Logger LOGGER = Logger.getLogger(ReadAllStream.class.getName()); + public ReadAllStream() { memStream = new MemoryStream(); fileStream = new FileStream(); @@ -75,6 +79,7 @@ } } + @Override public int read() throws IOException { int ch = memStream.read(); if (ch == -1) { @@ -92,6 +97,7 @@ return len; } + @Override public void close() throws IOException { if (!closed) { memStream.close(); @@ -120,6 +126,7 @@ fin = new FileInputStream(tempFile); } + @Override public int read() throws IOException { return (fin != null) ? fin.read() : -1; } @@ -135,7 +142,10 @@ fin.close(); } if (tempFile != null) { - tempFile.delete(); + boolean success = tempFile.delete(); + if (!success) { + LOGGER.log(Level.INFO, "File {0} could not be deleted", tempFile); + } } } } @@ -168,12 +178,15 @@ byte[] buf = new byte[8192]; int read = fill(in, buf); total += read; - if (read != 0) + if (read != 0) { add(buf, read); - if (read != buf.length) - return true; // EOF - if (total > inMemory) - return false; // Reached in-memory size + } + if (read != buf.length) { + return true; + } // EOF + if (total > inMemory) { + return false; // Reached in-memory size + } } } @@ -186,6 +199,7 @@ return total; } + @Override public int read() throws IOException { if (!fetch()) { return -1; --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/RuntimeVersion.java 2013-04-04 15:31:13.160616596 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/RuntimeVersion.java 2013-04-04 15:31:13.100616595 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ServiceConfigurationError.java 2013-04-04 15:31:13.432616600 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ServiceConfigurationError.java 2013-04-04 15:31:13.376616599 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ServiceFinder.java 2013-04-04 15:31:13.656616604 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ServiceFinder.java 2013-04-04 15:31:13.608616603 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -47,6 +47,8 @@ import java.util.NoSuchElementException; import java.util.Set; import java.util.TreeSet; +import java.util.WeakHashMap; +import java.util.concurrent.ConcurrentHashMap; /** @@ -137,12 +139,24 @@ private static final String prefix = "META-INF/services/"; + private static WeakHashMap> serviceNameCache + = new WeakHashMap>(); + private final Class serviceClass; private final @Nullable ClassLoader classLoader; private final @Nullable ComponentEx component; + private static class ServiceName { + final String className; + final URL config; + public ServiceName(String className, URL config) { + this.className = className; + this.config = config; + } + } + public static ServiceFinder find(@NotNull Class service, @Nullable ClassLoader loader, Component component) { - return new ServiceFinder(service,loader,component); + return new ServiceFinder(service, loader, component); } public static ServiceFinder find(@NotNull Class service, Component component) { @@ -204,6 +218,12 @@ this.component = getComponentEx(component); } + private static ServiceName[] serviceClassNames(Class serviceClass, ClassLoader classLoader) { + ArrayList l = new ArrayList(); + for (Iterator it = new ServiceNameIterator(serviceClass,classLoader);it.hasNext();) l.add(it.next()); + return l.toArray(new ServiceName[l.size()]); + } + /** * Returns discovered objects incrementally. * @@ -395,8 +415,8 @@ /** * Private inner class implementing fully-lazy provider lookup */ - private static class LazyIterator implements Iterator { - Class service; + private static class ServiceNameIterator implements Iterator { + Class service; @Nullable ClassLoader loader; Enumeration configs = null; Iterator pending = null; @@ -404,7 +424,7 @@ String nextName = null; URL currentConfig = null; - private LazyIterator(Class service, ClassLoader loader) { + private ServiceNameIterator(Class service, ClassLoader loader) { this.service = service; this.loader = loader; } @@ -435,26 +455,69 @@ return true; } - public T next() throws ServiceConfigurationError { + public ServiceName next() throws ServiceConfigurationError { if (!hasNext()) { throw new NoSuchElementException(); } String cn = nextName; nextName = null; + return new ServiceName(cn, currentConfig); + } + + public void remove() { + throw new UnsupportedOperationException(); + } + } + + private static class LazyIterator implements Iterator { + Class service; + @Nullable ClassLoader loader; + ServiceName[] names; + int index; + + private LazyIterator(Class service, ClassLoader loader) { + this.service = service; + this.loader = loader; + this.names = null; + index = 0; + } + + @Override + public boolean hasNext() { + if (names == null) { + ConcurrentHashMap nameMap = null; + synchronized(serviceNameCache){ nameMap = serviceNameCache.get(loader); } + names = (nameMap != null)? nameMap.get(service.getName()) : null; + if (names == null) { + names = serviceClassNames(service, loader); + if (nameMap == null) nameMap = new ConcurrentHashMap(); + nameMap.put(service.getName(), names); + synchronized(serviceNameCache){ serviceNameCache.put(loader,nameMap); } + } + } + return (index < names.length); + } + + @Override + public T next() { + if (!hasNext()) throw new NoSuchElementException(); + ServiceName sn = names[index++]; + String cn = sn.className; + URL currentConfig = sn.config; try { return service.cast(Class.forName(cn, true, loader).newInstance()); } catch (ClassNotFoundException x) { - fail(service, - "Provider " + cn + " is specified in "+currentConfig+" but not found"); + fail(service, "Provider " + cn + " is specified in "+currentConfig+" but not found"); } catch (Exception x) { - fail(service, - "Provider " + cn + " is specified in "+currentConfig+"but could not be instantiated: " + x, x); + fail(service, "Provider " + cn + " is specified in "+currentConfig+"but could not be instantiated: " + x, x); } return null; /* This cannot happen */ } + @Override public void remove() { throw new UnsupportedOperationException(); } + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/StreamUtils.java 2013-04-04 15:31:13.956616608 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/StreamUtils.java 2013-04-04 15:31:13.888616607 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/StringUtils.java 2013-04-04 15:31:14.224616613 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/StringUtils.java 2013-04-04 15:31:14.160616612 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/UtilException.java 2013-04-04 15:31:14.468616616 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/UtilException.java 2013-04-04 15:31:14.408616615 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +25,8 @@ package com.sun.xml.internal.ws.util; +import com.sun.istack.internal.localization.Localizable; import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase; -import com.sun.xml.internal.ws.util.localization.Localizable; /** * UtilException represents an exception that occurred while --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/Version.java 2013-04-04 15:31:14.756616620 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/Version.java 2013-04-04 15:31:14.692616619 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/VersionUtil.java 2013-04-04 15:31:15.032616625 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/VersionUtil.java 2013-04-04 15:31:14.984616624 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java 2013-04-04 15:31:15.272616629 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java 2013-04-04 15:31:15.216616628 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,13 +25,16 @@ package com.sun.xml.internal.ws.util.exception; -import com.sun.xml.internal.ws.util.localization.*; - -import javax.xml.ws.WebServiceException; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessage; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.Localizer; +import com.sun.istack.internal.localization.NullLocalizable; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; +import javax.xml.ws.WebServiceException; /** * Represents a {@link WebServiceException} with @@ -53,7 +56,7 @@ */ protected JAXWSExceptionBase(String key, Object... args) { super(findNestedException(args)); - this.msg = new LocalizableImpl(key,fixNull(args),getDefaultResourceBundleName()); + this.msg = new LocalizableMessage(getDefaultResourceBundleName(), key, args); } @@ -61,11 +64,6 @@ this(new NullLocalizable(message)); } - private static Object[] fixNull(Object[] x) { - if(x==null) return new Object[0]; - else return x; - } - /** * Creates a new exception that wraps the specified exception. */ --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/exception/LocatableWebServiceException.java 2013-04-04 15:31:15.528616632 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/exception/LocatableWebServiceException.java 2013-04-04 15:31:15.464616631 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java 2013-04-04 15:31:15.776616637 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java 2013-04-04 15:31:15.716616636 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,8 +107,9 @@ private static class ValidationDocumentAddressResolver implements DocumentAddressResolver { @Nullable + @Override public String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced) { - LOGGER.fine("Current = "+current.getURL()+" resolved relative="+referenced.getURL()); + LOGGER.log(Level.FINE, "Current = {0} resolved relative={1}", new Object[]{current.getURL(), referenced.getURL()}); return referenced.getURL().toExternalForm(); } } @@ -175,6 +176,7 @@ } } + @Override public SDDocument resolve(String systemId) { SDDocument sdi = docs.get(systemId); if (sdi == null) { @@ -190,8 +192,11 @@ return sdi; } + @Override public LSInput resolveResource(String type, String namespaceURI, String publicId, final String systemId, final String baseURI) { - LOGGER.fine("type="+type+ " namespaceURI="+namespaceURI+" publicId="+publicId+" systemId="+systemId+" baseURI="+baseURI); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "type={0} namespaceURI={1} publicId={2} systemId={3} baseURI={4}", new Object[]{type, namespaceURI, publicId, systemId, baseURI}); + } try { final SDDocument doc; if (systemId == null) { @@ -205,14 +210,17 @@ if (doc != null) { return new LSInput() { + @Override public Reader getCharacterStream() { return null; } + @Override public void setCharacterStream(Reader characterStream) { throw new UnsupportedOperationException(); } + @Override public InputStream getByteStream() { ByteArrayBuffer bab = new ByteArrayBuffer(); try { @@ -223,54 +231,67 @@ return bab.newInputStream(); } + @Override public void setByteStream(InputStream byteStream) { throw new UnsupportedOperationException(); } + @Override public String getStringData() { return null; } + @Override public void setStringData(String stringData) { throw new UnsupportedOperationException(); } + @Override public String getSystemId() { return doc.getURL().toExternalForm(); } + @Override public void setSystemId(String systemId) { throw new UnsupportedOperationException(); } + @Override public String getPublicId() { return null; } + @Override public void setPublicId(String publicId) { throw new UnsupportedOperationException(); } + @Override public String getBaseURI() { return doc.getURL().toExternalForm(); } + @Override public void setBaseURI(String baseURI) { throw new UnsupportedOperationException(); } + @Override public String getEncoding() { return null; } + @Override public void setEncoding(String encoding) { throw new UnsupportedOperationException(); } + @Override public boolean getCertifiedText() { return false; } + @Override public void setCertifiedText(boolean certifiedText) { throw new UnsupportedOperationException(); } @@ -279,7 +300,9 @@ } catch(Exception e) { LOGGER.log(Level.WARNING, "Exception in LSResourceResolver impl", e); } - LOGGER.fine("Don't know about systemId="+systemId+" baseURI="+baseURI); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Don''t know about systemId={0} baseURI={1}", new Object[]{systemId, baseURI}); + } return null; } @@ -325,7 +348,9 @@ updateMultiSchemaForTns(((SDDocument.Schema)sdoc).getTargetNamespace(), sdoc.getURL().toExternalForm(), multiSchemaForTns); } } - LOGGER.fine("WSDL inlined schema fragment documents(these are used to create a pseudo schema) = "+ inlinedSchemas.keySet()); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "WSDL inlined schema fragment documents(these are used to create a pseudo schema) = {0}", inlinedSchemas.keySet()); + } for(DOMSource src: inlinedSchemas.values()) { String tns = getTargetNamespace(src); updateMultiSchemaForTns(tns, src.getSystemId(), multiSchemaForTns); @@ -393,8 +418,9 @@ * Recursively visit ancestors and build up {@link org.xml.sax.helpers.NamespaceSupport} object. */ private void buildNamespaceSupport(NamespaceSupport nss, Node node) { - if(node==null || node.getNodeType()!=Node.ELEMENT_NODE) + if (node==null || node.getNodeType()!=Node.ELEMENT_NODE) { return; + } buildNamespaceSupport( nss, node.getParentNode() ); @@ -427,7 +453,9 @@ for( int i=0; i\n"); } sb.append("\n"); - LOGGER.fine("Pseudo Schema for the same tns="+tns+"is "+sb); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Pseudo Schema for the same tns={0}is {1}", new Object[]{tns, sb}); + } // override getReader() so that the same source can be used multiple times return new StreamSource(pseudoSystemId) { @@ -495,7 +525,9 @@ sb.append("/>\n"); } sb.append(""); - LOGGER.fine("Master Pseudo Schema = "+sb); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Master Pseudo Schema = {0}", sb); + } // override getReader() so that the same source can be used multiple times return new StreamSource("file:x-jax-ws-master-doc") { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java 2013-04-04 15:31:16.032616640 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java 2013-04-04 15:31:15.980616640 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java 2013-04-04 15:31:16.292616645 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java 2013-04-04 15:31:16.240616644 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java 2013-04-04 15:31:16.560616648 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java 2013-04-04 15:31:16.496616647 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties 2013-04-04 15:31:16.828616653 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties 2013-04-04 15:31:16.772616652 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties 2013-04-04 15:31:17.104616657 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties 2013-04-04 15:31:17.040616656 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 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,8 +23,7 @@ # questions. # -build-id=b09 - build-version=JAX-WS RI 2.2.7-b09 - major-version=2.2.7 - svn-revision=12895 - svn-url=https://svn.java.net/svn/jax-ws~sources/branches/jaxws22/jaxws-ri +build-id=2.2.9-b13941 +build-version=JAX-WS RI 2.2.9-b13941 +major-version=2.2.9 +svn-revision=unknown --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/CDATA.java 2013-04-04 15:31:17.368616662 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/CDATA.java 2013-04-04 15:31:17.300616660 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java 2013-04-04 15:31:17.612616665 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java 2013-04-04 15:31:17.560616665 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/DummyLocation.java 2013-04-04 15:31:17.888616669 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/DummyLocation.java 2013-04-04 15:31:17.836616669 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/NamedNodeMapIterator.java 2013-04-04 15:31:18.164616674 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/NamedNodeMapIterator.java 2013-04-04 15:31:18.108616673 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/NodeListIterator.java 2013-04-04 15:31:18.424616678 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/NodeListIterator.java 2013-04-04 15:31:18.368616677 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/StAXResult.java 2013-04-04 15:31:18.644616681 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/StAXResult.java 2013-04-04 15:31:18.592616681 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/StAXSource.java 2013-04-04 15:31:18.860616685 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/StAXSource.java 2013-04-04 15:31:18.808616683 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -41,7 +41,7 @@ * A JAXP {@link javax.xml.transform.Source} implementation that wraps * the specified {@link javax.xml.stream.XMLStreamReader} or * {@link javax.xml.stream.XMLEventReader} for use by applications that - * expext a {@link javax.xml.transform.Source}. + * expect a {@link javax.xml.transform.Source}. * *

      * The fact that StAXSource derives from SAXSource is an implementation @@ -66,7 +66,7 @@ XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(args[0])); Source staxSource = new StAXSource(reader); - // createa StreamResult + // create a StreamResult Result streamResult = new StreamResult(System.out); // run the transform @@ -87,16 +87,19 @@ // SAX allows ContentHandler to be changed during the parsing, // but JAXB doesn't. So this repeater will sit between those // two components. - private XMLFilterImpl repeater = new XMLFilterImpl(); + private final XMLFilterImpl repeater = new XMLFilterImpl(); // this object will pretend as an XMLReader. // no matter what parameter is specified to the parse method, // it will just read from the StAX reader. private final XMLReader pseudoParser = new XMLReader() { + + @Override public boolean getFeature(String name) throws SAXNotRecognizedException { throw new SAXNotRecognizedException(name); } + @Override public void setFeature(String name, boolean value) throws SAXNotRecognizedException { // Should support these two features according to XMLReader javadoc. if (name.equals("http://xml.org/sax/features/namespaces") && value) { @@ -108,6 +111,7 @@ } } + @Override public Object getProperty(String name) throws SAXNotRecognizedException { if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) { return lexicalHandler; @@ -115,6 +119,7 @@ throw new SAXNotRecognizedException(name); } + @Override public void setProperty(String name, Object value) throws SAXNotRecognizedException { if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) { this.lexicalHandler = (LexicalHandler)value; @@ -127,40 +132,55 @@ // we will store this value but never use it by ourselves. private EntityResolver entityResolver; + + @Override public void setEntityResolver(EntityResolver resolver) { this.entityResolver = resolver; } + + @Override public EntityResolver getEntityResolver() { return entityResolver; } private DTDHandler dtdHandler; + + @Override public void setDTDHandler(DTDHandler handler) { this.dtdHandler = handler; } + @Override public DTDHandler getDTDHandler() { return dtdHandler; } + @Override public void setContentHandler(ContentHandler handler) { repeater.setContentHandler(handler); } + + @Override public ContentHandler getContentHandler() { return repeater.getContentHandler(); } private ErrorHandler errorHandler; + + @Override public void setErrorHandler(ErrorHandler handler) { this.errorHandler = handler; } + @Override public ErrorHandler getErrorHandler() { return errorHandler; } + @Override public void parse(InputSource input) throws SAXException { parse(); } + @Override public void parse(String systemId) throws SAXException { parse(); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderFilter.java 2013-04-04 15:31:19.088616688 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderFilter.java 2013-04-04 15:31:19.024616687 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java 2013-04-04 15:31:19.300616692 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java 2013-04-04 15:31:19.248616691 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,20 @@ package com.sun.xml.internal.ws.util.xml; +import java.io.IOException; + +import javax.xml.bind.attachment.AttachmentMarshaller; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import javax.xml.XMLConstants; +import com.sun.xml.internal.ws.streaming.MtomStreamWriter; +import com.sun.xml.internal.org.jvnet.staxex.Base64Data; +import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx; +import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx; + /** * Reads a sub-tree from {@link XMLStreamReader} and writes to {@link XMLStreamWriter} * as-is. @@ -50,6 +58,10 @@ private char[] buf; + boolean optimizeBase64Data = false; + + AttachmentMarshaller mtomAttachmentMarshaller; + /** * Reads one subtree and writes it out. * @@ -62,6 +74,11 @@ this.in = in; this.out = out; + optimizeBase64Data = (in instanceof XMLStreamReaderEx); + + if (out instanceof XMLStreamWriterEx && out instanceof MtomStreamWriter) { + mtomAttachmentMarshaller = ((MtomStreamWriter) out).getAttachmentMarshaller(); + } // remembers the nest level of elements to know when we are done. int depth=0; @@ -136,9 +153,29 @@ protected void handleCharacters() throws XMLStreamException { - for (int start=0,read=buf.length; read == buf.length; start+=buf.length) { - read = in.getTextCharacters(start, buf, 0, buf.length); - out.writeCharacters(buf, 0, read); + + CharSequence c = null; + + if (optimizeBase64Data) { + c = ((XMLStreamReaderEx)in).getPCDATA(); + } + + if ((c != null) && (c instanceof Base64Data)) { + if (mtomAttachmentMarshaller != null) { + Base64Data b64d = (Base64Data) c; + ((XMLStreamWriterEx)out).writeBinary(b64d.getDataHandler()); + } else { + try { + ((Base64Data)c).writeTo(out); + } catch (IOException e) { + throw new XMLStreamException(e); + } + } + } else { + for (int start=0,read=buf.length; read == buf.length; start+=buf.length) { + read = in.getTextCharacters(start, buf, 0, buf.length); + out.writeCharacters(buf, 0, read); + } } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamWriterFilter.java 2013-04-04 15:31:19.524616695 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XMLStreamWriterFilter.java 2013-04-04 15:31:19.468616694 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2013-04-04 15:31:19.732616698 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2013-04-04 15:31:19.680616698 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -37,16 +37,14 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Text; -import org.xml.sax.EntityResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.XMLReader; -import org.xml.sax.InputSource; +import org.xml.sax.*; +import javax.xml.XMLConstants; import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; +import javax.xml.stream.XMLInputFactory; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; @@ -57,6 +55,8 @@ import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamSource; import javax.xml.ws.WebServiceException; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPathFactoryConfigurationException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; @@ -67,6 +67,8 @@ import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @author WS Development Team @@ -75,6 +77,15 @@ private final static String LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler"; + private static final Logger LOGGER = Logger.getLogger(XmlUtil.class.getName()); + + private static boolean globalSecureXmlProcessingEnabled; + + static { + String disableSecureXmlProcessing = System.getProperty("disableSecureXmlProcessing"); + globalSecureXmlProcessingEnabled = disableSecureXmlProcessing == null || !Boolean.valueOf(disableSecureXmlProcessing); + } + public static String getPrefix(String s) { int i = s.indexOf(':'); if (i == -1) @@ -163,7 +174,7 @@ } public static String getTextForNode(Node node) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); NodeList children = node.getChildNodes(); if (children.getLength() == 0) @@ -199,9 +210,9 @@ } } - static final TransformerFactory transformerFactory = TransformerFactory.newInstance(); + static final TransformerFactory transformerFactory = newTransformerFactory(); - static final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); + static final SAXParserFactory saxParserFactory = newSAXParserFactory(true); static { saxParserFactory.setNamespaceAware(true); @@ -326,15 +337,81 @@ * {@link ErrorHandler} that always treat the error as fatal. */ public static final ErrorHandler DRACONIAN_ERROR_HANDLER = new ErrorHandler() { + @Override public void warning(SAXParseException exception) { } + @Override public void error(SAXParseException exception) throws SAXException { throw exception; } + @Override public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }; + + public static DocumentBuilderFactory newDocumentBuilderFactory() { + return newDocumentBuilderFactory(true); + } + + public static DocumentBuilderFactory newDocumentBuilderFactory(boolean secureXmlProcessing) { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + try { + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessing)); + } catch (ParserConfigurationException e) { + LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); + } + return factory; + } + + public static TransformerFactory newTransformerFactory(boolean secureXmlProcessingEnabled) { + TransformerFactory factory = TransformerFactory.newInstance(); + try { + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessingEnabled)); + } catch (TransformerConfigurationException e) { + LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); + } + return factory; + } + + public static TransformerFactory newTransformerFactory() { + return newTransformerFactory(true); + } + + public static SAXParserFactory newSAXParserFactory(boolean secureXmlProcessingEnabled) { + SAXParserFactory factory = SAXParserFactory.newInstance(); + try { + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessingEnabled)); + } catch (Exception e) { + LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); + } + return factory; + } + + public static XPathFactory newXPathFactory(boolean secureXmlProcessingEnabled) { + XPathFactory factory = XPathFactory.newInstance(); + try { + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessingEnabled)); + } catch (XPathFactoryConfigurationException e) { + LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); + } + return factory; + } + + public static XMLInputFactory newXMLInputFactory(boolean secureXmlProcessingEnabled) { + XMLInputFactory factory = XMLInputFactory.newInstance(); + if (checkGlobalOverride(secureXmlProcessingEnabled)) { + // TODO-Miran: are those apppropriate defaults? + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); + } + return factory; + } + + private static boolean checkGlobalOverride(boolean localSecureXmlProcessingEnabled) { + return globalSecureXmlProcessingEnabled && localSecureXmlProcessingEnabled; + } + } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationFinder.java 2013-04-04 15:31:19.964616701 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationFinder.java 2013-04-04 15:31:19.912616701 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,11 +29,13 @@ import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; -import com.sun.xml.internal.ws.api.message.HeaderList; +import com.sun.xml.internal.ws.api.message.AddressingUtils; import com.sun.xml.internal.ws.api.message.Message; +import com.sun.xml.internal.ws.api.message.MessageHeaders; import com.sun.xml.internal.ws.api.message.Messages; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.model.AbstractSEIModelImpl; @@ -61,8 +63,8 @@ final class ActionBasedOperationFinder extends WSDLOperationFinder { private static final Logger LOGGER = Logger.getLogger(ActionBasedOperationFinder.class.getName()); - private final Map uniqueOpSignatureMap; - private final Map actionMap; + private final Map uniqueOpSignatureMap; + private final Map actionMap; private final @NotNull AddressingVersion av; @@ -71,8 +73,8 @@ assert binding.getAddressingVersion() != null; // this dispatcher can be only used when addressing is on. av = binding.getAddressingVersion(); - uniqueOpSignatureMap = new HashMap(); - actionMap = new HashMap(); + uniqueOpSignatureMap = new HashMap(); + actionMap = new HashMap(); if (seiModel != null) { for (JavaMethodImpl m : ((AbstractSEIModelImpl) seiModel).getJavaMethods()) { @@ -94,8 +96,8 @@ LOGGER.warning(AddressingMessages.NON_UNIQUE_OPERATION_SIGNATURE( uniqueOpSignatureMap.get(opSignature),m.getOperationQName(),action,payloadName)); } - uniqueOpSignatureMap.put(opSignature, m.getOperationQName()); - actionMap.put(action,m.getOperationQName()); + uniqueOpSignatureMap.put(opSignature, wsdlOperationMapping(m)); + actionMap.put(action,wsdlOperationMapping(m)); } } } else { @@ -111,24 +113,28 @@ uniqueOpSignatureMap.get(opSignature),wsdlOp.getName(),action,payloadName)); } - uniqueOpSignatureMap.put(opSignature, wsdlOp.getName()); - actionMap.put(action,wsdlOp.getName()); + uniqueOpSignatureMap.put(opSignature, wsdlOperationMapping(wsdlOp)); + actionMap.put(action,wsdlOperationMapping(wsdlOp)); } } } - /** - * - * @param request Request Packet that is used to find the associated WSDLOperation - * @return WSDL operation Qname. - * return null if WS-Addressing is not engaged. - * @throws DispatchException with WSA defined fault message when it cannot find an associated WSDL operation. - * - */ - @Override - public QName getWSDLOperationQName(Packet request) throws DispatchException { - HeaderList hl = request.getMessage().getHeaders(); - String action = hl.getAction(av, binding.getSOAPVersion()); +// /** +// * +// * @param request Request Packet that is used to find the associated WSDLOperation +// * @return WSDL operation Qname. +// * return null if WS-Addressing is not engaged. +// * @throws DispatchException with WSA defined fault message when it cannot find an associated WSDL operation. +// * +// */ +// @Override +// public QName getWSDLOperationQName(Packet request) throws DispatchException { +// return getWSDLOperationMapping(request).getWSDLBoundOperation().getName(); +// } + + public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException { + MessageHeaders hl = request.getMessage().getHeaders(); + String action = AddressingUtils.getAction(hl, av, binding.getSOAPVersion()); if (action == null) // Addressing is not enagaged, return null to use other ways to dispatch. @@ -146,16 +152,16 @@ payloadName = new QName(nsUri, localPart); } - QName opName = uniqueOpSignatureMap.get(new ActionBasedOperationSignature(action, payloadName)); - if (opName != null) - return opName; + WSDLOperationMapping opMapping = uniqueOpSignatureMap.get(new ActionBasedOperationSignature(action, payloadName)); + if (opMapping != null) + return opMapping; //Seems like in Wstrust STS wsdls, the payload does not match what is specified in the wsdl leading to incorrect // wsdl operation resolution. Use just wsa:Action to dispatch as a last resort. //try just with wsa:Action - opName = actionMap.get(action); - if (opName != null) - return opName; + opMapping = actionMap.get(action); + if (opMapping != null) + return opMapping; // invalid action header Message result = Messages.create(action, av, binding.getSOAPVersion()); @@ -163,6 +169,4 @@ throw new DispatchException(result); } - - } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationSignature.java 2013-04-04 15:31:20.240616706 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationSignature.java 2013-04-04 15:31:20.192616705 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/DispatchException.java 2013-04-04 15:31:20.512616710 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/DispatchException.java 2013-04-04 15:31:20.456616710 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/OperationDispatcher.java 2013-04-04 15:31:20.764616714 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/OperationDispatcher.java 2013-04-04 15:31:20.716616713 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +29,7 @@ import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.message.Message; @@ -65,15 +66,20 @@ } /** - * + * @deprecated use getWSDLOperationMapping(Packet request) * @param request Packet * @return QName of the wsdl operation. * @throws DispatchException if a unique operartion cannot be associated with this packet. */ public @NotNull QName getWSDLOperationQName(Packet request) throws DispatchException { - QName opName; + WSDLOperationMapping m = getWSDLOperationMapping(request); + return m != null ? m.getOperationName() : null; + } + + public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException { + WSDLOperationMapping opName; for(WSDLOperationFinder finder: opFinders) { - opName = finder.getWSDLOperationQName(request); + opName = finder.getWSDLOperationMapping(request); if(opName != null) return opName; } @@ -85,6 +91,5 @@ Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage( binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient); throw new DispatchException(faultMsg); - } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/PayloadQNameBasedOperationFinder.java 2013-04-04 15:31:21.024616718 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/PayloadQNameBasedOperationFinder.java 2013-04-04 15:31:20.964616718 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,6 +28,7 @@ import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.message.Message; @@ -62,7 +63,7 @@ public static final String EMPTY_PAYLOAD_NSURI = ""; public static final QName EMPTY_PAYLOAD = new QName(EMPTY_PAYLOAD_NSURI, EMPTY_PAYLOAD_LOCAL); - private final QNameMap methodHandlers = new QNameMap(); + private final QNameMap methodHandlers = new QNameMap(); private final QNameMap> unique = new QNameMap>(); @@ -98,7 +99,7 @@ // Set up method handlers only for unique QNames. So that dispatching // happens consistently for a method if (unique.get(name).size() == 1) { - methodHandlers.put(name, m.getOperationQName()); + methodHandlers.put(name, wsdlOperationMapping(m)); } } } else { @@ -106,7 +107,7 @@ QName name = wsdlOp.getReqPayloadName(); if (name == null) name = EMPTY_PAYLOAD; - methodHandlers.put(name, wsdlOp.getName()); + methodHandlers.put(name, wsdlOperationMapping(wsdlOp)); } } } @@ -119,7 +120,9 @@ * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by * any operation in the port. */ - public QName getWSDLOperationQName(Packet request) throws DispatchException{ +// public QName getWSDLOperationQName(Packet request) throws DispatchException{ + + public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException { Message message = request.getMessage(); String localPart = message.getPayloadLocalPart(); String nsUri; @@ -131,7 +134,7 @@ if(nsUri == null) nsUri = EMPTY_PAYLOAD_NSURI; } - QName op = methodHandlers.get(nsUri, localPart); + WSDLOperationMapping op = methodHandlers.get(nsUri, localPart); // Check if payload itself is correct. Usually it is, so let us check last if (op == null && !unique.containsKey(nsUri,localPart)) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/SDDocumentResolver.java 2013-04-04 15:31:21.284616722 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/SDDocumentResolver.java 2013-04-04 15:31:21.232616721 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/SOAPActionBasedOperationFinder.java 2013-04-04 15:31:21.532616726 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/SOAPActionBasedOperationFinder.java 2013-04-04 15:31:21.480616726 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2012, 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,6 +29,7 @@ import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.message.Packet; @@ -49,11 +50,11 @@ * @author Jitendra Kotamraju */ final class SOAPActionBasedOperationFinder extends WSDLOperationFinder { - private final Map methodHandlers; + private final Map methodHandlers; public SOAPActionBasedOperationFinder(WSDLPort wsdlModel, WSBinding binding, @Nullable SEIModel seiModel) { super(wsdlModel,binding,seiModel); - methodHandlers = new HashMap(); + methodHandlers = new HashMap(); // Find if any SOAPAction repeat for operations Map unique = new HashMap(); @@ -73,18 +74,19 @@ // Set up method handlers only for unique SOAPAction values so // that dispatching happens consistently for a method if (unique.get(soapAction) == 1) { - methodHandlers.put('"' + soapAction + '"', m.getOperationQName()); + methodHandlers.put('"' + soapAction + '"', wsdlOperationMapping(m)); } } } else { for(WSDLBoundOperation wsdlOp: wsdlModel.getBinding().getBindingOperations()) { - methodHandlers.put(wsdlOp.getSOAPAction(),wsdlOp.getName()); + methodHandlers.put(wsdlOp.getSOAPAction(), wsdlOperationMapping(wsdlOp)); } } } - public QName getWSDLOperationQName(Packet request) { +// public QName getWSDLOperationQName(Packet request) { + public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException { return request.soapAction == null ? null : methodHandlers.get(request.soapAction); } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/WSDLOperationFinder.java 2013-04-04 15:31:21.800616731 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/WSDLOperationFinder.java 2013-04-04 15:31:21.744616729 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,13 @@ package com.sun.xml.internal.ws.wsdl; import com.sun.xml.internal.ws.api.message.Packet; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; +import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; @@ -38,7 +42,7 @@ * Extensions if this class will be used for dispatching the request message to the correct endpoint method by * identifying the wsdl operation associated with the request. * - * @See OperationDispatcher + * @see OperationDispatcher * * @author Rama Pulavarthi */ @@ -59,10 +63,51 @@ * In such case, other OperationFinders are queried to resolve a WSDL operation. * It should throw an instance of DispatchException if it finds incorrect information in the packet. * + * @deprecated use getWSDLOperationMapping(Packet request) + * * @param request Request Packet that is used to find the associated WSDLOperation * @return QName of the WSDL Operation that this request correponds to. * null when it cannot find a unique operation to dispatch to. * @throws DispatchException When the information in the Packet is invalid */ - public abstract QName getWSDLOperationQName(Packet request) throws DispatchException; + public QName getWSDLOperationQName(Packet request) throws DispatchException { + WSDLOperationMapping m = getWSDLOperationMapping(request); + return m != null ? m.getOperationName() : null; + } + + public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException { + return null; + } + + protected WSDLOperationMapping wsdlOperationMapping(JavaMethodImpl j) { + return new WSDLOperationMappingImpl(j.getOperation(), j); + } + + protected WSDLOperationMapping wsdlOperationMapping(WSDLBoundOperation o) { + return new WSDLOperationMappingImpl(o, null); + } + + static class WSDLOperationMappingImpl implements WSDLOperationMapping { + private WSDLBoundOperation wsdlOperation; + private JavaMethod javaMethod; + private QName operationName; + + WSDLOperationMappingImpl(WSDLBoundOperation wsdlOperation, JavaMethodImpl javaMethod) { + this.wsdlOperation = wsdlOperation; + this.javaMethod = javaMethod; + operationName = (javaMethod != null) ? javaMethod.getOperationQName() : wsdlOperation.getName(); + } + + public WSDLBoundOperation getWSDLBoundOperation() { + return wsdlOperation; + } + + public JavaMethod getJavaMethod() { + return javaMethod; + } + + public QName getOperationName() { + return operationName; + } + } } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java 2013-04-04 15:31:22.032616734 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java 2013-04-04 15:31:21.984616733 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/EntityResolverWrapper.java 2013-04-04 15:31:22.304616738 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/EntityResolverWrapper.java 2013-04-04 15:31:22.248616737 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/ErrorHandler.java 2013-04-04 15:31:22.568616742 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/ErrorHandler.java 2013-04-04 15:31:22.512616742 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java 2013-04-04 15:31:22.828616747 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java 2013-04-04 15:31:22.772616745 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/InaccessibleWSDLException.java 2013-04-04 15:31:23.108616750 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/InaccessibleWSDLException.java 2013-04-04 15:31:23.052616750 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ * A list of {@link InaccessibleWSDLException} wrapped in one exception. * *

      - * This exception is used to report all the errors during WSDL parsing from {@link RuntimeWSDLParser#parse(java.net.URL, org.xml.sax.EntityResolver, boolean, com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension[])} + * This exception is used to report all the errors during WSDL parsing from {@link RuntimeWSDLParser#parse(java.net.URL, javax.xml.transform.Source, org.xml.sax.EntityResolver, boolean, com.sun.xml.internal.ws.api.server.Container, com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension[])} * * @author Vivek Pandey */ --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MIMEConstants.java 2013-04-04 15:31:23.372616755 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MIMEConstants.java 2013-04-04 15:31:23.320616754 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,13 +29,13 @@ interface MIMEConstants { + // namespace URIs - public static String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"; + static final String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"; // QNames - public static QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content"); - public static QName QNAME_MULTIPART_RELATED = - new QName(NS_WSDL_MIME, "multipartRelated"); - public static QName QNAME_PART = new QName(NS_WSDL_MIME, "part"); - public static QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml"); + static final QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content"); + static final QName QNAME_MULTIPART_RELATED = new QName(NS_WSDL_MIME, "multipartRelated"); + static final QName QNAME_PART = new QName(NS_WSDL_MIME, "part"); + static final QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml"); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java 2013-04-04 15:31:23.632616759 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java 2013-04-04 15:31:23.584616758 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MexEntityResolver.java 2013-04-04 15:31:23.904616763 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MexEntityResolver.java 2013-04-04 15:31:23.844616762 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java 2013-04-04 15:31:24.168616767 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java 2013-04-04 15:31:24.112616767 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java 2013-04-04 15:31:24.428616771 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java 2013-04-04 15:31:24.380616770 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -32,6 +32,7 @@ import com.sun.xml.internal.stream.buffer.XMLStreamBufferMark; import com.sun.xml.internal.stream.buffer.stax.StreamReaderBufferCreator; import com.sun.xml.internal.ws.api.BindingID; +import com.sun.xml.internal.ws.api.BindingIDFactory; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.WSDLLocator; @@ -100,6 +101,7 @@ private final XMLEntityResolver resolver; private final PolicyResolver policyResolver; + /** * The {@link WSDLParserExtension}. Always non-null. */ @@ -224,10 +226,6 @@ return wsdlParser.wsdlDoc; } - private static WSDLModelImpl tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Throwable e, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws SAXException, XMLStreamException { - return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, Service.class, policyResolver, extensions); - } - private static WSDLModelImpl tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Throwable e, Class serviceClass, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws SAXException, XMLStreamException { ArrayList exceptions = new ArrayList(); try { @@ -246,10 +244,6 @@ throw new InaccessibleWSDLException(exceptions); } - private WSDLModelImpl parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException { - return parseUsingMex(wsdlLoc, resolver, isClientSide, container, Service.class, policyResolver, extensions); - } - private WSDLModelImpl parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Class serviceClass, PolicyResolver policyResolver, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException { //try MEX MetaDataResolver mdResolver = null; @@ -347,10 +341,6 @@ this.extensionFacade = new WSDLParserExtensionFacade(this.extensions.toArray(new WSDLParserExtension[0])); } - private Parser resolveWSDL(@Nullable URL wsdlLoc, @NotNull Source wsdlSource) throws IOException, SAXException, XMLStreamException { - return resolveWSDL(wsdlLoc, wsdlSource, Service.class); - } - private Parser resolveWSDL(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, Class serviceClass) throws IOException, SAXException, XMLStreamException { String systemId = wsdlSource.getSystemId(); @@ -369,22 +359,22 @@ } } } - if(parser == null){ - //If a WSDL source is provided that is known to be readable, then - //prioritize that over the URL - this avoids going over the network - //an additional time if a valid WSDL Source is provided - Deva Sagar 09/20/2011 - if (wsdlSource != null && isKnownReadableSource(wsdlSource)) { + if (parser == null) { + //If a WSDL source is provided that is known to be readable, then + //prioritize that over the URL - this avoids going over the network + //an additional time if a valid WSDL Source is provided - Deva Sagar 09/20/2011 + if (isKnownReadableSource(wsdlSource)) { parser = new Parser(wsdlLoc, createReader(wsdlSource)); - } else if (wsdlLoc != null) { - parser = new Parser(wsdlLoc, createReader(wsdlLoc, serviceClass)); - } + } else if (wsdlLoc != null) { + parser = new Parser(wsdlLoc, createReader(wsdlLoc, serviceClass)); + } - //parser could still be null if isKnownReadableSource returns - //false and wsdlLoc is also null. Fall back to using Source based - //parser since Source is not null - if (parser == null) { - parser = new Parser(wsdlLoc, createReader(wsdlSource)); - } + //parser could still be null if isKnownReadableSource returns + //false and wsdlLoc is also null. Fall back to using Source based + //parser since Source is not null + if (parser == null) { + parser = new Parser(wsdlLoc, createReader(wsdlSource)); + } } return parser; } @@ -568,7 +558,9 @@ while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { QName name = reader.getName(); if (WSDLConstants.NS_SOAP_BINDING.equals(name)) { - binding.setBindingId(BindingID.SOAP11_HTTP); + String transport = reader.getAttributeValue(null, WSDLConstants.ATTR_TRANSPORT); + binding.setBindingId(createBindingId(transport, SOAPVersion.SOAP_11)); + String style = reader.getAttributeValue(null, "style"); if ((style != null) && (style.equals("rpc"))) { @@ -578,7 +570,9 @@ } goToEnd(reader); } else if (WSDLConstants.NS_SOAP12_BINDING.equals(name)) { - binding.setBindingId(BindingID.SOAP12_HTTP); + String transport = reader.getAttributeValue(null, WSDLConstants.ATTR_TRANSPORT); + binding.setBindingId(createBindingId(transport, SOAPVersion.SOAP_12)); + String style = reader.getAttributeValue(null, "style"); if ((style != null) && (style.equals("rpc"))) { binding.setStyle(Style.RPC); @@ -594,6 +588,18 @@ } } + private static BindingID createBindingId(String transport, SOAPVersion soapVersion) { + if (!transport.equals(SOAPConstants.URI_SOAP_TRANSPORT_HTTP)) { + for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) { + BindingID bindingId = f.create(transport, soapVersion); + if(bindingId!=null) { + return bindingId; + } + } + } + return soapVersion.equals(SOAPVersion.SOAP_11)?BindingID.SOAP11_HTTP:BindingID.SOAP12_HTTP; + } + private void parseBindingOperation(XMLStreamReader reader, WSDLBoundPortTypeImpl binding) { String bindingOpName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name"); @@ -913,7 +919,7 @@ QName descName = reader.getAttributeName(i); if (descName.getLocalPart().equals("element")) kind = WSDLDescriptorKind.ELEMENT; - else if (descName.getLocalPart().equals("TYPE")) + else if (descName.getLocalPart().equals("type")) kind = WSDLDescriptorKind.TYPE; if (descName.getLocalPart().equals("element") || descName.getLocalPart().equals("type")) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java 2013-04-04 15:31:24.712616776 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java 2013-04-04 15:31:24.652616775 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java 2013-04-04 15:31:24.964616780 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java 2013-04-04 15:31:24.912616778 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java 2013-04-04 15:31:25.220616784 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java 2013-04-04 15:31:25.164616782 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLConstants.java 2013-04-04 15:31:25.488616788 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLConstants.java 2013-04-04 15:31:25.432616787 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -35,49 +35,45 @@ */ public interface WSDLConstants { // namespace URIs - public static final String PREFIX_NS_WSDL = "wsdl"; - public static final String NS_XMLNS = "http://www.w3.org/2001/XMLSchema"; - public static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/"; - public static final String NS_SOAP11_HTTP_BINDING = "http://schemas.xmlsoap.org/soap/http"; + static final String PREFIX_NS_WSDL = "wsdl"; + static final String NS_XMLNS = "http://www.w3.org/2001/XMLSchema"; + static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + static final String NS_SOAP11_HTTP_BINDING = "http://schemas.xmlsoap.org/soap/http"; - public static final QName QNAME_SCHEMA = new QName(NS_XMLNS, "schema"); + static final QName QNAME_SCHEMA = new QName(NS_XMLNS, "schema"); // QNames - public static final QName QNAME_BINDING = new QName(NS_WSDL, "binding"); - public static final QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions"); - public static final QName QNAME_DOCUMENTATION = new QName(NS_WSDL, "documentation"); - public static final QName NS_SOAP_BINDING_ADDRESS = new QName("http://schemas.xmlsoap.org/wsdl/soap/", - "address"); - public static final QName NS_SOAP_BINDING = new QName("http://schemas.xmlsoap.org/wsdl/soap/", - "binding"); - public static final QName NS_SOAP12_BINDING = new QName("http://schemas.xmlsoap.org/wsdl/soap12/", - "binding"); - public static final QName NS_SOAP12_BINDING_ADDRESS = new QName("http://schemas.xmlsoap.org/wsdl/soap12/", - "address"); - - //public static final QName QNAME_FAULT = new QName(NS_WSDL, "fault"); - public static final QName QNAME_IMPORT = new QName(NS_WSDL, "import"); - - //public static final QName QNAME_INPUT = new QName(NS_WSDL, "input"); - public static final QName QNAME_MESSAGE = new QName(NS_WSDL, "message"); - public static final QName QNAME_PART = new QName(NS_WSDL, "part"); - public static final QName QNAME_OPERATION = new QName(NS_WSDL, "operation"); - public static final QName QNAME_INPUT = new QName(NS_WSDL, "input"); - public static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output"); - - //public static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output"); - //public static final QName QNAME_PART = new QName(NS_WSDL, "part"); - public static final QName QNAME_PORT = new QName(NS_WSDL, "port"); - public static final QName QNAME_ADDRESS = new QName(NS_WSDL, "address"); - public static final QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType"); - public static final QName QNAME_FAULT = new QName(NS_WSDL, "fault"); - public static final QName QNAME_SERVICE = new QName(NS_WSDL, "service"); - public static final QName QNAME_TYPES = new QName(NS_WSDL, "types"); - - public static final String ATTR_TRANSPORT = "transport"; - public static final String ATTR_LOCATION = "location"; - public static final String ATTR_NAME = "name"; - public static final String ATTR_TNS = "targetNamespace"; + static final QName QNAME_BINDING = new QName(NS_WSDL, "binding"); + static final QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions"); + static final QName QNAME_DOCUMENTATION = new QName(NS_WSDL, "documentation"); + static final QName NS_SOAP_BINDING_ADDRESS = new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"); + static final QName NS_SOAP_BINDING = new QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"); + static final QName NS_SOAP12_BINDING = new QName("http://schemas.xmlsoap.org/wsdl/soap12/", "binding"); + static final QName NS_SOAP12_BINDING_ADDRESS = new QName("http://schemas.xmlsoap.org/wsdl/soap12/", "address"); + + //static final QName QNAME_FAULT = new QName(NS_WSDL, "fault"); + static final QName QNAME_IMPORT = new QName(NS_WSDL, "import"); + + //static final QName QNAME_INPUT = new QName(NS_WSDL, "input"); + static final QName QNAME_MESSAGE = new QName(NS_WSDL, "message"); + static final QName QNAME_PART = new QName(NS_WSDL, "part"); + static final QName QNAME_OPERATION = new QName(NS_WSDL, "operation"); + static final QName QNAME_INPUT = new QName(NS_WSDL, "input"); + static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output"); + + //static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output"); + //static final QName QNAME_PART = new QName(NS_WSDL, "part"); + static final QName QNAME_PORT = new QName(NS_WSDL, "port"); + static final QName QNAME_ADDRESS = new QName(NS_WSDL, "address"); + static final QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType"); + static final QName QNAME_FAULT = new QName(NS_WSDL, "fault"); + static final QName QNAME_SERVICE = new QName(NS_WSDL, "service"); + static final QName QNAME_TYPES = new QName(NS_WSDL, "types"); + + static final String ATTR_TRANSPORT = "transport"; + static final String ATTR_LOCATION = "location"; + static final String ATTR_NAME = "name"; + static final String ATTR_TNS = "targetNamespace"; - //public static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType"); + //static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType"); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java 2013-04-04 15:31:25.760616792 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java 2013-04-04 15:31:25.704616791 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java 2013-04-04 15:31:26.032616796 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java 2013-04-04 15:31:25.980616796 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/DocumentLocationResolver.java 2013-04-04 15:31:26.308616800 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/DocumentLocationResolver.java 2013-04-04 15:31:26.252616800 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/TXWContentHandler.java 2013-04-04 15:31:26.560616805 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/TXWContentHandler.java 2013-04-04 15:31:26.496616804 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,7 +64,10 @@ for(int i = 0; i < atts.getLength(); i++) { String auri = atts.getURI(i); if ("http://www.w3.org/2000/xmlns/".equals(auri)) { - txw._namespace(atts.getValue(i),atts.getLocalName(i)); + if ("xmlns".equals(atts.getLocalName(i))) + txw._namespace(atts.getValue(i), ""); + else + txw._namespace(atts.getValue(i),atts.getLocalName(i)); } else { if ("schemaLocation".equals(atts.getLocalName(i)) && "".equals(atts.getValue(i))) --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java 2013-04-04 15:31:26.828616809 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java 2013-04-04 15:31:26.764616808 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingMetadataWSDLGeneratorExtension.java 2013-04-04 15:31:27.100616813 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingMetadataWSDLGeneratorExtension.java 2013-04-04 15:31:27.044616812 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java 2013-04-04 15:31:27.372616817 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java 2013-04-04 15:31:27.316616816 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,10 @@ if (a != null && !a.input().equals("")) { addAttribute(input, a.input()); } else { - if (method.getBinding().getSOAPAction().equals("")) { + + String soapAction = method.getBinding().getSOAPAction(); + // in SOAP 1.2 soapAction is optional ... + if (soapAction == null || soapAction.equals("")) { //hack: generate default action for interop with .Net3.0 when soapAction is non-empty String defaultAction = getDefaultAction(method); addAttribute(input, defaultAction); @@ -143,7 +146,7 @@ public void addBindingExtension(TypedXmlWriter binding) { if (!enabled) return; - UsingAddressing ua = binding._element(AddressingVersion.W3C.wsdlExtensionTag, UsingAddressing.class); + binding._element(AddressingVersion.W3C.wsdlExtensionTag, UsingAddressing.class); /* Do not generate wsdl:required=true if(required) { --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java 2013-04-04 15:31:27.636616821 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java 2013-04-04 15:31:27.588616821 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,6 +28,8 @@ import static com.sun.xml.internal.bind.v2.schemagen.Util.*; +import com.oracle.webservices.internal.api.databinding.WSDLResolver; + import com.sun.xml.internal.txw2.TXW; import com.sun.xml.internal.txw2.TypedXmlWriter; import com.sun.xml.internal.txw2.output.ResultFactory; @@ -48,6 +50,7 @@ import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.ParameterImpl; import com.sun.xml.internal.ws.model.WrapperParameter; +import com.sun.xml.internal.ws.util.xml.XmlUtil; import com.sun.xml.internal.ws.wsdl.parser.SOAPConstants; import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; import com.sun.xml.internal.ws.wsdl.writer.document.Binding; @@ -68,11 +71,18 @@ import com.sun.xml.internal.ws.wsdl.writer.document.soap.Header; import com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPAddress; import com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPFault; +import com.sun.xml.internal.ws.wsdl.writer.document.xsd.Schema; import com.sun.xml.internal.ws.spi.db.BindingContext; import com.sun.xml.internal.ws.spi.db.BindingHelper; +import com.sun.xml.internal.ws.spi.db.TypeInfo; +import com.sun.xml.internal.ws.spi.db.WrapperComposite; import com.sun.xml.internal.ws.util.RuntimeVersion; import com.sun.xml.internal.ws.policy.jaxws.PolicyWSDLGeneratorExtension; import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants; +import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Element; +import com.sun.xml.internal.bind.v2.schemagen.xmlschema.ComplexType; +import com.sun.xml.internal.bind.v2.schemagen.xmlschema.ExplicitGroup; +import com.sun.xml.internal.bind.v2.schemagen.xmlschema.LocalElement; import javax.jws.soap.SOAPBinding.Style; import javax.jws.soap.SOAPBinding.Use; @@ -95,6 +105,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -198,6 +209,7 @@ private final Class implType; private boolean inlineSchemas; // TODO + private final boolean disableSecureXmlProcessing; /** * Creates the WSDLGenerator @@ -209,6 +221,22 @@ */ public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, Class implType, boolean inlineSchemas, WSDLGeneratorExtension... extensions) { + this(model, wsdlResolver, binding, container, implType, inlineSchemas, false, extensions); + } + + /** + * Creates the WSDLGenerator + * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL + * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL + * @param binding specifies which {@link javax.xml.ws.BindingType} to generate + * @param disableSecureXmlProcessing specifies whether to disable the secure xml processing feature + * @param extensions an array {@link WSDLGeneratorExtension} that will + * be invoked to generate WSDL extensions + */ + public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, + Class implType, boolean inlineSchemas, boolean disableSecureXmlProcessing, + WSDLGeneratorExtension... extensions) { + this.model = model; resolver = new JAXWSOutputSchemaResolver(); this.wsdlResolver = wsdlResolver; @@ -217,6 +245,7 @@ this.implType = implType; extensionHandlers = new ArrayList(); this.inlineSchemas = inlineSchemas; + this.disableSecureXmlProcessing = disableSecureXmlProcessing; // register handlers for default extensions register(new W3CAddressingWSDLGeneratorExtension()); @@ -306,48 +335,59 @@ this.serializer = serializer; } + @Override public void startDocument() { serializer.startDocument(); comment(new StringBuilder(VERSION_COMMENT)); text(new StringBuilder("\n")); } + @Override public void beginStartTag(String uri, String localName, String prefix) { serializer.beginStartTag(uri, localName, prefix); } + @Override public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) { serializer.writeAttribute(uri, localName, prefix, value); } + @Override public void writeXmlns(String prefix, String uri) { serializer.writeXmlns(prefix, uri); } + @Override public void endStartTag(String uri, String localName, String prefix) { serializer.endStartTag(uri, localName, prefix); } + @Override public void endTag() { serializer.endTag(); } + @Override public void text(StringBuilder text) { serializer.text(text); } + @Override public void cdata(StringBuilder text) { serializer.cdata(text); } + @Override public void comment(StringBuilder comment) { serializer.comment(comment); } + @Override public void endDocument() { serializer.endDocument(); } + @Override public void flush() { serializer.flush(); } @@ -419,12 +459,11 @@ model.getBindingContext().generateSchema(resolver); } catch (IOException e) { // TODO locallize and wrap this - e.printStackTrace(); throw new WebServiceException(e.getMessage()); } } if (resolver.nonGlassfishSchemas != null) { - TransformerFactory tf = TransformerFactory.newInstance(); + TransformerFactory tf = XmlUtil.newTransformerFactory(!disableSecureXmlProcessing); try { Transformer t = tf.newTransformer(); for (DOMResult xsd : resolver.nonGlassfishSchemas) { @@ -433,13 +472,69 @@ t.transform(new DOMSource(doc.getDocumentElement()), sax); } } catch (TransformerConfigurationException e) { - e.printStackTrace(); throw new WebServiceException(e.getMessage(), e); } catch (TransformerException e) { - e.printStackTrace(); throw new WebServiceException(e.getMessage(), e); } } + generateWrappers(); + } + + void generateWrappers() { + List wrappers = new ArrayList(); + for (JavaMethodImpl method : model.getJavaMethods()) { + if(method.getBinding().isRpcLit()) continue; + for (ParameterImpl p : method.getRequestParameters()) { + if (p instanceof WrapperParameter) { + if (WrapperComposite.class.equals((((WrapperParameter)p).getTypeInfo().type))) { + wrappers.add((WrapperParameter)p); + } + } + } + for (ParameterImpl p : method.getResponseParameters()) { + if (p instanceof WrapperParameter) { + if (WrapperComposite.class.equals((((WrapperParameter)p).getTypeInfo().type))) { + wrappers.add((WrapperParameter)p); + } + } + } + } + if (wrappers.isEmpty()) return; + HashMap xsds = new HashMap(); + for(WrapperParameter wp : wrappers) { + String tns = wp.getName().getNamespaceURI(); + Schema xsd = xsds.get(tns); + if (xsd == null) { + xsd = types.schema(); + xsd.targetNamespace(tns); + xsds.put(tns, xsd); + } + Element e = xsd._element(Element.class); + e._attribute("name", wp.getName().getLocalPart()); + e.type(wp.getName()); + ComplexType ct = xsd._element(ComplexType.class); + ct._attribute("name", wp.getName().getLocalPart()); + ExplicitGroup sq = ct.sequence(); + for (ParameterImpl p : wp.getWrapperChildren() ) { + if (p.getBinding().isBody()) { + LocalElement le = sq.element(); + le._attribute("name", p.getName().getLocalPart()); + TypeInfo typeInfo = p.getItemType(); + boolean repeatedElement = false; + if (typeInfo == null) { + typeInfo = p.getTypeInfo(); + } else { + repeatedElement = true; + } + QName type = model.getBindingContext().getTypeName(typeInfo); + le.type(type); + if (repeatedElement) { + le.minOccurs(0); + le.maxOccurs("unbounded"); + } + } + } + } } /** @@ -484,15 +579,8 @@ } } if (method.getMEP() != MEP.ONE_WAY) { -// message = portDefinitions.message().name(method.getOperation().getName().getLocalPart()+RESPONSE); message = portDefinitions.message().name(method.getResponseMessageName()); extension.addOutputMessageExtension(message, method); - if (unwrappable) { - for (ParameterImpl param : method.getResponseParameters()) { - if (isHeaderParameter(param)) - unwrappable = false; - } - } for (ParameterImpl param : method.getResponseParameters()) { if (isDoclit) { @@ -548,6 +636,8 @@ case ONE_WAY: generateInputMessage(operation, method); break; + default: + break; } // faults for (CheckedExceptionImpl exception : method.getCheckedExceptions()) { @@ -601,7 +691,7 @@ */ protected void generateRpcParameterOrder(Operation operation, JavaMethodImpl method) { String partName; - StringBuffer paramOrder = new StringBuffer(); + StringBuilder paramOrder = new StringBuilder(); Set partNames = new HashSet(); List sortedParams = sortMethodParameters(method); int i = 0; @@ -629,10 +719,10 @@ */ protected void generateDocumentParameterOrder(Operation operation, JavaMethodImpl method) { String partName; - StringBuffer paramOrder = new StringBuffer(); + StringBuilder paramOrder = new StringBuilder(); Set partNames = new HashSet(); List sortedParams = sortMethodParameters(method); - boolean isWrapperStyle = isWrapperStyle(method); +// boolean isWrapperStyle = isWrapperStyle(method); int i = 0; for (ParameterImpl parameter : sortedParams) { // System.out.println("param: "+parameter.getIndex()+" name: "+parameter.getName().getLocalPart()); @@ -697,7 +787,7 @@ paramSet.addAll(method.getResponseParameters()); } Iterator params = paramSet.iterator(); - if (paramSet.size() == 0) + if (paramSet.isEmpty()) return sortedParams; ParameterImpl param = params.next(); sortedParams.add(param); @@ -744,23 +834,23 @@ * Generates the Binding section of the WSDL */ protected void generateBinding() { - Binding binding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart()); - extension.addBindingExtension(binding); - binding.type(model.getPortTypeName()); + Binding newBinding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart()); + extension.addBindingExtension(newBinding); + newBinding.type(model.getPortTypeName()); boolean first = true; for (JavaMethodImpl method : model.getJavaMethods()) { if (first) { SOAPBinding sBinding = method.getBinding(); SOAPVersion soapVersion = sBinding.getSOAPVersion(); if (soapVersion == SOAPVersion.SOAP_12) { - com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = binding.soap12Binding(); + com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = newBinding.soap12Binding(); soapBinding.transport(this.binding.getBindingId().getTransport()); if (sBinding.getStyle().equals(Style.DOCUMENT)) soapBinding.style(DOCUMENT); else soapBinding.style(RPC); } else { - com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = binding.soapBinding(); + com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = newBinding.soapBinding(); soapBinding.transport(this.binding.getBindingId().getTransport()); if (sBinding.getStyle().equals(Style.DOCUMENT)) soapBinding.style(DOCUMENT); @@ -770,9 +860,9 @@ first = false; } if (this.binding.getBindingId().getSOAPVersion() == SOAPVersion.SOAP_12) - generateSOAP12BindingOperation(method, binding); + generateSOAP12BindingOperation(method, newBinding); else - generateBindingOperation(method, binding); + generateBindingOperation(method, newBinding); } } @@ -798,7 +888,7 @@ if (bodyParams.size() > 0) { ParameterImpl param = bodyParams.iterator().next(); if (isRpc) { - StringBuffer parts = new StringBuffer(); + StringBuilder parts = new StringBuilder(); int i = 0; for (ParameterImpl parameter : ((WrapperParameter) param).getWrapperChildren()) { if (i++ > 0) @@ -823,34 +913,33 @@ } if (method.getMEP() != MEP.ONE_WAY) { - boolean unwrappable = headerParams.size() == 0; // output bodyParams.clear(); headerParams.clear(); splitParameters(bodyParams, headerParams, method.getResponseParameters()); - unwrappable = unwrappable ? headerParams.size() == 0 : unwrappable; TypedXmlWriter output = operation.output(); extension.addBindingOperationOutputExtension(output, method); body = output._element(Body.class); body.use(LITERAL); if (headerParams.size() > 0) { - String parts = ""; + StringBuilder parts = new StringBuilder(); if (bodyParams.size() > 0) { ParameterImpl param = bodyParams.iterator().hasNext() ? bodyParams.iterator().next() : null; if (param != null) { if (isRpc) { int i = 0; for (ParameterImpl parameter : ((WrapperParameter) param).getWrapperChildren()) { - if (i++ > 0) - parts += " "; - parts += parameter.getPartName(); + if (i++ > 0) { + parts.append(" "); + } + parts.append(parameter.getPartName()); } } else { - parts = param.getPartName(); + parts = new StringBuilder(param.getPartName()); } } } - body.parts(parts); + body.parts(parts.toString()); QName responseMessage = new QName(targetNamespace, method.getResponseMessageName()); generateSOAPHeaders(output, headerParams, responseMessage); } @@ -892,7 +981,7 @@ if (bodyParams.size() > 0) { ParameterImpl param = bodyParams.iterator().next(); if (isRpc) { - StringBuffer parts = new StringBuffer(); + StringBuilder parts = new StringBuilder(); int i = 0; for (ParameterImpl parameter : ((WrapperParameter) param).getWrapperChildren()) { if (i++ > 0) @@ -918,11 +1007,9 @@ if (method.getMEP() != MEP.ONE_WAY) { // output - boolean unwrappable = headerParams.size() == 0; bodyParams.clear(); headerParams.clear(); splitParameters(bodyParams, headerParams, method.getResponseParameters()); - unwrappable = unwrappable ? headerParams.size() == 0 : unwrappable; TypedXmlWriter output = operation.output(); extension.addBindingOperationOutputExtension(output, method); body = output._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Body.class); @@ -931,14 +1018,15 @@ if (bodyParams.size() > 0) { ParameterImpl param = bodyParams.iterator().next(); if (isRpc) { - String parts = ""; + StringBuilder parts = new StringBuilder(); int i = 0; for (ParameterImpl parameter : ((WrapperParameter) param).getWrapperChildren()) { - if (i++ > 0) - parts += " "; - parts += parameter.getPartName(); + if (i++ > 0) { + parts.append(" "); + } + parts.append(parameter.getPartName()); } - body.parts(parts); + body.parts(parts.toString()); } else { body.parts(param.getPartName()); } @@ -1003,7 +1091,7 @@ Port port = service.port().name(portQName.getLocalPart()); port.binding(model.getBoundPortTypeName()); extension.addPortExtension(port); - if (model.getJavaMethods().size() == 0) + if (model.getJavaMethods().isEmpty()) return; if (this.binding.getBindingId().getSOAPVersion() == SOAPVersion.SOAP_12) { @@ -1133,7 +1221,7 @@ if (relPath == null) return uri; // recursion found no commonality in the two uris at all - StringBuffer relUri = new StringBuffer(); + StringBuilder relUri = new StringBuilder(); relUri.append(relPath); if (theUri.getQuery() != null) relUri.append('?').append(theUri.getQuery()); @@ -1172,6 +1260,7 @@ * @return the {@link Result} for JAXB to generate the schema into * @throws java.io.IOException thrown if on IO error occurs */ + @Override public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { return inlineSchemas ? ((nonGlassfishSchemas != null) ? nonGlassfishSchemaResult(namespaceUri, suggestedFileName) : createInlineSchema(namespaceUri, suggestedFileName)) --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGeneratorExtensionFacade.java 2013-04-04 15:31:27.872616825 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGeneratorExtensionFacade.java 2013-04-04 15:31:27.816616824 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLPatcher.java 2013-04-04 15:31:28.156616829 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLPatcher.java 2013-04-04 15:31:28.096616829 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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,6 +30,7 @@ import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter; import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; import com.sun.xml.internal.ws.addressing.W3CAddressingConstants; +import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants; import com.sun.istack.internal.Nullable; import javax.xml.namespace.QName; @@ -158,11 +159,13 @@ if (value != null) { portName = new QName(targetNamespace,value); } - } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)) { + } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME) + || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) { if (serviceName != null && portName != null) { inEpr = true; } - } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)) { + } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME) + || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) { if (inEpr) { inEprAddress = true; } @@ -177,12 +180,14 @@ serviceName = null; } else if (name.equals(WSDLConstants.QNAME_PORT)) { portName = null; - } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)) { + } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME) + || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) { if (inEpr) { inEpr = false; } - } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)) { - if (inEprAddress) { + } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME) + || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) { + if (inEprAddress) { String value = getAddressLocation(); if (value != null) { logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java 2013-04-04 15:31:28.424616833 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java 2013-04-04 15:31:28.368616833 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,52 +25,10 @@ package com.sun.xml.internal.ws.wsdl.writer; -import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; -import javax.xml.transform.Result; -import javax.xml.ws.Holder; - - /** - * WSDLResolver is used by WSDLGenerator while generating WSDL and its associated - * documents. It is used to control what documents need to be generated and what - * documents need to be picked from metadata. If endpont's document metadata - * already contains some documents, their systemids may be used for wsdl:import, - * and schema:import. The suggested filenames are relative urls(for e.g: EchoSchema1.xsd) - * The Result object systemids are also relative urls(for e.g: AbsWsdl.wsdl). + * @deprecated Use com.oracle.webservices.internal.api.databinding.WSDLResolver directly * - * @author Jitendra Kotamraju */ -public interface WSDLResolver { - /** - * Create a Result object into which concrete WSDL is to be generated. - * - * @return Result for the concrete WSDL - */ - public @NotNull Result getWSDL(@NotNull String suggestedFilename); - - /** - * Create a Result object into which abstract WSDL is to be generated. If the the - * abstract WSDL is already in metadata, it is not generated. - * - * Update filename if the suggested filename need to be changed in wsdl:import. - * This needs to be done if the metadata contains abstract WSDL, and that systemid - * needs to be reflected in concrete WSDL's wsdl:import - * - * @return null if abstract WSDL need not be generated - */ - public @Nullable Result getAbstractWSDL(@NotNull Holder filename); - - /** - * Create a Result object into which schema doc is to be generated. Typically if - * there is a schema doc for namespace in metadata, then it is not generated. - * - * Update filename if the suggested filename need to be changed in xsd:import. This - * needs to be done if the metadata contains the document, and that systemid - * needs to be reflected in some other document's xsd:import - * - * @return null if schema need not be generated - */ - public @Nullable Result getSchemaOutput(@NotNull String namespace, @NotNull Holder filename); +public interface WSDLResolver extends com.oracle.webservices.internal.api.databinding.WSDLResolver { } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Binding.java 2013-04-04 15:31:28.712616838 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Binding.java 2013-04-04 15:31:28.660616837 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/BindingOperationType.java 2013-04-04 15:31:28.968616842 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/BindingOperationType.java 2013-04-04 15:31:28.916616841 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Definitions.java 2013-04-04 15:31:29.236616846 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Definitions.java 2013-04-04 15:31:29.184616845 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Documented.java 2013-04-04 15:31:29.504616850 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Documented.java 2013-04-04 15:31:29.444616850 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Fault.java 2013-04-04 15:31:29.740616854 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Fault.java 2013-04-04 15:31:29.688616853 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/FaultType.java 2013-04-04 15:31:29.968616857 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/FaultType.java 2013-04-04 15:31:29.916616857 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Import.java 2013-04-04 15:31:30.192616861 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Import.java 2013-04-04 15:31:30.136616860 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Message.java 2013-04-04 15:31:30.436616864 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Message.java 2013-04-04 15:31:30.364616864 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/OpenAtts.java 2013-04-04 15:31:30.672616868 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/OpenAtts.java 2013-04-04 15:31:30.612616867 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Operation.java 2013-04-04 15:31:30.920616872 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Operation.java 2013-04-04 15:31:30.868616871 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/ParamType.java 2013-04-04 15:31:31.140616876 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/ParamType.java 2013-04-04 15:31:31.088616875 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Part.java 2013-04-04 15:31:31.404616880 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Part.java 2013-04-04 15:31:31.336616878 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Port.java 2013-04-04 15:31:31.676616884 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Port.java 2013-04-04 15:31:31.616616883 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/PortType.java 2013-04-04 15:31:31.960616888 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/PortType.java 2013-04-04 15:31:31.900616887 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Service.java 2013-04-04 15:31:32.232616893 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Service.java 2013-04-04 15:31:32.176616892 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/StartWithExtensionsType.java 2013-04-04 15:31:32.516616897 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/StartWithExtensionsType.java 2013-04-04 15:31:32.468616897 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Types.java 2013-04-04 15:31:32.756616901 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/Types.java 2013-04-04 15:31:32.696616900 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Address.java 2013-04-04 15:31:33.032616905 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Address.java 2013-04-04 15:31:32.980616905 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Binding.java 2013-04-04 15:31:33.316616910 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Binding.java 2013-04-04 15:31:33.260616909 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Operation.java 2013-04-04 15:31:33.584616913 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Operation.java 2013-04-04 15:31:33.528616913 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/package-info.java 2013-04-04 15:31:33.852616918 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/http/package-info.java 2013-04-04 15:31:33.792616917 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/package-info.java 2013-04-04 15:31:34.088616922 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/package-info.java 2013-04-04 15:31:34.036616921 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Body.java 2013-04-04 15:31:34.352616926 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Body.java 2013-04-04 15:31:34.288616925 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/BodyType.java 2013-04-04 15:31:34.584616930 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/BodyType.java 2013-04-04 15:31:34.528616928 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Header.java 2013-04-04 15:31:34.808616933 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Header.java 2013-04-04 15:31:34.760616932 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/HeaderFault.java 2013-04-04 15:31:35.044616936 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/HeaderFault.java 2013-04-04 15:31:34.996616936 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPAddress.java 2013-04-04 15:31:35.272616940 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPAddress.java 2013-04-04 15:31:35.212616939 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPBinding.java 2013-04-04 15:31:35.540616944 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPBinding.java 2013-04-04 15:31:35.468616943 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPFault.java 2013-04-04 15:31:35.768616947 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPFault.java 2013-04-04 15:31:35.720616947 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPOperation.java 2013-04-04 15:31:35.996616951 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPOperation.java 2013-04-04 15:31:35.944616950 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/package-info.java 2013-04-04 15:31:36.268616955 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/package-info.java 2013-04-04 15:31:36.216616955 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Body.java 2013-04-04 15:31:36.524616959 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Body.java 2013-04-04 15:31:36.472616959 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/BodyType.java 2013-04-04 15:31:36.752616963 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/BodyType.java 2013-04-04 15:31:36.696616962 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Header.java 2013-04-04 15:31:37.004616967 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Header.java 2013-04-04 15:31:36.944616966 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/HeaderFault.java 2013-04-04 15:31:37.280616971 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/HeaderFault.java 2013-04-04 15:31:37.220616971 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPAddress.java 2013-04-04 15:31:37.496616975 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPAddress.java 2013-04-04 15:31:37.444616974 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPBinding.java 2013-04-04 15:31:37.716616978 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPBinding.java 2013-04-04 15:31:37.660616977 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPFault.java 2013-04-04 15:31:37.980616982 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPFault.java 2013-04-04 15:31:37.916616981 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPOperation.java 2013-04-04 15:31:38.224616986 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPOperation.java 2013-04-04 15:31:38.172616985 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/package-info.java 2013-04-04 15:31:38.440616990 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/package-info.java 2013-04-04 15:31:38.388616988 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Import.java 2013-04-04 15:31:38.652616993 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Import.java 2013-04-04 15:31:38.604616992 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Schema.java 2013-04-04 15:31:38.888616997 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Schema.java 2013-04-04 15:31:38.820616995 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -28,7 +28,6 @@ import com.sun.xml.internal.txw2.TypedXmlWriter; import com.sun.xml.internal.txw2.annotation.XmlAttribute; import com.sun.xml.internal.txw2.annotation.XmlElement; -import com.sun.xml.internal.ws.wsdl.writer.document.Documented; import com.sun.xml.internal.ws.wsdl.writer.document.*; /** @@ -43,4 +42,7 @@ @XmlElement("import") public Import _import(); + + @XmlAttribute + public com.sun.xml.internal.ws.wsdl.writer.document.xsd.Schema targetNamespace(String value); } --- old/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/package-info.java 2013-04-04 15:31:39.164617001 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/package-info.java 2013-04-04 15:31:39.100617000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 --- old/src/share/jaxws_classes/javax/annotation/Generated.java 2013-04-04 15:31:39.420617005 +0200 +++ new/src/share/jaxws_classes/javax/annotation/Generated.java 2013-04-04 15:31:39.360617004 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -34,14 +34,14 @@ * in a single file. When used, 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. + *

      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 * 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 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 Common Annotations 1.0 */ --- old/src/share/jaxws_classes/javax/annotation/PostConstruct.java 2013-04-04 15:31:39.644617008 +0200 +++ new/src/share/jaxws_classes/javax/annotation/PostConstruct.java 2013-04-04 15:31:39.584617007 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -38,19 +38,19 @@ * 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 method MUST NOT have any parameters except in the case of EJB - * interceptors in which case it takes an InvocationC ontext object as - * defined by the EJB specification. - * - The return type of the method MUST be void. - * - The method MUST NOT throw a checked exception. - * - 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 + * criteria:
        + *
      • The method MUST NOT have any parameters except in the case of EJB + * interceptors in which case it takes an InvocationContext object as + * defined by the EJB specification.
      • + *
      • The return type of the method MUST be void.
      • + *
      • The method MUST NOT throw a checked exception.
      • + *
      • 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. + * even recover from them.
      * @since Common Annotations 1.0 * @see javax.annotation.PreDestroy * @see javax.annotation.Resource --- old/src/share/jaxws_classes/javax/annotation/PreDestroy.java 2013-04-04 15:31:39.880617011 +0200 +++ new/src/share/jaxws_classes/javax/annotation/PreDestroy.java 2013-04-04 15:31:39.828617011 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -37,18 +37,18 @@ * 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 method MUST NOT have any parameters except in the case of EJB + * criteria: